[ { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_loop_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %sv_0.0.reload\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge1.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %19 = call i64 @FUNC(i64 %12)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_postinc_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = load i32, i32* @gv_3, align 4\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i64, i64* %sv_0, align 8\n %9 = icmp eq i64 %8, 9223372036854775807\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %10 = add i64 %8, 1\n store i64 %10, i64* %sv_0, align 8\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_7\n LBL_6:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_5 to i64))\n br label LBL_7\n LBL_7:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_printf_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_3\n LBL_3:\n %.pr = load i32, i32* @gv_0, align 4\n %13 = icmp eq i32 %.pr, 0\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = call i32 @puts(i8* nonnull %3)\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i8* (i8*)* @getenv, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_loop_17-bad", "fun_name": "CWE124_Buffer_Underwrite__char_declare_loop_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n store i64 0, i64* %sv_1, align 8\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %5 = add i64 %storemerge2.reload, %2\n %6 = add i64 %storemerge2.reload, %4\n %7 = inttoptr i64 %6 to i8*\n %8 = load i8, i8* %7, align 1\n %9 = inttoptr i64 %5 to i8*\n store i8 %8, i8* %9, align 1\n %10 = load i64, i64* %sv_1, align 8\n %11 = add i64 %10, 1\n store i64 %11, i64* %sv_1, align 8\n %12 = icmp ult i64 %11, 100\n store i64 %11, i64* %storemerge2.reg2mem\n br i1 %12, label LBL_1, label LBL_2\n LBL_2:\n %13 = add i64 %2, 99\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n %15 = call i64 @FUNC(i64 %2)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 0, 2, 1 }\n uselistorder i64 %storemerge2.reload, { 1, 0 }\n uselistorder i64 %2, { 1, 2, 0 }\n uselistorder i64* %sv_1, { 2, 3, 1, 0 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_01-bad", "fun_name": "CWE415_Double_Free__malloc_free_int64_t_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %0)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_sub_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 4294967293)\n ret i64 %0\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_ncpy_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 5\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = bitcast i8** %sv_2 to i64*\n store i64 %13, i64* %14, align 8\n br label LBL_3\n LBL_3:\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = bitcast i64* %sv_0 to i8*\n %17 = call i32 @strlen(i8* nonnull %16)\n %18 = load i8*, i8** %sv_2, align 8\n %19 = call i8* @strncpy(i8* nonnull %16, i8* %18, i32 %17)\n %20 = ptrtoint i64* %sv_0 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 2, 0, 1 }\n uselistorder i64* %sv_0, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__rand_strncpy_05-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__rand_strncpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %12 = ashr exact i32 %sext, 16\n store i32 %12, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n store i64 0, i64* %sv_2, align 8\n %13 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %14 = trunc i32 %sv_0.0.reload to i16\n %15 = icmp sgt i16 %14, 99\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n %16 = ptrtoint i64* %sv_3 to i64\n %17 = bitcast i64* %sv_2 to i8*\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i8* @strncpy(i8* nonnull %17, i8* nonnull %18, i32 %sv_0.0.reload)\n %20 = sext i32 %sv_0.0.reload to i64\n %21 = add i64 %16, -128\n %22 = add i64 %21, %20\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n br label LBL_4\n LBL_4:\n %24 = call i64 @FUNC(i64* nonnull %sv_2)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 -4, i64 28\n %6 = call i64* @malloc(i32 40)\n %7 = ptrtoint i64* %6 to i64\n %8 = icmp eq i64* %6, null\n %9 = icmp eq i1 %8, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %9, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %10 = mul i64 %indvars.iv5.reload, 4\n %11 = add i64 %10, %7\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n br i1 %5, label LBL_7, label LBL_5\n LBL_5:\n %13 = add i64 %spec.select, %7\n %14 = inttoptr i64 %13 to i32*\n store i32 1, i32* %14, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_6\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %15 = mul i64 %indvars.iv.reload, 4\n %16 = add i64 %15, %7\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_6\n LBL_7:\n %21 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_8\n LBL_8:\n call void @free(i64* %6)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0, 2 }\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 4, 5 }\n uselistorder void (i32)* @exit, { 2, 3, 1, 0, 4 }\n uselistorder i32 -1, { 1, 2, 0, 3, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 3, 2, 4 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memmove_14-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_memmove_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %7, -8\n store i64 %11, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %13 = inttoptr i64 %sv_0.0.reload to i64*\n %14 = call i64* @memmove(i64* %13, i64* nonnull %sv_1, i32 100)\n %15 = add i64 %sv_0.0.reload, 99\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = call i64 @FUNC(i64 %sv_0.0.reload)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %4, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_fprintf_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_10, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_10\n LBL_10:\n %.reload = load i32, i32* %.reg2mem\n %29 = icmp eq i32 %.reload, 5\n br i1 %29, label LBL_12, label LBL_11\n LBL_11:\n %30 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_13\n LBL_12:\n %31 = load %_IO_FILE*, %_IO_FILE** @gv_3, align 8\n %32 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n br label LBL_13\n LBL_13:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_realloc_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 4)\n %1 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = bitcast i64* %0 to i32*\n store i32 5, i32* %2, align 4\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 5, { 2, 3, 0, 1 }\n uselistorder i64 5, { 2, 0, 3, 1 }\n uselistorder i64* (i64*, i32)* @realloc, { 1, 0, 2 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_01-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = icmp ult i32 %0, 6\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 %0)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = ptrtoint i64* %2 to i64\n %6 = bitcast i64* %2 to i32*\n store i32 1819043176, i32* %6, align 4\n %7 = add i64 %5, 4\n %8 = inttoptr i64 %7 to i16*\n store i16 111, i16* %8, align 2\n %9 = call i64 @FUNC(i64 %5)\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_5\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %10, i64* %storemerge.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %2, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_max_add_14-bad", "fun_name": "CWE190_Integer_Overflow__char_max_add_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %7 = select i1 %6, i64 33, i64 4294967168\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE588_Attempt_to_Access_Child_of_Non_Structure_Pointer__struct_07-bad", "fun_name": "CWE588_Attempt_to_Access_Child_of_Non_Structure_Pointer__struct_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n store i32 100, i32* %sv_0, align 4\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n %6 = ptrtoint i32* %sv_0 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = call i64 @FUNC(i64 %spec.select)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %2, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memcpy_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %7 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %6, i64 %1, i64 %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = inttoptr i64 %spec.select to i64*\n %10 = load i64, i64* %9, align 8\n store i64 %10, i64* %sv_0, align 8\n %11 = ptrtoint i64* %sv_0 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %2, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 1, 0, 2, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_memcpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = load i64, i64* %sv_0, align 8\n store i64 %4, i64* %sv_1, align 8\n %5 = add i64 %2, 8\n %6 = inttoptr i64 %5 to i64*\n %7 = add i64 %2, 16\n %8 = inttoptr i64 %7 to i64*\n %9 = add i64 %2, 24\n %10 = inttoptr i64 %9 to i64*\n %11 = add i64 %2, 32\n %12 = inttoptr i64 %11 to i64*\n %13 = add i64 %2, 40\n %14 = inttoptr i64 %13 to i64*\n %15 = add i64 %2, 48\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %2, 56\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %2, 64\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %2, 72\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %2, 80\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %2, 88\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %2, 96\n %28 = inttoptr i64 %27 to i32*\n %29 = add i64 %2, 99\n %30 = inttoptr i64 %29 to i8*\n store i8 0, i8* %30, align 1\n %31 = call i64 @FUNC(i64 %2)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %2, { 0, 1, 2, 10, 3, 13, 4, 5, 6, 7, 8, 9, 11, 12 }\n uselistorder i64* %sv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_memcpy_07-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_memcpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.13.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_5, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_3 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_6, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_2, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_6, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_2 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_6\n LBL_5:\n store i64 0, i64* %sv_2, align 8\n %22 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.13.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %5)\n store i64 0, i64* %sv_2, align 8\n %24 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %25 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.13.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.13.reload = load i32, i32* %sv_0.13.reg2mem\n %26 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.13.reload)\n %27 = sext i32 %sv_0.13.reload to i64\n %28 = add i64 %0, -112\n %29 = add i64 %28, %27\n %30 = inttoptr i64 %29 to i8*\n store i8 0, i8* %30, align 1\n br label LBL_8\n LBL_8:\n %31 = call i64 @FUNC(i64* nonnull %sv_2)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %1, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.13.reload, { 1, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 1, 2, 5, 0, 3, 4 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 0, 1, 3 }\n uselistorder i32 -1, { 0, 2, 1, 3, 4 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_ncpy_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -161\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %9, i32 99)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = add i64 %11, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %11)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_memcpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %8, 5\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n store i64 %3, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %11 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %12 = load i64, i64* %sv_1, align 8\n %13 = load i64, i64* %sv_0, align 8\n %14 = inttoptr i64 %12 to i64*\n store i64 %13, i64* %14, align 8\n %15 = add i64 %12, 8\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %12, 16\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %12, 24\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %12, 32\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %12, 40\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %12, 48\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %12, 56\n %28 = inttoptr i64 %27 to i64*\n %29 = add i64 %12, 64\n %30 = inttoptr i64 %29 to i64*\n %31 = add i64 %12, 72\n %32 = inttoptr i64 %31 to i64*\n %33 = add i64 %12, 80\n %34 = inttoptr i64 %33 to i64*\n %35 = add i64 %12, 88\n %36 = inttoptr i64 %35 to i64*\n %37 = add i64 %12, 96\n %38 = inttoptr i64 %37 to i32*\n %39 = load i64, i64* %sv_1, align 8\n %40 = add i64 %39, 99\n %41 = inttoptr i64 %40 to i8*\n store i8 0, i8* %41, align 1\n %42 = load i64, i64* %sv_1, align 8\n %43 = call i64 @FUNC(i64 %42)\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %1, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %12, { 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_multiply_12-bad", "fun_name": "CWE191_Integer_Underflow__int_min_multiply_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %. = select i1 %2, i32 -2, i32 -2147483648\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i32 %., 2\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n br i1 %2, label LBL_3, label LBL_4\n LBL_3:\n %9 = mul i32 %., 2\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__char_pointer_07-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__char_pointer_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = load i32, i32* @gv_0, align 4\n %3 = zext i32 %2 to i64\n %4 = icmp eq i32 %2, 5\n %5 = icmp eq i1 %4, false\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 %1)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_zero_divide_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_partial_init_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %4 = mul i64 %indvars.iv6.reload, 8\n %5 = add i64 %4, %1\n %6 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %7 = trunc i64 %indvars.iv6.reload to i32\n %8 = call i128 @FUNC(i32 %7)\n %9 = call i64 @FUNC(i128 %8)\n %10 = inttoptr i64 %5 to i64*\n store i64 %9, i64* %10, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %8, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 8\n %12 = add i64 %11, %1\n %13 = inttoptr i64 %12 to i64*\n %14 = load i64, i64* %13, align 8\n %15 = call i128 @FUNC(i64 %14)\n %16 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %16\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @printDoubleLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 2, 3, 1, 0, 4 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_fscanf_05-bad", "fun_name": "CWE126_Buffer_Overread__CWE129_fscanf_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = icmp slt i32 %6, 0\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = sext i32 %6 to i64\n %10 = mul i64 %9, 4\n %11 = add i64 %8, -48\n %12 = add i64 %11, %10\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_5\n LBL_4:\n %17 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_sub_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = icmp eq i64 %6, -9223372036854775808\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i64 %6, -1\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_5\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memcpy_02-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_memcpy_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = load i64, i64* %sv_0, align 8\n %11 = inttoptr i64 %8 to i64*\n store i64 %10, i64* %11, align 8\n %12 = add i64 %4, 8\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %4, 16\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %4, 24\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %4, 32\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %4, 40\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %4, 48\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %4, 56\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %4, 64\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %4, 72\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %4, 80\n %31 = inttoptr i64 %30 to i64*\n %32 = add i64 %4, 88\n %33 = inttoptr i64 %32 to i32*\n %34 = add i64 %4, 91\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n %36 = call i64 @FUNC(i64 %8)\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 0, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 13 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_multiply_13-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %.pr = load i16, i16* %sv_0, align 2\n %6 = icmp slt i16 %.pr, 1\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = mul i16 %.pr, 2\n %8 = sext i16 %7 to i64\n %9 = and i64 %8, 4294967294\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i32 66)\n store i32 %4, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %7, label LBL_5, label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %8 = call i32 @close(i32 %sv_0.0.reload)\n %9 = sext i32 %8 to i64\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = bitcast i64* %0 to i32*\n store i32 0, i32* %4, align 4\n %5 = add i64 %3, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %7 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 3, 1, 4, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_postdec_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = zext i32 %4 to i64\n %6 = mul i64 %5, 1152921504606846976\n %7 = call i32 @rand()\n %8 = zext i32 %7 to i64\n %9 = mul i64 %8, 35184372088832\n %10 = call i32 @rand()\n %11 = sext i32 %10 to i64\n %12 = mul i64 %11, 1073741824\n %13 = call i32 @rand()\n %14 = sext i32 %13 to i64\n %15 = mul i64 %14, 32768\n %16 = call i32 @rand()\n %17 = sext i32 %16 to i64\n %18 = sext i1 %3 to i64\n %19 = xor i64 %6, %18\n %20 = xor i64 %19, %9\n %21 = xor i64 %20, %12\n %22 = xor i64 %21, %15\n %storemerge = xor i64 %22, %17\n %23 = icmp eq i64 %storemerge, -9223372036854775808\n br i1 %23, label LBL_2, label LBL_1\n LBL_1:\n %24 = add i64 %storemerge, -1\n %25 = call i64 @FUNC(i64 %24)\n br label LBL_3\n LBL_2:\n %26 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge, { 1, 0 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_max_square_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %narrow = select i1 %5, i64 0, i64 4\n %6 = call i64 @FUNC(i64 %narrow)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memmove_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_2 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_2 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %7, i64 0, i64 100)\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_3 to i32))\n %10 = load i64, i64* %8, align 8\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_min_predec_13-bad", "fun_name": "CWE191_Integer_Underflow__short_min_predec_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = select i1 %2, i64 4294967295, i64 32767\n %4 = call i64 @FUNC(i64 %3)\n ret i64 %4\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_snprintf_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_1 to i8*\n %4 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 32777976880262761, i64* %6, align 8\n store i64 0, i64* %sv_0, align 8\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %7, i32 99, i8* nonnull %3)\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_2\n LBL_2:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0, 2, 3 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 0, 2, 3, 1, 4 }\n uselistorder i32 99, { 0, 1, 3, 2, 5, 4 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_pointer_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = ptrtoint i64* %3 to i64\n %8 = add i64 %7, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 6, i32* %9, align 4\n store i32* %6, i32** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32*, i32** %sv_0.0.reg2mem\n %13 = load i32, i32* %sv_0.0.reload, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = ptrtoint i32* %sv_0.0.reload to i64\n %17 = add i64 %16, 4\n %18 = inttoptr i64 %17 to i32*\n %19 = load i32, i32* %18, align 4\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 0, 3, 2, 1, 4 }\n uselistorder i64* (i32)* @malloc, { 2, 1, 3, 0, 4 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_src_char_cat_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %6 = call i64* @memset(i64* %1, i32 65, i32 49)\n %7 = ptrtoint i64* %1 to i64\n %8 = add i64 %7, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 %7, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %10 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strcat(i8* nonnull %11, i8* %10)\n %13 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 5, 2, 3, 0, 4 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*)* @strcat, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32*\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %1 = load i32*, i32** %0\n %sv_2 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n %6 = bitcast i64* %sv_1 to i32*\n %spec.select = select i1 %5, i32* %1, i32* %6\n %7 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %7, i64 0, i64 50)\n %8 = ptrtoint i32* %spec.select to i64\n %9 = add i64 %2, -416\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %10 = mul i64 %storemerge2.reload, 4\n %11 = add i64 %10, %8\n %12 = add i64 %9, %10\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = inttoptr i64 %11 to i32*\n store i32 %14, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %17 = load i32, i32* %spec.select, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %3, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %spec.select, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_multiply_06-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = zext i32 %3 to i64\n %5 = mul i64 %4, 1152921504606846976\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 35184372088832\n %9 = call i32 @rand()\n %10 = sext i32 %9 to i64\n %11 = mul i64 %10, 1073741824\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 32768\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = sext i1 %2 to i64\n %18 = xor i64 %5, %17\n %19 = xor i64 %18, %8\n %20 = xor i64 %19, %11\n %21 = xor i64 %20, %14\n %storemerge = xor i64 %21, %16\n %22 = icmp slt i64 %storemerge, 1\n store i64 5, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_1\n LBL_1:\n %23 = icmp sgt i64 %storemerge, 4611686018427387902\n br i1 %23, label LBL_3, label LBL_2\n LBL_2:\n %24 = mul i64 %storemerge, 2\n %25 = call i64 @FUNC(i64 %24)\n store i64 %25, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %26 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %26, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_sub_11-bad", "fun_name": "CWE191_Integer_Underflow__int_fscanf_sub_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = add i64 %9, 4294967295\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -20\n %6 = inttoptr i64 %5 to i32*\n store i32 1, i32* %6, align 4\n %7 = add i64 %4, -48\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 -20, { 1, 0 }\n uselistorder i32 5, { 1, 0, 2, 3, 4, 5, 6, 7 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fgets_strncpy_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %3 = bitcast i64* %sv_1 to i8*\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strncpy(i8* nonnull %3, i8* nonnull %4, i32 99)\n %6 = add i64 %0, -13\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC(i64* nonnull %sv_1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 99, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_fprintf_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %sv_0 to i64\n %6 = sext i32 %2 to i64\n %7 = add i64 %6, %5\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n %11 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %12 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fprintf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_predec_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0368.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.0368.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.0368.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp eq i32 %sv_0.0.ph.reload, -2147483648\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0368.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.0368.reload = load i32, i32* %sv_0.0368.reg2mem\n %26 = add i32 %sv_0.0368.reload, -1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0368.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_loop_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = ptrtoint i64* %1 to i64\n %6 = add i64 %4, -816\n %7 = add i64 %4, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %8 = mul i64 %storemerge13.reload, 8\n %9 = add i64 %8, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 8\n %11 = add i64 %7, %8\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge13.reg2mem\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %exitcond4, label LBL_4, label LBL_3\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %14 = mul i64 %storemerge2.reload, 8\n %15 = add i64 %14, %5\n %16 = add i64 %14, %6\n %17 = inttoptr i64 %16 to i64*\n %18 = load i64, i64* %17, align 8\n %19 = inttoptr i64 %15 to i64*\n store i64 %18, i64* %19, align 8\n %20 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %20, 100\n store i64 %20, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %21 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %14, { 1, 0 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64 100, { 1, 0, 3, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_for_loop_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge9.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_7\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %sv_3.0.off = add i32 %19, -1\n %21 = icmp ugt i32 %sv_3.0.off, 19\n br i1 %21, label LBL_7, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n store i64 0, i64* %storemerge9.reg2mem\n br label LBL_6\n LBL_6:\n %storemerge9.reload = load i64, i64* %storemerge9.reg2mem\n %23 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n %24 = add nuw i64 %storemerge9.reload, 1\n %25 = icmp ult i64 %24, %22\n store i64 %24, i64* %storemerge9.reg2mem\n br i1 %25, label LBL_6, label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %storemerge9.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 2, 3, 1, 4, 5 }\n uselistorder label LBL_7, { 0, 3, 2, 1 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_divide_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = load i32, i32* @gv_3, align 4\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i32, i32* %sv_0, align 4\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %10 = udiv i32 100, %8\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_7\n LBL_6:\n %13 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_5 to i64))\n br label LBL_7\n LBL_7:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_memmove_17-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_memmove_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %3, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = inttoptr i64 %8 to i64*\n %11 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %10, i32 100)\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fgets_31-bad", "fun_name": "CWE369_Divide_by_Zero__float_fgets_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %3 = call i64 @FUNC(i64 40)\n %4 = call i128 @FUNC(i128 %2, i128 %2)\n %5 = call i64 @FUNC(i128 %4)\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = bitcast i64* %sv_1 to i8*\n %8 = call i8* @fgets(i8* nonnull %7, i32 20, %_IO_FILE* %6)\n %9 = icmp eq i8* %8, null\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n %10 = call double @atof(i8* nonnull %7)\n %11 = fptrunc double %10 to float\n %12 = bitcast float %11 to i32\n %13 = sext i32 %12 to i128\n %14 = call i128 @FUNC(i128 %13)\n %15 = call i64 @FUNC(i128 %14)\n store i64 %15, i64* %sv_0.0.in.reg2mem\n br label LBL_3\n LBL_2:\n %16 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 %5, i64* %sv_0.0.in.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %17 = call i128 @__asm_movss.1(i32 %sv_0.0)\n %18 = call i64 @FUNC(i128 %17)\n %19 = trunc i64 %18 to i32\n %20 = call i128 @__asm_movss.1(i32 %19)\n %21 = call i64 @FUNC(i128 %20)\n %22 = trunc i64 %21 to i32\n %23 = call i128 @FUNC(i128 %1, i128 %1)\n %24 = call i128 @FUNC(i32 %22)\n %25 = call i128 @FUNC(i64 4636737291354636288)\n %26 = call i128 @FUNC(i128 %25, i128 %24)\n %27 = call i32 @FUNC(i128 %26)\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %3, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.in.reg2mem, { 0, 2, 1 }\n uselistorder i128* %0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_snprintf_05-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_snprintf_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %3, i32 93, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_2, i64 0, i64 0))\n %5 = icmp eq i32 %4, 0\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_multiply_17-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_rand_multiply_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = urem i32 %0, 2\n %7 = icmp eq i32 %6, 0\n %8 = zext i32 %1 to i64\n %9 = mul i64 %8, 1152921504606846976\n %10 = zext i32 %2 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = sext i32 %3 to i64\n %13 = mul i64 %12, 1073741824\n %14 = sext i32 %4 to i64\n %15 = mul i64 %14, 32768\n %16 = sext i32 %5 to i64\n %17 = sext i1 %7 to i64\n %18 = xor i64 %9, %17\n %19 = xor i64 %18, %11\n %20 = xor i64 %19, %13\n %21 = xor i64 %20, %15\n %storemerge2.le = xor i64 %21, %16\n %22 = icmp slt i64 %storemerge2.le, 0\n %23 = icmp eq i1 %22, false\n store i64 %storemerge2.le, i64* %rax.1.reg2mem\n br i1 %23, label LBL_2, label LBL_1\n LBL_1:\n %24 = mul i64 %storemerge2.le, 2\n %25 = call i64 @FUNC(i64 %24)\n store i64 %25, i64* %rax.1.reg2mem\n br label LBL_2\n LBL_2:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64 %storemerge2.le, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_4:\n %8 = load i8, i8* %sv_0, align 1\n %9 = icmp slt i8 %8, 0\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_8, label LBL_5\n LBL_5:\n %11 = icmp slt i8 %8, -63\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n %12 = mul i8 %8, 2\n %13 = sext i8 %12 to i64\n %14 = and i64 %13, 4294967294\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_8\n LBL_7:\n %16 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_4 to i64))\n br label LBL_8\n LBL_8:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_struct_declare_12-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_struct_declare_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %storemerge23.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %5 = mul i64 %storemerge4.reload, 8\n %6 = add i64 %5, %0\n %7 = add i64 %6, -816\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 8\n %9 = add i64 %6, -812\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge4.reload, 1\n %exitcond5 = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge4.reg2mem\n br i1 %exitcond5, label LBL_2, label LBL_1\n LBL_2:\n %12 = ptrtoint i64* %sv_0 to i64\n store i64 %12, i64* %storemerge1.reg2mem\n br label LBL_6\n LBL_3:\n %13 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %14 = ptrtoint i64* %13 to i64\n %15 = icmp eq i64* %13, null\n %16 = icmp eq i1 %15, false\n store i64 0, i64* %storemerge23.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n %17 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_5:\n %storemerge23.reload = load i64, i64* %storemerge23.reg2mem\n %18 = mul i64 %storemerge23.reload, 8\n %19 = add i64 %18, %14\n %20 = inttoptr i64 %19 to i32*\n store i32 1, i32* %20, align 4\n %21 = add i64 %19, 4\n %22 = inttoptr i64 %21 to i32*\n store i32 1, i32* %22, align 4\n %23 = add nuw nsw i64 %storemerge23.reload, 1\n %exitcond = icmp eq i64 %23, 100\n store i64 %23, i64* %storemerge23.reg2mem\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %24 = call i64 @FUNC(i64 %storemerge1.reload)\n %25 = inttoptr i64 %storemerge1.reload to i64*\n call void @free(i64* %25)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %1, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge23.reg2mem, { 2, 0, 1 }\n uselistorder i64 100, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_alloca_partial_init_11-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_array_alloca_partial_init_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.03.reg2mem = alloca i128\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %xmm0.03.reload = load i128, i128* %xmm0.03.reg2mem\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %7 = mul i64 %indvars.iv5.reload, 8\n %8 = add i64 %7, %3\n %9 = call i128 @FUNC(i128 %xmm0.03.reload, i128 %xmm0.03.reload)\n %10 = trunc i64 %indvars.iv5.reload to i32\n %11 = call i128 @FUNC(i32 %10)\n %12 = call i64 @FUNC(i128 %11)\n %13 = inttoptr i64 %8 to i64*\n store i64 %12, i64* %13, align 8\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 5\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i128 %11, i128* %xmm0.03.reg2mem\n br i1 %exitcond7, label LBL_2, label LBL_1\n LBL_2:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %17 = mul i64 %indvars.iv.reload, 8\n %18 = add i64 %17, %3\n %19 = inttoptr i64 %18 to i64*\n %20 = load i64, i64* %19, align 8\n %21 = call i128 @FUNC(i64 %20)\n %22 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %1, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.03.reload, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.03.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_sub_09-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = sext i1 %2 to i32\n %storemerge = xor i32 %5, %6\n %7 = trunc i32 %storemerge to i8\n %8 = icmp eq i8 %7, -128\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %sext = mul i32 %storemerge, 16777216\n %sext2 = add i32 %sext, -16777216\n %9 = ashr exact i32 %sext2, 24\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %12 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_environment_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* inttoptr (i64 8368 to i32*), align 16\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_2 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_3\n LBL_3:\n %14 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %15 = icmp eq i32 %14, 1\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_9, label LBL_4\n LBL_4:\n %17 = load i64, i64* %sv_1, align 8\n %18 = trunc i64 %17 to i32\n %19 = icmp sgt i32 %18, ptrtoint (i1* @gv_2 to i32)\n br i1 %19, label LBL_9, label LBL_5\n LBL_5:\n %20 = and i64 %17, 4294967295\n %21 = icmp eq i64 %20, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %21, label LBL_8, label LBL_6\n LBL_6:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %22 = add i32 %storemerge4.reload, 1\n %23 = sext i32 %22 to i64\n %24 = icmp sgt i64 %20, %23\n store i32 %22, i32* %storemerge4.reg2mem\n br i1 %24, label LBL_6, label LBL_7\n LBL_7:\n %phitmp = zext i32 %22 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %25 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_9\n LBL_9:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cpy_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i8* @strcpy(i8* nonnull %1, i8* nonnull %3)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = call i64 @FUNC(i64 %5)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_square_12-bad", "fun_name": "CWE190_Integer_Overflow__char_rand_square_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 2, i32* %storemerge5.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n store i32 %10, i32* %storemerge5.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n %14 = urem i32 %storemerge5.reload, 256\n %narrow = mul i32 %storemerge5.reload, 16777216\n %sext2 = mul i32 %narrow, %14\n %15 = ashr exact i32 %sext2, 24\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %18 = trunc i32 %storemerge5.reload to i8\n %19 = sub i8 0, %18\n %20 = icmp slt i8 %19, 0\n %21 = icmp eq i1 %20, false\n %22 = zext i8 %19 to i32\n %23 = select i1 %21, i32 %22, i32 %storemerge5.reload\n %24 = trunc i32 %23 to i8\n %25 = icmp ult i8 %24, 12\n br i1 %25, label LBL_5, label LBL_6\n LBL_5:\n %26 = urem i32 %storemerge5.reload, 256\n %narrow3 = mul i32 %storemerge5.reload, 16777216\n %sext4 = mul i32 %narrow3, %26\n %27 = ashr exact i32 %sext4, 24\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n store i64 %29, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %30, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge5.reload, { 5, 3, 0, 1, 4, 2 }\n uselistorder i32* %storemerge5.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_listen_socket_13-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_listen_socket_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv10.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8372 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %28 = call i64* @malloc(i32 40)\n %29 = ptrtoint i64* %28 to i64\n %30 = icmp eq i64* %28, null\n %31 = icmp eq i1 %30, false\n store i64 0, i64* %indvars.iv10.reg2mem\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n call void @exit(i32 -1)\n unreachable\n LBL_11:\n %indvars.iv10.reload = load i64, i64* %indvars.iv10.reg2mem\n %32 = mul i64 %indvars.iv10.reload, 4\n %33 = add i64 %32, %29\n %34 = inttoptr i64 %33 to i32*\n store i32 0, i32* %34, align 4\n %indvars.iv.next11 = add nuw nsw i64 %indvars.iv10.reload, 1\n %exitcond12 = icmp eq i64 %indvars.iv.next11, 10\n store i64 %indvars.iv.next11, i64* %indvars.iv10.reg2mem\n br i1 %exitcond12, label LBL_12, label LBL_11\n LBL_12:\n %35 = icmp slt i32 %sv_0.1.reload, 0\n br i1 %35, label LBL_15, label LBL_13\n LBL_13:\n %36 = sext i32 %sv_0.1.reload to i64\n %37 = mul i64 %36, 4\n %38 = add i64 %37, %29\n %39 = inttoptr i64 %38 to i32*\n store i32 1, i32* %39, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_14\n LBL_14:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %40 = mul i64 %indvars.iv.reload, 4\n %41 = add i64 %40, %29\n %42 = inttoptr i64 %41 to i32*\n %43 = load i32, i32* %42, align 4\n %44 = zext i32 %43 to i64\n %45 = call i64 @FUNC(i64 %44)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_16, label LBL_14\n LBL_15:\n %46 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_16\n LBL_16:\n call void @free(i64* %28)\n %47 = call i64 @FUNC(i64 40)\n %48 = icmp eq i64 %0, %47\n store i64 0, i64* %rax.0.reg2mem\n br i1 %48, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %29, { 0, 2, 1 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %indvars.iv10.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 8, 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i32 5, { 1, 0, 2 }\n uselistorder label LBL_16, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_9, { 3, 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_17-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.08.reg2mem = alloca i8*\n %sv_0.09.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_16, label LBL_3\n LBL_3:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_11, label LBL_4\n LBL_4:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_11, label LBL_5\n LBL_5:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_6\n LBL_6:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_12, label LBL_7\n LBL_7:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %28, align 1\n br label LBL_9\n LBL_9:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_12, label LBL_10\n LBL_10:\n store i8 0, i8* %30, align 1\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %6)\n br label LBL_16\n LBL_12:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_16\n LBL_13:\n %sv_0.09.reload = load i8*, i8** %sv_0.09.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %35 = icmp eq i8 %.reload, 83\n %36 = icmp eq i1 %35, false\n br i1 %36, label LBL_15, label LBL_14\n LBL_14:\n %37 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n store i8* %sv_0.09.reload, i8** %sv_0.08.reg2mem\n br label LBL_17\n LBL_15:\n %38 = ptrtoint i8* %sv_0.09.reload to i64\n %39 = add i64 %38, 1\n %40 = inttoptr i64 %39 to i8*\n %41 = load i8, i8* %40, align 1\n %42 = icmp eq i8 %41, 0\n %43 = icmp eq i1 %42, false\n store i8 %41, i8* %.reg2mem\n store i8* %40, i8** %sv_0.09.reg2mem\n store i8* %40, i8** %sv_0.08.reg2mem\n br i1 %43, label LBL_13, label LBL_17\n LBL_16:\n %44 = load i8, i8* %4, align 1\n %45 = icmp eq i8 %44, 0\n %46 = icmp eq i1 %45, false\n store i8 %44, i8* %.reg2mem\n store i8* %4, i8** %sv_0.09.reg2mem\n store i8* %4, i8** %sv_0.08.reg2mem\n br i1 %46, label LBL_13, label LBL_17\n LBL_17:\n %sv_0.08.reload = load i8*, i8** %sv_0.08.reg2mem\n %47 = bitcast i8* %sv_0.08.reload to i64*\n call void @free(i64* %47)\n %48 = call i64 @FUNC(i64 40)\n %49 = icmp eq i64 %0, %48\n store i64 0, i64* %rax.0.reg2mem\n br i1 %49, label LBL_19, label LBL_18\n LBL_18:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_19\n LBL_19:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.09.reload, { 1, 0 }\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %4, { 0, 1, 2, 3, 4, 6, 5 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 1, 2, 0 }\n uselistorder i8** %sv_0.09.reg2mem, { 1, 2, 0 }\n uselistorder i8** %sv_0.08.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_17, { 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__long_alloca_use_12-bad", "fun_name": "CWE758_Undefined_Behavior__long_alloca_use_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = add i64 %0, -1\n %6 = and i64 %5, -16\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %7 = inttoptr i64 %6 to i64*\n %8 = load i64, i64* %7, align 16\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n store i64 %6, i64* %sv_0, align 8\n %10 = inttoptr i64 %6 to i64*\n store i64 5, i64* %10, align 16\n %11 = load i64, i64* %sv_0, align 8\n %12 = inttoptr i64 %11 to i64*\n %13 = load i64, i64* %12, align 8\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 1, 2, 0 }\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_memmove_07-bad", "fun_name": "CWE124_Buffer_Underwrite__char_alloca_memmove_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %8, 5\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = add i64 %3, -8\n store i64 %11, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %13 = load i64, i64* %sv_1, align 8\n %14 = inttoptr i64 %13 to i64*\n %15 = call i64* @memmove(i64* %14, i64* nonnull %sv_0, i32 100)\n %16 = load i64, i64* %sv_1, align 8\n %17 = add i64 %16, 99\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = load i64, i64* %sv_1, align 8\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_05-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -193\n %5 = and i64 %4, -16\n %6 = load i32, i32* @gv_0, align 4\n %7 = icmp eq i32 %6, 0\n %spec.select = select i1 %7, i64 %1, i64 %5\n %8 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 50)\n %9 = inttoptr i64 %spec.select to i64*\n %10 = call i64* @memcpy(i64* %9, i64* nonnull %sv_0, i32 400)\n %11 = inttoptr i64 %spec.select to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %3, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_cpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i8*\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i8*, i8** %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n %6 = bitcast i64* %sv_1 to i8*\n %spec.select = select i1 %5, i8* %1, i8* %6\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %8 = bitcast i64* %sv_0 to i8*\n %9 = call i8* @strcpy(i8* %spec.select, i8* nonnull %8)\n %10 = ptrtoint i8* %spec.select to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %2, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_sleep_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i32 20, i32* %sv_0.01.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %3 = zext i32 %.pre to i64\n %4 = icmp eq i32 %.pre, 5\n %5 = icmp eq i1 %4, false\n store i32 -1, i32* %sv_0.01.reg2mem\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %6 = call i32 @usleep(i32 %sv_0.01.reload)\n %7 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_2 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.01.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 0, 1, 2, 4, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 13617, i64* %sv_2, align 8\n %1 = ptrtoint i64* %sv_2 to i64\n %2 = or i64 %1, 2\n %3 = inttoptr i64 %2 to i8*\n store i8 0, i8* %3, align 2\n %4 = bitcast i64* %sv_2 to i8*\n %5 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %6 = icmp eq i32 %5, 1\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_5, label LBL_1\n LBL_1:\n %8 = load i64, i64* %sv_1, align 8\n %9 = and i64 %8, 4294967295\n %10 = icmp eq i64 %9, 0\n store i32 0, i32* %storemerge2.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %10, label LBL_4, label LBL_2\n LBL_2:\n %storemerge2.reload = load i32, i32* %storemerge2.reg2mem\n %11 = add i32 %storemerge2.reload, 1\n %12 = sext i32 %11 to i64\n %13 = icmp sgt i64 %9, %12\n store i32 %11, i32* %storemerge2.reg2mem\n br i1 %13, label LBL_2, label LBL_3\n LBL_3:\n %phitmp = zext i32 %11 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %14 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0, 2 }\n uselistorder i64* %sv_2, { 1, 2, 0 }\n uselistorder i32* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_predec_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.045.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.045.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.045.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, -2147483648\n store i32 %19, i32* %sv_0.045.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.045.reload = load i32, i32* %sv_0.045.reg2mem\n %22 = add i32 %sv_0.045.reload, -1\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.045.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %5 = call i64* @malloc(i32 100)\n %6 = icmp eq i64* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = ptrtoint i64* %5 to i64\n %9 = call i64* @memset(i64* %5, i32 65, i32 99)\n %10 = add i64 %8, 99\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n store i64 %8, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %13 = bitcast i64* %sv_1 to i8*\n %14 = call i32 @strlen(i8* nonnull %13)\n %15 = sext i32 %14 to i64\n %16 = icmp eq i32 %14, 0\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %17 = add i64 %storemerge1.reload, %sv_0.0.reload\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = add i64 %storemerge1.reload, %.pre\n %21 = inttoptr i64 %20 to i8*\n store i8 %19, i8* %21, align 1\n %22 = add nuw i64 %storemerge1.reload, 1\n %23 = icmp ult i64 %22, %15\n store i64 %22, i64* %storemerge1.reg2mem\n br i1 %23, label LBL_6, label LBL_7\n LBL_7:\n %24 = call i64 @FUNC(i64 %.pre)\n %25 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %25)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %.pre, { 1, 0 }\n uselistorder i64* %5, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_declare_partial_init_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %indvars.iv9.reg2mem\n br label LBL_1\n LBL_1:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %2 = mul i64 %indvars.iv9.reload, 8\n %3 = add i64 %2, %1\n %4 = inttoptr i64 %3 to i32*\n %5 = trunc i64 %indvars.iv9.reload to i32\n store i32 %5, i32* %4, align 8\n %6 = or i64 %3, 4\n %7 = inttoptr i64 %6 to i32*\n store i32 %5, i32* %7, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %exitcond11, label LBL_2, label LBL_1\n LBL_2:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %8 = mul i64 %indvars.iv6.reload, 8\n %9 = add i64 %8, %1\n %10 = inttoptr i64 %9 to i32*\n %11 = trunc i64 %indvars.iv6.reload to i32\n store i32 %11, i32* %10, align 8\n %12 = or i64 %9, 4\n %13 = inttoptr i64 %12 to i32*\n store i32 %11, i32* %13, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 8\n %15 = add i64 %14, %1\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 8\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %20 = or i64 %15, 4\n %21 = inttoptr i64 %20 to i32*\n %22 = load i32, i32* %21, align 4\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv9.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_putc_13-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_putc_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 @putc(i32 65, %_IO_FILE* %4)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_modulo_01-bad", "fun_name": "CWE369_Divide_by_Zero__int_fgets_modulo_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %2)\n store i32 %5, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = urem i32 100, %sv_0.0.reload\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_large_14-bad", "fun_name": "CWE126_Buffer_Overread__CWE129_large_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = add i64 %7, -8\n %9 = inttoptr i64 %8 to i32*\n %10 = load i32, i32* %9, align 8\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_3:\n %13 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_max_multiply_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 4)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 4, 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_predec_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = icmp eq i64 %3, -9223372036854775808\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i64 %3, -1\n store i64 %5, i64* %sv_0, align 8\n %6 = call i64 @FUNC(i64 %5)\n br label LBL_3\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__struct_pointer_alloca_use_13-bad", "fun_name": "CWE758_Undefined_Behavior__struct_pointer_alloca_use_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -1\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i64*\n %8 = load i64, i64* %7, align 16\n %9 = inttoptr i64 %8 to i32*\n %10 = load i32, i32* %9, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = add i64 %8, 4\n %14 = inttoptr i64 %13 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_2\n LBL_2:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i32*, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i32** %sv_1 to i64\n %5 = add i64 %4, -609\n %6 = and i64 %5, -16\n %7 = bitcast i32** %sv_1 to i64*\n store i64 %6, i64* %7, align 8\n br label LBL_3\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 50)\n %10 = add i64 %8, -416\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %11 = mul i64 %storemerge3.reload, 4\n %12 = load i32*, i32** %sv_1, align 8\n %13 = ptrtoint i32* %12 to i64\n %14 = add i64 %11, %13\n %15 = add i64 %10, %11\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = inttoptr i64 %14 to i32*\n store i32 %17, i32* %18, align 4\n %19 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %19, 100\n store i64 %19, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %20 = load i32*, i32** %sv_1, align 8\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_1, { 3, 2, 0, 1 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_ncpy_04-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_ncpy_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %9 = inttoptr i64 %8 to i8*\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strncpy(i8* %9, i8* nonnull %11, i32 99)\n %13 = add i64 %4, 91\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n %15 = call i64 @FUNC(i64 %8)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_13-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* inttoptr (i64 8348 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_7, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_3 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_6, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_2, i32 7, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_6, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_2 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %.off = add i32 %21, 32768\n %22 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %22, label LBL_5, label LBL_6\n LBL_5:\n %sext3 = mul i32 %21, 65536\n %23 = ashr exact i32 %sext3, 16\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %24 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %25 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %26 = trunc i32 %sv_0.1.reload to i16\n %27 = icmp sgt i16 %26, 99\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n %28 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.1.reload)\n %29 = sext i32 %sv_0.1.reload to i64\n %30 = add i64 %0, -112\n %31 = add i64 %30, %29\n %32 = inttoptr i64 %31 to i8*\n store i8 0, i8* %32, align 1\n br label LBL_9\n LBL_9:\n %33 = call i64 @FUNC(i64* nonnull %sv_2)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %1, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 2, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 4, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0, 2 }\n uselistorder label LBL_6, { 2, 0, 3, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_realloc_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %2 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 2, 4, 0, 3, 5, 1 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_listen_socket_17-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_listen_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.04712.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to %sockaddr*\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = call i32 @bind(i32 %2, %sockaddr* nonnull %4, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call i32 @listen(i32 %2, i32 5)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = call i32 @accept(i32 %2, %sockaddr* null, i32* null)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_4\n LBL_4:\n %13 = call i32 @recv(i32 %11, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = add i64 %0, -22\n %17 = bitcast i64* %sv_1 to i8*\n %18 = sext i32 %13 to i64\n %19 = add i64 %16, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i32 @atoi(i8* nonnull %17)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %2)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n store i32 -1, i32* %sv_0.04712.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %2)\n %24 = call i32 @close(i32 %11)\n %25 = icmp sgt i32 %sv_0.0.ph.reload, 9\n store i64 0, i64* %sv_2, align 8\n store i32 %sv_0.0.ph.reload, i32* %sv_0.04712.reg2mem\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n %sv_0.04712.reload = load i32, i32* %sv_0.04712.reg2mem\n %26 = add i64 %0, -64\n %27 = sext i32 %sv_0.04712.reload to i64\n %28 = mul i64 %27, 4\n %29 = add i64 %26, %28\n %30 = inttoptr i64 %29 to i32*\n %31 = load i32, i32* %30, align 4\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_11\n LBL_10:\n %34 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %1, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %2, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 3, 0, 4, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_struct_declare_05-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_struct_declare_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %storemerge1.reg2mem\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %4, %0\n %6 = add i64 %5, -816\n %7 = inttoptr i64 %6 to i32*\n store i32 1, i32* %7, align 8\n %8 = add i64 %5, -812\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 4\n %10 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %10, 100\n store i64 %10, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %11 = ptrtoint i64* %sv_1 to i64\n store i64 %11, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = call i64 @FUNC(i64 %sv_0.0.reload)\n %13 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %13)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_int64_t_08-bad", "fun_name": "CWE563_Unused_Variable__unused_value_int64_t_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 10)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_for_loop_05-bad", "fun_name": "CWE400_Resource_Exhaustion__rand_for_loop_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = urem i32 %2, 2\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @rand()\n %6 = mul i32 %5, 1073741824\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = xor i32 %8, %6\n %10 = call i32 @rand()\n %11 = xor i32 %9, %10\n %12 = sext i1 %4 to i32\n %storemerge1.in = xor i32 %11, %12\n %phitmp = sext i32 %storemerge1.in to i64\n %.pr = load i32, i32* @gv_0, align 4\n %13 = icmp eq i32 %.pr, 0\n %14 = icmp eq i32 %storemerge1.in, 0\n %or.cond = or i1 %13, %14\n store i64 0, i64* %storemerge2.reg2mem\n store i64 0, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_3, label LBL_2\n LBL_2:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %15 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n %16 = add nuw i64 %storemerge2.reload, 1\n %17 = icmp ult i64 %16, %phitmp\n store i64 %16, i64* %storemerge2.reg2mem\n store i64 %phitmp, i64* %rax.0.reg2mem\n br i1 %17, label LBL_2, label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 1, 3, 2 }\n uselistorder label LBL_3, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_rand_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 %4, i64* %sv_0.0.in.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i128 @__asm_movss.1(i32 1073741824)\n %9 = call i64 @FUNC(i128 %8)\n store i64 %9, i64* %sv_0.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %13 = call i128 @FUNC(i128 %1, i128 %1)\n %14 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.0)\n %15 = call i128 @FUNC(i64 4636737291354636288)\n %16 = call i128 @FUNC(i128 %15, i128 %14)\n %17 = call i32 @FUNC(i128 %16)\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %2, { 1, 0 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }\n uselistorder i32 1073741824, { 2, 3, 0, 1, 4 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_predec_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp eq i32 %sv_0.0.reload, -2147483648\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = add i32 %sv_0.0.reload, -1\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_8\n LBL_7:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_printf_12-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_file_printf_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_7\n LBL_6:\n %20 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %21 = add i64 %20, 8\n %22 = inttoptr i64 %21 to i64*\n store i64 32777976880262761, i64* %22, align 8\n br label LBL_7\n LBL_7:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %26 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n br label LBL_10\n LBL_9:\n %27 = call i32 @puts(i8* nonnull %1)\n br label LBL_10\n LBL_10:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memmove_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = inttoptr i64 %sv_0.0.reload to i64*\n %13 = call i64* @memmove(i64* %12, i64* nonnull %sv_1, i32 100)\n %14 = add i64 %sv_0.0.reload, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %sv_0.0.reload)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_partial_init_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %7 = mul i64 %indvars.iv9.reload, 8\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv9.reload to i32\n store i32 %10, i32* %9, align 4\n %11 = add i64 %8, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 %10, i32* %12, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_4, label LBL_3\n LBL_4:\n %13 = load i32, i32* @gv_0, align 4\n %14 = icmp eq i32 %13, 5\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %15, i64* %rax.2.reg2mem\n br label LBL_8\n LBL_6:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %16 = mul i64 %indvars.iv6.reload, 8\n %17 = add i64 %16, %3\n %18 = inttoptr i64 %17 to i32*\n %19 = trunc i64 %indvars.iv6.reload to i32\n store i32 %19, i32* %18, align 4\n %20 = add i64 %17, 4\n %21 = inttoptr i64 %20 to i32*\n store i32 %19, i32* %21, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_7, label LBL_6\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %22 = mul i64 %indvars.iv.reload, 8\n %23 = add i64 %22, %3\n %24 = inttoptr i64 %23 to i32*\n %25 = load i32, i32* %24, align 4\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %28 = add i64 %23, 4\n %29 = inttoptr i64 %28 to i32*\n %30 = load i32, i32* %29, align 4\n %31 = zext i32 %30 to i64\n %32 = call i64 @FUNC(i64 %31)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %32, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_7\n LBL_8:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_multiply_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n ret i64 %2\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_realloc_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @realloc(i64* null, i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n store i64 7453010373643542593, i64* %3, align 8\n %7 = add i64 %6, 8\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC(i64 %6)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %10 = icmp eq i32 %.reload, 5\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %11, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64** %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_13-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 1, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %phitmp = add i32 %.pre, 1\n %phitmp2 = zext i32 %phitmp to i64\n store i64 %phitmp2, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %6 = call i64 @FUNC(i64 %.reload)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_rand_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8440 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n %14 = sext i1 %6 to i32\n %storemerge.in = xor i32 %13, %14\n %15 = icmp ugt i32 %storemerge.in, 9\n br i1 %15, label LBL_3, label LBL_2\n LBL_2:\n %16 = ptrtoint i64* %sv_0 to i64\n %17 = sext i32 %storemerge.in to i64\n %18 = mul i64 %17, 4\n %19 = add i64 %16, -64\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i32*\n %22 = load i32, i32* %21, align 4\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_4\n LBL_3:\n %25 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_4:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_declare_14-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_char_declare_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = ptrtoint i64* %sv_1 to i64\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %6 = call i64 @FUNC(i64 %sv_0.0.reload)\n %7 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %7)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_partial_init_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -33\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %7 = mul i64 %indvars.iv9.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv9.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_2, label LBL_1\n LBL_2:\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %13, label LBL_5, label LBL_3\n LBL_3:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %14 = mul i64 %indvars.iv6.reload, 4\n %15 = add i64 %14, %3\n %16 = inttoptr i64 %15 to i32*\n %17 = trunc i64 %indvars.iv6.reload to i32\n store i32 %17, i32* %16, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_4, label LBL_3\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %18 = mul i64 %indvars.iv.reload, 4\n %19 = add i64 %18, %3\n %20 = inttoptr i64 %19 to i32*\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %1, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_short_01-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_short_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.058.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i64 4294967295, i64* %sv_0.058.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i64 4294967295, i64* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %phitmp = mul i32 %21, 65536\n %phitmp2 = ashr exact i32 %phitmp, 16\n %phitmp3 = zext i32 %phitmp2 to i64\n store i64 %phitmp3, i64* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i64 4294967295, i64* %sv_0.058.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i64, i64* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i64 %sv_0.0.ph.reload, i64* %sv_0.058.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.058.reload = load i64, i64* %sv_0.058.reg2mem\n %25 = call i64 @FUNC(i64 %sv_0.058.reload)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %sv_0.058.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = ptrtoint %_IO_FILE* %0 to i64\n %2 = call i32 @fclose(%_IO_FILE* %0)\n ret i64 %1\n\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__long_realloc_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = load i32, i32* @gv_0, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 0\n %4 = icmp eq i64* %0, null\n %or.cond = or i1 %4, %3\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %1)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC()\n %27 = trunc i64 %26 to i32\n %28 = icmp eq i32 %27, 0\n br i1 %28, label LBL_14, label LBL_8\n LBL_8:\n %29 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %30 = icmp eq i32 %29, 1\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_14, label LBL_9\n LBL_9:\n %32 = load i64, i64* %sv_1, align 8\n %33 = trunc i64 %32 to i32\n %34 = icmp sgt i32 %33, ptrtoint (i1* @gv_3 to i32)\n br i1 %34, label LBL_14, label LBL_10\n LBL_10:\n %35 = and i64 %32, 4294967295\n %36 = icmp eq i64 %35, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %36, label LBL_13, label LBL_11\n LBL_11:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %37 = add i32 %storemerge4.reload, 1\n %38 = sext i32 %37 to i64\n %39 = icmp sgt i64 %35, %38\n store i32 %37, i32* %storemerge4.reg2mem\n br i1 %39, label LBL_11, label LBL_12\n LBL_12:\n %phitmp = zext i32 %37 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_13\n LBL_13:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %40 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_14\n LBL_14:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %37, { 1, 0, 2 }\n uselistorder i64 %11, { 1, 0 }\n uselistorder i8* %1, { 2, 0, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 ptrtoint (i1* @gv_3 to i32), { 1, 0 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 2, 3, 0, 4 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_03-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = ptrtoint i64* %sv_2 to i64\n %2 = bitcast i64* %sv_2 to i16*\n store i16 ptrtoint (i64* @gv_0 to i16), i16* %2, align 8\n %3 = or i64 %1, 2\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 2\n %5 = bitcast i64* %sv_2 to i8*\n %6 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %7 = icmp eq i32 %6, 1\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_5, label LBL_1\n LBL_1:\n %9 = load i64, i64* %sv_1, align 8\n %10 = and i64 %9, 4294967295\n %11 = icmp eq i64 %10, 0\n store i32 0, i32* %storemerge2.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %11, label LBL_4, label LBL_2\n LBL_2:\n %storemerge2.reload = load i32, i32* %storemerge2.reg2mem\n %12 = add i32 %storemerge2.reload, 1\n %13 = sext i32 %12 to i64\n %14 = icmp sgt i64 %10, %13\n store i32 %12, i32* %storemerge2.reg2mem\n br i1 %14, label LBL_2, label LBL_3\n LBL_3:\n %phitmp = zext i32 %12 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %15 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0, 2 }\n uselistorder i32* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_negative_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = add i64 %1, -48\n %3 = add i64 %1, -20\n %4 = inttoptr i64 %3 to i32*\n store i32 1, i32* %4, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_1\n LBL_1:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %5 = mul i64 %indvars.iv.reload, 4\n %6 = add i64 %2, %5\n %7 = inttoptr i64 %6 to i32*\n %8 = load i32, i32* %7, align 4\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_loop_08-bad", "fun_name": "CWE124_Buffer_Underwrite__char_declare_loop_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %1 = load i64, i64* %0\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %6, i64 %1, i64 %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n store i64 0, i64* %sv_1, align 8\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %spec.select\n %11 = add i64 %storemerge1.reload, %9\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = inttoptr i64 %10 to i8*\n store i8 %13, i8* %14, align 1\n %15 = load i64, i64* %sv_1, align 8\n %16 = add i64 %15, 1\n store i64 %16, i64* %sv_1, align 8\n %17 = icmp ult i64 %16, 100\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %17, label LBL_1, label LBL_2\n LBL_2:\n %18 = add i64 %spec.select, 99\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = call i64 @FUNC(i64 %spec.select)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %2, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 0, 2, 1 }\n uselistorder i64 %storemerge1.reload, { 1, 0 }\n uselistorder i64 %spec.select, { 2, 1, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memmove_16-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %5)\n %7 = call i64 @FUNC(i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 2, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_calloc_11-bad", "fun_name": "CWE401_Memory_Leak__int64_t_calloc_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @calloc(i32 100, i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %3, align 8\n %6 = call i64 @FUNC(i64 5)\n br label LBL_4\n LBL_4:\n %7 = call i64 @FUNC()\n ret i64 %7\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i32 %3, 1\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_multiply_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge.in = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge.in, 0\n store i64 5, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_1\n LBL_1:\n %12 = icmp ult i32 %storemerge.in, 2147483647\n br i1 %12, label LBL_2, label LBL_3\n LBL_2:\n %13 = mul i32 %storemerge.in, 2\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 5, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE665_Improper_Initialization__char_ncat_12-bad", "fun_name": "CWE665_Improper_Initialization__char_ncat_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n store i8 0, i8* %1, align 8\n br label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = call i8* @strncat(i8* nonnull %1, i8* nonnull %7, i32 %8)\n %10 = ptrtoint i64* %sv_1 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_connect_socket_07-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_connect_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_2, align 8\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_2 to i8*\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 5\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_9, label LBL_1\n LBL_1:\n %12 = call i32 @strlen(i8* nonnull %8)\n %13 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %13, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %15 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %16 = call i16 @htons(i16 27015)\n %17 = bitcast i64* %sv_0 to %sockaddr*\n %18 = call i32 @connect(i32 %13, %sockaddr* nonnull %17, i32 16)\n %19 = icmp eq i32 %18, -1\n br i1 %19, label LBL_8, label LBL_3\n LBL_3:\n %20 = sext i32 %12 to i64\n %21 = ptrtoint i64* %sv_2 to i64\n %22 = add i64 %20, %21\n %23 = inttoptr i64 %22 to i64*\n %24 = sub i32 249, %12\n %25 = call i32 @recv(i32 %13, i64* %23, i32 %24, i32 0)\n %26 = add i32 %25, 1\n %27 = icmp ult i32 %26, 2\n br i1 %27, label LBL_8, label LBL_4\n LBL_4:\n %28 = sext i32 %25 to i64\n %29 = add i64 %22, %28\n %30 = inttoptr i64 %29 to i8*\n store i8 0, i8* %30, align 1\n %31 = call i8* @strchr(i8* nonnull %8, i32 13)\n %32 = icmp eq i8* %31, null\n br i1 %32, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %31, align 1\n br label LBL_6\n LBL_6:\n %33 = call i8* @strchr(i8* nonnull %8, i32 10)\n %34 = icmp eq i8* %33, null\n br i1 %34, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %33, align 1\n br label LBL_8\n LBL_8:\n %35 = call i32 @close(i32 %13)\n br label LBL_9\n LBL_9:\n %36 = call i32 @putenv(i8* nonnull %8)\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %2, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %25, { 1, 0 }\n uselistorder i32 %13, { 3, 1, 2, 0 }\n uselistorder i8* %8, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE188_Reliance_on_Data_Memory_Layout__modify_local_08-bad", "fun_name": "CWE188_Reliance_on_Data_Memory_Layout__modify_local_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n store i32 1, i32* %sv_0, align 4\n %6 = ptrtoint i32* %sv_0 to i64\n %7 = add i64 %6, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 5, i32* %8, align 4\n %9 = load i32, i32* %sv_0, align 4\n %sext = mul i32 %9, 16777216\n %10 = ashr exact i32 %sext, 24\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = zext i32 %1 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_2\n LBL_2:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %2, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_06-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, 99\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n store i64 0, i64* %sv_0, align 8\n %6 = call i32 @strlen(i8* nonnull %1)\n %7 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %6)\n %8 = call i64 @FUNC(i64 %3)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_for_loop_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge12.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_11, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_11, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n br label LBL_11\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n %sv_0.1.off = add i32 %sv_0.0.ph.reload, -1\n %31 = icmp ugt i32 %sv_0.1.off, 19\n %32 = or i1 %31, %30\n br i1 %32, label LBL_11, label LBL_9\n LBL_9:\n %33 = sext i32 %sv_0.0.ph.reload to i64\n store i64 0, i64* %storemerge12.reg2mem\n br label LBL_10\n LBL_10:\n %storemerge12.reload = load i64, i64* %storemerge12.reg2mem\n %34 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n %35 = add nuw i64 %storemerge12.reload, 1\n %36 = icmp ult i64 %35, %33\n store i64 %35, i64* %storemerge12.reg2mem\n br i1 %36, label LBL_10, label LBL_11\n LBL_11:\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge12.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 5, 0, 7, 8, 9, 10, 6, 3, 4, 11, 12, 13, 2, 14, 1 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_11, { 0, 4, 2, 1, 3 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_for_loop_17-bad", "fun_name": "CWE400_Resource_Exhaustion__rand_for_loop_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge14.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = mul i32 %1, 1073741824\n %7 = mul i32 %2, 32768\n %8 = xor i32 %7, %6\n %9 = xor i32 %8, %3\n %10 = sext i1 %5 to i32\n %storemerge3.in.le = xor i32 %9, %10\n %phitmp.le = sext i32 %storemerge3.in.le to i64\n %11 = icmp eq i32 %storemerge3.in.le, 0\n store i64 0, i64* %storemerge14.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %storemerge14.reload = load i64, i64* %storemerge14.reg2mem\n %12 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n %13 = add nuw i64 %storemerge14.reload, 1\n %14 = icmp ult i64 %13, %phitmp.le\n store i64 %13, i64* %storemerge14.reg2mem\n br i1 %14, label LBL_1, label LBL_2\n LBL_2:\n ret i64 %phitmp.le\n\n uselistorder i64* %storemerge14.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_snprintf_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -161\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n %7 = call i64 @FUNC(i64 %3)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %1, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_01-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.04.reg2mem = alloca i8*\n %sv_0.05.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_8, label LBL_3\n LBL_3:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_7, label LBL_4\n LBL_4:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_8, label LBL_5\n LBL_5:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_8, label LBL_6\n LBL_6:\n store i8 0, i8* %20, align 1\n br label LBL_8\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_8\n LBL_8:\n %25 = load i8, i8* %3, align 1\n %26 = icmp eq i8 %25, 0\n %27 = icmp eq i1 %26, false\n store i8 %25, i8* %.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n store i8* %3, i8** %sv_0.04.reg2mem\n br i1 %27, label LBL_9, label LBL_12\n LBL_9:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %28 = icmp eq i8 %.reload, 83\n %29 = icmp eq i1 %28, false\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n store i8* %sv_0.05.reload, i8** %sv_0.04.reg2mem\n br label LBL_12\n LBL_11:\n %31 = ptrtoint i8* %sv_0.05.reload to i64\n %32 = add i64 %31, 1\n %33 = inttoptr i64 %32 to i8*\n %34 = load i8, i8* %33, align 1\n %35 = icmp eq i8 %34, 0\n %36 = icmp eq i1 %35, false\n store i8 %34, i8* %.reg2mem\n store i8* %33, i8** %sv_0.05.reg2mem\n store i8* %33, i8** %sv_0.04.reg2mem\n br i1 %36, label LBL_9, label LBL_12\n LBL_12:\n %sv_0.04.reload = load i8*, i8** %sv_0.04.reg2mem\n %37 = bitcast i8* %sv_0.04.reload to i64*\n call void @free(i64* %37)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %sv_0.05.reload, { 1, 0 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 0, 1, 2, 3, 5, 4 }\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.05.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.04.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8 0, { 2, 0, 3, 4, 5, 6, 1 }\n uselistorder label LBL_12, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_predec_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8420 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i64, i64* %sv_0, align 8\n %6 = trunc i64 %.pre to i32\n %7 = icmp eq i32 %6, -2147483648\n store i64 %.pre, i64* %.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %8 = mul i64 %.reload, 4294967296\n %sext = add i64 %8, -4294967296\n %9 = ashr exact i64 %sext, 32\n store i64 %9, i64* %sv_0, align 8\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_4\n LBL_3:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1, 3 }\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__listen_socket_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @gv_1, i64 0, i64 0), i32 178, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_2, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i8*, i8*, i32, i8*)* @__assert_fail, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_add_09-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = icmp eq i8 %3, 127\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i8 %3, 1\n %6 = sext i8 %5 to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_malloc_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n store i64 7453010373643542593, i64* %0, align 8\n %4 = add i64 %3, 8\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_multiply_11-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 32, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n %14 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %15 = trunc i32 %sv_0.0.reload to i8\n %16 = icmp slt i8 %15, 0\n %17 = icmp eq i1 %16, false\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %17, label LBL_8, label LBL_5\n LBL_5:\n %18 = icmp slt i8 %15, -63\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n %sext2 = mul i32 %sv_0.0.reload, 33554432\n %19 = ashr exact i32 %sext2, 24\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_7:\n %22 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memcpy_08-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memcpy_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i32, align 4\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_2, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_2)\n br label LBL_2\n LBL_2:\n store i64 0, i64* %sv_1, align 8\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %7 = load i32, i32* %sv_2, align 4\n %8 = icmp sgt i32 %7, 99\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = ptrtoint i64* %sv_3 to i64\n %10 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %7)\n %11 = load i32, i32* %sv_2, align 4\n %12 = sext i32 %11 to i64\n %13 = add i64 %9, -112\n %14 = add i64 %13, %12\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n br label LBL_4\n LBL_4:\n %16 = call i64 @FUNC(i64* nonnull %sv_1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_2, { 1, 2, 0, 3 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fgets_memcpy_32-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__fgets_memcpy_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_2 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_2, align 8\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.03.reg2mem\n br label LBL_3\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %2)\n store i64 0, i64* %sv_2, align 8\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %9 = icmp sgt i32 %7, 99\n store i32 %7, i32* %sv_0.03.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n %10 = ptrtoint i64* %sv_3 to i64\n %sv_0.03.reload = load i32, i32* %sv_0.03.reg2mem\n %11 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.03.reload)\n %12 = sext i32 %sv_0.03.reload to i64\n %13 = add i64 %10, -112\n %14 = add i64 %13, %12\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n br label LBL_4\n LBL_4:\n %16 = ptrtoint i64* %sv_2 to i64\n %17 = call i64 @FUNC(i64 %16)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.03.reload, { 1, 0 }\n uselistorder i64* %sv_2, { 3, 1, 4, 0, 2, 5 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_long_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 5)\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 10)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLine, { 5, 4, 3, 2, 1, 0 }\n uselistorder i64 5, { 2, 3, 0, 1 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__sizeof_int64_t_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 2147483643, i64* %0, align 8\n %3 = call i64 @FUNC(i64 2147483643)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 2147483643, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_partial_init_17-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_partial_init_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv8.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = ptrtoint i32* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -33\n %3 = and i64 %2, -16\n store i32 0, i32* %sv_0, align 4\n br label LBL_3\n LBL_1:\n %indvars.iv8.reload = load i64, i64* %indvars.iv8.reg2mem\n %4 = mul i64 %indvars.iv8.reload, 4\n %5 = add i64 %4, %3\n %6 = inttoptr i64 %5 to i32*\n %7 = trunc i64 %indvars.iv8.reload to i32\n store i32 %7, i32* %6, align 4\n %indvars.iv.next9 = add nuw nsw i64 %indvars.iv8.reload, 1\n %exitcond10 = icmp eq i64 %indvars.iv.next9, 5\n store i64 %indvars.iv.next9, i64* %indvars.iv8.reg2mem\n br i1 %exitcond10, label LBL_2, label LBL_1\n LBL_2:\n %8 = load i32, i32* %sv_0, align 4\n %9 = add i32 %8, 1\n store i32 %9, i32* %sv_0, align 4\n %10 = icmp slt i32 %9, 1\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %10, label LBL_3, label LBL_4\n LBL_3:\n store i64 0, i64* %indvars.iv8.reg2mem\n br label LBL_1\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 3, 0, 2 }\n uselistorder i64* %indvars.iv8.reg2mem, { 2, 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_listen_socket_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_14, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %31 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %31, label LBL_13, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %33, %34\n %36 = inttoptr i64 %35 to i32*\n store i32 1, i32* %36, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_12\n LBL_12:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %37 = mul i64 %indvars.iv.reload, 4\n %38 = add i64 %37, %34\n %39 = inttoptr i64 %38 to i32*\n %40 = load i32, i32* %39, align 4\n %41 = zext i32 %40 to i64\n %42 = call i64 @FUNC(i64 %41)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_14, label LBL_12\n LBL_13:\n %43 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_14\n LBL_14:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %1, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 3, 8, 9, 10, 0, 11, 2, 5, 7, 12, 13, 14, 4, 15, 6 }\n uselistorder label LBL_14, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_max_multiply_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 4)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_34-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %4 = and i64 %3, -16\n store i64 %4, i64* %sv_1, align 8\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %5 = mul i64 %storemerge1.reload, 8\n %6 = add i64 %5, %2\n %7 = add i64 %6, -816\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 8\n %9 = add i64 %6, -812\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %12 = inttoptr i64 %4 to i64*\n %13 = call i64* @memcpy(i64* %12, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %14 = call i64 @FUNC(i64 %4)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_sub_08-bad", "fun_name": "CWE191_Integer_Underflow__short_fscanf_sub_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i16, i16* %sv_0, align 2\n %10 = add i16 %9, -1\n %11 = sext i16 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memcpy_13-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memcpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 10)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %sv_1, align 8\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memcpy(i64* %8, i64* nonnull %sv_1, i32 40)\n %10 = inttoptr i64 %sv_0.0.reload to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n call void @free(i64* %8)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %3, align 8\n store i8* %3, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = add i32 %5, 1\n %7 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %4, i32 %6)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = add i64 %7, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = mul i64 %storemerge1.reload, 8\n %11 = add i64 %10, %sv_0.0.reload\n %12 = add i64 %9, %10\n %13 = inttoptr i64 %12 to i64*\n %14 = load i64, i64* %13, align 8\n %15 = inttoptr i64 %11 to i64*\n store i64 %14, i64* %15, align 8\n %16 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %17 = inttoptr i64 %sv_0.0.reload to i64*\n %18 = load i64, i64* %17, align 8\n %19 = call i64 @FUNC(i64 %18)\n call void @free(i64* %17)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 100, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__short_fscanf_07-bad", "fun_name": "CWE197_Numeric_Truncation_Error__short_fscanf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 -1, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 4294967295, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i16, i16* %sv_0, align 2\n %phitmp = zext i16 %.pre to i32\n %phitmp1 = mul i32 %phitmp, 16777216\n %phitmp2 = ashr exact i32 %phitmp1, 24\n %phitmp3 = zext i32 %phitmp2 to i64\n store i64 %phitmp3, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %6 = call i64 @FUNC(i64 %.reload)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_loop_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %8 = call i64* @memset(i64* %1, i32 65, i32 49)\n %9 = ptrtoint i64* %1 to i64\n %10 = add i64 %9, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n store i64 %9, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %12 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %13 = call i32 @strlen(i8* %12)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_8, label LBL_6\n LBL_6:\n %15 = sext i32 %13 to i64\n %16 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %17 = add i64 %storemerge2.reload, %.pre-phi.reload\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = add i64 %storemerge2.reload, %16\n %21 = inttoptr i64 %20 to i8*\n store i8 %19, i8* %21, align 1\n %22 = add nuw i64 %storemerge2.reload, 1\n %23 = icmp ult i64 %22, %15\n store i64 %22, i64* %storemerge2.reg2mem\n br i1 %23, label LBL_7, label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64* %1, { 3, 5, 1, 2, 0, 4 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %2 = add i64 %1, 8\n %3 = inttoptr i64 %2 to i64*\n store i64 32777976880262761, i64* %3, align 8\n store i64 0, i64* %sv_0, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %4, i32 99, i8* nonnull %5)\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 0, 1, 3, 2, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memcpy_32-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_memcpy_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = load i64, i64* %sv_0, align 8\n %11 = inttoptr i64 %8 to i64*\n store i64 %10, i64* %11, align 8\n %12 = add i64 %4, 8\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %4, 16\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %4, 24\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %4, 32\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %4, 40\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %4, 48\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %4, 56\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %4, 64\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %4, 72\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %4, 80\n %31 = inttoptr i64 %30 to i64*\n %32 = add i64 %4, 88\n %33 = inttoptr i64 %32 to i32*\n %34 = add i64 %4, 91\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n %36 = call i64 @FUNC(i64 %8)\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_sub_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.02.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.02.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp eq i32 %6, -2147483648\n store i32 %6, i32* %sv_0.02.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.02.reload = load i32, i32* %sv_0.02.reg2mem\n %8 = add i32 %sv_0.02.reload, -1\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_listen_socket_popen_07-bad", "fun_name": "CWE78_OS_Command_Injection__char_listen_socket_popen_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %36 = icmp eq %_IO_FILE* %35, null\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n %37 = call i32 @pclose(%_IO_FILE* nonnull %35)\n br label LBL_14\n LBL_14:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_modulo_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %14 = icmp eq i32 %.reload, 5\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %16 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = urem i32 100, %sv_0.0.reload\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %20 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 7, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = load i32, i32* @gv_2, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_7, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %6 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %6, label LBL_6, label LBL_4\n LBL_4:\n %7 = ptrtoint i64* %sv_1 to i64\n %8 = sext i32 %sv_0.0.reload to i64\n %9 = mul i64 %8, 4\n %10 = add i64 %7, -48\n %11 = add i64 %9, %10\n %12 = inttoptr i64 %11 to i32*\n store i32 1, i32* %12, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 4\n %14 = add i64 %13, %10\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_5\n LBL_6:\n %19 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_7, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_snprintf_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -161\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n %7 = call i64 @FUNC(i64 %3)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %1, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__struct_realloc_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = load i32, i32* @gv_0, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 0\n %4 = icmp eq i64* %0, null\n %or.cond = or i1 %4, %3\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %0 to i64\n %6 = bitcast i64* %0 to i32*\n store i32 1, i32* %6, align 4\n %7 = add i64 %5, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n %9 = call i64 @FUNC(i64 %5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64* (i64*, i32)* @realloc, { 1, 0, 2 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fscanf_17-bad", "fun_name": "CWE617_Reachable_Assertion__fscanf_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 -1, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %5 = icmp sgt i32 %4, 5\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gv_3, i64 0, i64 0), i32 37, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @gv_4, i64 0, i64 0))\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = sext i32 %7 to i64\n %9 = add nsw i64 %8, 1\n %10 = icmp eq i64 %9, 0\n br i1 %10, label LBL_6, label LBL_4\n LBL_4:\n %11 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %12 = add i64 %storemerge1.reload, %sv_0.0.reload\n %13 = add i64 %storemerge1.reload, %11\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = inttoptr i64 %12 to i8*\n store i8 %15, i8* %16, align 1\n %17 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, %9\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %18 = call i64 @FUNC(i64 %sv_0.0.reload)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_snprintf_31-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = ptrtoint i64* %1 to i64\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 1, 0, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_05-bad", "fun_name": "CWE369_Divide_by_Zero__int_connect_socket_divide_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %.pr = load i32, i32* @gv_0, align 4\n %22 = icmp eq i32 %.pr, 0\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %23 = udiv i32 100, %sv_0.1.ph.reload\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n br label LBL_8\n LBL_8:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 -1, { 2, 1, 3, 0, 4 }\n uselistorder label LBL_8, { 1, 2, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_multiply_17-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_multiply_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp slt i32 %3, 1\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = mul i32 %3, 2\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_postdec_10-bad", "fun_name": "CWE191_Integer_Underflow__int_fscanf_postdec_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = mul i64 %6, 4294967296\n %sext = add i64 %7, -4294967296\n %8 = ashr exact i64 %sext, 32\n store i64 %8, i64* %sv_0, align 8\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = icmp eq %_IO_FILE* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %3 = sext i32 %2 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %0, { 1, 0 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_fprintf_07-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_fprintf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_3, i64 0, i64 0))\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_max_multiply_14-bad", "fun_name": "CWE190_Integer_Overflow__char_max_multiply_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %7 = select i1 %6, i64 64, i64 4294967294\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_zero_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = call i128 @FUNC(i128 %1, i128 %1)\n %3 = call i64 @FUNC(i128 %2)\n %4 = call i64 @FUNC()\n %5 = call i128 @FUNC(i128 %2, i128 %2)\n %6 = call i64 @FUNC(i128 %5)\n %storemerge = trunc i64 %6 to i32\n %7 = call i64 @FUNC()\n %8 = trunc i64 %7 to i32\n %9 = icmp eq i32 %8, 0\n %10 = call i128 @__asm_movss.1(i32 %storemerge)\n %11 = call i128 @__asm_movss.1(i32 2147483647)\n %12 = call i128 @FUNC(i128 %10, i128 %11)\n %13 = call i128 @FUNC(i128 %12)\n %14 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %13, i128 %14)\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n %15 = call i128 @FUNC(i128 %11, i128 %11)\n %16 = call i128 @__asm_cvtss2sd.2(i32 %storemerge)\n %17 = call i128 @FUNC(i64 4636737291354636288)\n %18 = call i128 @FUNC(i128 %17, i128 %16)\n %19 = call i32 @FUNC(i128 %18)\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %22 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %11, { 1, 0, 2 }\n uselistorder i128 %2, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_partial_init_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.4.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv16.reg2mem = alloca i64\n %indvars.iv19.reg2mem = alloca i64\n %indvars.iv22.reg2mem = alloca i64\n %indvars.iv25.reg2mem = alloca i64\n %indvars.iv28.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv28.reg2mem\n store i64 0, i64* %indvars.iv25.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv28.reload = load i64, i64* %indvars.iv28.reg2mem\n %7 = mul i64 %indvars.iv28.reload, 8\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv28.reload to i32\n store i32 %10, i32* %9, align 4\n %11 = add i64 %8, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 %10, i32* %12, align 4\n %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28.reload, 1\n %exitcond30 = icmp eq i64 %indvars.iv.next29, 5\n store i64 %indvars.iv.next29, i64* %indvars.iv28.reg2mem\n br i1 %exitcond30, label LBL_5, label LBL_3\n LBL_4:\n %indvars.iv25.reload = load i64, i64* %indvars.iv25.reg2mem\n %13 = mul i64 %indvars.iv25.reload, 8\n %14 = add i64 %13, %3\n %15 = inttoptr i64 %14 to i32*\n %16 = trunc i64 %indvars.iv25.reload to i32\n store i32 %16, i32* %15, align 4\n %17 = add i64 %14, 4\n %18 = inttoptr i64 %17 to i32*\n store i32 %16, i32* %18, align 4\n %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25.reload, 1\n %exitcond27 = icmp eq i64 %indvars.iv.next26, 5\n store i64 %indvars.iv.next26, i64* %indvars.iv25.reg2mem\n br i1 %exitcond27, label LBL_5, label LBL_4\n LBL_5:\n %19 = call i64 @FUNC()\n %20 = trunc i64 %19 to i32\n %21 = icmp eq i32 %20, 0\n store i64 0, i64* %indvars.iv22.reg2mem\n store i64 0, i64* %indvars.iv16.reg2mem\n br i1 %21, label LBL_8, label LBL_6\n LBL_6:\n %indvars.iv22.reload = load i64, i64* %indvars.iv22.reg2mem\n %22 = mul i64 %indvars.iv22.reload, 8\n %23 = add i64 %22, %3\n %24 = inttoptr i64 %23 to i32*\n %25 = trunc i64 %indvars.iv22.reload to i32\n store i32 %25, i32* %24, align 4\n %26 = add i64 %23, 4\n %27 = inttoptr i64 %26 to i32*\n store i32 %25, i32* %27, align 4\n %indvars.iv.next23 = add nuw nsw i64 %indvars.iv22.reload, 1\n %exitcond24 = icmp eq i64 %indvars.iv.next23, 10\n store i64 %indvars.iv.next23, i64* %indvars.iv22.reg2mem\n store i64 0, i64* %indvars.iv19.reg2mem\n br i1 %exitcond24, label LBL_7, label LBL_6\n LBL_7:\n %indvars.iv19.reload = load i64, i64* %indvars.iv19.reg2mem\n %28 = mul i64 %indvars.iv19.reload, 8\n %29 = add i64 %28, %3\n %30 = inttoptr i64 %29 to i32*\n %31 = load i32, i32* %30, align 4\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n %34 = add i64 %29, 4\n %35 = inttoptr i64 %34 to i32*\n %36 = load i32, i32* %35, align 4\n %37 = zext i32 %36 to i64\n %38 = call i64 @FUNC(i64 %37)\n %indvars.iv.next20 = add nuw nsw i64 %indvars.iv19.reload, 1\n %exitcond21 = icmp eq i64 %indvars.iv.next20, 10\n store i64 %indvars.iv.next20, i64* %indvars.iv19.reg2mem\n store i64 %38, i64* %rax.4.reg2mem\n br i1 %exitcond21, label LBL_10, label LBL_7\n LBL_8:\n %indvars.iv16.reload = load i64, i64* %indvars.iv16.reg2mem\n %39 = mul i64 %indvars.iv16.reload, 8\n %40 = add i64 %39, %3\n %41 = inttoptr i64 %40 to i32*\n %42 = trunc i64 %indvars.iv16.reload to i32\n store i32 %42, i32* %41, align 4\n %43 = add i64 %40, 4\n %44 = inttoptr i64 %43 to i32*\n store i32 %42, i32* %44, align 4\n %indvars.iv.next17 = add nuw nsw i64 %indvars.iv16.reload, 1\n %exitcond18 = icmp eq i64 %indvars.iv.next17, 10\n store i64 %indvars.iv.next17, i64* %indvars.iv16.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond18, label LBL_9, label LBL_8\n LBL_9:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %45 = mul i64 %indvars.iv.reload, 8\n %46 = add i64 %45, %3\n %47 = inttoptr i64 %46 to i32*\n %48 = load i32, i32* %47, align 4\n %49 = zext i32 %48 to i64\n %50 = call i64 @FUNC(i64 %49)\n %51 = add i64 %46, 4\n %52 = inttoptr i64 %51 to i32*\n %53 = load i32, i32* %52, align 4\n %54 = zext i32 %53 to i64\n %55 = call i64 @FUNC(i64 %54)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %55, i64* %rax.4.reg2mem\n br i1 %exitcond, label LBL_10, label LBL_9\n LBL_10:\n %rax.4.reload = load i64, i64* %rax.4.reg2mem\n ret i64 %rax.4.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv28.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv25.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv22.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv19.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv16.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64* %rax.4.reg2mem, { 0, 2, 1 }\n uselistorder i64 5, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__rand_malloc_17-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__rand_malloc_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = mul i32 %1, 1073741824\n %7 = mul i32 %2, 32768\n %8 = xor i32 %7, %6\n %9 = xor i32 %8, %3\n %10 = sext i1 %5 to i32\n %storemerge2.in.le = xor i32 %9, %10\n %storemerge2.le = zext i32 %storemerge2.in.le to i64\n %11 = icmp sgt i32 %storemerge2.in.le, 99\n store i64 %storemerge2.le, i64* %rax.1.reg2mem\n br i1 %11, label LBL_4, label LBL_1\n LBL_1:\n %12 = call i64* @malloc(i32 %storemerge2.in.le)\n %13 = icmp eq i64* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %15 = ptrtoint i64* %12 to i64\n %16 = add i32 %storemerge2.in.le, -1\n %17 = call i64* @memset(i64* %12, i32 65, i32 %16)\n %18 = sext i32 %storemerge2.in.le to i64\n %19 = add nsw i64 %18, -1\n %20 = add i64 %19, %15\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = call i64 @FUNC(i64 %15)\n call void @free(i64* %12)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_4\n LBL_4:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64 %15, { 1, 0 }\n uselistorder i64* %12, { 0, 1, 3, 2 }\n uselistorder i32 %storemerge2.in.le, { 1, 0, 3, 2, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_init_variable_char_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %2, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %3 = call i64 @FUNC(i64 67)\n store i64 %3, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_snprintf_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = add i64 %4, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 0, i64* %sv_0, align 8\n %8 = bitcast i64* %1 to i8*\n %9 = call i32 @strlen(i8* %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %10, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* %1)\n %12 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %1, { 2, 0, 1, 3, 5, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_multiply_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 4)\n ret i64 %2\n\n uselistorder i64 (i64)* @printHexCharLine, { 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__negative_malloc_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %spec.select = select i1 %2, i32 0, i32 99\n %3 = call i64* @malloc(i32 %spec.select)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %spec.select, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = zext i32 %spec.select to i64\n %10 = add i64 %6, -1\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i8* @strncpy(i8* nonnull %1, i8* nonnull %3, i32 99)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC(i64 %5)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 1, 0 }\n uselistorder i8 0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 50)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = call i64* @memset(i64* %0, i32 65, i32 49)\n %4 = ptrtoint i64* %0 to i64\n %5 = add i64 %4, 49\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = bitcast i64* %0 to i8*\n %8 = call i32 @strlen(i8* %7)\n %9 = add i32 %8, 1\n %10 = call i64* @calloc(i32 %9, i32 1)\n %11 = icmp eq i64* %10, null\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %13 = bitcast i64* %10 to i8*\n %14 = call i8* @strcpy(i8* %13, i8* %7)\n %15 = ptrtoint i64* %10 to i64\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %10)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %10, { 1, 0, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 1, 0, 3, 2 }\n uselistorder i64* null, { 1, 0, 3, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_memmove_07-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__connect_socket_memmove_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_7, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_3 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_6, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_2, i32 7, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_6, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_2 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %.off = add i32 %21, 32768\n %22 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %22, label LBL_5, label LBL_6\n LBL_5:\n %sext3 = mul i32 %21, 65536\n %23 = ashr exact i32 %sext3, 16\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %24 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %25 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %26 = trunc i32 %sv_0.1.reload to i16\n %27 = icmp sgt i16 %26, 99\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n %28 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.1.reload)\n %29 = sext i32 %sv_0.1.reload to i64\n %30 = add i64 %0, -112\n %31 = add i64 %30, %29\n %32 = inttoptr i64 %31 to i8*\n store i8 0, i8* %32, align 1\n br label LBL_9\n LBL_9:\n %33 = call i64 @FUNC(i64* nonnull %sv_2)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %1, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 2, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 4, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0, 2 }\n uselistorder label LBL_6, { 2, 0, 3, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_square_10-bad", "fun_name": "CWE190_Integer_Overflow__int_listen_socket_square_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %4, label LBL_9, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 13, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_9:\n %.pr = load i32, i32* @gv_0, align 4\n %27 = icmp eq i32 %.pr, 0\n br i1 %27, label LBL_11, label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %28 = mul i32 %sv_0.1.ph.reload, %sv_0.1.ph.reload\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n br label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_11, { 1, 2, 0 }\n uselistorder label LBL_9, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %7 = ptrtoint i64* %sv_1 to i64\n %8 = ptrtoint i64* %4 to i64\n %9 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = add i64 %7, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_6\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = mul i64 %storemerge1.reload, 8\n %12 = add i64 %11, %8\n %13 = add i64 %10, %11\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = inttoptr i64 %12 to i64*\n store i64 %15, i64* %16, align 8\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %18 = load i64, i64* %4, align 8\n %19 = call i64 @FUNC(i64 %18)\n call void @free(i64* %4)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %3 = ptrtoint i64* %2 to i64\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n %9 = add i64 %7, 4\n %10 = inttoptr i64 %9 to i32*\n store i32 2, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memmove_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %10 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memmove(i64* %11, i64* nonnull %sv_1, i32 100)\n %13 = add i64 %sv_0.0.reload, 99\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n %15 = call i64 @FUNC(i64 %sv_0.0.reload)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 100, { 0, 1, 3, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* %4, i8* nonnull %6, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_07-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = call i64* @memmove(i64* nonnull %sv_0, i64* %1, i32 %12)\n %14 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 2, 6, 3, 4, 0, 5 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_square_13-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_square_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i64, i64* %sv_0, align 8\n %phitmp = mul i64 %.pre, 4294967296\n %phitmp2 = ashr exact i64 %phitmp, 32\n store i64 %phitmp2, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %6 = mul nsw i64 %.reload, %.reload\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cpy_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i8* null, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %9)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %13)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_int_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 400)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 4\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i32*\n store i32 5, i32* %9, align 4\n %10 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %10, 100\n store i64 %10, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %3)\n br label LBL_5\n LBL_5:\n %11 = call i64 @FUNC()\n ret i64 %11\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_add_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 1, i64 3\n %6 = call i64 @FUNC(i64 %spec.select)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 3, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_square_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.2.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n store i32 0, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_11, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_11\n LBL_6:\n store i32 0, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_11, label LBL_7\n LBL_7:\n %23 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %24 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %25 = call i16 @htons(i16 27015)\n %26 = bitcast i64* %sv_2 to %sockaddr*\n %27 = call i32 @connect(i32 %5, %sockaddr* nonnull %26, i32 16)\n %28 = icmp eq i32 %27, -1\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n %29 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %30 = add i32 %29, 1\n %31 = icmp ult i32 %30, 2\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %31, label LBL_10, label LBL_9\n LBL_9:\n %32 = sext i32 %29 to i64\n %33 = add i64 %0, -22\n %34 = add i64 %33, %32\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n %36 = bitcast i64* %sv_1 to i8*\n %37 = call i32 @atoi(i8* nonnull %36)\n store i32 %37, i32* %sv_0.1.ph.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %38 = call i32 @close(i32 %5)\n store i32 %sv_0.1.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.2.reload = load i32, i32* %sv_0.2.reg2mem\n %39 = call i64 @FUNC()\n %40 = trunc i64 %39 to i32\n %41 = icmp eq i32 %40, 0\n %sv_0.2.off = add i32 %sv_0.2.reload, 46339\n %42 = icmp ugt i32 %sv_0.2.off, 92678\n br i1 %41, label LBL_15, label LBL_12\n LBL_12:\n br i1 %42, label LBL_14, label LBL_13\n LBL_13:\n %43 = mul i32 %sv_0.2.reload, %sv_0.2.reload\n %44 = zext i32 %43 to i64\n %45 = call i64 @FUNC(i64 %44)\n br label LBL_18\n LBL_14:\n %46 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_18\n LBL_15:\n br i1 %42, label LBL_17, label LBL_16\n LBL_16:\n %47 = mul i32 %sv_0.2.reload, %sv_0.2.reload\n %48 = zext i32 %47 to i64\n %49 = call i64 @FUNC(i64 %48)\n br label LBL_18\n LBL_17:\n %50 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_18\n LBL_18:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %1, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_20, label LBL_19\n LBL_19:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_20\n LBL_20:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %42, { 1, 0 }\n uselistorder i32 %sv_0.2.reload, { 3, 2, 1, 0, 4 }\n uselistorder i32 %29, { 1, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i1 %6, { 1, 0 }\n uselistorder i32 %5, { 5, 3, 4, 2, 0, 1, 6 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 0, 4, 1, 2, 5, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.2.reg2mem, { 0, 4, 1, 3, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 2, 1 }\n uselistorder label LBL_11, { 2, 0, 3, 1 }\n uselistorder label LBL_10, { 1, 2, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE546_Suspicious_Comment__BUG_07-bad", "fun_name": "CWE546_Suspicious_Comment__BUG_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_listen_socket_14-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_listen_socket_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge8.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = load i32, i32* @gv_0, align 4\n %36 = icmp eq i32 %35, 5\n %37 = icmp eq i1 %36, false\n br i1 %37, label LBL_18, label LBL_13\n LBL_13:\n %38 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_3)\n %39 = icmp eq i32 %38, 1\n %40 = icmp eq i1 %39, false\n br i1 %40, label LBL_18, label LBL_14\n LBL_14:\n %41 = load i64, i64* %sv_3, align 8\n %42 = and i64 %41, 4294967295\n %43 = icmp eq i64 %42, 0\n store i32 0, i32* %storemerge8.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %43, label LBL_17, label LBL_15\n LBL_15:\n %storemerge8.reload = load i32, i32* %storemerge8.reg2mem\n %44 = add i32 %storemerge8.reload, 1\n %45 = sext i32 %44 to i64\n %46 = icmp sgt i64 %42, %45\n store i32 %44, i32* %storemerge8.reg2mem\n br i1 %46, label LBL_15, label LBL_16\n LBL_16:\n %phitmp = zext i32 %44 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_17\n LBL_17:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %47 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_18\n LBL_18:\n %48 = call i64 @FUNC(i64 40)\n %49 = icmp eq i64 %0, %48\n store i64 0, i64* %rax.0.reg2mem\n br i1 %49, label LBL_20, label LBL_19\n LBL_19:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_20\n LBL_20:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %44, { 1, 0, 2 }\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32* %storemerge8.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder label LBL_17, { 1, 0 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_2 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %2\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = icmp eq i1 %5, false\n %spec.select = select i1 %14, i64 %1, i64 %13\n %15 = inttoptr i64 %spec.select to i64*\n %16 = call i64* @memcpy(i64* %15, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %17 = call i64 @FUNC(i64 %spec.select)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %3, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 400)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 2, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %3)\n br label LBL_5\n LBL_5:\n ret i64 5\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_alloca_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 400)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %5 = mul i64 %storemerge1.reload, 4\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n store i32 5, i32* %7, align 4\n %8 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %8, 100\n store i64 %8, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %9 = bitcast i64* %0 to i32*\n %10 = load i32, i32* %9, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n %storemerge1.v.v = select i1 %5, i64 add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416)), i64 -401\n %storemerge1.v = add i64 %storemerge1.v.v, %0\n %storemerge1 = and i64 %storemerge1.v, -16\n store i64 %storemerge1, i64* %sv_1, align 8\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %6 = mul i64 %storemerge2.reload, 8\n %7 = add i64 %6, %2\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %13 = load i64, i64* %sv_1, align 8\n %14 = inttoptr i64 %13 to i64*\n %15 = call i64* @memcpy(i64* %14, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %16 = load i64, i64* %sv_1, align 8\n %17 = call i64 @FUNC(i64 %16)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_1 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = sext i32 %2 to i64\n %15 = ptrtoint i64* %sv_2 to i64\n %16 = add i64 %14, %15\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n store i64 0, i64* %sv_0, align 8\n %32 = bitcast i64* %sv_0 to i8*\n %33 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %32, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_2)\n %34 = call i64 @FUNC(i64* nonnull %sv_0)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_large_to_short_08-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_large_to_short_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %spec.select = select i1 %2, i64 4294967295, i64 4294934532\n %3 = call i64 @FUNC(i64 %spec.select)\n ret i64 %3\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_postdec_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_4:\n %9 = load i8, i8* %sv_0, align 1\n %10 = icmp eq i8 %9, -128\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = add i8 %9, -1\n store i8 %11, i8* %sv_0, align 1\n %12 = sext i8 %11 to i64\n %13 = and i64 %12, 4294967295\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_7\n LBL_6:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_7:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 2, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_add_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = load i32, i32* @gv_0, align 4\n %15 = icmp eq i32 %14, 5\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n %16 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %17 = icmp eq i32 %sv_0.0.reload, -1\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n %18 = add i32 %sv_0.0.reload, 1\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %21 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cat_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strcat(i8* %sv_0.0.reload, i8* nonnull %6)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_fprintf_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* inttoptr (i64 12460 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %36 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder label LBL_12, { 3, 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE665_Improper_Initialization__char_cat_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n store i8 0, i8* %1, align 8\n br label LBL_3\n LBL_3:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strcat(i8* nonnull %1, i8* nonnull %6)\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_cpy_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i8*, i8** %sv_1, align 8\n %10 = ptrtoint i8* %9 to i64\n %11 = bitcast i8** %sv_2 to i64*\n store i64 %10, i64* %11, align 8\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %13 = load i8*, i8** %sv_2, align 8\n %14 = bitcast i64* %sv_0 to i8*\n %15 = call i8* @strcpy(i8* %13, i8* nonnull %14)\n %16 = load i8*, i8** %sv_2, align 8\n %17 = ptrtoint i8* %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 3, 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_no_init_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv5.reg2mem\n store i32 %4, i32* %.reg2mem\n br i1 %6, label LBL_5, label LBL_3\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %7 = mul i64 %indvars.iv5.reload, 8\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv5.reload to i32\n store i32 %10, i32* %9, align 4\n %11 = add i64 %8, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 %10, i32* %12, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i32, i32* %.reg2mem\n %13 = zext i32 %.reload to i64\n %14 = icmp eq i32 %.reload, 5\n %15 = icmp eq i1 %14, false\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 %13, i64* %rax.1.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %16 = mul i64 %indvars.iv.reload, 8\n %17 = add i64 %16, %3\n %18 = inttoptr i64 %17 to i32*\n %19 = load i32, i32* %18, align 4\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = add i64 %17, 4\n %23 = inttoptr i64 %22 to i32*\n %24 = load i32, i32* %23, align 4\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %26, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder i32* @gv_0, { 0, 5, 4, 3, 2, 1 }\n uselistorder void (i32)* @exit, { 2, 3, 0, 1, 4 }\n uselistorder i64* (i32)* @malloc, { 2, 3, 0, 1, 4 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_connect_socket_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n br label LBL_8\n LBL_2:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_17, label LBL_3\n LBL_3:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_17, label LBL_5\n LBL_4:\n %12 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n br label LBL_8\n LBL_5:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n %21 = icmp ugt i32 %19, 9\n br i1 %21, label LBL_8, label LBL_6\n LBL_6:\n %22 = sext i32 %19 to i64\n %23 = mul i64 %22, 4\n %24 = add i64 %13, -64\n %25 = add i64 %23, %24\n %26 = inttoptr i64 %25 to i32*\n store i32 1, i32* %26, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %27 = mul i64 %indvars.iv.reload, 4\n %28 = add i64 %27, %24\n %29 = inttoptr i64 %28 to i32*\n %30 = load i32, i32* %29, align 4\n %31 = zext i32 %30 to i64\n %32 = call i64 @FUNC(i64 %31)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %33 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i64 %13, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 4, 0, 2, 5, 3, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__connect_socket_15-bad", "fun_name": "CWE617_Reachable_Assertion__connect_socket_15_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp sgt i32 %19, 5\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @gv_2, i64 0, i64 0), i32 118, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @gv_3, i64 0, i64 0))\n br label LBL_6\n LBL_6:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memcpy_05-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memcpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %6 = call i64* @memset(i64* %1, i32 65, i32 99)\n %7 = ptrtoint i64* %1 to i64\n %8 = add i64 %7, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 %7, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %10 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %11 = call i32 @strlen(i8* %10)\n %12 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %11)\n %13 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 2, 6, 3, 4, 0, 5 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_square_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i32 2, i32* %sv_0.01.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %3 = zext i32 %.pre to i64\n %4 = icmp eq i32 %.pre, 5\n %5 = icmp eq i1 %4, false\n store i32 0, i32* %sv_0.01.reg2mem\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %6 = mul nuw nsw i32 %sv_0.01.reload, %sv_0.01.reload\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.01.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memmove_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -609\n %3 = and i64 %2, -16\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 50)\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memmove(i64* %5, i64* nonnull %sv_0, i32 400)\n %7 = inttoptr i64 %3 to i32*\n %8 = load i32, i32* %7, align 16\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__rand_malloc_12-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__rand_malloc_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %storemerge12.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 99, i32* %storemerge12.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n %storemerge = zext i32 %storemerge.in to i64\n %14 = icmp sgt i32 %storemerge.in, 99\n store i32 %storemerge.in, i32* %storemerge12.reg2mem\n store i64 %storemerge, i64* %rax.1.reg2mem\n br i1 %14, label LBL_5, label LBL_2\n LBL_2:\n %storemerge12.reload = load i32, i32* %storemerge12.reg2mem\n %15 = call i64* @malloc(i32 %storemerge12.reload)\n %16 = icmp eq i64* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %18 = ptrtoint i64* %15 to i64\n %19 = add i32 %storemerge12.reload, -1\n %20 = call i64* @memset(i64* %15, i32 65, i32 %19)\n %21 = sext i32 %storemerge12.reload to i64\n %22 = add nsw i64 %21, -1\n %23 = add i64 %22, %18\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i64 @FUNC(i64 %18)\n call void @free(i64* %15)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_5\n LBL_5:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64 %18, { 1, 0 }\n uselistorder i64* %15, { 0, 1, 3, 2 }\n uselistorder i32 %storemerge12.reload, { 1, 2, 0 }\n uselistorder i32* %storemerge12.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fscanf_08-bad", "fun_name": "CWE617_Reachable_Assertion__fscanf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %phitmp = icmp sgt i32 %.pre, 5\n br i1 %phitmp, label LBL_3, label LBL_2\n LBL_2:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gv_3, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @gv_4, i64 0, i64 0))\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv11.reg2mem = alloca i64\n %indvars.iv14.reg2mem = alloca i64\n %indvars.iv17.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv17.reg2mem\n store i64 0, i64* %indvars.iv14.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv17.reload = load i64, i64* %indvars.iv17.reg2mem\n %7 = mul i64 %indvars.iv17.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv17.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next18 = add nuw nsw i64 %indvars.iv17.reload, 1\n %exitcond19 = icmp eq i64 %indvars.iv.next18, 10\n store i64 %indvars.iv.next18, i64* %indvars.iv17.reg2mem\n br i1 %exitcond19, label LBL_5, label LBL_3\n LBL_4:\n %indvars.iv14.reload = load i64, i64* %indvars.iv14.reg2mem\n %11 = mul i64 %indvars.iv14.reload, 4\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i32*\n %14 = trunc i64 %indvars.iv14.reload to i32\n store i32 %14, i32* %13, align 4\n %indvars.iv.next15 = add nuw nsw i64 %indvars.iv14.reload, 1\n %exitcond16 = icmp eq i64 %indvars.iv.next15, 10\n store i64 %indvars.iv.next15, i64* %indvars.iv14.reg2mem\n br i1 %exitcond16, label LBL_5, label LBL_4\n LBL_5:\n %15 = call i64 @FUNC()\n %16 = trunc i64 %15 to i32\n %17 = icmp eq i32 %16, 0\n store i64 0, i64* %indvars.iv11.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n %indvars.iv11.reload = load i64, i64* %indvars.iv11.reg2mem\n %18 = mul i64 %indvars.iv11.reload, 4\n %19 = add i64 %18, %3\n %20 = inttoptr i64 %19 to i32*\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %indvars.iv.next12 = add nuw nsw i64 %indvars.iv11.reload, 1\n %exitcond13 = icmp eq i64 %indvars.iv.next12, 10\n store i64 %indvars.iv.next12, i64* %indvars.iv11.reg2mem\n store i64 %23, i64* %rax.2.reg2mem\n br i1 %exitcond13, label LBL_8, label LBL_6\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %24 = mul i64 %indvars.iv.reload, 4\n %25 = add i64 %24, %3\n %26 = inttoptr i64 %25 to i32*\n %27 = load i32, i32* %26, align 4\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %29, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_7\n LBL_8:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv17.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv14.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv11.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64* %rax.2.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 3, 2, 1, 0, 7, 6, 5, 4 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_char_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %3)\n br label LBL_4\n LBL_4:\n ret i64 5\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cpy_07-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %9)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %13)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_int_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 5)\n %1 = call i64 @FUNC(i64 10)\n ret i64 %1\n\n uselistorder i64 (i64)* @printIntLine, { 5, 4, 3, 2, 1, 0 }\n uselistorder i64 5, { 2, 3, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_predec_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = add i32 %sv_0.1.reload, -1\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_10\n LBL_9:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memmove_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 11)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %7 = bitcast i64* %sv_1 to i8*\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = add i32 %8, 1\n %10 = inttoptr i64 %sv_0.0.reload to i64*\n %11 = call i64* @memmove(i64* %10, i64* nonnull %sv_1, i32 %9)\n %12 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %10)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0, align 8\n %2 = call i64 @FUNC()\n store i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0), i32** %sv_0, align 8\n %3 = call i64 @FUNC()\n %4 = load i32*, i32** %sv_0, align 8\n %5 = call i32 @wcslen(i32* %4)\n %6 = sext i32 %5 to i64\n %7 = mul i64 %6, 4\n %8 = add nsw i64 %7, 27\n %9 = udiv i64 %8, 16\n %10 = mul i64 %9, 16\n %11 = and i64 %10, -4096\n %12 = and i64 %10, 4080\n %13 = add i64 %0, 15\n %14 = sub i64 %13, %12\n %15 = sub i64 %14, %11\n %16 = and i64 %15, -16\n %17 = load i32*, i32** %sv_0, align 8\n %18 = inttoptr i64 %16 to i32*\n %19 = call i32* @wcscpy(i32* %18, i32* %17)\n %20 = call i64 @FUNC(i64 %16)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 1, 0 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i32** %sv_0, { 4, 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_rand_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %7 = add i64 %1, 28\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %9 = mul i64 %indvars.iv.reload, 4\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %1, { 0, 2, 1 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, -49\n %7 = and i64 %6, -16\n store i64 %7, i64* %sv_1, align 8\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 16\n br label LBL_3\n LBL_3:\n store i64 4702111234474983745, i64* %sv_0, align 8\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = add i32 %10, 1\n %12 = load i64, i64* %sv_1, align 8\n %13 = inttoptr i64 %12 to i64*\n %14 = call i64* @memmove(i64* %13, i64* nonnull %sv_0, i32 %11)\n %15 = load i64, i64* %sv_1, align 8\n %16 = call i64 @FUNC(i64 %15)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_ncpy_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %10 = icmp eq i32 %9, 5\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = bitcast i8** %sv_2 to i64*\n store i64 %13, i64* %14, align 8\n br label LBL_3\n LBL_3:\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = bitcast i64* %sv_0 to i8*\n %17 = call i32 @strlen(i8* nonnull %16)\n %18 = load i8*, i8** %sv_2, align 8\n %19 = call i8* @strncpy(i8* nonnull %16, i8* %18, i32 %17)\n %20 = ptrtoint i64* %sv_0 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 2, 0, 1 }\n uselistorder i64* %sv_0, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE170_char_loop_13-bad", "fun_name": "CWE126_Buffer_Overread__CWE170_char_loop_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 149)\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %6 = add i64 %indvars.iv.reload, %4\n %7 = add i64 %6, -160\n %8 = inttoptr i64 %7 to i8*\n %9 = load i8, i8* %8, align 1\n %10 = add i64 %6, -272\n %11 = inttoptr i64 %10 to i8*\n store i8 %9, i8* %11, align 1\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 99\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_listen_socket_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv12.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_18, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %4, label LBL_9, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 13, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_9:\n %.pr = load i32, i32* @gv_0, align 4\n %27 = icmp eq i32 %.pr, 0\n br i1 %27, label LBL_18, label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %28 = call i64* @malloc(i32 40)\n %29 = ptrtoint i64* %28 to i64\n %30 = icmp eq i64* %28, null\n %31 = icmp eq i1 %30, false\n store i64 0, i64* %indvars.iv12.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @exit(i32 -1)\n unreachable\n LBL_12:\n %indvars.iv12.reload = load i64, i64* %indvars.iv12.reg2mem\n %32 = mul i64 %indvars.iv12.reload, 4\n %33 = add i64 %32, %29\n %34 = inttoptr i64 %33 to i32*\n store i32 0, i32* %34, align 4\n %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12.reload, 1\n %exitcond14 = icmp eq i64 %indvars.iv.next13, 10\n store i64 %indvars.iv.next13, i64* %indvars.iv12.reg2mem\n br i1 %exitcond14, label LBL_13, label LBL_12\n LBL_13:\n %35 = icmp ugt i32 %sv_0.1.ph.reload, 9\n br i1 %35, label LBL_16, label LBL_14\n LBL_14:\n %36 = sext i32 %sv_0.1.ph.reload to i64\n %37 = mul i64 %36, 4\n %38 = add i64 %37, %29\n %39 = inttoptr i64 %38 to i32*\n store i32 1, i32* %39, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_15\n LBL_15:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %40 = mul i64 %indvars.iv.reload, 4\n %41 = add i64 %40, %29\n %42 = inttoptr i64 %41 to i32*\n %43 = load i32, i32* %42, align 4\n %44 = zext i32 %43 to i64\n %45 = call i64 @FUNC(i64 %44)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_17, label LBL_15\n LBL_16:\n %46 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_17\n LBL_17:\n call void @free(i64* %28)\n br label LBL_18\n LBL_18:\n %47 = call i64 @FUNC(i64 40)\n %48 = icmp eq i64 %0, %47\n store i64 0, i64* %rax.0.reg2mem\n br i1 %48, label LBL_20, label LBL_19\n LBL_19:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_20\n LBL_20:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %29, { 1, 0, 2 }\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64* %indvars.iv12.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_18, { 1, 2, 0 }\n uselistorder label LBL_17, { 1, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_08-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_8, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = icmp ult i64 %9, 6\n br i1 %10, label LBL_7, label LBL_4\n LBL_4:\n %11 = trunc i64 %9 to i32\n %12 = call i64* @malloc(i32 %11)\n %13 = icmp eq i64* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %15 = ptrtoint i64* %12 to i64\n %16 = bitcast i64* %12 to i32*\n store i32 1819043176, i32* %16, align 4\n %17 = add i64 %15, 4\n %18 = inttoptr i64 %17 to i16*\n store i16 111, i16* %18, align 2\n %19 = call i64 @FUNC(i64 %15)\n call void @free(i64* %12)\n br label LBL_8\n LBL_7:\n %20 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %12, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fgets_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -48\n %6 = add i64 %4, -20\n %7 = inttoptr i64 %6 to i32*\n store i32 1, i32* %7, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %5, %8\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 5, { 1, 0, 2, 3, 4, 5, 6, 7 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_accept_bind_14-bad", "fun_name": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_accept_bind_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_13, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = call i32 @listen(i32 %6, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_10, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_10, label LBL_4\n LBL_4:\n %14 = bitcast i64* %sv_0 to %sockaddr*\n %15 = call i32 @bind(i32 %6, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_5\n LBL_5:\n %17 = sub i32 99, %5\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = sext i32 %5 to i64\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i64*\n %22 = call i32 @recv(i32 %12, i64* %21, i32 %17, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = ptrtoint i64* %sv_2 to i64\n %26 = sext i32 %22 to i64\n %27 = add i64 %25, -112\n %28 = add i64 %27, %26\n %29 = inttoptr i64 %28 to i8*\n store i8 0, i8* %29, align 1\n %30 = call i8* @strchr(i8* nonnull %4, i32 13)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %30, align 1\n br label LBL_8\n LBL_8:\n %32 = call i8* @strchr(i8* nonnull %4, i32 10)\n %33 = icmp eq i8* %32, null\n br i1 %33, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %32, align 1\n br label LBL_11\n LBL_10:\n %34 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %35 = call i32 @close(i32 %6)\n %36 = call i32 @close(i32 %12)\n br label LBL_12\n LBL_12:\n %37 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_13\n LBL_13:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 0, 4, 1, 2, 3, 5 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 0, 1, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_7, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_7, label LBL_2\n LBL_2:\n %4 = icmp ult i32 %2, 6\n br i1 %4, label LBL_6, label LBL_3\n LBL_3:\n %5 = call i64* @malloc(i32 %2)\n %6 = icmp eq i64* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %8 = ptrtoint i64* %5 to i64\n %9 = bitcast i64* %5 to i32*\n store i32 1819043176, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i16*\n store i16 111, i16* %11, align 2\n %12 = call i64 @FUNC(i64 %8)\n call void @free(i64* %5)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %13 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %5, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n uselistorder label LBL_7, { 1, 2, 3, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_fprintf_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %4 = add i64 %3, 8\n %5 = inttoptr i64 %4 to i64*\n store i64 32777976880262761, i64* %5, align 8\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %phitmp = icmp eq i32 %.pre, 5\n %phitmp2 = icmp eq i1 %phitmp, false\n br i1 %phitmp2, label LBL_4, label LBL_3\n LBL_3:\n %7 = bitcast i64* %sv_0 to i8*\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_2, align 8\n %9 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %8, i8* nonnull %7)\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 1, 0, 3 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_snprintf_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %3 = add i64 %2, 8\n %4 = inttoptr i64 %3 to i64*\n store i64 32777976880262761, i64* %4, align 8\n store i64 0, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %5, i32 99, i8* nonnull %1)\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 3, 0, 2, 1, 4 }\n uselistorder i32 99, { 0, 1, 3, 2, 5, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 8\n %9 = add i64 %8, %7\n %10 = add i64 %9, -816\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 8\n %12 = add i64 %9, -812\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 4\n %14 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %14, 100\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %15 = inttoptr i64 %sv_0.0.reload to i64*\n %16 = call i64* @memcpy(i64* %15, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %17 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %15)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 ptrtoint (i32* @gv_1 to i32), { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_7, label LBL_1\n LBL_1:\n %spec.store.select = select i1 %1, i64 -4, i64 28\n %2 = call i64* @malloc(i32 40)\n %3 = ptrtoint i64* %2 to i64\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %6 = mul i64 %indvars.iv5.reload, 4\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %9 = add i64 %spec.store.select, %3\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i1 %1, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 1, 2, 0, 3, 5, 4, 6 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2, 3, 4 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_cpy_07-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_cpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %7, -8\n %12 = inttoptr i64 %11 to i8*\n store i8* %12, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %13 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 199)\n %14 = bitcast i64* %sv_1 to i8*\n %15 = call i8* @strcpy(i8* nonnull %14, i8* %sv_0.0.reload)\n %16 = call i64 @FUNC(i64* nonnull %sv_1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_max_square_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n %7 = trunc i64 %indvars.iv5.reload to i32\n store i32 %7, i32* %6, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %8, %1\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %13\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 1, 3, 2, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 0, 3, 1, 2, 4 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_predec_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = mul i32 %4, 1073741824\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = xor i32 %7, %5\n %9 = call i32 @rand()\n %10 = xor i32 %8, %9\n %11 = sext i1 %3 to i32\n %storemerge.in = xor i32 %10, %11\n %12 = icmp eq i32 %storemerge.in, -2147483648\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n %13 = add i32 %storemerge.in, -1\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_3\n LBL_2:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_char_14-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_char_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext = mul i32 %sv_0.1.reload, 16777216\n %28 = ashr exact i32 %sext, 24\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_multiply_11-bad", "fun_name": "CWE191_Integer_Underflow__int_fscanf_multiply_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_5, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = trunc i64 %9 to i32\n %11 = icmp slt i32 %10, 0\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n %13 = mul i64 %9, 2\n %14 = and i64 %13, 4294967294\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge4.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = call i32 @strlen(i8* nonnull %3)\n %20 = icmp eq i32 %19, 0\n br i1 %20, label LBL_12, label LBL_8\n LBL_8:\n %21 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %22 = add i64 %storemerge4.reload, %21\n %23 = inttoptr i64 %22 to i8*\n %24 = load i8, i8* %23, align 1\n %25 = icmp eq i8 %24, 83\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_11, label LBL_10\n LBL_10:\n %27 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_11:\n %28 = add nuw i64 %storemerge4.reload, 1\n %29 = call i32 @strlen(i8* %3)\n %30 = sext i32 %29 to i64\n %31 = icmp ult i64 %28, %30\n store i64 %28, i64* %storemerge4.reg2mem\n br i1 %31, label LBL_9, label LBL_12\n LBL_12:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %3, { 1, 0, 3, 2 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 2, 0, 1, 3 }\n uselistorder label LBL_12, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_listen_socket_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %31 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %34, %33\n %36 = inttoptr i64 %35 to i32*\n %37 = load i32, i32* %36, align 4\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n br label LBL_13\n LBL_12:\n %40 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_13\n LBL_13:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %1, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__struct_pointer_malloc_use_12-bad", "fun_name": "CWE758_Undefined_Behavior__struct_pointer_malloc_use_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = load i64, i64* %3, align 8\n call void @free(i64* %3)\n %7 = inttoptr i64 %6 to i32*\n %8 = load i32, i32* %7, align 4\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = add i64 %6, 4\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n store i64 %15, i64* %storemerge.reg2mem\n br label LBL_9\n LBL_4:\n br i1 %5, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %16 = call i64* @malloc(i32 8)\n %17 = icmp eq i64* %16, null\n %18 = icmp eq i1 %17, false\n br i1 %18, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %19 = bitcast i64* %16 to i32*\n store i32 5, i32* %19, align 4\n %20 = ptrtoint i64* %16 to i64\n %21 = add i64 %20, 4\n %22 = inttoptr i64 %21 to i32*\n store i32 6, i32* %22, align 4\n store i64 %20, i64* %3, align 8\n %23 = load i32, i32* %19, align 4\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = load i32, i32* %22, align 4\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n call void @free(i64* %3)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %16, { 0, 2, 1 }\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 2, 1, 0, 3 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__char_pointer_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_1, i64 0, i64 0), i8** %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_2\n LBL_2:\n %3 = load i32, i32* @gv_3, align 4\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = ptrtoint i8* %sv_0.0.reload to i64\n %6 = call i64 @FUNC(i64 %5)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__binary_if_17-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__binary_if_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n call void @llvm.trap()\n unreachable\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_postdec_32-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_min_postdec_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC(i64 9223372036854775807)\n %2 = call i64 @FUNC(i64 40)\n %3 = icmp eq i64 %0, %2\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_predec_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %12 = ashr exact i32 %sext, 16\n store i32 %12, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n %16 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %17 = trunc i32 %sv_0.0.reload to i16\n %18 = icmp eq i16 %17, -32768\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n %19 = mul i32 %sv_0.0.reload, 65536\n %sext2 = add i32 %19, -65536\n %20 = ashr exact i32 %sext2, 16\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %23 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_calloc_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @calloc(i32 100, i32 8)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %2, align 8\n %5 = call i64 @FUNC(i64 5)\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n call void @free(i64* nonnull %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 1, 2, 0 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_malloc_14-bad", "fun_name": "CWE690_NULL_Deref_From_Return__int64_t_malloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 8)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE665_Improper_Initialization__char_ncat_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i8* @strncat(i8* nonnull %1, i8* nonnull %3, i32 %4)\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fgets_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %4, i64* %sv_0.0.in.reg2mem\n br label LBL_3\n LBL_2:\n %9 = call i128 @__asm_movss.1(i32 1073741824)\n %10 = call i64 @FUNC(i128 %9)\n store i64 %10, i64* %sv_0.0.in.reg2mem\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %14 = call i128 @FUNC(i128 %1, i128 %1)\n %15 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.0)\n %16 = call i128 @FUNC(i64 4636737291354636288)\n %17 = call i128 @FUNC(i128 %16, i128 %15)\n %18 = call i32 @FUNC(i128 %17)\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %2, { 1, 0 }\n uselistorder i64* %sv_0.0.in.reg2mem, { 0, 2, 1 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8*, align 8\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_7, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 50)\n %3 = bitcast i64* %2 to i8*\n store i8* %3, i8** %sv_0, align 8\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = call i64* @memset(i64* %2, i32 65, i32 49)\n %7 = ptrtoint i64* %2 to i64\n %8 = add i64 %7, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %.pr = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_7, label LBL_4\n LBL_4:\n %11 = load i8*, i8** %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = add i32 %12, 1\n %14 = call i64* @calloc(i32 %13, i32 1)\n %15 = icmp eq i64* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %17 = bitcast i64* %14 to i8*\n %18 = call i8* @strcpy(i8* %17, i8* %11)\n %19 = ptrtoint i64* %14 to i64\n %20 = call i64 @FUNC(i64 %19)\n call void @free(i64* %14)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %14, { 1, 0, 3, 2 }\n uselistorder i8* %11, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32, i32)* @calloc, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 7, 6, 5, 4, 3, 2, 1, 0, 8 }\n uselistorder i32 -1, { 0, 1, 3, 2, 4, 5, 6, 7 }\n uselistorder i64* null, { 0, 1, 3, 2, 4, 5, 6, 7 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i32* @gv_0, { 0, 5, 4, 1, 3, 2 }\n uselistorder label LBL_7, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_printf_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_0 to i8*\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 32777976880262761, i64* %6, align 8\n %7 = call i32 (i8*, ...) @printf(i8* nonnull %3)\n br label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2, 3 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_puts_08-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_puts_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_0, i64 0, i64 0))\n %4 = sext i32 %3 to i64\n %5 = icmp eq i32 %3, 0\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_1 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i32 66)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32 %3, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %4 = zext i32 %.reload to i64\n %5 = icmp eq i32 %.reload, 5\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = call i32 @close(i32 %sv_0.0.reload)\n %8 = sext i32 %7 to i64\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i32)* @close, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i8*, i32, ...)* @open, { 2, 0, 1, 3, 4 }\n uselistorder i32* @gv_0, { 0, 5, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_calloc_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_0, align 8\n %4 = inttoptr i64 %3 to i64*\n store i64 5, i64* %4, align 16\n %5 = load i64, i64* %sv_0, align 8\n %6 = inttoptr i64 %5 to i64*\n %7 = load i64, i64* %6, align 8\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_16-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %4 = mul i64 %indvars.iv6.reload, 8\n %5 = add i64 %4, %1\n %6 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %7 = trunc i64 %indvars.iv6.reload to i32\n %8 = call i128 @FUNC(i32 %7)\n %9 = call i64 @FUNC(i128 %8)\n %10 = inttoptr i64 %5 to i64*\n store i64 %9, i64* %10, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %8, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 8\n %12 = add i64 %11, %1\n %13 = inttoptr i64 %12 to i64*\n %14 = load i64, i64* %13, align 8\n %15 = call i128 @FUNC(i64 %14)\n %16 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %16\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @printDoubleLine, { 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_postdec_13-bad", "fun_name": "CWE191_Integer_Underflow__short_fscanf_postdec_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i16\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i16 -1, i16* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i16, i16* %sv_0, align 2\n %phitmp = add i16 %.pre, -1\n store i16 %phitmp, i16* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i16, i16* %.reg2mem\n store i16 %.reload, i16* %sv_0, align 2\n %6 = sext i16 %.reload to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 2, 0, 1, 3 }\n uselistorder i16 -1, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_fwrite_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge14.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_16, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_16, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 13, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n br label LBL_16\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n %27 = load i32, i32* @gv_0, align 4\n %28 = icmp eq i32 %27, 0\n %sv_0.1.off = add i32 %sv_0.0.ph.reload, -1\n %29 = icmp ugt i32 %sv_0.1.off, 19\n %or.cond = or i1 %29, %28\n br i1 %or.cond, label LBL_16, label LBL_9\n LBL_9:\n %30 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %31 = icmp eq %_IO_FILE* %30, null\n %32 = icmp eq i1 %31, false\n br i1 %32, label LBL_10, label LBL_11\n LBL_10:\n %33 = sext i32 %sv_0.0.ph.reload to i64\n store i64 0, i64* %storemerge14.reg2mem\n br label LBL_12\n LBL_11:\n call void @exit(i32 1)\n unreachable\n LBL_12:\n %34 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_3 to i64*), i32 1, i32 50, %_IO_FILE* %30)\n %35 = icmp eq i32 %34, 50\n br i1 %35, label LBL_14, label LBL_13\n LBL_13:\n call void @exit(i32 1)\n unreachable\n LBL_14:\n %storemerge14.reload = load i64, i64* %storemerge14.reg2mem\n %36 = add nuw i64 %storemerge14.reload, 1\n %37 = icmp ult i64 %36, %33\n store i64 %36, i64* %storemerge14.reg2mem\n br i1 %37, label LBL_12, label LBL_15\n LBL_15:\n %38 = call i32 @fclose(%_IO_FILE* nonnull %30)\n br label LBL_16\n LBL_16:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %30, { 1, 0, 2 }\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge14.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 5, 0, 7, 8, 9, 10, 6, 2, 4, 11, 12, 13, 1, 14, 3 }\n uselistorder label LBL_16, { 3, 4, 1, 0, 2 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE404_Improper_Resource_Shutdown__open_fclose_17-bad", "fun_name": "CWE404_Improper_Resource_Shutdown__open_fclose_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.in.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = icmp eq i32 %0, -1\n store i64 -1, i64* %rax.0.in.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = zext i32 %0 to i64\n %3 = inttoptr i64 %2 to %_IO_FILE*\n %4 = call i32 @fclose(%_IO_FILE* %3)\n %phitmp = sext i32 %4 to i64\n store i64 %phitmp, i64* %rax.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.in.reload = load i64, i64* %rax.0.in.reg2mem\n ret i64 %rax.0.in.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %4 = mul i64 %indvars.iv6.reload, 8\n %5 = add i64 %4, %1\n %6 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %7 = trunc i64 %indvars.iv6.reload to i32\n %8 = call i128 @FUNC(i32 %7)\n %9 = call i64 @FUNC(i128 %8)\n %10 = inttoptr i64 %5 to i64*\n store i64 %9, i64* %10, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %8, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 8\n %12 = add i64 %11, %1\n %13 = inttoptr i64 %12 to i64*\n %14 = load i64, i64* %13, align 8\n %15 = call i128 @FUNC(i64 %14)\n %16 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %16\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @printDoubleLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_postdec_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_1, align 4\n %24 = icmp eq i32 %23, 5\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n %25 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n %27 = add i32 %sv_0.1.reload, -1\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_11\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_12-bad", "fun_name": "CWE416_Use_After_Free__malloc_free_struct_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge12.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n store i64 0, i64* %storemerge3.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %7 = mul i64 %storemerge3.reload, 8\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 2, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond4 = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge3.reg2mem\n br i1 %exitcond4, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %3)\n br label LBL_8\n LBL_5:\n store i64 0, i64* %storemerge12.reg2mem\n br i1 %6, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %storemerge12.reload = load i64, i64* %storemerge12.reg2mem\n %13 = mul i64 %storemerge12.reload, 8\n %14 = add i64 %13, %4\n %15 = inttoptr i64 %14 to i32*\n store i32 1, i32* %15, align 4\n %16 = add i64 %14, 4\n %17 = inttoptr i64 %16 to i32*\n store i32 2, i32* %17, align 4\n %18 = add nuw nsw i64 %storemerge12.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge12.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_7\n LBL_8:\n %19 = call i64 @FUNC()\n %20 = trunc i64 %19 to i32\n %21 = icmp eq i32 %20, 0\n store i64 %19, i64* %rax.0.reg2mem\n br i1 %21, label LBL_10, label LBL_9\n LBL_9:\n %22 = call i64 @FUNC(i64 %4)\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64 %4, { 2, 0, 1 }\n uselistorder i64* %storemerge3.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge12.reg2mem, { 2, 0, 1 }\n uselistorder i64 100, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE170_char_strncpy_13-bad", "fun_name": "CWE126_Buffer_Overread__CWE170_char_strncpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 149)\n %5 = bitcast i64* %sv_1 to i8*\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* nonnull %5, i8* nonnull %6, i32 99)\n %8 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 40)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %8 = mul i64 %indvars.iv5.reload, 4\n %9 = add i64 %8, %5\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %11 = add i64 %5, 28\n %12 = inttoptr i64 %11 to i32*\n store i32 1, i32* %12, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 4\n %14 = add i64 %13, %5\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 4, 5 }\n uselistorder void (i32)* @exit, { 2, 1, 0, 3, 4 }\n uselistorder i32 -1, { 1, 2, 0, 3, 4 }\n uselistorder i64* (i32)* @malloc, { 0, 3, 1, 2, 4 }\n uselistorder i32* @gv_0, { 4, 0, 3, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_malloc_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 400)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = call i64 @FUNC(i64 5)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %8 = zext i32 %.reload to i64\n %9 = icmp eq i32 %.reload, 5\n %10 = icmp eq i1 %9, false\n store i64 %8, i64* %rax.0.reg2mem\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_12-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %indvars.iv12.reg2mem = alloca i64\n %indvars.iv15.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_3\n LBL_2:\n store i32 7, i32* %sv_0, align 4\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = call i64* @malloc(i32 40)\n %10 = ptrtoint i64* %9 to i64\n %11 = icmp eq i64* %9, null\n %12 = icmp eq i1 %11, false\n br i1 %8, label LBL_12, label LBL_4\n LBL_4:\n store i64 0, i64* %indvars.iv15.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %indvars.iv15.reload = load i64, i64* %indvars.iv15.reg2mem\n %13 = mul i64 %indvars.iv15.reload, 4\n %14 = add i64 %13, %10\n %15 = inttoptr i64 %14 to i32*\n store i32 0, i32* %15, align 4\n %indvars.iv.next16 = add nuw nsw i64 %indvars.iv15.reload, 1\n %exitcond17 = icmp eq i64 %indvars.iv.next16, 10\n store i64 %indvars.iv.next16, i64* %indvars.iv15.reg2mem\n br i1 %exitcond17, label LBL_7, label LBL_6\n LBL_7:\n %16 = load i32, i32* %sv_0, align 4\n %17 = icmp slt i32 %16, 0\n br i1 %17, label LBL_10, label LBL_8\n LBL_8:\n %18 = sext i32 %16 to i64\n %19 = mul i64 %18, 4\n %20 = add i64 %19, %10\n %21 = inttoptr i64 %20 to i32*\n store i32 1, i32* %21, align 4\n store i64 0, i64* %indvars.iv12.reg2mem\n br label LBL_9\n LBL_9:\n %indvars.iv12.reload = load i64, i64* %indvars.iv12.reg2mem\n %22 = mul i64 %indvars.iv12.reload, 4\n %23 = add i64 %22, %10\n %24 = inttoptr i64 %23 to i32*\n %25 = load i32, i32* %24, align 4\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12.reload, 1\n %exitcond14 = icmp eq i64 %indvars.iv.next13, 10\n store i64 %indvars.iv.next13, i64* %indvars.iv12.reg2mem\n br i1 %exitcond14, label LBL_11, label LBL_9\n LBL_10:\n %28 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_11:\n call void @free(i64* %9)\n br label LBL_20\n LBL_12:\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %12, label LBL_14, label LBL_13\n LBL_13:\n call void @exit(i32 -1)\n unreachable\n LBL_14:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %29 = mul i64 %indvars.iv9.reload, 4\n %30 = add i64 %29, %10\n %31 = inttoptr i64 %30 to i32*\n store i32 0, i32* %31, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 10\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_15, label LBL_14\n LBL_15:\n %32 = load i32, i32* %sv_0, align 4\n %33 = icmp ugt i32 %32, 9\n br i1 %33, label LBL_18, label LBL_16\n LBL_16:\n %34 = sext i32 %32 to i64\n %35 = mul i64 %34, 4\n %36 = add i64 %35, %10\n %37 = inttoptr i64 %36 to i32*\n store i32 1, i32* %37, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_17\n LBL_17:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %38 = mul i64 %indvars.iv.reload, 4\n %39 = add i64 %38, %10\n %40 = inttoptr i64 %39 to i32*\n %41 = load i32, i32* %40, align 4\n %42 = zext i32 %41 to i64\n %43 = call i64 @FUNC(i64 %42)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_19, label LBL_17\n LBL_18:\n %44 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_19\n LBL_19:\n call void @free(i64* %9)\n br label LBL_20\n LBL_20:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_22, label LBL_21\n LBL_21:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_22\n LBL_22:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %32, { 1, 0 }\n uselistorder i1 %12, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 2, 3, 0, 4 }\n uselistorder i64* %indvars.iv15.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv12.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 10, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_19, { 1, 0 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_32-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_0, i32 100)\n %8 = add i64 %3, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %3)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_postdec_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i8, i8* %sv_0, align 1\n %10 = icmp eq i8 %9, -128\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = add i8 %9, -1\n store i8 %11, i8* %sv_0, align 1\n %12 = sext i8 %11 to i64\n %13 = and i64 %12, 4294967295\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_6\n LBL_5:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memcpy_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = load i64, i64* %sv_1, align 8\n store i64 %4, i64* %sv_0, align 8\n %5 = call i64 @FUNC(i64* nonnull %sv_0)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__fopen_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = load i32, i32* @gv_2, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 0\n %4 = icmp eq %_IO_FILE* %0, null\n %or.cond = or i1 %4, %3\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %0, { 1, 0 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_loop_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %9 = icmp eq i32 %8, 5\n store i64 %3, i64* %sv_0.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n %10 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %sv_0.0.reload\n %14 = add i64 %storemerge1.reload, %12\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = inttoptr i64 %13 to i8*\n store i8 %16, i8* %17, align 1\n %18 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %19 = add i64 %sv_0.0.reload, 99\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i64 @FUNC(i64 %sv_0.0.reload)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_fgets_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %14, -64\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n br label LBL_8\n LBL_7:\n %23 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder i32 -1, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_alloca_no_init_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.03.reg2mem = alloca i128\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_2:\n %xmm0.03.reload = load i128, i128* %xmm0.03.reg2mem\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %9 = mul i64 %indvars.iv5.reload, 8\n %10 = add i64 %9, %3\n %11 = call i128 @FUNC(i128 %xmm0.03.reload, i128 %xmm0.03.reload)\n %12 = trunc i64 %indvars.iv5.reload to i32\n %13 = call i128 @FUNC(i32 %12)\n %14 = call i64 @FUNC(i128 %13)\n %15 = inttoptr i64 %10 to i64*\n store i64 %14, i64* %15, align 8\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i128 %13, i128* %xmm0.03.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %16 = mul i64 %indvars.iv.reload, 8\n %17 = add i64 %16, %3\n %18 = inttoptr i64 %17 to i64*\n %19 = load i64, i64* %18, align 8\n %20 = call i128 @FUNC(i64 %19)\n %21 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.03.reload, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.03.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_fgets_to_char_13-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_fgets_to_char_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8352 to i32*), align 32\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n %phitmp = mul i32 %8, 16777216\n %phitmp1 = ashr exact i32 %phitmp, 24\n %phitmp2 = zext i32 %phitmp1 to i64\n store i64 %phitmp2, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %10 = call i64 @FUNC(i64 %sv_0.0.reload)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memcpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_0.LBL_3_crit_edge, label LBL_2\n LBL_1:\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %9)\n %11 = call i64 @FUNC(i64 %.pre-phi.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 4, 2, 3, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_connect_socket_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = load i32, i32* inttoptr (i64 8464 to i32*), align 16\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n store i32 %5, i32* %sv_0.1.reg2mem\n br i1 %8, label LBL_6, label LBL_1\n LBL_1:\n %9 = call i32 @socket(i32 2, i32 1, i32 6)\n %10 = icmp eq i32 %9, -1\n store i32 %5, i32* %sv_0.1.reg2mem\n br i1 %10, label LBL_6, label LBL_2\n LBL_2:\n %11 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %12 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %13 = call i16 @htons(i16 27015)\n %14 = bitcast i64* %sv_2 to %sockaddr*\n %15 = call i32 @connect(i32 %9, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_5, label LBL_3\n LBL_3:\n %17 = call i32 @recv(i32 %9, i64* nonnull %sv_1, i32 19, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n %20 = ptrtoint i64* %sv_3 to i64\n %21 = sext i32 %17 to i64\n %22 = add i64 %20, -32\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = bitcast i64* %sv_1 to i8*\n %26 = call double @atof(i8* nonnull %25)\n %27 = fptrunc double %26 to float\n %28 = bitcast float %27 to i32\n %29 = sext i32 %28 to i128\n %30 = call i128 @FUNC(i128 %29)\n %31 = call i64 @FUNC(i128 %30)\n %32 = trunc i64 %31 to i32\n store i32 %32, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %33 = call i32 @close(i32 %9)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %34 = call i128 @__asm_movss.1(i32 %sv_0.1.reload)\n %35 = call i128 @__asm_movss.1(i32 2147483647)\n %36 = call i128 @FUNC(i128 %34, i128 %35)\n %37 = call i128 @FUNC(i128 %36)\n %38 = load i128, i128* @gv_1, align 8\n call void @FUNC(i128 %37, i128 %38)\n %39 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n %40 = call i64 @FUNC(i64 40)\n %41 = icmp eq i64 %2, %40\n store i64 0, i64* %rax.0.reg2mem\n br i1 %41, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %9, { 2, 0, 1, 3 }\n uselistorder i32 %5, { 3, 2, 0, 1 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__long_malloc_use_12-bad", "fun_name": "CWE758_Undefined_Behavior__long_malloc_use_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = load i64, i64* %3, align 8\n call void @free(i64* %3)\n %7 = call i64 @FUNC(i64 %6)\n store i64 %7, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %5, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n store i64 5, i64* %3, align 8\n %8 = call i64 @FUNC(i64 5)\n call void @free(i64* %3)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %3, { 0, 3, 1, 2, 4 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__empty_else_08-bad", "fun_name": "CWE398_Poor_Code_Quality__empty_else_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = srem i32 %3, 3\n %5 = icmp eq i32 %4, 0\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_rand_postinc_06-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge.in = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge.in, 2147483647\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = add i32 %storemerge.in, 1\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_02-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv7.reg2mem = alloca i64\n %sv_0.04.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.04.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -22\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.04.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.04.reload = load i32, i32* %sv_0.04.reg2mem\n %20 = call i64* @malloc(i32 40)\n %21 = ptrtoint i64* %20 to i64\n %22 = icmp eq i64* %20, null\n %23 = icmp eq i1 %22, false\n store i64 0, i64* %indvars.iv7.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %indvars.iv7.reload = load i64, i64* %indvars.iv7.reg2mem\n %24 = mul i64 %indvars.iv7.reload, 4\n %25 = add i64 %24, %21\n %26 = inttoptr i64 %25 to i32*\n store i32 0, i32* %26, align 4\n %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7.reload, 1\n %exitcond9 = icmp eq i64 %indvars.iv.next8, 10\n store i64 %indvars.iv.next8, i64* %indvars.iv7.reg2mem\n br i1 %exitcond9, label LBL_8, label LBL_7\n LBL_8:\n %27 = icmp slt i32 %sv_0.04.reload, 0\n br i1 %27, label LBL_11, label LBL_9\n LBL_9:\n %28 = sext i32 %sv_0.04.reload to i64\n %29 = mul i64 %28, 4\n %30 = add i64 %29, %21\n %31 = inttoptr i64 %30 to i32*\n store i32 1, i32* %31, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %32 = mul i64 %indvars.iv.reload, 4\n %33 = add i64 %32, %21\n %34 = inttoptr i64 %33 to i32*\n %35 = load i32, i32* %34, align 4\n %36 = zext i32 %35 to i64\n %37 = call i64 @FUNC(i64 %36)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_10\n LBL_11:\n %38 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_1 to i64))\n br label LBL_12\n LBL_12:\n call void @free(i64* %20)\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %21, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.04.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv7.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i32 -1, { 5, 2, 1, 3, 0, 4 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_for_loop_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_1, align 4\n %24 = icmp eq i32 %23, 5\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n %25 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sv_0.1.off = add i32 %sv_0.1.reload, -1\n %26 = icmp ugt i32 %sv_0.1.off, 19\n br i1 %26, label LBL_11, label LBL_9\n LBL_9:\n %27 = sext i32 %sv_0.1.reload to i64\n store i64 0, i64* %storemerge5.reg2mem\n br label LBL_10\n LBL_10:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %28 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_3 to i64))\n %29 = add nuw i64 %storemerge5.reload, 1\n %30 = icmp ult i64 %29, %27\n store i64 %29, i64* %storemerge5.reg2mem\n br i1 %30, label LBL_10, label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %storemerge5.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_rand_add_32-bad", "fun_name": "CWE190_Integer_Overflow__int_rand_add_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = mul i32 %4, 1073741824\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = xor i32 %7, %5\n %9 = call i32 @rand()\n %10 = xor i32 %8, %9\n %11 = sext i1 %3 to i32\n %storemerge.in = xor i32 %10, %11\n %12 = add i32 %storemerge.in, 1\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_multiply_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_4:\n %9 = load i64, i64* %sv_0, align 8\n %10 = icmp slt i64 %9, 1\n br i1 %10, label LBL_8, label LBL_5\n LBL_5:\n %11 = icmp sgt i64 %9, 4611686018427387902\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n %12 = mul i64 %9, 2\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_8\n LBL_7:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_8\n LBL_8:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 1)\n %1 = call i64 @FUNC(i64 2)\n ret i64 %1\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_memmove_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = call i64* @memmove(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 100)\n %5 = add i64 %2, 99\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %2)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %2, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__listen_socket_malloc_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %spec.select = select i1 %2, i32 0, i32 99\n %3 = call i64* @malloc(i32 %spec.select)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %spec.select, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = zext i32 %spec.select to i64\n %10 = add i64 %6, -1\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 0, 2, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n store i32 99, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = ptrtoint i64* %sv_3 to i64\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n store i64 0, i64* %sv_2, align 8\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %6 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.0.reload)\n %7 = zext i32 %sv_0.0.reload to i64\n %8 = add i64 %4, -112\n %9 = add i64 %8, %7\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 0, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %3 = ptrtoint i64* %2 to i64\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %0\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %13 = call i64* @memcpy(i64* %2, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %14 = call i64 @FUNC(i64 %3)\n call void @free(i64* %2)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_add_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 3, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 33, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 40)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n %4 = ptrtoint i64* %1 to i64\n %5 = ptrtoint i64* %sv_0 to i64\n %6 = add i64 %5, -48\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 4\n %8 = add i64 %7, %4\n %9 = add i64 %6, %7\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = inttoptr i64 %8 to i32*\n store i32 %11, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %13, 10\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %14 = bitcast i64* %1 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %1)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_loop_01-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_loop_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = add i64 %0, -401\n %4 = add i64 %2, -816\n %5 = add i64 %2, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %6 = mul i64 %storemerge13.reload, 8\n %7 = add i64 %6, %4\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 8\n %9 = add i64 %5, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge13.reg2mem\n br i1 %exitcond4, label LBL_2, label LBL_1\n LBL_2:\n %12 = and i64 %3, -16\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %13 = mul i64 %storemerge2.reload, 8\n %14 = add i64 %13, %12\n %15 = add i64 %13, %4\n %16 = inttoptr i64 %15 to i64*\n %17 = load i64, i64* %16, align 8\n %18 = inttoptr i64 %14 to i64*\n store i64 %17, i64* %18, align 8\n %19 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %19, 100\n store i64 %19, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %20 = call i64 @FUNC(i64 %12)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i64 100, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_connect_socket_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_6, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %26 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = sext i32 %sv_0.1.reload to i64\n %28 = mul i64 %27, 4\n %29 = add i64 %0, -64\n %30 = add i64 %29, %28\n %31 = inttoptr i64 %30 to i32*\n %32 = load i32, i32* %31, align 4\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_10\n LBL_9:\n %35 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_10:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %1, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 2, 8, 0, 9, 1, 7, 6, 10, 4, 11, 5 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_pointer_07-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__struct_pointer_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32*\n %rax.0.reg2mem = alloca i64\n %1 = load i32*, i32** %0\n %2 = load i32, i32* @gv_0, align 4\n %3 = zext i32 %2 to i64\n %4 = icmp eq i32 %2, 5\n %5 = icmp eq i1 %4, false\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = load i32, i32* %1, align 4\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = ptrtoint i32* %1 to i64\n %10 = add i64 %9, 4\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_square_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i128, align 8\n %0 = call i64 @FUNC(i64 40)\n store i128 0, i128* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i128* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i128, i128* %sv_0, align 8\n %10 = trunc i128 %9 to i64\n %.off = add i64 %10, 3037000499\n %11 = icmp ugt i64 %.off, 6074000998\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 0)\n br label LBL_6\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128* %sv_0, { 2, 0, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_sub_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.045.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.045.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.045.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, -2147483648\n store i32 %19, i32* %sv_0.045.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.045.reload = load i32, i32* %sv_0.045.reg2mem\n %22 = add i32 %sv_0.045.reload, -1\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.045.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_postdec_01-bad", "fun_name": "CWE191_Integer_Underflow__int_fscanf_postdec_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = mul i64 %3, 4294967296\n %sext = add i64 %4, -4294967296\n %5 = ashr exact i64 %sext, 32\n store i64 %5, i64* %sv_0, align 8\n %6 = and i64 %5, 4294967295\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_max_square_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 4)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32* @gv_0, { 4, 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_predec_14-bad", "fun_name": "CWE191_Integer_Underflow__int_fscanf_predec_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = mul i64 %9, 4294967296\n %sext = add i64 %10, -4294967296\n %11 = ashr exact i64 %sext, 32\n store i64 %11, i64* %sv_0, align 8\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = bitcast i64* %sv_1 to i8*\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = sext i32 %13 to i64\n %15 = icmp eq i32 %13, 0\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %16 = add i64 %storemerge1.reload, %sv_0.0.reload\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = add i64 %storemerge1.reload, %.pre\n %20 = inttoptr i64 %19 to i8*\n store i8 %18, i8* %20, align 1\n %21 = add nuw i64 %storemerge1.reload, 1\n %22 = icmp ult i64 %21, %14\n store i64 %21, i64* %storemerge1.reg2mem\n br i1 %22, label LBL_5, label LBL_6\n LBL_6:\n %23 = call i64 @FUNC(i64 %.pre)\n %24 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %24)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %.pre, { 1, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_bind_accept_17-bad", "fun_name": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_bind_accept_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_1, align 8\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = call i32 @listen(i32 %3, i32 5)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_9, label LBL_2\n LBL_2:\n %9 = bitcast i64* %sv_0 to %sockaddr*\n %10 = call i32 @bind(i32 %3, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = sub i32 99, %2\n %16 = sext i32 %2 to i64\n %17 = add i64 %16, %14\n %18 = inttoptr i64 %17 to i64*\n %19 = call i32 @recv(i32 %12, i64* %18, i32 %15, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = ptrtoint i64* %sv_2 to i64\n %23 = add i64 %22, -112\n %24 = sext i32 %19 to i64\n %25 = add i64 %23, %24\n %26 = inttoptr i64 %25 to i8*\n store i8 0, i8* %26, align 1\n %27 = call i8* @strchr(i8* nonnull %1, i32 13)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %27, align 1\n br label LBL_7\n LBL_7:\n %29 = call i8* @strchr(i8* nonnull %1, i32 10)\n %30 = icmp eq i8* %29, null\n br i1 %30, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %29, align 1\n br label LBL_10\n LBL_9:\n %31 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %3)\n %33 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64* nonnull %sv_1)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i32 %2, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 3, 1 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = sub i16 0, %3\n %5 = icmp slt i16 %4, 0\n %6 = icmp eq i1 %5, false\n %.v = select i1 %6, i16 %4, i16 %3\n %7 = icmp ult i16 %.v, 182\n br i1 %7, label LBL_1, label LBL_2\n LBL_1:\n %8 = mul i16 %3, %3\n %9 = sext i16 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_2:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %3, { 1, 0, 2, 3 }\n uselistorder i16* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_system_07-bad", "fun_name": "CWE426_Untrusted_Search_Path__char_system_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = bitcast i64* %sv_0 to i32*\n store i32 757101420, i32* %5, align 8\n %6 = or i64 %4, 4\n %7 = inttoptr i64 %6 to i16*\n store i16 24940, i16* %7, align 4\n %8 = or i64 %4, 6\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 2\n br label LBL_2\n LBL_2:\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 @system(i8* nonnull %10)\n %12 = icmp eq i32 %11, 0\n %13 = icmp slt i32 %11, 0\n %14 = icmp eq i1 %13, false\n %15 = icmp eq i1 %12, false\n %16 = icmp eq i1 %14, %15\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0 }\n uselistorder i64* %sv_0, { 2, 0, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_postinc_13-bad", "fun_name": "CWE190_Integer_Overflow__char_fscanf_postinc_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i8\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i8 33, i8* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %.pre = load i8, i8* %sv_0, align 1\n %phitmp = add i8 %.pre, 1\n store i8 %phitmp, i8* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i8, i8* %.reg2mem\n store i8 %.reload, i8* %sv_0, align 1\n %6 = sext i8 %.reload to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 2, 0, 1, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_6, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_11\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %27 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %28 = sext i32 %sv_0.1.reload to i64\n %29 = mul i64 %28, 4\n %30 = add i64 %0, -64\n %31 = add i64 %30, %29\n %32 = inttoptr i64 %31 to i32*\n %33 = load i32, i32* %32, align 4\n %34 = zext i32 %33 to i64\n %35 = call i64 @FUNC(i64 %34)\n br label LBL_11\n LBL_10:\n %36 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_11:\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %1, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_08-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64 @FUNC()\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 %5, i64* %rax.1.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 8\n %9 = add i64 %8, %3\n %10 = inttoptr i64 %9 to i64*\n %11 = load i64, i64* %10, align 8\n %12 = call i128 @FUNC(i64 %11)\n %13 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %13, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_partial_init_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %5 = mul i64 %indvars.iv9.reload, 4\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = trunc i64 %indvars.iv9.reload to i32\n store i32 %8, i32* %7, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_2, label LBL_1\n LBL_2:\n %9 = call i64 @FUNC()\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %12 = mul i64 %indvars.iv6.reload, 4\n %13 = add i64 %12, %1\n %14 = inttoptr i64 %13 to i32*\n %15 = trunc i64 %indvars.iv6.reload to i32\n store i32 %15, i32* %14, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_4, label LBL_3\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %16 = mul i64 %indvars.iv.reload, 4\n %17 = add i64 %16, %1\n %18 = inttoptr i64 %17 to i32*\n %19 = load i32, i32* %18, align 4\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_fwrite_07-bad", "fun_name": "CWE400_Resource_Exhaustion__fgets_fwrite_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 -1, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n %phitmp = sext i32 %8 to i64\n store i64 %phitmp, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i64 -1, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_12, label LBL_5\n LBL_5:\n %13 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0))\n %14 = icmp eq %_IO_FILE* %13, null\n %15 = icmp eq i1 %14, false\n br i1 %15, label LBL_6, label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %16 = icmp eq i64 %sv_0.0.reload, 0\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %16, label LBL_11, label LBL_8\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %17 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_5 to i64*), i32 1, i32 50, %_IO_FILE* %13)\n %18 = icmp eq i32 %17, 50\n br i1 %18, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 1)\n unreachable\n LBL_10:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %19 = add nuw i64 %storemerge2.reload, 1\n %20 = icmp ult i64 %19, %sv_0.0.reload\n store i64 %19, i64* %storemerge2.reg2mem\n br i1 %20, label LBL_8, label LBL_11\n LBL_11:\n %21 = call i32 @fclose(%_IO_FILE* nonnull %13)\n br label LBL_12\n LBL_12:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %13, { 1, 0, 2 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cpy_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %3, align 8\n store i8* %3, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %5)\n %7 = ptrtoint i8* %sv_0.0.reload to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_14-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_10, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_10, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_3 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_8, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_8, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_2, i32 7, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_9, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -112\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_2 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %.off = add i32 %24, 32768\n %25 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %25, label LBL_7, label LBL_9\n LBL_7:\n %sext3 = mul i32 %24, 65536\n %26 = ashr exact i32 %sext3, 16\n store i32 %26, i32* %sv_0.0.ph.reg2mem\n br label LBL_9\n LBL_8:\n %27 = call i32 @close(i32 %5)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_10\n LBL_9:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %28 = call i32 @close(i32 %5)\n %29 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %30 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %31 = trunc i32 %sv_0.1.reload to i16\n %32 = icmp sgt i16 %31, 99\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n %33 = bitcast i64* %sv_2 to i8*\n %34 = bitcast i64* %sv_1 to i8*\n %35 = call i8* @strncpy(i8* nonnull %33, i8* nonnull %34, i32 %sv_0.1.reload)\n %36 = sext i32 %sv_0.1.reload to i64\n %37 = add i64 %0, -112\n %38 = add i64 %37, %36\n %39 = inttoptr i64 %38 to i8*\n store i8 0, i8* %39, align 1\n br label LBL_12\n LBL_12:\n %40 = call i64 @FUNC(i64* nonnull %sv_2)\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %1, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 2, 0 }\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_10, { 2, 1, 0, 3 }\n uselistorder label LBL_9, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_rand_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_rand_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv8.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 7, i32* %storemerge3.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n %14 = sext i1 %6 to i32\n %storemerge2.in = xor i32 %13, %14\n store i32 %storemerge2.in, i32* %storemerge3.reg2mem\n br label LBL_2\n LBL_2:\n %15 = ptrtoint i64* %sv_0 to i64\n %storemerge3.reload = load i32, i32* %storemerge3.reg2mem\n %16 = call i64 @FUNC()\n %17 = trunc i64 %16 to i32\n %18 = icmp eq i32 %17, 0\n br i1 %18, label LBL_7, label LBL_3\n LBL_3:\n %19 = icmp slt i32 %storemerge3.reload, 0\n br i1 %19, label LBL_6, label LBL_4\n LBL_4:\n %20 = sext i32 %storemerge3.reload to i64\n %21 = mul i64 %20, 4\n %22 = add i64 %15, -64\n %23 = add i64 %21, %22\n %24 = inttoptr i64 %23 to i32*\n store i32 1, i32* %24, align 4\n store i64 0, i64* %indvars.iv8.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv8.reload = load i64, i64* %indvars.iv8.reg2mem\n %25 = mul i64 %indvars.iv8.reload, 4\n %26 = add i64 %25, %22\n %27 = inttoptr i64 %26 to i32*\n %28 = load i32, i32* %27, align 4\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n %indvars.iv.next9 = add nuw nsw i64 %indvars.iv8.reload, 1\n %exitcond10 = icmp eq i64 %indvars.iv.next9, 10\n store i64 %indvars.iv.next9, i64* %indvars.iv8.reg2mem\n br i1 %exitcond10, label LBL_11, label LBL_5\n LBL_6:\n %31 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_7:\n %32 = icmp ugt i32 %storemerge3.reload, 9\n br i1 %32, label LBL_10, label LBL_8\n LBL_8:\n %33 = sext i32 %storemerge3.reload to i64\n %34 = mul i64 %33, 4\n %35 = add i64 %15, -64\n %36 = add i64 %34, %35\n %37 = inttoptr i64 %36 to i32*\n store i32 1, i32* %37, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_9\n LBL_9:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %38 = mul i64 %indvars.iv.reload, 4\n %39 = add i64 %38, %35\n %40 = inttoptr i64 %39 to i32*\n %41 = load i32, i32* %40, align 4\n %42 = zext i32 %41 to i64\n %43 = call i64 @FUNC(i64 %42)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_11, label LBL_9\n LBL_10:\n %44 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_11\n LBL_11:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge3.reload, { 1, 3, 0, 2 }\n uselistorder i64 %15, { 1, 0 }\n uselistorder i32* %storemerge3.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv8.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_11, { 2, 1, 3, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cpy_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strcpy(i8* %7, i8* nonnull %9)\n %11 = ptrtoint i64* %4 to i64\n %12 = call i64 @FUNC(i64 %11)\n call void @free(i64* %4)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %7, { 1, 0 }\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64* %4, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_fwrite_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %.off = add i32 %3, -1\n %4 = icmp ugt i32 %.off, 19\n br i1 %4, label LBL_8, label LBL_1\n LBL_1:\n %5 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %6 = icmp eq %_IO_FILE* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_2, label LBL_3\n LBL_2:\n %8 = sext i32 %3 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_4\n LBL_3:\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %9 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_4 to i64*), i32 1, i32 50, %_IO_FILE* %5)\n %10 = icmp eq i32 %9, 50\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 1)\n unreachable\n LBL_6:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %11 = add nuw i64 %storemerge4.reload, 1\n %12 = icmp ult i64 %11, %8\n store i64 %11, i64* %storemerge4.reg2mem\n br i1 %12, label LBL_4, label LBL_7\n LBL_7:\n %13 = call i32 @fclose(%_IO_FILE* nonnull %5)\n br label LBL_8\n LBL_8:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %5, { 1, 0, 2 }\n uselistorder i32 %3, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__strdup_char_12-bad", "fun_name": "CWE401_Memory_Leak__strdup_char_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, -97\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_1, align 8\n %7 = inttoptr i64 %6 to i64*\n store i64 7453010373645639777, i64* %7, align 16\n %8 = or i64 %6, 8\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 8\n %10 = load i64, i64* %sv_1, align 8\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_2:\n store i64 7453010373643565421, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strdup(i8* nonnull %12)\n %14 = ptrtoint i8* %13 to i64\n store i64 %14, i64* %sv_1, align 8\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_3\n LBL_3:\n %16 = call i64 @FUNC()\n %17 = trunc i64 %16 to i32\n %18 = icmp eq i32 %17, 0\n %19 = icmp eq i1 %18, false\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n %20 = load i64, i64* %sv_1, align 8\n %21 = inttoptr i64 %20 to i64*\n call void @free(i64* %21)\n br label LBL_5\n LBL_5:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 0, 3, 1, 2, 5, 4 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_postdec_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = add i32 %sv_0.1.reload, -1\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_10\n LBL_9:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_sub_10-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp eq i32 %3, 0\n %spec.store.select = select i1 %4, i32 32, i32 -128\n %5 = trunc i32 %spec.store.select to i8\n %6 = icmp eq i8 %5, -128\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = mul i32 %spec.store.select, 16777216\n %sext = add i32 %7, -16777216\n %8 = ashr exact i32 %sext, 24\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_max_square_08-bad", "fun_name": "CWE190_Integer_Overflow__short_max_square_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp ne i32 %4, 0\n %6 = zext i1 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i16, i16* %sv_0, align 2\n %9 = sub i16 0, %8\n %10 = icmp slt i16 %9, 0\n %11 = icmp eq i1 %10, false\n %.v = select i1 %11, i16 %9, i16 %8\n %12 = icmp ult i16 %.v, 182\n br i1 %12, label LBL_4, label LBL_5\n LBL_4:\n %13 = mul i16 %8, %8\n %14 = sext i16 %13 to i64\n %15 = and i64 %14, 4294967295\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_6\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %8, { 1, 0, 2, 3 }\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0, align 8\n %2 = call i64 @FUNC()\n %3 = add i64 %0, -401\n %4 = and i64 %3, -16\n %5 = inttoptr i64 %4 to i32*\n store i32* %5, i32** %sv_0, align 8\n store i32 5, i32* %5, align 16\n %6 = load i32*, i32** %sv_0, align 8\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC()\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_0, { 3, 2, 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_loop_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = add i64 %0, -33\n %4 = and i64 %3, -16\n %5 = add i64 %2, -48\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %6 = mul i64 %storemerge3.reload, 4\n %7 = add i64 %6, %4\n %8 = add i64 %5, %6\n %9 = inttoptr i64 %8 to i32*\n %10 = load i32, i32* %9, align 4\n %11 = inttoptr i64 %7 to i32*\n store i32 %10, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %12, 10\n store i64 %12, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %13 = inttoptr i64 %4 to i32*\n %14 = load i32, i32* %13, align 16\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_memmove_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = ptrtoint i64* %sv_2 to i64\n %4 = add i64 %3, -33\n %5 = and i64 %4, -16\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %sv_1, align 8\n %7 = inttoptr i64 %sv_0.0.reload to i64*\n %8 = call i64* @memmove(i64* %7, i64* nonnull %sv_1, i32 40)\n %9 = inttoptr i64 %sv_0.0.reload to i32*\n %10 = load i32, i32* %9, align 16\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fgets_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_2, align 4\n %11 = icmp eq i32 %10, 5\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_10\n LBL_6:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %13, label LBL_9, label LBL_7\n LBL_7:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %14, -64\n %18 = add i64 %16, %17\n %19 = inttoptr i64 %18 to i32*\n store i32 1, i32* %19, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_8\n LBL_8:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %20 = mul i64 %indvars.iv.reload, 4\n %21 = add i64 %20, %17\n %22 = inttoptr i64 %21 to i32*\n %23 = load i32, i32* %22, align 4\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_10, label LBL_8\n LBL_9:\n %26 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_4 to i64))\n br label LBL_10\n LBL_10:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_rand_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_rand_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8372 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n %14 = sext i1 %6 to i32\n %storemerge1.in = xor i32 %13, %14\n %15 = icmp slt i32 %storemerge1.in, 0\n br i1 %15, label LBL_4, label LBL_2\n LBL_2:\n %16 = ptrtoint i64* %sv_0 to i64\n %17 = sext i32 %storemerge1.in to i64\n %18 = mul i64 %17, 4\n %19 = add i64 %16, -64\n %20 = add i64 %18, %19\n %21 = inttoptr i64 %20 to i32*\n store i32 1, i32* %21, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %22 = mul i64 %indvars.iv.reload, 4\n %23 = add i64 %22, %19\n %24 = inttoptr i64 %23 to i32*\n %25 = load i32, i32* %24, align 4\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_3\n LBL_4:\n %28 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_5\n LBL_5:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge1.in, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_fwrite_32-bad", "fun_name": "CWE400_Resource_Exhaustion__connect_socket_fwrite_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %sv_0.06.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.06.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -22\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.06.reg2mem\n br label LBL_5\n LBL_5:\n %20 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %21 = icmp eq %_IO_FILE* %20, null\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_6, label LBL_7\n LBL_6:\n %sv_0.06.reload = load i32, i32* %sv_0.06.reg2mem\n %23 = sext i32 %sv_0.06.reload to i64\n %24 = icmp eq i32 %sv_0.06.reload, 0\n store i64 0, i64* %storemerge7.reg2mem\n br i1 %24, label LBL_11, label LBL_8\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %25 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_3 to i64*), i32 1, i32 50, %_IO_FILE* %20)\n %26 = icmp eq i32 %25, 50\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 1)\n unreachable\n LBL_10:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %27 = add nuw i64 %storemerge7.reload, 1\n %28 = icmp ult i64 %27, %23\n store i64 %27, i64* %storemerge7.reg2mem\n br i1 %28, label LBL_8, label LBL_11\n LBL_11:\n %29 = call i32 @fclose(%_IO_FILE* nonnull %20)\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.06.reload, { 1, 0 }\n uselistorder %_IO_FILE* %20, { 1, 0, 2 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.06.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge7.reg2mem, { 2, 0, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 1, 3, 0, 4 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_divide_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 7\n %6 = udiv i32 100, %spec.select\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 7, { 1, 0 }\n uselistorder i32 -1, { 3, 0, 1, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_for_loop_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge9.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_10, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %sv_0.1.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_10\n LBL_10:\n %.reload = load i32, i32* %.reg2mem\n %28 = icmp eq i32 %.reload, 5\n br i1 %28, label LBL_12, label LBL_11\n LBL_11:\n %29 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_15\n LBL_12:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sv_0.1.off = add i32 %sv_0.1.reload, -1\n %30 = icmp ugt i32 %sv_0.1.off, 19\n br i1 %30, label LBL_15, label LBL_13\n LBL_13:\n %31 = sext i32 %sv_0.1.reload to i64\n store i64 0, i64* %storemerge9.reg2mem\n br label LBL_14\n LBL_14:\n %storemerge9.reload = load i64, i64* %storemerge9.reg2mem\n %32 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %33 = add nuw i64 %storemerge9.reload, 1\n %34 = icmp ult i64 %33, %31\n store i64 %33, i64* %storemerge9.reg2mem\n br i1 %34, label LBL_14, label LBL_15\n LBL_15:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge9.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_9, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 400)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_1.LBL_4_crit_edge, label LBL_3\n LBL_2:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %6 = zext i32 %.reload to i64\n %7 = icmp eq i32 %.reload, 5\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i64* null, { 1, 0, 2, 3, 4 }\n uselistorder i32* @gv_0, { 0, 6, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memcpy_08-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memcpy_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %12)\n %14 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 2, 6, 3, 4, 0, 5 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %rax.1.reg2mem\n br i1 %5, label LBL_6, label LBL_3\n LBL_3:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %6 = mul i64 %indvars.iv6.reload, 8\n %7 = add i64 %6, %3\n %8 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %9 = trunc i64 %indvars.iv6.reload to i32\n %10 = call i128 @FUNC(i32 %9)\n %11 = call i64 @FUNC(i128 %10)\n %12 = inttoptr i64 %7 to i64*\n store i64 %11, i64* %12, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %10, i128* %xmm0.04.reg2mem\n br i1 %exitcond8, label LBL_4, label LBL_3\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %13 = icmp eq i32 %.pr, 0\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 0, i64* %rax.1.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 8\n %15 = add i64 %14, %3\n %16 = inttoptr i64 %15 to i64*\n %17 = load i64, i64* %16, align 8\n %18 = call i128 @FUNC(i64 %17)\n %19 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %19, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64* %rax.1.reg2mem, { 0, 1, 3, 2 }\n uselistorder i64 ()* @printDoubleLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder i32* @gv_0, { 0, 3, 2, 1 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 0, 3, 1, 2, 4 }\n uselistorder label LBL_6, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_32-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, -401\n %4 = and i64 %3, -16\n store i64 %4, i64* %sv_1, align 8\n %5 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 100)\n %6 = add i64 %2, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %4\n %9 = add i64 %6, %7\n %10 = inttoptr i64 %9 to i64*\n %11 = load i64, i64* %10, align 8\n %12 = inttoptr i64 %8 to i64*\n store i64 %11, i64* %12, align 8\n %13 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %14 = inttoptr i64 %4 to i64*\n %15 = load i64, i64* %14, align 16\n %16 = call i64 @FUNC(i64 %15)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_multiply_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp slt i16 %3, 1\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp sgt i16 %3, ptrtoint (i1* @gv_2 to i16)\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = mul i16 %3, 2\n %7 = sext i16 %6 to i64\n %8 = and i64 %7, 4294967294\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_4\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__rand_malloc_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %spec.select = select i1 %2, i32 0, i32 99\n %3 = call i64* @malloc(i32 %spec.select)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %spec.select, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = zext i32 %spec.select to i64\n %10 = add i64 %6, -1\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.05.reg2mem = alloca i8*\n %sv_0.06.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = load i8, i8* %3, align 1\n %20 = icmp eq i8 %19, 0\n %21 = icmp eq i1 %20, false\n store i8 %19, i8* %.reg2mem\n store i8* %3, i8** %sv_0.06.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n br i1 %21, label LBL_8, label LBL_11\n LBL_8:\n %sv_0.06.reload = load i8*, i8** %sv_0.06.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %22 = icmp eq i8 %.reload, 83\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_10, label LBL_9\n LBL_9:\n %24 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n store i8* %sv_0.06.reload, i8** %sv_0.05.reg2mem\n br label LBL_11\n LBL_10:\n %25 = ptrtoint i8* %sv_0.06.reload to i64\n %26 = add i64 %25, 1\n %27 = inttoptr i64 %26 to i8*\n %28 = load i8, i8* %27, align 1\n %29 = icmp eq i8 %28, 0\n %30 = icmp eq i1 %29, false\n store i8 %28, i8* %.reg2mem\n store i8* %27, i8** %sv_0.06.reg2mem\n store i8* %27, i8** %sv_0.05.reg2mem\n br i1 %30, label LBL_8, label LBL_11\n LBL_11:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %31 = bitcast i8* %sv_0.05.reload to i64*\n call void @free(i64* %31)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %sv_0.06.reload, { 1, 0 }\n uselistorder i8* %3, { 0, 1, 2, 4, 3 }\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.06.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.05.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4 }\n uselistorder label LBL_11, { 0, 2, 1 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_char_11-bad", "fun_name": "CWE563_Unused_Variable__unused_value_char_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 90)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_postinc_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = load i32, i32* %sv_0, align 4\n %8 = icmp eq i32 %7, -1\n br i1 %6, label LBL_4, label LBL_1\n LBL_1:\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = add i32 %7, 1\n store i32 %9, i32* %sv_0, align 4\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_7\n LBL_3:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %13 = add i32 %7, 1\n store i32 %13, i32* %sv_0, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_7\n LBL_6:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_7:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %8, { 1, 0 }\n uselistorder i32 %7, { 1, 0, 2 }\n uselistorder i32* %sv_0, { 1, 3, 2, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.034.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.034.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.034.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, 0\n store i32 %19, i32* %sv_0.034.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.034.reload = load i32, i32* %sv_0.034.reg2mem\n %22 = urem i32 100, %sv_0.034.reload\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.034.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 2, 0, 3 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cpy_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %6)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i8** %sv_1 to i64\n %5 = add i64 %4, -49\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n %8 = bitcast i8** %sv_1 to i64*\n store i64 %6, i64* %8, align 8\n store i8 0, i8* %7, align 16\n br label LBL_3\n LBL_3:\n store i64 4702111234474983745, i64* %sv_0, align 8\n %9 = load i8*, i8** %sv_1, align 8\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strcpy(i8* %9, i8* nonnull %10)\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 3, 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_malloc_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 4)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i64* %0, null\n %or.cond = or i1 %4, %3\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %5 = bitcast i64* %0 to i32*\n store i32 5, i32* %5, align 4\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_06-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n store i64 4702111234474983745, i64* %sv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i32 @strlen(i8* nonnull %2)\n %4 = add i32 %3, 1\n %5 = call i8* @strncpy(i8* nonnull %1, i8* nonnull %2, i32 %4)\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__twoIntsStruct_realloc_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_1 to i32))\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = ptrtoint i64* %2 to i64\n %6 = bitcast i64* %2 to i32*\n store i32 0, i32* %6, align 4\n %7 = add i64 %5, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %9 = call i64 @FUNC(i64 %5)\n %.pr = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @free(i64* nonnull %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 3, 1, 4, 2, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__listen_socket_08-bad", "fun_name": "CWE617_Reachable_Assertion__listen_socket_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_1 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_0, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %phitmp = icmp sgt i32 %24, 5\n %25 = call i32 @close(i32 %4)\n %26 = call i32 @close(i32 %13)\n br i1 %phitmp, label LBL_10, label LBL_9\n LBL_7:\n %27 = call i32 @close(i32 %4)\n br label LBL_9\n LBL_8:\n %28 = call i32 @close(i32 %4)\n %29 = call i32 @close(i32 %13)\n br label LBL_9\n LBL_9:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @gv_1, i64 0, i64 0), i32 139, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @gv_2, i64 0, i64 0))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 0, 1, 5, 2, 3, 4, 6 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 0, 1, 2, 4, 3, 5 }\n uselistorder label LBL_9, { 0, 2, 4, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge4.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = call i32 @strlen(i8* nonnull %3)\n %20 = icmp eq i32 %19, 0\n br i1 %20, label LBL_12, label LBL_8\n LBL_8:\n %21 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %22 = add i64 %storemerge4.reload, %21\n %23 = inttoptr i64 %22 to i8*\n %24 = load i8, i8* %23, align 1\n %25 = icmp eq i8 %24, 83\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_11, label LBL_10\n LBL_10:\n %27 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_11:\n %28 = add nuw i64 %storemerge4.reload, 1\n %29 = call i32 @strlen(i8* %3)\n %30 = sext i32 %29 to i64\n %31 = icmp ult i64 %28, %30\n store i64 %28, i64* %storemerge4.reg2mem\n br i1 %31, label LBL_9, label LBL_12\n LBL_12:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %3, { 1, 0, 3, 2 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 5, 0, 4, 3, 1, 2, 6 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_12, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE665_Improper_Initialization__char_cat_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n store i8 0, i8* %1, align 8\n br label LBL_3\n LBL_3:\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i8* @strcat(i8* nonnull %1, i8* nonnull %7)\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_2 to i64\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i64 %3, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = load i64, i64* %sv_1, align 8\n %7 = inttoptr i64 %sv_0.0.reload to i64*\n store i64 %6, i64* %7, align 8\n %8 = add i64 %sv_0.0.reload, 8\n %9 = inttoptr i64 %8 to i64*\n %10 = add i64 %sv_0.0.reload, 16\n %11 = inttoptr i64 %10 to i64*\n %12 = add i64 %sv_0.0.reload, 24\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %sv_0.0.reload, 32\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %sv_0.0.reload, 40\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %sv_0.0.reload, 48\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %sv_0.0.reload, 56\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %sv_0.0.reload, 64\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %sv_0.0.reload, 72\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %sv_0.0.reload, 80\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %sv_0.0.reload, 88\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %sv_0.0.reload, 96\n %31 = inttoptr i64 %30 to i32*\n %32 = add i64 %sv_0.0.reload, 99\n %33 = inttoptr i64 %32 to i8*\n store i8 0, i8* %33, align 1\n %34 = call i64 @FUNC(i64 %sv_0.0.reload)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 14, 13, 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = sext i32 %10 to i64\n %13 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %4\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = add i64 %storemerge1.reload, %13\n %18 = inttoptr i64 %17 to i8*\n store i8 %16, i8* %18, align 1\n %19 = add nuw i64 %storemerge1.reload, 1\n %20 = icmp ult i64 %19, %12\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %20, label LBL_4, label LBL_5\n LBL_5:\n %21 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %1)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %10, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE665_Improper_Initialization__char_cat_02-bad", "fun_name": "CWE665_Improper_Initialization__char_cat_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = bitcast i64* %sv_1 to i8*\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strcat(i8* nonnull %3, i8* nonnull %4)\n %6 = call i64 @FUNC(i64 %1)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_square_05-bad", "fun_name": "CWE190_Integer_Overflow__char_fscanf_square_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i8, i8* %sv_0, align 1\n %7 = mul i8 %6, %6\n %8 = sext i8 %7 to i64\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_multiply_08-bad", "fun_name": "CWE191_Integer_Underflow__char_min_multiply_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 32, i32 -128\n %6 = trunc i32 %spec.select to i8\n %7 = icmp slt i8 %6, 0\n %8 = icmp eq i1 %7, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = mul i32 %spec.select, 2\n %10 = and i32 %9, 64\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_loop_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_loop_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = add i64 %9, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n store i64 %9, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %12 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_4\n LBL_4:\n %15 = sext i32 %13 to i64\n %16 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %17 = add i64 %storemerge2.reload, %.pre-phi.reload\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = add i64 %storemerge2.reload, %16\n %21 = inttoptr i64 %20 to i8*\n store i8 %19, i8* %21, align 1\n %22 = add nuw i64 %storemerge2.reload, 1\n %23 = icmp ult i64 %22, %15\n store i64 %22, i64* %storemerge2.reg2mem\n br i1 %23, label LBL_5, label LBL_6\n LBL_6:\n %24 = call i64 @FUNC(i64 %.pre-phi.reload)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64* %sv_1, { 4, 0, 3, 1, 2 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_fprintf_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = call i64 @FUNC()\n %21 = trunc i64 %20 to i32\n %22 = icmp eq i32 %21, 0\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n %23 = load %_IO_FILE*, %_IO_FILE** @gv_3, align 8\n %24 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_8\n LBL_8:\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_multiply_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %3 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 100)\n %4 = call i64 @FUNC(i64* nonnull %sv_0)\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_postdec_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i32 %3, -1\n store i32 %5, i32* %sv_0, align 4\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_07-bad", "fun_name": "CWE401_Memory_Leak__int_calloc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @calloc(i32 100, i32 4)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i32*\n store i32 5, i32* %7, align 4\n %8 = call i64 @FUNC(i64 5)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n uselistorder i32 5, { 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_sub_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_14\n LBL_11:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %31, label LBL_13, label LBL_12\n LBL_12:\n %32 = add i32 %sv_0.1.reload, -1\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_14\n LBL_13:\n %35 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_14\n LBL_14:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memmove_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = inttoptr i64 %sv_0.0.reload to i64*\n %13 = call i64* @memmove(i64* %12, i64* nonnull %sv_1, i32 100)\n %14 = add i64 %sv_0.0.reload, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %sv_0.0.reload)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 100, { 0, 1, 3, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 11)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = call i64* @memcpy(i64* %1, i64* nonnull %sv_0, i32 %7)\n %9 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = add i64 %8, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = mul i64 %storemerge1.reload, 8\n %12 = add i64 %11, %sv_0.0.reload\n %13 = add i64 %10, %11\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = inttoptr i64 %12 to i64*\n store i64 %15, i64* %16, align 8\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %18 = inttoptr i64 %sv_0.0.reload to i64*\n %19 = load i64, i64* %18, align 8\n %20 = call i64 @FUNC(i64 %19)\n call void @free(i64* %18)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 100, { 0, 2, 1, 3 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_src_char_cat_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = add i64 %4, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 0, i64* %sv_0, align 8\n %8 = bitcast i64* %sv_0 to i8*\n %9 = bitcast i64* %1 to i8*\n %10 = call i8* @strcat(i8* nonnull %8, i8* %9)\n %11 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_pointer_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i128 @FUNC(i64 4617315517961601024)\n %8 = call i64 @__asm_movsd.1(i128 %7)\n store i64 %8, i64* %3, align 8\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %9 = call i64 @FUNC()\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 0\n store i64 %9, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = inttoptr i64 %sv_0.0.reload to i64*\n %13 = load i64, i64* %12, align 8\n %14 = call i128 @FUNC(i64 %13)\n %15 = call i64 @FUNC()\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64 ()* @printDoubleLine, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 0, 3, 2, 1, 4 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_realloc_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_0 to i32))\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 5, i64* %1, align 8\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %1)\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_listen_socket_31-bad", "fun_name": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_listen_socket_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge8.reg2mem = alloca i64\n %sv_0.036.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.036.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.036.reload = load i32, i32* %sv_0.036.reg2mem\n %25 = mul i32 %sv_0.036.reload, 4\n %26 = call i64* @malloc(i32 %25)\n %27 = icmp eq i64* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_9, label LBL_10\n LBL_9:\n %29 = ptrtoint i64* %26 to i64\n %30 = sext i32 %sv_0.036.reload to i64\n %31 = icmp eq i32 %sv_0.036.reload, 0\n store i64 0, i64* %storemerge8.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_10:\n call void @exit(i32 -1)\n unreachable\n LBL_11:\n %storemerge8.reload = load i64, i64* %storemerge8.reg2mem\n %32 = mul i64 %storemerge8.reload, 4\n %33 = add i64 %32, %29\n %34 = inttoptr i64 %33 to i32*\n store i32 0, i32* %34, align 4\n %35 = add nuw i64 %storemerge8.reload, 1\n %36 = icmp ult i64 %35, %30\n store i64 %35, i64* %storemerge8.reg2mem\n br i1 %36, label LBL_11, label LBL_12\n LBL_12:\n %37 = bitcast i64* %26 to i32*\n %38 = load i32, i32* %37, align 4\n %39 = zext i32 %38 to i64\n %40 = call i64 @FUNC(i64 %39)\n call void @free(i64* %26)\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %26, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.036.reload, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.036.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %storemerge8.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 7, 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__short_fscanf_05-bad", "fun_name": "CWE197_Numeric_Truncation_Error__short_fscanf_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 -1, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 4294967295, i64* %.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i16, i16* %sv_0, align 2\n %phitmp = zext i16 %.pre to i32\n %phitmp1 = mul i32 %phitmp, 16777216\n %phitmp2 = ashr exact i32 %phitmp1, 24\n %phitmp3 = zext i32 %phitmp2 to i64\n store i64 %phitmp3, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %5 = call i64 @FUNC(i64 %.reload)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05.reg2mem = alloca i8*\n %sv_0.06.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = load i32, i32* @gv_3, align 4\n %20 = zext i32 %19 to i64\n %21 = icmp eq i32 %19, 5\n %22 = icmp eq i1 %21, false\n store i64 %20, i64* %rax.0.reg2mem\n br i1 %22, label LBL_13, label LBL_8\n LBL_8:\n %23 = load i8, i8* %3, align 1\n %24 = icmp eq i8 %23, 0\n %25 = icmp eq i1 %24, false\n store i8 %23, i8* %.reg2mem\n store i8* %3, i8** %sv_0.06.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n br i1 %25, label LBL_9, label LBL_12\n LBL_9:\n %sv_0.06.reload = load i8*, i8** %sv_0.06.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %26 = icmp eq i8 %.reload, 83\n %27 = icmp eq i1 %26, false\n br i1 %27, label LBL_11, label LBL_10\n LBL_10:\n %28 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_4 to i64))\n store i8* %sv_0.06.reload, i8** %sv_0.05.reg2mem\n br label LBL_12\n LBL_11:\n %29 = ptrtoint i8* %sv_0.06.reload to i64\n %30 = add i64 %29, 1\n %31 = inttoptr i64 %30 to i8*\n %32 = load i8, i8* %31, align 1\n %33 = icmp eq i8 %32, 0\n %34 = icmp eq i1 %33, false\n store i8 %32, i8* %.reg2mem\n store i8* %31, i8** %sv_0.06.reg2mem\n store i8* %31, i8** %sv_0.05.reg2mem\n br i1 %34, label LBL_9, label LBL_12\n LBL_12:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %35 = bitcast i8* %sv_0.05.reload to i64*\n call void @free(i64* %35)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.06.reload, { 1, 0 }\n uselistorder i8* %3, { 0, 1, 2, 4, 3 }\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.06.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.05.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4 }\n uselistorder label LBL_12, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_multiply_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = call i32 @rand()\n %8 = xor i32 %7, %6\n %9 = sext i1 %3 to i32\n %storemerge.in = xor i32 %8, %9\n %10 = trunc i32 %storemerge.in to i16\n %11 = icmp slt i16 %10, 0\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_4, label LBL_1\n LBL_1:\n %13 = icmp slt i16 %10, -16383\n br i1 %13, label LBL_3, label LBL_2\n LBL_2:\n %sext = mul i32 %storemerge.in, 131072\n %14 = ashr exact i32 %sext, 16\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_4\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %10, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_square_07-bad", "fun_name": "CWE190_Integer_Overflow__char_fscanf_square_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = load i8, i8* %sv_0, align 1\n %9 = mul i8 %8, %8\n %10 = sext i8 %9 to i64\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 49)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = call i64* @memmove(i64* nonnull %sv_0, i64* %1, i32 %12)\n %14 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 2, 6, 3, 4, 0, 5 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_malloc_05-bad", "fun_name": "CWE401_Memory_Leak__struct_twoIntsStruct_malloc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = bitcast i64* %2 to i32*\n store i32 0, i32* %5, align 4\n %6 = ptrtoint i64* %2 to i64\n %7 = add i64 %6, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %9 = call i64 @FUNC(i64 %6)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i32 7, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %5 = udiv i32 100, %sv_0.0.reload\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 0, 3, 2, 8, 1, 9, 7, 6, 10, 4, 11, 5 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_square_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0810.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.0810.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.0810.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %sv_0.0.off = add i32 %19, 46339\n %21 = icmp ugt i32 %sv_0.0.off, 92678\n store i32 %19, i32* %sv_0.0810.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0810.reload = load i32, i32* %sv_0.0810.reg2mem\n %22 = mul i32 %sv_0.0810.reload, %sv_0.0810.reload\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0810.reload, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0810.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_environment_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i16*\n store i16 13617, i16* %5, align 8\n %6 = or i64 %4, 2\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 2\n br label LBL_2\n LBL_2:\n %8 = call i64 @FUNC()\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_8, label LBL_3\n LBL_3:\n %11 = bitcast i64* %sv_2 to i8*\n %12 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %13 = icmp eq i32 %12, 1\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_8, label LBL_4\n LBL_4:\n %15 = load i64, i64* %sv_1, align 8\n %16 = and i64 %15, 4294967295\n %17 = icmp eq i64 %16, 0\n store i32 0, i32* %storemerge3.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %17, label LBL_7, label LBL_5\n LBL_5:\n %storemerge3.reload = load i32, i32* %storemerge3.reg2mem\n %18 = add i32 %storemerge3.reload, 1\n %19 = sext i32 %18 to i64\n %20 = icmp sgt i64 %16, %19\n store i32 %18, i32* %storemerge3.reg2mem\n br i1 %20, label LBL_5, label LBL_6\n LBL_6:\n %phitmp = zext i32 %18 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %21 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_8\n LBL_8:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0, 2 }\n uselistorder i64* %sv_2, { 2, 0, 1, 3 }\n uselistorder i32* %storemerge3.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_ncpy_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 100)\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = bitcast i64* %4 to i8*\n store i8* %11, i8** %sv_2, align 8\n store i8* %11, i8** %.reg2mem\n br label LBL_7\n LBL_4:\n %12 = bitcast i64* %4 to i8*\n store i8* %12, i8** %sv_1, align 8\n %13 = icmp eq i64* %4, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %15 = call i64* @memset(i64* %4, i32 65, i32 99)\n %16 = ptrtoint i64* %4 to i64\n %17 = add i64 %16, 99\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = load i8*, i8** %sv_1, align 8\n %20 = ptrtoint i8* %19 to i64\n %21 = bitcast i8** %sv_2 to i64*\n store i64 %20, i64* %21, align 8\n store i8* %19, i8** %.reg2mem\n br label LBL_7\n LBL_7:\n %.reload = load i8*, i8** %.reg2mem\n %22 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i8* @strncpy(i8* %.reload, i8* nonnull %23, i32 99)\n %25 = ptrtoint i8* %.reload to i64\n %26 = add i64 %25, 99\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = load i8*, i8** %sv_2, align 8\n %29 = ptrtoint i8* %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 3, 6, 7, 1, 2, 4, 5 }\n uselistorder i8** %sv_2, { 2, 0, 1 }\n uselistorder i8** %.reg2mem, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3 }\n uselistorder i32 99, { 1, 2, 0, 3 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 20)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = ptrtoint i64* %2 to i64\n %6 = bitcast i64* %2 to i32*\n store i32 1819043176, i32* %6, align 4\n %7 = add i64 %5, 4\n %8 = inttoptr i64 %7 to i16*\n store i16 111, i16* %8, align 2\n %9 = call i64 @FUNC(i64 %5)\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 2, 3, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_partial_init_05-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_partial_init_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv4.reg2mem\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %6 = mul i64 %indvars.iv4.reload, 8\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n %9 = trunc i64 %indvars.iv4.reload to i32\n store i32 %9, i32* %8, align 8\n %10 = or i64 %7, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 %9, i32* %11, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 5\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n br i1 %exitcond6, label LBL_2, label LBL_1\n LBL_2:\n %.pr = load i32, i32* @gv_0, align 4\n %12 = icmp eq i32 %.pr, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 8\n %14 = add i64 %13, %3\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 8\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = or i64 %14, 4\n %20 = inttoptr i64 %19 to i32*\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %1, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder label LBL_4, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_square_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %sv_0.0.off = add i32 %sv_0.0.reload, 65534\n %17 = icmp ugt i32 %sv_0.0.off, 131068\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = mul i32 %sv_0.0.reload, %sv_0.0.reload\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %21 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 %2, i32* %.reg2mem\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %6, label LBL_6, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %sv_0.1.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_7\n LBL_7:\n %.reload = load i32, i32* %.reg2mem\n %23 = icmp eq i32 %.reload, 5\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_12\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %25 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %25, label LBL_11, label LBL_10\n LBL_10:\n %26 = sext i32 %sv_0.1.reload to i64\n %27 = mul i64 %26, 4\n %28 = add i64 %0, -64\n %29 = add i64 %28, %27\n %30 = inttoptr i64 %29 to i32*\n %31 = load i32, i32* %30, align 4\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_12\n LBL_11:\n %34 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %1, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_memmove_12-bad", "fun_name": "CWE124_Buffer_Underwrite__char_declare_memmove_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %sv_2.stack_var_-240 = select i1 %4, i64* %sv_2, i64* %sv_1\n %storemerge = ptrtoint i64* %sv_2.stack_var_-240 to i64\n store i64 %storemerge, i64* %sv_1, align 8\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = load i64, i64* %sv_1, align 8\n %7 = inttoptr i64 %6 to i64*\n %8 = call i64* @memmove(i64* %7, i64* nonnull %sv_0, i32 100)\n %9 = load i64, i64* %sv_1, align 8\n %10 = add i64 %9, 99\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = load i64, i64* %sv_1, align 8\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 3, 4, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memcpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64* %4, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = bitcast i64* %sv_1 to i8*\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = call i64* @memcpy(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 %13)\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %sv_0.0.reload)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 3, 0, 1, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__short_listen_socket_13-bad", "fun_name": "CWE197_Numeric_Truncation_Error__short_listen_socket_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 7, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -16\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %sext = mul i32 %24, 65536\n %25 = ashr exact i32 %sext, 16\n store i32 %25, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %26 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %27 = call i32 @close(i32 %4)\n %28 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext2 = mul i32 %sv_0.1.reload, 16777216\n %29 = ashr exact i32 %sext2, 24\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_long_alloca_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge24.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %storemerge5.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %8 = mul i64 %storemerge5.reload, 8\n %9 = add i64 %8, %4\n %10 = inttoptr i64 %9 to i64*\n store i64 5, i64* %10, align 8\n %11 = add nuw nsw i64 %storemerge5.reload, 1\n %exitcond6 = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge5.reg2mem\n br i1 %exitcond6, label LBL_7, label LBL_3\n LBL_4:\n store i64 0, i64* %storemerge24.reg2mem\n br i1 %6, label LBL_6, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_6:\n %storemerge24.reload = load i64, i64* %storemerge24.reg2mem\n %13 = mul i64 %storemerge24.reload, 8\n %14 = add i64 %13, %4\n %15 = inttoptr i64 %14 to i64*\n store i64 5, i64* %15, align 8\n %16 = add nuw nsw i64 %storemerge24.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge24.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %17 = load i64, i64* %3, align 8\n %18 = call i64 @FUNC(i64 %17)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge24.reg2mem, { 2, 0, 1 }\n uselistorder i64 100, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_13, label LBL_3\n LBL_3:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_11, label LBL_4\n LBL_4:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_11, label LBL_5\n LBL_5:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_6\n LBL_6:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_12, label LBL_7\n LBL_7:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %28, align 1\n br label LBL_9\n LBL_9:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_12, label LBL_10\n LBL_10:\n store i8 0, i8* %30, align 1\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %6)\n br label LBL_13\n LBL_12:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_13\n LBL_13:\n %35 = load i32, i32* @gv_0, align 4\n %36 = icmp eq i32 %35, 5\n br i1 %36, label LBL_14, label LBL_16\n LBL_14:\n %37 = call i32 @strlen(i8* nonnull %4)\n %38 = icmp eq i32 %37, 0\n br i1 %38, label LBL_20, label LBL_15\n LBL_15:\n %39 = ptrtoint i64* %1 to i64\n store i64 0, i64* %storemerge7.reg2mem\n br label LBL_17\n LBL_16:\n %40 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_21\n LBL_17:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %41 = add i64 %storemerge7.reload, %39\n %42 = inttoptr i64 %41 to i8*\n %43 = load i8, i8* %42, align 1\n %44 = icmp eq i8 %43, 83\n %45 = icmp eq i1 %44, false\n br i1 %45, label LBL_19, label LBL_18\n LBL_18:\n %46 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n br label LBL_20\n LBL_19:\n %47 = add nuw i64 %storemerge7.reload, 1\n %48 = call i32 @strlen(i8* %4)\n %49 = sext i32 %48 to i64\n %50 = icmp ult i64 %47, %49\n store i64 %47, i64* %storemerge7.reg2mem\n br i1 %50, label LBL_17, label LBL_20\n LBL_20:\n call void @free(i64* %1)\n br label LBL_21\n LBL_21:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %0, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_23, label LBL_22\n LBL_22:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_23\n LBL_23:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %4, { 3, 0, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge7.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_20, { 0, 2, 1 }\n uselistorder label LBL_17, { 1, 0 }\n uselistorder label LBL_13, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_modulo_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.01.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp eq i32 %6, 0\n store i32 %6, i32* %sv_0.01.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %8 = urem i32 100, %sv_0.01.reload\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_cpy_03-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = bitcast i64* %1 to i8*\n store i8* %2, i8** %sv_1, align 8\n %3 = icmp eq i64* %1, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i8*, i8** %sv_1, align 8\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strcpy(i8* nonnull %11, i8* %9)\n %13 = call i64 @FUNC(i64* nonnull %sv_0)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_loop_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = ptrtoint i8* %sv_0.0.reload to i64\n %7 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %8 = add i64 %storemerge2.reload, %6\n %9 = add i64 %storemerge2.reload, %7\n %10 = inttoptr i64 %9 to i8*\n %11 = load i8, i8* %10, align 1\n %12 = inttoptr i64 %8 to i8*\n store i8 %11, i8* %12, align 1\n %13 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %14 = add i64 %6, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %6)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i64 %6, { 1, 2, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %.in.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -161\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = bitcast i8** %sv_1 to i64*\n store i64 %3, i64* %5, align 8\n %.cast3 = inttoptr i64 %3 to i8*\n store i8 0, i8* %.cast3, align 16\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = load i8*, i8** %sv_1, align 8\n %8 = ptrtoint i64* %sv_0 to i64\n store i8* %7, i8** %.in.reg2mem\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %.in.reload = load i8*, i8** %.in.reg2mem\n %9 = ptrtoint i8* %.in.reload to i64\n %10 = add i64 %storemerge4.reload, %9\n %11 = add i64 %storemerge4.reload, %8\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = inttoptr i64 %10 to i8*\n store i8 %13, i8* %14, align 1\n %15 = add nuw nsw i64 %storemerge4.reload, 1\n %16 = load i8*, i8** %sv_1, align 8\n %exitcond = icmp eq i64 %15, 100\n store i8* %16, i8** %.in.reg2mem\n store i64 %15, i64* %storemerge4.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %17 = ptrtoint i8* %16 to i64\n %18 = add i64 %17, 99\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = load i8*, i8** %sv_1, align 8\n %21 = ptrtoint i8* %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %1, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %16, { 1, 0 }\n uselistorder i64 %storemerge4.reload, { 0, 2, 1 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i8** %sv_1, { 4, 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i8** %.in.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp ult i32 %3, 2147483647\n br i1 %5, label LBL_2, label LBL_3\n LBL_2:\n %6 = mul i32 %3, 2\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE835_Infinite_Loop__do_01-bad", "fun_name": "CWE835_Infinite_Loop__do_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i32\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_1\n LBL_1:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %0 = zext i32 %sv_0.0.reload to i64\n %1 = call i64 @FUNC(i64 %0)\n %2 = add nsw i32 %sv_0.0.reload, 1\n %3 = srem i32 %2, 256\n %4 = icmp slt i32 %3, 0\n %5 = icmp eq i1 %4, false\n store i32 %3, i32* %sv_0.0.reg2mem\n br i1 %5, label LBL_1, label LBL_2\n LBL_2:\n %6 = zext i32 %3 to i64\n ret i64 %6\n\n uselistorder i32 %3, { 2, 0, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_cpy_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = bitcast i64* %sv_1 to i8*\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @strcpy(i8* nonnull %2, i8* nonnull %5)\n %7 = call i64 @FUNC(i64 %3)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__open_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_2:\n %4 = icmp eq i32 %0, -1\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = call i32 @close(i32 %0)\n br label LBL_4\n LBL_4:\n %6 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gv_2, i64 0, i64 0), i32 66)\n %7 = icmp eq i32 %6, -1\n store i64 -1, i64* %rax.0.reg2mem\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n %8 = call i32 @close(i32 %6)\n %9 = sext i32 %8 to i64\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %5 = call i64* @malloc(i32 11)\n %6 = ptrtoint i64* %5 to i64\n %7 = icmp eq i64* %5, null\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %sv_0.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = add i32 %10, 1\n %12 = inttoptr i64 %sv_0.0.reload to i64*\n %13 = call i64* @memcpy(i64* %12, i64* nonnull %sv_1, i32 %11)\n %14 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %12)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_multiply_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_2:\n %5 = trunc i64 %0 to i32\n %6 = icmp eq i32 %5, 0\n %spec.select = select i1 %6, i32 32, i32 -128\n %7 = trunc i32 %spec.select to i8\n %8 = icmp slt i8 %7, 0\n %9 = icmp eq i1 %8, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = icmp slt i8 %7, -63\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = mul i32 %spec.select, 2\n %12 = and i32 %11, 64\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %15 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_multiply_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = load i32, i32* %sv_0, align 4\n %8 = icmp slt i32 %7, 0\n %9 = icmp eq i1 %8, false\n br i1 %6, label LBL_5, label LBL_1\n LBL_1:\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = icmp slt i32 %7, -1073741823\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = mul i32 %7, 2\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_9\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_9\n LBL_5:\n br i1 %9, label LBL_9, label LBL_6\n LBL_6:\n %15 = icmp slt i32 %7, -1073741823\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n %16 = mul i32 %7, 2\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n br label LBL_9\n LBL_8:\n %19 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_9\n LBL_9:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %9, { 1, 0 }\n uselistorder i32 %7, { 0, 3, 1, 2, 4 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_07-bad", "fun_name": "CWE126_Buffer_Overread__CWE129_connect_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_6, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %26 = icmp slt i32 %sv_0.1.reload, 0\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = sext i32 %sv_0.1.reload to i64\n %28 = mul i64 %27, 4\n %29 = add i64 %0, -64\n %30 = add i64 %29, %28\n %31 = inttoptr i64 %30 to i32*\n %32 = load i32, i32* %31, align 4\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_10\n LBL_9:\n %35 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %1, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memmove_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 8\n %10 = add i64 %9, %8\n %11 = add i64 %10, -816\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 8\n %13 = add i64 %10, -812\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %16 = inttoptr i64 %sv_0.0.reload to i64*\n %17 = call i64* @memmove(i64* %16, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %18 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %16)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 ptrtoint (i32* @gv_1 to i32), { 0, 1, 3, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_17-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -401\n %3 = and i64 %2, -16\n store i32 0, i32* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i32, i32* %storemerge1.reg2mem\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %4 = add nuw nsw i32 %storemerge1.reload, 1\n %exitcond3 = icmp eq i32 %4, 2\n store i64 %3, i64* %sv_0.0.reg2mem\n store i32 %4, i32* %storemerge1.reg2mem\n br i1 %exitcond3, label LBL_2, label LBL_1\n LBL_2:\n %5 = ptrtoint i64* %sv_3 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %6 = mul i64 %storemerge2.reload, 8\n %7 = add i64 %6, %5\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %13 = inttoptr i64 %sv_0.0.reload to i64*\n %14 = call i64* @memcpy(i64* %13, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_0 to i32))\n %15 = call i64 @FUNC(i64 %sv_0.0.reload)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 1, 0 }\n uselistorder i32* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fscanf_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = icmp ugt i32 %6, 9\n br i1 %7, label LBL_5, label LBL_3\n LBL_3:\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = sext i32 %6 to i64\n %10 = mul i64 %9, 4\n %11 = add i64 %8, -48\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i32*\n store i32 1, i32* %13, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 4\n %15 = add i64 %14, %11\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_4\n LBL_5:\n %20 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_6, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_calloc_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @calloc(i32 100, i32 8)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %3 to i32*\n store i32 0, i32* %7, align 4\n %8 = add i64 %4, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 4\n %10 = call i64 @FUNC(i64 %4)\n br label LBL_7\n LBL_4:\n br i1 %6, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = bitcast i64* %3 to i32*\n store i32 0, i32* %11, align 4\n %12 = add i64 %4, 4\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 4\n %14 = call i64 @FUNC(i64 %4)\n br label LBL_7\n LBL_7:\n %15 = call i64 @FUNC()\n call void @free(i64* nonnull %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64 %4, { 2, 3, 0, 1 }\n uselistorder i64* %3, { 1, 0, 2, 3, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_add_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %18 = icmp eq i32 %sv_0.0.reload, -1\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n %19 = add i32 %sv_0.0.reload, 1\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fread_17-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fread_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 @fread(i64* nonnull %sv_0, i32 1, i32 99, %_IO_FILE* %1)\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_18-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64* @memset(i64* %0, i32 65, i32 99)\n %5 = add i64 %3, 99\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %3)\n ret i64 %7\n\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_sleep_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @usleep(i32 20)\n %1 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_0 to i64))\n ret i64 %1\n\n uselistorder i32 (i32)* @usleep, { 3, 0, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_10-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 99)\n %8 = add i64 %3, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n br label LBL_2\n LBL_2:\n %10 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strcat(i8* nonnull %11, i8* %10)\n %13 = call i64 @FUNC(i64 %3)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_memcpy_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = load i64, i64* %sv_1, align 8\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i64, i64* %sv_1, align 8\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %11 = load i64, i64* %sv_0, align 8\n %12 = inttoptr i64 %9 to i64*\n store i64 %11, i64* %12, align 8\n %13 = add i64 %9, 8\n %14 = inttoptr i64 %13 to i64*\n %15 = add i64 %9, 16\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %9, 24\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %9, 32\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %9, 40\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %9, 48\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %9, 56\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %9, 64\n %28 = inttoptr i64 %27 to i64*\n %29 = add i64 %9, 72\n %30 = inttoptr i64 %29 to i64*\n %31 = add i64 %9, 80\n %32 = inttoptr i64 %31 to i64*\n %33 = add i64 %9, 88\n %34 = inttoptr i64 %33 to i64*\n %35 = add i64 %9, 96\n %36 = inttoptr i64 %35 to i32*\n %37 = add i64 %9, 99\n %38 = inttoptr i64 %37 to i8*\n store i8 0, i8* %38, align 1\n %39 = call i64 @FUNC(i64 %9)\n %40 = call i64 @FUNC(i64 40)\n %41 = icmp eq i64 %1, %40\n store i64 0, i64* %rax.0.reg2mem\n br i1 %41, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %9, { 0, 1, 14, 6, 13, 3, 12, 11, 10, 9, 8, 7, 5, 4, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_17-bad", "fun_name": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_1, align 8\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_9, label LBL_2\n LBL_2:\n %9 = bitcast i64* %sv_0 to %sockaddr*\n %10 = call i32 @bind(i32 %3, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_10, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %3, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_10, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = sub i32 99, %2\n %16 = sext i32 %2 to i64\n %17 = add i64 %16, %14\n %18 = inttoptr i64 %17 to i64*\n %19 = call i32 @recv(i32 %7, i64* %18, i32 %15, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = ptrtoint i64* %sv_2 to i64\n %23 = add i64 %22, -112\n %24 = sext i32 %19 to i64\n %25 = add i64 %23, %24\n %26 = inttoptr i64 %25 to i8*\n store i8 0, i8* %26, align 1\n %27 = call i8* @strchr(i8* nonnull %1, i32 13)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %27, align 1\n br label LBL_7\n LBL_7:\n %29 = call i8* @strchr(i8* nonnull %1, i32 10)\n %30 = icmp eq i8* %29, null\n br i1 %30, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %29, align 1\n br label LBL_10\n LBL_9:\n %31 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %3)\n %33 = call i32 @close(i32 %7)\n br label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64* nonnull %sv_1)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 0, 4, 1, 2, 3, 5 }\n uselistorder i32 %2, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 3, 1 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 0, 1, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_10, { 2, 1, 0, 4, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.2.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n store i32 -1, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_11, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_11\n LBL_6:\n store i32 -1, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_11, label LBL_7\n LBL_7:\n %23 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %24 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %25 = call i16 @htons(i16 27015)\n %26 = bitcast i64* %sv_2 to %sockaddr*\n %27 = call i32 @connect(i32 %5, %sockaddr* nonnull %26, i32 16)\n %28 = icmp eq i32 %27, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n %29 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %30 = add i32 %29, 1\n %31 = icmp ult i32 %30, 2\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %31, label LBL_10, label LBL_9\n LBL_9:\n %32 = sext i32 %29 to i64\n %33 = add i64 %0, -22\n %34 = add i64 %33, %32\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n %36 = bitcast i64* %sv_1 to i8*\n %37 = call i32 @atoi(i8* nonnull %36)\n store i32 %37, i32* %sv_0.1.ph.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %38 = call i32 @close(i32 %5)\n store i32 %sv_0.1.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.2.reload = load i32, i32* %sv_0.2.reg2mem\n %39 = call i64 @FUNC()\n %40 = trunc i64 %39 to i32\n %41 = icmp eq i32 %40, 0\n %42 = icmp eq i32 %sv_0.2.reload, 0\n br i1 %41, label LBL_15, label LBL_12\n LBL_12:\n br i1 %42, label LBL_14, label LBL_13\n LBL_13:\n %43 = udiv i32 100, %sv_0.2.reload\n %44 = zext i32 %43 to i64\n %45 = call i64 @FUNC(i64 %44)\n br label LBL_18\n LBL_14:\n %46 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_18\n LBL_15:\n br i1 %42, label LBL_17, label LBL_16\n LBL_16:\n %47 = udiv i32 100, %sv_0.2.reload\n %48 = zext i32 %47 to i64\n %49 = call i64 @FUNC(i64 %48)\n br label LBL_18\n LBL_17:\n %50 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_18\n LBL_18:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %1, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_20, label LBL_19\n LBL_19:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_20\n LBL_20:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %42, { 1, 0 }\n uselistorder i32 %sv_0.2.reload, { 1, 0, 2 }\n uselistorder i32 %29, { 1, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i1 %6, { 1, 0 }\n uselistorder i32 %5, { 5, 3, 4, 2, 0, 1, 6 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 0, 4, 1, 2, 5, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.2.reg2mem, { 0, 4, 1, 3, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 2, 6, 0, 5, 4, 8, 1, 7 }\n uselistorder label LBL_11, { 2, 0, 3, 1 }\n uselistorder label LBL_10, { 1, 2, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memcpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64* %4, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = load i64, i64* %sv_0.0.reload, align 8\n store i64 %12, i64* %sv_1, align 8\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %3 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 99)\n %4 = add i64 %0, -13\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64 @FUNC(i64* nonnull %sv_1)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %1, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_no_init_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n %7 = trunc i64 %indvars.iv5.reload to i32\n store i32 %7, i32* %6, align 4\n %8 = add i64 %5, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 %7, i32* %9, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %10 = mul i64 %indvars.iv.reload, 8\n %11 = add i64 %10, %1\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = add i64 %11, 4\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %20\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memmove_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %2, align 8\n store i64 4702111234474983745, i64* %sv_0, align 8\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = add i32 %4, 1\n %6 = call i64* @memmove(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %5)\n %7 = call i64 @FUNC(i64 %1)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_preinc_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = load i32, i32* @gv_3, align 4\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i64, i64* %sv_0, align 8\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, 2147483647\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = mul i64 %8, 4294967296\n %sext = add i64 %11, 4294967296\n %12 = ashr exact i64 %sext, 32\n store i64 %12, i64* %sv_0, align 8\n %13 = and i64 %12, 4294967295\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_7\n LBL_6:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_5 to i64))\n br label LBL_7\n LBL_7:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_rand_postinc_17-bad", "fun_name": "CWE190_Integer_Overflow__int_rand_postinc_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = mul i32 %1, 1073741824\n %7 = mul i32 %2, 32768\n %8 = xor i32 %7, %6\n %9 = xor i32 %8, %3\n %10 = sext i1 %5 to i32\n %storemerge3.in.le = xor i32 %9, %10\n %11 = add i32 %storemerge3.in.le, 1\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n ret i64 %13\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE843_Type_Confusion__char_12-bad", "fun_name": "CWE843_Type_Confusion__char_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 4\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %. = select i1 %3, i8 8, i8 97\n store i8 %., i8* %sv_0, align 4\n %storemerge = bitcast i8* %sv_0 to i32*\n %4 = load i32, i32* %storemerge, align 4\n %5 = zext i32 %4 to i64\n %6 = call i64 @FUNC(i64 %5)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memmove_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 0\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %7 = and i64 %6, -16\n %sv_2.0 = select i1 %4, i64 %1, i64 %7\n %8 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = inttoptr i64 %sv_2.0 to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_2 to i32))\n %11 = load i64, i64* %9, align 8\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %2, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_05-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_2 to i64\n %4 = add i64 %3, -49\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 16\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_1, i32 100)\n %10 = add i64 %sv_0.0.reload, 99\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = call i64 @FUNC(i64 %sv_0.0.reload)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_ncpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = load i8*, i8** %sv_1, align 8\n %12 = ptrtoint i8* %11 to i64\n %13 = bitcast i8** %sv_2 to i64*\n store i64 %12, i64* %13, align 8\n br label LBL_2\n LBL_2:\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i32 @strlen(i8* nonnull %15)\n %17 = load i8*, i8** %sv_2, align 8\n %18 = call i8* @strncpy(i8* nonnull %15, i8* %17, i32 %16)\n %19 = ptrtoint i64* %sv_0 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 2, 0, 1 }\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_alloca_partial_init_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.24.reg2mem = alloca i128\n %indvars.iv8.reg2mem = alloca i64\n %xmm0.1.reg2mem = alloca i128\n %xmm0.06.reg2mem = alloca i128\n %indvars.iv11.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv11.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %xmm0.06.reload = load i128, i128* %xmm0.06.reg2mem\n %indvars.iv11.reload = load i64, i64* %indvars.iv11.reg2mem\n %6 = mul i64 %indvars.iv11.reload, 8\n %7 = add i64 %6, %3\n %8 = call i128 @FUNC(i128 %xmm0.06.reload, i128 %xmm0.06.reload)\n %9 = trunc i64 %indvars.iv11.reload to i32\n %10 = call i128 @FUNC(i32 %9)\n %11 = call i64 @FUNC(i128 %10)\n %12 = inttoptr i64 %7 to i64*\n store i64 %11, i64* %12, align 8\n %indvars.iv.next12 = add nuw nsw i64 %indvars.iv11.reload, 1\n %exitcond13 = icmp eq i64 %indvars.iv.next12, 5\n store i64 %indvars.iv.next12, i64* %indvars.iv11.reg2mem\n store i128 %10, i128* %xmm0.06.reg2mem\n store i128 %10, i128* %xmm0.1.reg2mem\n br i1 %exitcond13, label LBL_2, label LBL_1\n LBL_2:\n %xmm0.1.reload = load i128, i128* %xmm0.1.reg2mem\n %13 = load i32, i32* @gv_1, align 4\n %14 = icmp eq i32 %13, 0\n store i64 0, i64* %indvars.iv8.reg2mem\n store i128 %xmm0.1.reload, i128* %xmm0.24.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_4:\n %xmm0.24.reload = load i128, i128* %xmm0.24.reg2mem\n %indvars.iv8.reload = load i64, i64* %indvars.iv8.reg2mem\n %16 = mul i64 %indvars.iv8.reload, 8\n %17 = add i64 %16, %3\n %18 = call i128 @FUNC(i128 %xmm0.24.reload, i128 %xmm0.24.reload)\n %19 = trunc i64 %indvars.iv8.reload to i32\n %20 = call i128 @FUNC(i32 %19)\n %21 = call i64 @FUNC(i128 %20)\n %22 = inttoptr i64 %17 to i64*\n store i64 %21, i64* %22, align 8\n %indvars.iv.next9 = add nuw nsw i64 %indvars.iv8.reload, 1\n %exitcond10 = icmp eq i64 %indvars.iv.next9, 10\n store i64 %indvars.iv.next9, i64* %indvars.iv8.reg2mem\n store i128 %20, i128* %xmm0.24.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond10, label LBL_5, label LBL_4\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %23 = mul i64 %indvars.iv.reload, 8\n %24 = add i64 %23, %3\n %25 = inttoptr i64 %24 to i64*\n %26 = load i64, i64* %25, align 8\n %27 = call i128 @FUNC(i64 %26)\n %28 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %1, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.24.reload, { 1, 0 }\n uselistorder i128 %xmm0.06.reload, { 1, 0 }\n uselistorder i64* %indvars.iv11.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.06.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv8.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.24.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_ncpy_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, 49\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n store i64 0, i64* %sv_0, align 8\n %6 = call i32 @strlen(i8* nonnull %1)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i8* @strncpy(i8* nonnull %7, i8* nonnull %1, i32 %6)\n %9 = call i64 @FUNC(i64 %3)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %1, { 1, 0 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_sub_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 4294967293)\n ret i64 %0\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_init_variable_char_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %3, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64 @FUNC(i64 67)\n store i64 %4, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_14-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__struct_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %2 = load i32, i32* %0\n %3 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %4 = zext i32 %3 to i64\n %5 = icmp eq i32 %3, 5\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = zext i32 %2 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = zext i32 %1 to i64\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_loop_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = ptrtoint i64* %1 to i64\n %6 = add i64 %4, -816\n %7 = add i64 %4, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %8 = mul i64 %storemerge13.reload, 8\n %9 = add i64 %8, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 8\n %11 = add i64 %7, %8\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge13.reg2mem\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %exitcond4, label LBL_4, label LBL_3\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %14 = mul i64 %storemerge2.reload, 8\n %15 = add i64 %14, %5\n %16 = add i64 %14, %6\n %17 = inttoptr i64 %16 to i64*\n %18 = load i64, i64* %17, align 8\n %19 = inttoptr i64 %15 to i64*\n store i64 %18, i64* %19, align 8\n %20 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %20, 100\n store i64 %20, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %21 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %14, { 1, 0 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64 100, { 1, 0, 3, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_sub_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = add i32 %sv_0.1.reload, -1\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_10\n LBL_9:\n %30 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_modulo_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_2, align 4\n %11 = icmp eq i32 %10, 5\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_9\n LBL_6:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %13, label LBL_8, label LBL_7\n LBL_7:\n %14 = urem i32 100, %sv_0.0.reload\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_9\n LBL_8:\n %17 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_4 to i64))\n br label LBL_9\n LBL_9:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 1)\n %3 = call i64 @FUNC(i64 2)\n ret i64 %3\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_listen_socket_08-bad", "fun_name": "CWE124_Buffer_Underwrite__CWE839_listen_socket_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_14, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %31 = icmp sgt i32 %sv_0.1.reload, 9\n br i1 %31, label LBL_13, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %33, %34\n %36 = inttoptr i64 %35 to i32*\n store i32 1, i32* %36, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_12\n LBL_12:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %37 = mul i64 %indvars.iv.reload, 4\n %38 = add i64 %37, %34\n %39 = inttoptr i64 %38 to i32*\n %40 = load i32, i32* %39, align 4\n %41 = zext i32 %40 to i64\n %42 = call i64 @FUNC(i64 %41)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_14, label LBL_12\n LBL_13:\n %43 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_14\n LBL_14:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %1, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_14, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__malloc_realloc_int64_t_14-bad", "fun_name": "CWE401_Memory_Leak__malloc_realloc_int64_t_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %4, align 8\n %7 = call i64 @FUNC(i64 5)\n %8 = call i64* @realloc(i64* %4, i32 1040000)\n %9 = ptrtoint i64* %8 to i64\n %10 = icmp eq i64* %8, null\n store i64 %9, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n store i64 10, i64* %8, align 8\n %11 = call i64 @FUNC(i64 10)\n call void @free(i64* nonnull %8)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_realloc_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 5, i64* %0, align 8\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_partial_init_07-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_partial_init_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %indvars.iv4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -33\n %3 = and i64 %2, -16\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv4.reg2mem\n store i32 %4, i32* %.reg2mem\n br i1 %6, label LBL_3, label LBL_1\n LBL_1:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %7 = mul i64 %indvars.iv4.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv4.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 5\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n br i1 %exitcond6, label LBL_2, label LBL_1\n LBL_2:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_3\n LBL_3:\n %.reload = load i32, i32* %.reg2mem\n %11 = icmp eq i32 %.reload, 5\n %12 = icmp eq i1 %11, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 4\n %14 = add i64 %13, %3\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.056.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.056.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.056.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, 0\n store i32 %19, i32* %sv_0.056.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.056.reload = load i32, i32* %sv_0.056.reg2mem\n %22 = urem i32 100, %sv_0.056.reload\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.056.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 2, 0, 3 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_memmove_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %1, i64 0, i64 100)\n %2 = call i64* @memmove(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %3 = load i64, i64* %sv_1, align 8\n %4 = call i64 @FUNC(i64 %3)\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_ncat_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -161\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strncat(i8* %sv_0.0.reload, i8* nonnull %9, i32 100)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__negative_malloc_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %spec.select = select i1 %2, i32 0, i32 99\n %3 = call i64* @malloc(i32 %spec.select)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %spec.select, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = zext i32 %spec.select to i64\n %10 = add i64 %6, -1\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_snprintf_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 49)\n %6 = add i64 %3, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %3, i64* %sv_1, align 8\n store i64 0, i64* %sv_0, align 8\n %8 = inttoptr i64 %3 to i8*\n %9 = call i32 @strlen(i8* %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %10, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i8* %8)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 4, 3, 2, 5 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 0, i64* %sv_1, align 8\n %2 = add i64 %1, -816\n %3 = add i64 %1, -812\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %2, %4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 8\n %7 = load i64, i64* %sv_1, align 8\n %8 = mul i64 %7, 8\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = load i64, i64* %sv_1, align 8\n %12 = add i64 %11, 1\n store i64 %12, i64* %sv_1, align 8\n %13 = icmp ult i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %13, label LBL_1, label LBL_2\n LBL_2:\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %14, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %16 = and i64 %15, -16\n %17 = inttoptr i64 %16 to i64*\n %18 = call i64* @memcpy(i64* %17, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %19 = call i64 @FUNC(i64 %16)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 1, 0 }\n uselistorder i64 %12, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 4, 1, 2, 3, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 11)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = sext i32 %9 to i64\n %11 = add nsw i64 %10, 1\n %12 = icmp eq i64 %11, 0\n br i1 %12, label LBL_7, label LBL_5\n LBL_5:\n %13 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_6\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %sv_0.0.reload\n %15 = add i64 %storemerge1.reload, %13\n %16 = inttoptr i64 %15 to i8*\n %17 = load i8, i8* %16, align 1\n %18 = inttoptr i64 %14 to i8*\n store i8 %17, i8* %18, align 1\n %19 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %19, %11\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %20 = call i64 @FUNC(i64 %sv_0.0.reload)\n %21 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %21)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_06-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i8*\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strncpy(i8* nonnull %10, i8* %4, i32 %9)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64 %3, { 0, 2, 1, 3, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_int64_t_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %storemerge1.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i64*\n store i64 5, i64* %9, align 8\n %10 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %10, 100\n store i64 %10, i64* %storemerge1.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %14 = load i64, i64* %sv_0.0.reload, align 8\n %15 = call i64 @FUNC(i64 %14)\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 0, 3, 1, 2, 4 }\n uselistorder i64* null, { 2, 0, 3, 1, 4, 5 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_07-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv5.reg2mem\n store i32 %4, i32* %.reg2mem\n br i1 %6, label LBL_5, label LBL_3\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %7 = mul i64 %indvars.iv5.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv5.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 5\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i32, i32* %.reg2mem\n %11 = zext i32 %.reload to i64\n %12 = icmp eq i32 %.reload, 5\n %13 = icmp eq i1 %12, false\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 %11, i64* %rax.1.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 4\n %15 = add i64 %14, %3\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %19, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_predec_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n %10 = load i64, i64* %sv_0, align 8\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, -2147483648\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = mul i64 %10, 4294967296\n %sext = add i64 %13, -4294967296\n %14 = ashr exact i64 %sext, 32\n store i64 %14, i64* %sv_0, align 8\n %15 = and i64 %14, 4294967295\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_7\n LBL_6:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_sub_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %12 = ashr exact i32 %sext, 16\n store i32 %12, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %13 = load i32, i32* @gv_0, align 4\n %14 = icmp eq i32 %13, 5\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %16 = trunc i32 %sv_0.0.reload to i16\n %17 = icmp eq i16 %16, -32768\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n %18 = mul i32 %sv_0.0.reload, 65536\n %sext2 = add i32 %18, -65536\n %19 = ashr exact i32 %sext2, 16\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE188_Reliance_on_Data_Memory_Layout__modify_local_14-bad", "fun_name": "CWE188_Reliance_on_Data_Memory_Layout__modify_local_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n store i32 1, i32* %sv_0, align 4\n %6 = ptrtoint i32* %sv_0 to i64\n %7 = add i64 %6, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 5, i32* %8, align 4\n %9 = load i32, i32* %sv_0, align 4\n %sext = mul i32 %9, 16777216\n %10 = ashr exact i32 %sext, 24\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = zext i32 %1 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_2\n LBL_2:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %2, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memcpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %10 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %11 = load i64, i64* %sv_0.0.reload, align 8\n store i64 %11, i64* %sv_1, align 8\n %12 = ptrtoint i64* %sv_1 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int64_t_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 5)\n ret i64 %2\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_calloc_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 4)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = call i32 @fclose(%_IO_FILE* %0)\n %2 = sext i32 %1 to i64\n ret i64 %2\n\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = call i32 @close(i32 %0)\n ret i64 0\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memmove_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n %8 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %7, i64 %1, i64 %8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 @strlen(i8* nonnull %10)\n %12 = inttoptr i64 %spec.select to i64*\n %13 = call i64* @memmove(i64* nonnull %sv_0, i64* %12, i32 %11)\n %14 = ptrtoint i64* %sv_0 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %2, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 5, 3, 4, 2, 1, 0, 6 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_07-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 8\n %10 = add i64 %9, %8\n %11 = add i64 %10, -816\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 8\n %13 = add i64 %10, -812\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %16 = inttoptr i64 %sv_0.0.reload to i64*\n %17 = call i64* @memcpy(i64* %16, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %18 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %16)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_loop_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_2 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n %6 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %7, i64 0, i64 100)\n %8 = add i64 %2, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 8\n %10 = add i64 %9, %spec.select\n %11 = add i64 %8, %9\n %12 = inttoptr i64 %11 to i64*\n %13 = load i64, i64* %12, align 8\n %14 = inttoptr i64 %10 to i64*\n store i64 %13, i64* %14, align 8\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %16 = inttoptr i64 %spec.select to i64*\n %17 = load i64, i64* %16, align 8\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %3, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %spec.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 100, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_0.LBL_3_crit_edge, label LBL_2\n LBL_1:\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %9)\n %11 = call i64 @FUNC(i64 %.pre-phi.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 4, 2, 3, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__rand_strncpy_04-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__rand_strncpy_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = call i32 @rand()\n %8 = xor i32 %7, %6\n %9 = sext i1 %3 to i32\n %storemerge.in = xor i32 %8, %9\n store i64 0, i64* %sv_1, align 8\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %11 = trunc i32 %storemerge.in to i16\n %12 = icmp sgt i16 %11, 99\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n %sext = mul i32 %storemerge.in, 65536\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = bitcast i64* %sv_1 to i8*\n %15 = bitcast i64* %sv_0 to i8*\n %16 = ashr exact i32 %sext, 16\n %17 = call i8* @strncpy(i8* nonnull %14, i8* nonnull %15, i32 %16)\n %18 = sext i32 %16 to i64\n %19 = add i64 %13, -128\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n br label LBL_2\n LBL_2:\n %22 = call i64 @FUNC(i64* nonnull %sv_1)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_square_01-bad", "fun_name": "CWE190_Integer_Overflow__short_rand_square_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = mul i32 %4, 32768\n %6 = call i32 @rand()\n %7 = xor i32 %6, %5\n %8 = sext i1 %2 to i32\n %storemerge.in = xor i32 %7, %8\n %9 = urem i32 %storemerge.in, 65536\n %10 = mul i32 %storemerge.in, 65536\n %sext = mul i32 %10, %9\n %11 = ashr exact i32 %sext, 16\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n ret i64 %13\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncat_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %2, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strncat(i8* nonnull %2, i8* nonnull %4, i32 100)\n %6 = call i64 @FUNC(i64 %1)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %3 = add i64 %2, 8\n %4 = inttoptr i64 %3 to i64*\n store i64 32777976880262761, i64* %4, align 8\n store i64 0, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %5, i32 99, i8* nonnull %1)\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 2, 0, 3, 4 }\n uselistorder i32 99, { 0, 1, 3, 2, 5, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_10\n LBL_10:\n %29 = load i32, i32* @gv_1, align 4\n %30 = icmp eq i32 %29, 5\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_17, label LBL_11\n LBL_11:\n %32 = call i32 @strlen(i8* nonnull %4)\n %33 = icmp eq i32 %32, 0\n br i1 %33, label LBL_16, label LBL_12\n LBL_12:\n %34 = ptrtoint i64* %1 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_13\n LBL_13:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %35 = add i64 %storemerge4.reload, %34\n %36 = inttoptr i64 %35 to i8*\n %37 = load i8, i8* %36, align 1\n %38 = icmp eq i8 %37, 83\n %39 = icmp eq i1 %38, false\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n %40 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n br label LBL_16\n LBL_15:\n %41 = add nuw i64 %storemerge4.reload, 1\n %42 = call i32 @strlen(i8* %4)\n %43 = sext i32 %42 to i64\n %44 = icmp ult i64 %41, %43\n store i64 %41, i64* %storemerge4.reg2mem\n br i1 %44, label LBL_13, label LBL_16\n LBL_16:\n call void @free(i64* %1)\n br label LBL_17\n LBL_17:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_19, label LBL_18\n LBL_18:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_19\n LBL_19:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 3, 0, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 2, 0, 5, 3, 1, 4, 6 }\n uselistorder i32 -1, { 2, 0, 3, 4, 1, 5 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_16, { 0, 2, 1 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_modulo_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 7\n %6 = urem i32 100, %spec.select\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 7, { 1, 0 }\n uselistorder i32 -1, { 5, 0, 1, 2, 3, 4 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_realloc_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 20)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i16*\n store i16 25978, i16* %7, align 2\n %8 = add i64 %5, 10\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_34-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 49)\n %6 = add i64 %3, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = inttoptr i64 %3 to i8*\n store i8* %8, i8** %sv_1, align 8\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %8)\n %10 = call i64* @memcpy(i64* nonnull %sv_0, i64* %4, i32 %9)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1 }\n uselistorder i8** %sv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 25, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -48\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @strtoul(i8* nonnull %20, i8** null, i32 0)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_12, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sv_0.1.off = add i32 %sv_0.1.reload, -6\n %26 = icmp ult i32 %sv_0.1.off, 94\n br i1 %26, label LBL_8, label LBL_11\n LBL_8:\n %27 = call i64* @malloc(i32 %sv_0.1.reload)\n %28 = icmp eq i64* %27, null\n %29 = icmp eq i1 %28, false\n br i1 %29, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %30 = ptrtoint i64* %27 to i64\n %31 = bitcast i64* %27 to i32*\n store i32 1819043176, i32* %31, align 4\n %32 = add i64 %30, 4\n %33 = inttoptr i64 %32 to i16*\n store i16 111, i16* %33, align 2\n %34 = call i64 @FUNC(i64 %30)\n call void @free(i64* %27)\n br label LBL_12\n LBL_11:\n %35 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_1 to i64))\n br label LBL_12\n LBL_12:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %27, { 0, 1, 3, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*, i8**, i32)* @strtoul, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_snprintf_14-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_snprintf_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %sv_0.0.reload, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %12)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_multiply_12-bad", "fun_name": "CWE191_Integer_Underflow__int_fscanf_multiply_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_3\n LBL_2:\n store i32 -2, i32* %sv_0, align 4\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = load i32, i32* %sv_0, align 4\n %10 = icmp slt i32 %9, 0\n %11 = icmp eq i1 %10, false\n br i1 %8, label LBL_6, label LBL_4\n LBL_4:\n br i1 %11, label LBL_10, label LBL_5\n LBL_5:\n %12 = mul i32 %9, 2\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_10\n LBL_6:\n br i1 %11, label LBL_10, label LBL_7\n LBL_7:\n %15 = icmp slt i32 %9, -1073741823\n br i1 %15, label LBL_9, label LBL_8\n LBL_8:\n %16 = mul i32 %9, 2\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n br label LBL_10\n LBL_9:\n %19 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %11, { 1, 0 }\n uselistorder i32 %9, { 0, 2, 1, 3 }\n uselistorder i32* %sv_0, { 1, 2, 0, 3 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_for_loop_07-bad", "fun_name": "CWE400_Resource_Exhaustion__rand_for_loop_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64 -1, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge1.in = xor i32 %12, %13\n %phitmp = sext i32 %storemerge1.in to i64\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64 %phitmp, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %14 = zext i32 %.reload to i64\n %15 = icmp eq i32 %.reload, 5\n %16 = icmp eq i1 %15, false\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %17 = icmp eq i64 %sv_0.0.reload, 0\n store i64 0, i64* %storemerge2.reg2mem\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %18 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n %19 = add nuw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %19, %sv_0.0.reload\n store i64 %19, i64* %storemerge2.reg2mem\n store i64 %sv_0.0.reload, i64* %rax.0.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_memmove_01-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_memmove_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = load i64, i64* %sv_1, align 8\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i64, i64* %sv_1, align 8\n %10 = add i64 %9, -8\n %11 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %12 = inttoptr i64 %10 to i64*\n %13 = call i64* @memmove(i64* nonnull %sv_0, i64* %12, i32 100)\n %14 = call i64 @FUNC(i64* nonnull %sv_0)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %8 = inttoptr i64 %3 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %3, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n br label LBL_3\n LBL_3:\n %12 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i8* @strcat(i8* nonnull %13, i8* %12)\n %15 = call i64 @FUNC(i64 %3)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 3, 0, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_add_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp eq i32 %sv_0.1.reload, 2147483647\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = add i32 %sv_0.1.reload, 1\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_10\n LBL_9:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fscanf_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n store i64 5, i64* %rax.1.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gv_2, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_3, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_2\n LBL_2:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %rax.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_src_char_cpy_05-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_src_char_cpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %6 = call i64* @memset(i64* %1, i32 65, i32 99)\n %7 = ptrtoint i64* %1 to i64\n %8 = add i64 %7, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 %7, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %10 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strcpy(i8* nonnull %11, i8* %10)\n %13 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 5, 2, 3, 0, 4 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_postinc_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i8, i8* %sv_0, align 1\n %7 = icmp eq i8 %6, 127\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i8 %6, 1\n store i8 %8, i8* %sv_0, align 1\n %9 = sext i8 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_5\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 2, 0, 3 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memcpy_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %8 = call i64* @memset(i64* %1, i32 65, i32 49)\n %9 = ptrtoint i64* %1 to i64\n %10 = add i64 %9, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n store i64 %9, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %12 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %13 = call i32 @strlen(i8* %12)\n %14 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %13)\n %15 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 3, 4, 6, 1, 2, 0, 5 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_14-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = add i64 %8, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = mul i64 %storemerge1.reload, 8\n %12 = add i64 %11, %sv_0.0.reload\n %13 = add i64 %10, %11\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = inttoptr i64 %12 to i64*\n store i64 %15, i64* %16, align 8\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %18 = inttoptr i64 %sv_0.0.reload to i64*\n %19 = load i64, i64* %18, align 8\n %20 = call i64 @FUNC(i64 %19)\n call void @free(i64* %18)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__negative_strncpy_12-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__negative_strncpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %. = select i1 %3, i32 99, i32 -1\n store i64 0, i64* %sv_1, align 8\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %5 = trunc i32 %. to i16\n %6 = icmp sgt i16 %5, 99\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = ptrtoint i64* %sv_2 to i64\n %8 = bitcast i64* %sv_1 to i8*\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strncpy(i8* nonnull %8, i8* nonnull %9, i32 %.)\n %11 = sext i32 %. to i64\n %12 = add i64 %7, -112\n %13 = add i64 %12, %11\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n br label LBL_2\n LBL_2:\n %15 = call i64 @FUNC(i64* nonnull %sv_1)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %., { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_multiply_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = call i64 @FUNC(i64 4)\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 5, 1, 4, 0, 3, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 4294967292)\n ret i64 %2\n\n uselistorder i64 (i64)* @printHexCharLine, { 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_sscanf_08-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_sscanf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_1, i64 0, i64 0))\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 100)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = ptrtoint i64* %2 to i64\n %6 = call i64* @memset(i64* %2, i32 65, i32 99)\n %7 = add i64 %5, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_no_init_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = call i64 @FUNC()\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %5, label LBL_3, label LBL_1\n LBL_1:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %6 = mul i64 %indvars.iv5.reload, 4\n %7 = add i64 %6, %1\n %8 = inttoptr i64 %7 to i32*\n %9 = trunc i64 %indvars.iv5.reload to i32\n store i32 %9, i32* %8, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_2, label LBL_1\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %10 = mul i64 %indvars.iv.reload, 4\n %11 = add i64 %10, %1\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_loop_08-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_loop_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = add i64 %2, -816\n %7 = add i64 %2, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %8 = mul i64 %storemerge13.reload, 8\n %9 = add i64 %8, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 8\n %11 = add i64 %7, %8\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge13.reg2mem\n br i1 %exitcond4, label LBL_2, label LBL_1\n LBL_2:\n %14 = ptrtoint i64* %sv_0 to i64\n %15 = icmp eq i32 %5, 0\n %spec.select = select i1 %15, i64 %1, i64 %14\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = mul i64 %storemerge2.reload, 8\n %17 = add i64 %16, %spec.select\n %18 = add i64 %16, %6\n %19 = inttoptr i64 %18 to i64*\n %20 = load i64, i64* %19, align 8\n %21 = inttoptr i64 %17 to i64*\n store i64 %20, i64* %21, align 8\n %22 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %22, 100\n store i64 %22, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %23 = call i64 @FUNC(i64 %spec.select)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %3, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 1, 0 }\n uselistorder i64 %spec.select, { 1, 0 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64 100, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_07-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n %.pre3 = load i32, i32* %sv_0, align 4\n %6 = icmp eq i32 %.pre, 5\n %7 = icmp eq i1 %6, false\n %8 = icmp eq i32 %.pre3, 0\n %or.cond = or i1 %7, %8\n br i1 %or.cond, label LBL_3, label LBL_2\n LBL_2:\n %9 = mul i32 %.pre3, 2\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %6, i32 99)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %8)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_7, label LBL_1\n LBL_1:\n %spec.store.select = select i1 %1, i64 -4, i64 28\n %2 = call i64* @malloc(i32 40)\n %3 = ptrtoint i64* %2 to i64\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %6 = mul i64 %indvars.iv5.reload, 4\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %9 = add i64 %spec.store.select, %3\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i1 %1, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 4, 5 }\n uselistorder void (i32)* @exit, { 0, 3, 2, 1, 4 }\n uselistorder i32 -1, { 1, 2, 0, 3, 4 }\n uselistorder i64* (i32)* @malloc, { 0, 2, 1, 3, 4 }\n uselistorder i32* @gv_0, { 2, 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_malloc_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %2, align 8\n %5 = call i64 @FUNC(i64 5)\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n call void @free(i64* nonnull %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 1, 2, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_preinc_10-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_preinc_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = mul i64 %6, 4294967296\n %sext = add i64 %7, 4294967296\n %8 = ashr exact i64 %sext, 32\n store i64 %8, i64* %sv_0, align 8\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_postdec_08-bad", "fun_name": "CWE191_Integer_Underflow__unsigned_int_fscanf_postdec_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = add i32 %9, -1\n store i32 %10, i32* %sv_0, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_pointer_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = ptrtoint i64* %0 to i64\n %5 = add i64 %4, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 6, i32* %6, align 4\n %7 = load i32, i32* %3, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = load i32, i32* %6, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n ret i64 %12\n\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_fscanf_13-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_fscanf_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8344 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_static_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %3 to i64\n %8 = call i64* @memset(i64* %3, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n %12 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %12)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_fprintf_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = sext i32 %2 to i64\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = add i64 %14, %15\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n %32 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %33 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 4, 0 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_sub_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = mul i32 %4, 1073741824\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = xor i32 %7, %5\n %9 = call i32 @rand()\n %10 = xor i32 %8, %9\n %11 = sext i1 %3 to i32\n %storemerge2.in = xor i32 %10, %11\n %12 = call i64 @FUNC()\n %13 = trunc i64 %12 to i32\n %14 = icmp eq i32 %13, 0\n %15 = icmp eq i32 %storemerge2.in, -2147483648\n br i1 %14, label LBL_4, label LBL_1\n LBL_1:\n br i1 %15, label LBL_3, label LBL_2\n LBL_2:\n %16 = add i32 %storemerge2.in, -1\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_3:\n %19 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n %20 = add i32 %storemerge2.in, -1\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %23 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %15, { 1, 0 }\n uselistorder i32 %storemerge2.in, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_postdec_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n %7 = urem i32 %2, 2\n %8 = icmp eq i32 %7, 0\n %9 = mul i32 %3, 1073741824\n %10 = mul i32 %4, 32768\n %11 = xor i32 %10, %9\n %12 = xor i32 %11, %5\n %13 = sext i1 %8 to i32\n %storemerge.in = xor i32 %12, %13\n %14 = icmp eq i32 %storemerge.in, -2147483648\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = add i32 %storemerge.in, -1\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_17-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = ptrtoint i64* %1 to i64\n %6 = add i64 %5, 99\n %7 = inttoptr i64 %6 to i8*\n %8 = call i64* @memset(i64* %1, i32 65, i32 99)\n store i8 0, i8* %7, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* %1, i32 %9)\n %11 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 2, 3, 1, 0, 5, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_listenSocket_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n store i32 %5, i32* %sv_0.1.reg2mem\n br i1 %8, label LBL_9, label LBL_1\n LBL_1:\n %9 = call i32 @socket(i32 2, i32 1, i32 6)\n %10 = icmp eq i32 %9, -1\n store i32 %5, i32* %sv_0.1.reg2mem\n br i1 %10, label LBL_9, label LBL_2\n LBL_2:\n %11 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %12 = call i16 @htons(i16 27015)\n %13 = bitcast i64* %sv_2 to %sockaddr*\n %14 = call i32 @bind(i32 %9, %sockaddr* nonnull %13, i32 16)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_3\n LBL_3:\n %16 = call i32 @listen(i32 %9, i32 5)\n %17 = icmp eq i32 %16, -1\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = call i32 @accept(i32 %9, %sockaddr* null, i32* null)\n %19 = icmp eq i32 %18, -1\n br i1 %19, label LBL_7, label LBL_5\n LBL_5:\n %20 = call i32 @recv(i32 %18, i64* nonnull %sv_1, i32 19, i32 0)\n %21 = add i32 %20, 1\n %22 = icmp ult i32 %21, 2\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %22, label LBL_8, label LBL_6\n LBL_6:\n %23 = ptrtoint i64* %sv_3 to i64\n %24 = sext i32 %20 to i64\n %25 = add i64 %23, -32\n %26 = add i64 %25, %24\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = bitcast i64* %sv_1 to i8*\n %29 = call double @atof(i8* nonnull %28)\n %30 = fptrunc double %29 to float\n %31 = bitcast float %30 to i32\n %32 = sext i32 %31 to i128\n %33 = call i128 @FUNC(i128 %32)\n %34 = call i64 @FUNC(i128 %33)\n %35 = trunc i64 %34 to i32\n store i32 %35, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %36 = call i32 @close(i32 %9)\n store i32 %5, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %37 = call i32 @close(i32 %9)\n %38 = call i32 @close(i32 %18)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %39 = load i32, i32* @gv_0, align 4\n %40 = icmp eq i32 %39, 5\n br i1 %40, label LBL_11, label LBL_10\n LBL_10:\n %41 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_12\n LBL_11:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %42 = call i128 @__asm_movss.1(i32 %sv_0.1.reload)\n %43 = call i128 @__asm_movss.1(i32 2147483647)\n %44 = call i128 @FUNC(i128 %42, i128 %43)\n %45 = call i128 @FUNC(i128 %44)\n %46 = load i128, i128* @gv_2, align 8\n call void @FUNC(i128 %45, i128 %46)\n %47 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_12:\n %48 = call i64 @FUNC(i64 40)\n %49 = icmp eq i64 %2, %48\n store i64 0, i64* %rax.0.reg2mem\n br i1 %49, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %20, { 1, 0 }\n uselistorder i32 %9, { 4, 0, 1, 2, 3, 5 }\n uselistorder i32 %5, { 1, 3, 0, 2 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memmove_17-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memmove_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -401\n %3 = and i64 %2, -16\n store i32 0, i32* %storemerge.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge.reload = load i32, i32* %storemerge.reg2mem\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %4 = add nuw nsw i32 %storemerge.reload, 1\n %exitcond = icmp eq i32 %4, 2\n store i64 %3, i64* %sv_0.0.reg2mem\n store i32 %4, i32* %storemerge.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %5 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 100)\n %6 = inttoptr i64 %sv_0.0.reload to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_0 to i32))\n %8 = load i64, i64* %6, align 8\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %1, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 1, 0 }\n uselistorder i32* %storemerge.reg2mem, { 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_loop_06-bad", "fun_name": "CWE127_Buffer_Underread__char_declare_loop_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n store i64 0, i64* %sv_1, align 8\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %5 = add i64 %storemerge1.reload, %2\n %6 = inttoptr i64 %5 to i8*\n %7 = load i8, i8* %6, align 1\n %8 = add i64 %storemerge1.reload, %4\n %9 = inttoptr i64 %8 to i8*\n store i8 %7, i8* %9, align 1\n %10 = load i64, i64* %sv_1, align 8\n %11 = add i64 %10, 1\n store i64 %11, i64* %sv_1, align 8\n %12 = icmp ult i64 %11, 100\n store i64 %11, i64* %storemerge1.reg2mem\n br i1 %12, label LBL_1, label LBL_2\n LBL_2:\n %13 = call i64 @FUNC(i64* nonnull %sv_0)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 0, 2, 1 }\n uselistorder i64 %storemerge1.reload, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_7, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_7, label LBL_2\n LBL_2:\n %sv_0.0.off = add i32 %2, -6\n %4 = icmp ult i32 %sv_0.0.off, 94\n br i1 %4, label LBL_3, label LBL_6\n LBL_3:\n %5 = call i64* @malloc(i32 %2)\n %6 = icmp eq i64* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %8 = ptrtoint i64* %5 to i64\n %9 = bitcast i64* %5 to i32*\n store i32 1819043176, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i16*\n store i16 111, i16* %11, align 2\n %12 = call i64 @FUNC(i64 %8)\n call void @free(i64* %5)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %13 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_1 to i64))\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %5, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 4, 1 }\n uselistorder label LBL_7, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge4.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = call i32 @strlen(i8* nonnull %3)\n %20 = icmp eq i32 %19, 0\n br i1 %20, label LBL_12, label LBL_8\n LBL_8:\n %21 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %22 = add i64 %storemerge4.reload, %21\n %23 = inttoptr i64 %22 to i8*\n %24 = load i8, i8* %23, align 1\n %25 = icmp eq i8 %24, 83\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_11, label LBL_10\n LBL_10:\n %27 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_11:\n %28 = add nuw i64 %storemerge4.reload, 1\n %29 = call i32 @strlen(i8* %3)\n %30 = sext i32 %29 to i64\n %31 = icmp ult i64 %28, %30\n store i64 %28, i64* %storemerge4.reg2mem\n br i1 %31, label LBL_9, label LBL_12\n LBL_12:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %3, { 1, 0, 3, 2 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2, 3 }\n uselistorder label LBL_12, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE404_Improper_Resource_Shutdown__open_fclose_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = icmp eq i32 %0, -1\n store i64 1, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @close(i32 %0)\n %3 = sext i32 %2 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, ...)* @open, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_34-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_34_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = inttoptr i64 %3 to i8*\n store i8* %8, i8** %sv_1, align 8\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strncpy(i8* nonnull %10, i8* %8, i32 %9)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %8, { 1, 0, 2 }\n uselistorder i64 %3, { 0, 3, 2, 1 }\n uselistorder i8** %sv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_sleep_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 20\n %6 = call i32 @usleep(i32 %spec.select)\n %7 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_0 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i32)* @usleep, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 9, 0, 4, 3, 10, 1, 11, 2, 8, 7, 12, 5, 13, 6 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memcpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %5, 5\n %7 = icmp eq i1 %6, false\n %8 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %7, i64 %1, i64 %8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 @strlen(i8* nonnull %10)\n %12 = inttoptr i64 %spec.select to i64*\n %13 = call i64* @memcpy(i64* nonnull %sv_0, i64* %12, i32 %11)\n %14 = ptrtoint i64* %sv_0 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %2, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 4, 0, 3, 5, 1, 6 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_multiply_12-bad", "fun_name": "CWE190_Integer_Overflow__char_rand_multiply_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 2, i32* %storemerge4.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n store i32 %10, i32* %storemerge4.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n %14 = trunc i32 %storemerge4.reload to i8\n %15 = icmp slt i8 %14, 1\n br i1 %13, label LBL_5, label LBL_3\n LBL_3:\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %15, label LBL_9, label LBL_4\n LBL_4:\n %sext2 = mul i32 %storemerge4.reload, 33554432\n %16 = ashr exact i32 %sext2, 24\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_5:\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %15, label LBL_9, label LBL_6\n LBL_6:\n %19 = icmp sgt i8 %14, 62\n br i1 %19, label LBL_8, label LBL_7\n LBL_7:\n %sext3 = mul i32 %storemerge4.reload, 33554432\n %20 = ashr exact i32 %sext3, 24\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_8:\n %23 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %15, { 1, 0 }\n uselistorder i64 %11, { 1, 0, 2 }\n uselistorder i32 %storemerge4.reload, { 2, 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 4, 3, 5, 1, 2 }\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, -33\n %6 = and i64 %5, -16\n %sv_2.0 = select i1 %3, i64 0, i64 %6\n store i64 0, i64* %sv_0, align 8\n %7 = inttoptr i64 %sv_2.0 to i64*\n %8 = call i64* @memcpy(i64* %7, i64* nonnull %sv_0, i32 40)\n %9 = inttoptr i64 %sv_2.0 to i32*\n %10 = load i32, i32* %9, align 16\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_strncpy_31-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_strncpy_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0368.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_3 to %sockaddr*\n %7 = call i32 @bind(i32 %2, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call i32 @listen(i32 %2, i32 5)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = call i32 @accept(i32 %2, %sockaddr* null, i32* null)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_4\n LBL_4:\n %13 = call i32 @recv(i32 %11, i64* nonnull %sv_2, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_2 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %2)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n %23 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.0368.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %24 = call i32 @close(i32 %2)\n %25 = call i32 @close(i32 %11)\n store i64 0, i64* %sv_2, align 8\n %26 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %27 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0368.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %sv_0.0368.reload = load i32, i32* %sv_0.0368.reg2mem\n %28 = bitcast i64* %sv_2 to i8*\n %29 = bitcast i64* %sv_1 to i8*\n %30 = call i8* @strncpy(i8* nonnull %28, i8* nonnull %29, i32 %sv_0.0368.reload)\n %31 = sext i32 %sv_0.0368.reload to i64\n %32 = add i64 %0, -112\n %33 = add i64 %32, %31\n %34 = inttoptr i64 %33 to i8*\n store i8 0, i8* %34, align 1\n br label LBL_10\n LBL_10:\n %35 = call i64 @FUNC(i64* nonnull %sv_2)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %1, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %2, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 1, 2, 5, 0, 3, 4 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 0, 1, 3 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_postinc_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = icmp eq i32 %sv_0.0.ph.reload, 2147483647\n br i1 %10, label LBL_7, label LBL_6\n LBL_6:\n %11 = add i32 %sv_0.0.ph.reload, 1\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_8\n LBL_7:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_8, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_multiply_08-bad", "fun_name": "CWE191_Integer_Underflow__short_fscanf_multiply_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_5, label LBL_3\n LBL_3:\n %9 = load i16, i16* %sv_0, align 2\n %10 = icmp slt i16 %9, 0\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = mul i16 %9, 2\n %13 = sext i16 %12 to i64\n %14 = and i64 %13, 4294967294\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_struct_alloca_04-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_struct_alloca_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %2 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %3 = and i64 %2, -16\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %4, %3\n %6 = inttoptr i64 %5 to i32*\n store i32 1, i32* %6, align 8\n %7 = or i64 %5, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n %9 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %9, 100\n store i64 %9, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n store i64 %3, i64* %sv_0, align 8\n %10 = call i64 @FUNC(i64 %3)\n %11 = load i64, i64* %sv_0, align 8\n %12 = inttoptr i64 %11 to i64*\n call void @free(i64* %12)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_postdec_10-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_fscanf_postdec_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = add i64 %6, -1\n store i64 %7, i64* %sv_0, align 8\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_multiply_13-bad", "fun_name": "CWE191_Integer_Underflow__short_fscanf_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i16, i16* %sv_0, align 2\n %6 = icmp slt i16 %.pre, 0\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = mul i16 %.pre, 2\n %9 = sext i16 %8 to i64\n %10 = and i64 %9, 4294967294\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_predec_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %3 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_4\n LBL_3:\n %6 = call i64 @FUNC(i64 4294967295)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_char_01-bad", "fun_name": "CWE563_Unused_Variable__unused_value_char_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 90)\n ret i64 %0\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memmove_08-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memmove_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 200)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 50)\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_1, i32 400)\n %11 = inttoptr i64 %sv_0.0.reload to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n call void @free(i64* %9)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %spec.store.select = select i1 %2, i32 -1, i32 20\n %3 = mul i32 %spec.store.select, 4\n %4 = call i64* @malloc(i32 %3)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_1, label LBL_2\n LBL_1:\n %7 = ptrtoint i64* %4 to i64\n %8 = sext i32 %spec.store.select to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 4\n %10 = add i64 %9, %7\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw i64 %storemerge1.reload, 1\n %13 = icmp ult i64 %12, %8\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %13, label LBL_3, label LBL_4\n LBL_4:\n %14 = bitcast i64* %4 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %4)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i32 %spec.store.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_fwrite_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_7, label LBL_1\n LBL_1:\n %spec.store.select = select i1 %1, i64 -1, i64 20\n %2 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %3 = icmp eq %_IO_FILE* %2, null\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %5 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_3 to i64*), i32 1, i32 50, %_IO_FILE* %2)\n %6 = icmp eq i32 %5, 50\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 1)\n unreachable\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %7 = add nuw i64 %storemerge2.reload, 1\n %8 = icmp ult i64 %7, %spec.store.select\n store i64 %7, i64* %storemerge2.reg2mem\n br i1 %8, label LBL_3, label LBL_6\n LBL_6:\n %9 = call i32 @fclose(%_IO_FILE* nonnull %2)\n %10 = sext i32 %9 to i64\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %2, { 1, 0, 2 }\n uselistorder i1 %1, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 7, 6, 5, 4, 3, 2, 1, 0, 8 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 3, 2, 1, 0, 4 }\n uselistorder i64 20, { 1, 0 }\n uselistorder i64 -1, { 1, 0 }\n uselistorder i32* @gv_0, { 4, 3, 2, 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memmove_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = call i64* @memmove(i64* nonnull %sv_0, i64* %1, i32 %10)\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = call i64 @FUNC(i64 %12)\n call void @free(i64* %1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2, 3, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_for_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.02.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i64 20, i64* %sv_0.02.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %3 = zext i32 %.pre to i64\n %4 = icmp eq i32 %.pre, 5\n %5 = icmp eq i1 %4, false\n store i64 -1, i64* %sv_0.02.reg2mem\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_2\n LBL_2:\n %sv_0.02.reload = load i64, i64* %sv_0.02.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %7 = add nuw i64 %storemerge1.reload, 1\n %8 = icmp ult i64 %7, %sv_0.02.reload\n store i64 %7, i64* %storemerge1.reg2mem\n store i64 %sv_0.02.reload, i64* %rax.0.reg2mem\n br i1 %8, label LBL_3, label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.02.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fgets_12-bad", "fun_name": "CWE617_Reachable_Assertion__fgets_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n %phitmp = icmp sgt i32 %8, 5\n br i1 %phitmp, label LBL_5, label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_4\n LBL_4:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([127 x i8], [127 x i8]* @gv_3, i64 0, i64 0), i32 54, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @gv_4, i64 0, i64 0))\n br label LBL_5\n LBL_5:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_for_loop_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n %.pre5 = load i32, i32* %sv_0, align 4\n %6 = icmp eq i32 %.pre, 5\n %7 = icmp eq i1 %6, false\n %.off = add i32 %.pre5, -1\n %8 = icmp ugt i32 %.off, 19\n %9 = or i1 %7, %8\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %9, label LBL_3, label LBL_2\n LBL_2:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %10 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_3 to i64))\n %11 = add nuw i64 %storemerge4.reload, 1\n %12 = load i32, i32* %sv_0, align 4\n %13 = sext i32 %12 to i64\n %14 = icmp ult i64 %11, %13\n store i64 %11, i64* %storemerge4.reg2mem\n br i1 %14, label LBL_2, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 0, 1, 3 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32 -1, { 0, 2, 1, 3 }\n uselistorder label LBL_3, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_2 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_2 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_1, align 8\n br label LBL_3\n LBL_3:\n %7 = ptrtoint i64* %sv_2 to i64\n %8 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = add i64 %7, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = mul i64 %storemerge1.reload, 8\n %11 = load i64, i64* %sv_1, align 8\n %12 = add i64 %11, %10\n %13 = add i64 %9, %10\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = inttoptr i64 %12 to i64*\n store i64 %15, i64* %16, align 8\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %18 = load i64, i64* %sv_1, align 8\n %19 = inttoptr i64 %18 to i64*\n %20 = load i64, i64* %19, align 8\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 32777976880262761, i64* %6, align 8\n br label LBL_3\n LBL_3:\n %7 = load i32, i32* @gv_2, align 4\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_0, align 8\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %10, i32 99, i8* nonnull %9)\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_5\n LBL_5:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 1, 0, 3 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_sleep_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 20\n %6 = call i32 @usleep(i32 %spec.select)\n %7 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_0 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i32)* @usleep, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 3, 0, 1, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int64_t_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge2.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i64\n store i32 0, i32* %storemerge3.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge3.reload = load i32, i32* %storemerge3.reg2mem\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %0 = add nuw nsw i32 %storemerge3.reload, 1\n %exitcond = icmp eq i32 %0, 2\n store i64 0, i64* %sv_0.0.reg2mem\n store i32 %0, i32* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %1 = icmp eq i64 %sv_0.0.reload, 0\n br i1 %1, label LBL_4, label LBL_3\n LBL_3:\n %2 = inttoptr i64 %sv_0.0.reload to i64*\n %3 = load i64, i64* %2, align 8\n %4 = call i64 @FUNC(i64 %3)\n store i64 %4, i64* %storemerge2.reg2mem\n br label LBL_5\n LBL_4:\n %5 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_0 to i64))\n store i64 %5, i64* %storemerge2.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n ret i64 %storemerge2.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 1, 0 }\n uselistorder i32* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memmove_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -609\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %7, i64 0, i64 50)\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_1, i32 400)\n %10 = inttoptr i64 %sv_0.0.reload to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_int64_t_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i64*\n store i64 5, i64* %6, align 8\n %7 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %7, 100\n store i64 %7, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %8 = load i64, i64* %0, align 8\n %9 = call i64 @FUNC(i64 %8)\n ret i64 %9\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 1, 2, 3, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE242_Use_of_Inherently_Dangerous_Function__basic_14-bad", "fun_name": "CWE242_Use_of_Inherently_Dangerous_Function__basic_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @gets(i8* nonnull %4)\n %6 = ptrtoint i8* %5 to i64\n %sext.mask = and i64 %6, 4294967295\n %7 = icmp eq i64 %sext.mask, 0\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([61 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %10 = ptrtoint i64* %sv_0 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__malloc_realloc_int64_t_08-bad", "fun_name": "CWE401_Memory_Leak__malloc_realloc_int64_t_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %3, align 8\n %6 = call i64 @FUNC(i64 5)\n %7 = call i64* @realloc(i64* %3, i32 1040000)\n %8 = ptrtoint i64* %7 to i64\n %9 = icmp eq i64* %7, null\n store i64 %8, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n store i64 10, i64* %7, align 8\n %10 = call i64 @FUNC(i64 10)\n call void @free(i64* nonnull %7)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_char_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 100)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_realloc_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 4)\n %1 = icmp eq i64* %0, null\n store i64 1, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = bitcast i64* %0 to i32*\n store i32 5, i32* %2, align 4\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i64*, i32)* @realloc, { 1, 0, 2 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %1)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %26 = load i32, i32* @gv_0, align 4\n %27 = icmp eq i32 %26, 5\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_14, label LBL_8\n LBL_8:\n %29 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %30 = icmp eq i32 %29, 1\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_14, label LBL_9\n LBL_9:\n %32 = load i64, i64* %sv_1, align 8\n %33 = trunc i64 %32 to i32\n %34 = icmp sgt i32 %33, ptrtoint (i1* @gv_4 to i32)\n br i1 %34, label LBL_14, label LBL_10\n LBL_10:\n %35 = and i64 %32, 4294967295\n %36 = icmp eq i64 %35, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %36, label LBL_13, label LBL_11\n LBL_11:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %37 = add i32 %storemerge4.reload, 1\n %38 = sext i32 %37 to i64\n %39 = icmp sgt i64 %35, %38\n store i32 %37, i32* %storemerge4.reg2mem\n br i1 %39, label LBL_11, label LBL_12\n LBL_12:\n %phitmp = zext i32 %37 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_13\n LBL_13:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %40 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_14\n LBL_14:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %37, { 1, 0, 2 }\n uselistorder i64 %11, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 ptrtoint (i1* @gv_4 to i32), { 1, 0 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2, 3, 4 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__fopen_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq %_IO_FILE* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %0, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_loop_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = ptrtoint i32** %sv_0 to i64\n %4 = add i64 %3, -33\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i32*\n store i32* %6, i32** %sv_0, align 8\n br label LBL_3\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_3:\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = add i64 %8, -48\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %10 = mul i64 %storemerge2.reload, 4\n %11 = load i32*, i32** %sv_0, align 8\n %12 = ptrtoint i32* %11 to i64\n %13 = add i64 %10, %12\n %14 = add i64 %9, %10\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = inttoptr i64 %13 to i32*\n store i32 %16, i32* %17, align 4\n %18 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %18, 10\n store i64 %18, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %19 = load i32*, i32** %sv_0, align 8\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_0, { 4, 3, 2, 0, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_multiply_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 4, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 64, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 25, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -48\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @strtoul(i8* nonnull %22, i8** null, i32 0)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %27 = load i32, i32* @gv_1, align 4\n %28 = icmp eq i32 %27, 0\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n %29 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_16\n LBL_11:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sv_0.1.off = add i32 %sv_0.1.reload, -6\n %30 = icmp ult i32 %sv_0.1.off, 94\n br i1 %30, label LBL_12, label LBL_15\n LBL_12:\n %31 = call i64* @malloc(i32 %sv_0.1.reload)\n %32 = icmp eq i64* %31, null\n %33 = icmp eq i1 %32, false\n br i1 %33, label LBL_14, label LBL_13\n LBL_13:\n call void @exit(i32 -1)\n unreachable\n LBL_14:\n %34 = ptrtoint i64* %31 to i64\n %35 = bitcast i64* %31 to i32*\n store i32 1819043176, i32* %35, align 4\n %36 = add i64 %34, 4\n %37 = inttoptr i64 %36 to i16*\n store i16 111, i16* %37, align 2\n %38 = call i64 @FUNC(i64 %34)\n call void @free(i64* %31)\n br label LBL_16\n LBL_15:\n %39 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_3 to i64))\n br label LBL_16\n LBL_16:\n %40 = call i64 @FUNC(i64 40)\n %41 = icmp eq i64 %0, %40\n store i64 0, i64* %rax.0.reg2mem\n br i1 %41, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %31, { 0, 1, 3, 2 }\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_01-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_snprintf_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n store i64 0, i64* %sv_0, align 8\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %23, i32 99, i8* nonnull %1)\n %25 = ptrtoint i64* %sv_0 to i64\n %26 = call i64 @FUNC(i64 %25)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_snprintf_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 49)\n %7 = add i64 %3, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %10, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i8* %4)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0, 2 }\n uselistorder i64 %3, { 2, 1, 0, 3 }\n uselistorder i8** %sv_1, { 1, 0 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_no_init_13-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_no_init_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -33\n %3 = and i64 %2, -16\n %4 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %7 = mul i64 %indvars.iv.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = load i32, i32* %9, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n store i32 %3, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %sv_0.0.off = add i32 %sv_0.0.reload, -6\n %7 = icmp ult i32 %sv_0.0.off, 94\n br i1 %7, label LBL_5, label LBL_8\n LBL_5:\n %8 = call i64* @malloc(i32 %sv_0.0.reload)\n %9 = icmp eq i64* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %11 = ptrtoint i64* %8 to i64\n %12 = bitcast i64* %8 to i32*\n store i32 1819043176, i32* %12, align 4\n %13 = add i64 %11, 4\n %14 = inttoptr i64 %13 to i16*\n store i16 111, i16* %14, align 2\n %15 = call i64 @FUNC(i64 %11)\n call void @free(i64* %8)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_8:\n %16 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_2 to i64))\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %8, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_multiply_13-bad", "fun_name": "CWE190_Integer_Overflow__int_listen_socket_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_10, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_10, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n br label LBL_10\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n %28 = icmp slt i32 %sv_0.0.ph.reload, 1\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n %29 = mul i32 %sv_0.0.ph.reload, 2\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n br label LBL_10\n LBL_10:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 5, { 1, 0, 2 }\n uselistorder label LBL_10, { 3, 4, 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 7, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_11, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = call i64* @malloc(i32 40)\n %8 = ptrtoint i64* %7 to i64\n %9 = icmp eq i64* %7, null\n %10 = icmp eq i1 %9, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %11 = mul i64 %indvars.iv5.reload, 4\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_6, label LBL_5\n LBL_6:\n %14 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %14, label LBL_9, label LBL_7\n LBL_7:\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %16, %8\n %18 = inttoptr i64 %17 to i32*\n store i32 1, i32* %18, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_8\n LBL_8:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %19 = mul i64 %indvars.iv.reload, 4\n %20 = add i64 %19, %8\n %21 = inttoptr i64 %20 to i32*\n %22 = load i32, i32* %21, align 4\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_10, label LBL_8\n LBL_9:\n %25 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_10:\n call void @free(i64* %7)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_06-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = icmp eq %_IO_FILE* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %3 = sext i32 %2 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_malloc_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = bitcast i64* %0 to i32*\n store i32 0, i32* %4, align 4\n %5 = add i64 %3, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %7 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_12-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge4.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i8*\n %sv_0.05.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n %4 = ptrtoint i64* %0 to i64\n store i64 8382078947037833542, i64* %0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i32*\n store i32 1735289202, i32* %6, align 4\n %7 = add i64 %4, 12\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC()\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = load i8, i8* %3, align 1\n %13 = icmp eq i8 %12, 0\n %14 = icmp eq i1 %13, false\n store i8 %12, i8* %.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n store i8* %3, i8** %sv_0.03.reg2mem\n br i1 %14, label LBL_5, label LBL_8\n LBL_4:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %16, label LBL_12, label LBL_9\n LBL_5:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %17 = icmp eq i8 %.reload, 83\n %18 = icmp eq i1 %17, false\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n %19 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n store i8* %sv_0.05.reload, i8** %sv_0.03.reg2mem\n br label LBL_8\n LBL_7:\n %20 = ptrtoint i8* %sv_0.05.reload to i64\n %21 = add i64 %20, 1\n %22 = inttoptr i64 %21 to i8*\n %23 = load i8, i8* %22, align 1\n %24 = icmp eq i8 %23, 0\n %25 = icmp eq i1 %24, false\n store i8 %23, i8* %.reg2mem\n store i8* %22, i8** %sv_0.05.reg2mem\n store i8* %22, i8** %sv_0.03.reg2mem\n br i1 %25, label LBL_5, label LBL_8\n LBL_8:\n %sv_0.03.reload = load i8*, i8** %sv_0.03.reg2mem\n %26 = bitcast i8* %sv_0.03.reload to i64*\n call void @free(i64* %26)\n br label LBL_13\n LBL_9:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %27 = add i64 %storemerge4.reload, %4\n %28 = inttoptr i64 %27 to i8*\n %29 = load i8, i8* %28, align 1\n %30 = icmp eq i8 %29, 83\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n %32 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n br label LBL_12\n LBL_11:\n %33 = add nuw i64 %storemerge4.reload, 1\n %34 = call i32 @strlen(i8* %3)\n %35 = sext i32 %34 to i64\n %36 = icmp ult i64 %33, %35\n store i64 %33, i64* %storemerge4.reg2mem\n br i1 %36, label LBL_9, label LBL_12\n LBL_12:\n call void @free(i64* %0)\n br label LBL_13\n LBL_13:\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %sv_0.05.reload, { 1, 0 }\n uselistorder i64 %4, { 0, 2, 1 }\n uselistorder i8* %3, { 4, 3, 0, 1, 2 }\n uselistorder i64* %0, { 0, 2, 1, 4, 3 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.05.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.03.reg2mem, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i8 0, { 1, 0, 2, 3 }\n uselistorder label LBL_12, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_divide_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0479.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.0479.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.0479.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp eq i32 %sv_0.0.ph.reload, 0\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0479.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.0479.reload = load i32, i32* %sv_0.0479.reg2mem\n %26 = udiv i32 100, %sv_0.0479.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0479.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 2, 6, 7, 8, 0, 9, 4, 5, 10, 11, 12, 3, 13 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_multiply_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_8\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp slt i32 %19, 1\n br i1 %21, label LBL_8, label LBL_5\n LBL_5:\n %22 = icmp sgt i32 %19, 1073741822\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n %23 = mul i32 %19, 2\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n br label LBL_8\n LBL_7:\n %26 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_8\n LBL_8:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 3, 4, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE588_Attempt_to_Access_Child_of_Non_Structure_Pointer__struct_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = ptrtoint i32* %sv_0 to i64\n %2 = call i64 @FUNC(i64 %1)\n %3 = call i64 @FUNC(i64 40)\n %4 = icmp eq i64 %0, %3\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_rand_08-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_rand_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge3.in = xor i32 %12, %13\n store i32 %storemerge3.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_11, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %17 = call i64* @malloc(i32 40)\n %18 = ptrtoint i64* %17 to i64\n %19 = icmp eq i64* %17, null\n %20 = icmp eq i1 %19, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %20, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %21 = mul i64 %indvars.iv6.reload, 4\n %22 = add i64 %21, %18\n %23 = inttoptr i64 %22 to i32*\n store i32 0, i32* %23, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n br i1 %exitcond8, label LBL_6, label LBL_5\n LBL_6:\n %24 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %24, label LBL_9, label LBL_7\n LBL_7:\n %25 = sext i32 %sv_0.0.reload to i64\n %26 = mul i64 %25, 4\n %27 = add i64 %26, %18\n %28 = inttoptr i64 %27 to i32*\n store i32 1, i32* %28, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_8\n LBL_8:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %29 = mul i64 %indvars.iv.reload, 4\n %30 = add i64 %29, %18\n %31 = inttoptr i64 %30 to i32*\n %32 = load i32, i32* %31, align 4\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_10, label LBL_8\n LBL_9:\n %35 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n call void @free(i64* %17)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %18, { 1, 0, 2 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memmove_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64 @FUNC()\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %6)\n %8 = call i64 @FUNC(i64* nonnull %sv_0)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_listen_socket_05-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_listen_socket_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_2, align 8\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_2 to i8*\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_12, label LBL_1\n LBL_1:\n %11 = call i32 @strlen(i8* nonnull %8)\n %12 = call i32 @socket(i32 2, i32 1, i32 6)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_12, label LBL_2\n LBL_2:\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %15 = call i16 @htons(i16 27015)\n %16 = bitcast i64* %sv_0 to %sockaddr*\n %17 = call i32 @bind(i32 %12, %sockaddr* nonnull %16, i32 16)\n %18 = icmp eq i32 %17, -1\n br i1 %18, label LBL_10, label LBL_3\n LBL_3:\n %19 = call i32 @listen(i32 %12, i32 5)\n %20 = icmp eq i32 %19, -1\n br i1 %20, label LBL_10, label LBL_4\n LBL_4:\n %21 = call i32 @accept(i32 %12, %sockaddr* null, i32* null)\n %22 = icmp eq i32 %21, -1\n br i1 %22, label LBL_10, label LBL_5\n LBL_5:\n %23 = sext i32 %11 to i64\n %24 = ptrtoint i64* %sv_2 to i64\n %25 = add i64 %23, %24\n %26 = inttoptr i64 %25 to i64*\n %27 = sub i32 249, %11\n %28 = call i32 @recv(i32 %21, i64* %26, i32 %27, i32 0)\n %29 = add i32 %28, 1\n %30 = icmp ult i32 %29, 2\n br i1 %30, label LBL_11, label LBL_6\n LBL_6:\n %31 = sext i32 %28 to i64\n %32 = add i64 %25, %31\n %33 = inttoptr i64 %32 to i8*\n store i8 0, i8* %33, align 1\n %34 = call i8* @strchr(i8* nonnull %8, i32 13)\n %35 = icmp eq i8* %34, null\n br i1 %35, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %34, align 1\n br label LBL_8\n LBL_8:\n %36 = call i8* @strchr(i8* nonnull %8, i32 10)\n %37 = icmp eq i8* %36, null\n br i1 %37, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %36, align 1\n br label LBL_11\n LBL_10:\n %38 = call i32 @close(i32 %12)\n br label LBL_12\n LBL_11:\n %39 = call i32 @close(i32 %12)\n %40 = call i32 @close(i32 %21)\n br label LBL_12\n LBL_12:\n %41 = call i32 @putenv(i8* nonnull %8)\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %2, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %28, { 1, 0 }\n uselistorder i32 %12, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %8, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_postinc_14-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_fscanf_postinc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = add i64 %9, 1\n store i64 %10, i64* %sv_0, align 8\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_malloc_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %spec.select = select i1 %2, i32 0, i32 99\n %3 = call i64* @malloc(i32 %spec.select)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %spec.select, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = zext i32 %spec.select to i64\n %10 = add i64 %6, -1\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_postdec_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 4294967293)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 3, 2, 1, 0 }\n uselistorder i64 4294967293, { 1, 0 }\n uselistorder i32* @gv_0, { 6, 0, 5, 1, 4, 2, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 20, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_8, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = icmp ult i32 %sv_0.0.reload, 6\n br i1 %7, label LBL_7, label LBL_4\n LBL_4:\n %8 = call i64* @malloc(i32 %sv_0.0.reload)\n %9 = icmp eq i64* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = ptrtoint i64* %8 to i64\n %12 = bitcast i64* %8 to i32*\n store i32 1819043176, i32* %12, align 4\n %13 = add i64 %11, 4\n %14 = inttoptr i64 %13 to i16*\n store i16 111, i16* %14, align 2\n %15 = call i64 @FUNC(i64 %11)\n call void @free(i64* %8)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_7:\n %16 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %8, { 0, 1, 3, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_max_multiply_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %3 = load i32, i32* @gv_2, align 4\n %4 = zext i32 %3 to i64\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %5 = load i32, i32* @gv_2, align 4\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 4)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memmove_01-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_memmove_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = inttoptr i64 %8 to i64*\n %11 = call i64* @memmove(i64* %10, i64* nonnull %sv_0, i32 100)\n %12 = add i64 %4, 91\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %8)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0, 2 }\n uselistorder i64* %1, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fwrite_05-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fwrite_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %3 = call i32 @fwrite(i64* bitcast ([7 x i8]* @gv_2 to i64*), i32 1, i32 6, %_IO_FILE* %2)\n %4 = sext i32 %3 to i64\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_file_17-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_file_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_1, align 8\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = sext i32 %9 to i64\n %11 = sub nsw i64 250, %10\n %12 = icmp ult i64 %11, 2\n br i1 %12, label LBL_5, label LBL_1\n LBL_1:\n %13 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %14 = icmp eq %_IO_FILE* %13, null\n br i1 %14, label LBL_5, label LBL_2\n LBL_2:\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = sub i32 250, %9\n %17 = add i64 %10, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = call i8* @fgets(i8* %18, i32 %16, %_IO_FILE* nonnull %13)\n %20 = icmp eq i8* %19, null\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %18, align 1\n br label LBL_4\n LBL_4:\n %23 = call i32 @fclose(%_IO_FILE* nonnull %13)\n br label LBL_5\n LBL_5:\n %24 = call i32 @putenv(i8* nonnull %8)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %2, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %8, { 1, 0 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_multiply_12-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_rand_multiply_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 -2, i64* %storemerge1.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 1152921504606846976\n %9 = call i32 @rand()\n %10 = zext i32 %9 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 1073741824\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = mul i64 %16, 32768\n %18 = call i32 @rand()\n %19 = sext i32 %18 to i64\n %20 = sext i1 %5 to i64\n %21 = xor i64 %8, %20\n %22 = xor i64 %21, %11\n %23 = xor i64 %22, %14\n %24 = xor i64 %23, %17\n %storemerge = xor i64 %24, %19\n store i64 %storemerge, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %25 = call i64 @FUNC()\n %26 = trunc i64 %25 to i32\n %27 = icmp eq i32 %26, 0\n %28 = icmp slt i64 %storemerge1.reload, 0\n %29 = icmp eq i1 %28, false\n br i1 %27, label LBL_5, label LBL_3\n LBL_3:\n store i64 %25, i64* %rax.0.reg2mem\n br i1 %29, label LBL_9, label LBL_4\n LBL_4:\n %30 = mul i64 %storemerge1.reload, 2\n %31 = call i64 @FUNC(i64 %30)\n store i64 %31, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_5:\n store i64 %25, i64* %rax.0.reg2mem\n br i1 %29, label LBL_9, label LBL_6\n LBL_6:\n %32 = icmp slt i64 %storemerge1.reload, -4611686018427387903\n br i1 %32, label LBL_8, label LBL_7\n LBL_7:\n %33 = mul i64 %storemerge1.reload, 2\n %34 = call i64 @FUNC(i64 %33)\n store i64 %34, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_8:\n %35 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %35, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %29, { 1, 0 }\n uselistorder i64 %25, { 1, 0, 2 }\n uselistorder i64 %storemerge1.reload, { 3, 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 4, 3, 5, 1, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_multiply_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_12, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n br label LBL_12\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp slt i32 %sv_0.0.ph.reload, 0\n %31 = icmp eq i1 %30, %29\n br i1 %31, label LBL_9, label LBL_12\n LBL_9:\n %32 = icmp slt i32 %sv_0.0.ph.reload, -1073741823\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n %33 = mul i32 %sv_0.0.ph.reload, 2\n %34 = zext i32 %33 to i64\n %35 = call i64 @FUNC(i64 %34)\n br label LBL_12\n LBL_11:\n %36 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n br label LBL_12\n LBL_12:\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 2, 0, 1 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_12, { 4, 5, 0, 2, 1, 3 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_multiply_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 1152921504606846976\n %9 = call i32 @rand()\n %10 = zext i32 %9 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 1073741824\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = mul i64 %16, 32768\n %18 = call i32 @rand()\n %19 = sext i32 %18 to i64\n %20 = sext i1 %5 to i64\n %21 = xor i64 %8, %20\n %22 = xor i64 %21, %11\n %23 = xor i64 %22, %14\n %24 = xor i64 %23, %17\n %storemerge = xor i64 %24, %19\n store i64 %storemerge, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %25 = call i64 @FUNC()\n %26 = trunc i64 %25 to i32\n %27 = icmp eq i32 %26, 0\n %28 = icmp slt i64 %sv_0.0.reload, 1\n %or.cond = or i1 %28, %27\n store i64 %25, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_6, label LBL_3\n LBL_3:\n %29 = icmp sgt i64 %sv_0.0.reload, 4611686018427387902\n br i1 %29, label LBL_5, label LBL_4\n LBL_4:\n %30 = mul i64 %sv_0.0.reload, 2\n %31 = call i64 @FUNC(i64 %30)\n store i64 %31, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %32 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %32, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_char_32-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_char_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.058.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.058.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.058.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.058.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.058.reload = load i32, i32* %sv_0.058.reg2mem\n %sext = mul i32 %sv_0.058.reload, 16777216\n %25 = ashr exact i32 %sext, 24\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.058.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_loop_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %5 = call i64* @malloc(i32 400)\n %6 = ptrtoint i64* %5 to i64\n %7 = icmp eq i64* %5, null\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %sv_0.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %9 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %10 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %10, i64 0, i64 50)\n %11 = add i64 %9, -416\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %12 = mul i64 %storemerge1.reload, 4\n %13 = add i64 %12, %sv_0.0.reload\n %14 = add i64 %11, %12\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = inttoptr i64 %13 to i32*\n store i32 %16, i32* %17, align 4\n %18 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %19 = inttoptr i64 %sv_0.0.reload to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %23 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %23)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int_16-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 400)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = add i64 %1, 8\n %3 = inttoptr i64 %2 to i64*\n store i64 8247343692658534758, i64* %sv_1, align 8\n store i64 32777976880262761, i64* %3, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = bitcast i64* %sv_0 to i8*\n %6 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %sv_0, align 8\n %7 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %5, i32 99, i8* nonnull %4)\n %8 = call i64 @FUNC(i64 %6)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 0, 1 }\n uselistorder i64* %sv_0, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_malloc_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 8)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n store i64 5, i64* %0, align 8\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE467_Use_of_sizeof_on_Pointer_Type__char_13-bad", "fun_name": "CWE467_Use_of_sizeof_on_Pointer_Type__char_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 8)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 66, i8* %7, align 1\n %8 = call i64 @FUNC(i64 66)\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_square_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0810.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.0810.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.0810.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %sv_0.0.off = add i32 %19, 46339\n %21 = icmp ugt i32 %sv_0.0.off, 92678\n store i32 %19, i32* %sv_0.0810.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0810.reload = load i32, i32* %sv_0.0810.reg2mem\n %22 = mul i32 %sv_0.0810.reload, %sv_0.0810.reload\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0810.reload, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0810.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 %2, i32* %.reg2mem\n br i1 %4, label LBL_8, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %1)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_8\n LBL_8:\n %.reload = load i32, i32* %.reg2mem\n %26 = icmp eq i32 %.reload, 5\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n %27 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_16\n LBL_10:\n %28 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n %29 = icmp eq i32 %28, 1\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_16, label LBL_11\n LBL_11:\n %31 = load i64, i64* %sv_1, align 8\n %32 = trunc i64 %31 to i32\n %33 = icmp sgt i32 %32, ptrtoint (i1* @gv_5 to i32)\n br i1 %33, label LBL_16, label LBL_12\n LBL_12:\n %34 = and i64 %31, 4294967295\n %35 = icmp eq i64 %34, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %35, label LBL_15, label LBL_13\n LBL_13:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %36 = add i32 %storemerge4.reload, 1\n %37 = sext i32 %36 to i64\n %38 = icmp sgt i64 %34, %37\n store i32 %36, i32* %storemerge4.reg2mem\n br i1 %38, label LBL_13, label LBL_14\n LBL_14:\n %phitmp = zext i32 %36 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_15\n LBL_15:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %39 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_16\n LBL_16:\n %40 = call i64 @FUNC(i64 40)\n %41 = icmp eq i64 %0, %40\n store i64 0, i64* %rax.0.reg2mem\n br i1 %41, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %36, { 1, 0, 2 }\n uselistorder i64 %11, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_7, { 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_postdec_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = icmp eq i8 %3, -128\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i8 %3, -1\n store i8 %5, i8* %sv_0, align 1\n %6 = sext i8 %5 to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 2, 0, 3 }\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_32-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05810.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_3 to %sockaddr*\n %7 = call i32 @bind(i32 %2, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call i32 @listen(i32 %2, i32 5)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = call i32 @accept(i32 %2, %sockaddr* null, i32* null)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_4\n LBL_4:\n %13 = call i32 @recv(i32 %11, i64* nonnull %sv_2, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_2 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %2)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n %23 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.05810.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %24 = call i32 @close(i32 %2)\n %25 = call i32 @close(i32 %11)\n store i64 0, i64* %sv_2, align 8\n %26 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %27 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.05810.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %sv_0.05810.reload = load i32, i32* %sv_0.05810.reg2mem\n %28 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.05810.reload)\n %29 = sext i32 %sv_0.05810.reload to i64\n %30 = add i64 %0, -112\n %31 = add i64 %30, %29\n %32 = inttoptr i64 %31 to i8*\n store i8 0, i8* %32, align 1\n br label LBL_10\n LBL_10:\n %33 = call i64 @FUNC(i64* nonnull %sv_2)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %1, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.05810.reload, { 1, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %2, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 1, 2, 5, 0, 3, 4 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 0, 1, 3 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_file_08-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_file_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_1, align 8\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i64 @FUNC()\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_6, label LBL_1\n LBL_1:\n %12 = call i32 @strlen(i8* nonnull %8)\n %13 = sext i32 %12 to i64\n %14 = sub nsw i64 250, %13\n %15 = icmp ult i64 %14, 2\n br i1 %15, label LBL_6, label LBL_2\n LBL_2:\n %16 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %17 = icmp eq %_IO_FILE* %16, null\n br i1 %17, label LBL_6, label LBL_3\n LBL_3:\n %18 = sub i32 250, %12\n %19 = ptrtoint i64* %sv_1 to i64\n %20 = add i64 %13, %19\n %21 = inttoptr i64 %20 to i8*\n %22 = call i8* @fgets(i8* %21, i32 %18, %_IO_FILE* nonnull %16)\n %23 = icmp eq i8* %22, null\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_5, label LBL_4\n LBL_4:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %26 = call i32 @fclose(%_IO_FILE* nonnull %16)\n br label LBL_6\n LBL_6:\n %27 = call i32 @putenv(i8* nonnull %8)\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %2, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_31-bad", "fun_name": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 0, i32* %3, align 4\n %4 = ptrtoint i64* %0 to i64\n %5 = add i64 %4, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %7 = call i64 @FUNC(i64 %4)\n ret i64 %4\n\n uselistorder i64* %0, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i32 66)\n %.pr = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_2\n LBL_2:\n %4 = call i32 @close(i32 %2)\n %5 = sext i32 %4 to i64\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32 (i32)* @close, { 1, 2, 3, 0, 4 }\n uselistorder i32 (i8*, i32, ...)* @open, { 0, 1, 3, 2, 4 }\n uselistorder i32* @gv_0, { 0, 4, 3, 2, 1 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_sleep_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp slt i32 %sv_0.1.reload, 1\n %27 = icmp sgt i32 %sv_0.1.reload, ptrtoint (i1* @gv_1 to i32)\n %or.cond3 = or i1 %26, %27\n br i1 %or.cond3, label LBL_9, label LBL_8\n LBL_8:\n %28 = call i32 @usleep(i32 %sv_0.1.reload)\n %29 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_9:\n %30 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_3 to i64))\n br label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_zero_modulo_11-bad", "fun_name": "CWE369_Divide_by_Zero__int_zero_modulo_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 100)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__listen_socket_07-bad", "fun_name": "CWE617_Reachable_Assertion__listen_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_1 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_0, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %phitmp = icmp sgt i32 %24, 5\n %25 = call i32 @close(i32 %4)\n %26 = call i32 @close(i32 %13)\n br i1 %phitmp, label LBL_10, label LBL_9\n LBL_7:\n %27 = call i32 @close(i32 %4)\n br label LBL_9\n LBL_8:\n %28 = call i32 @close(i32 %4)\n %29 = call i32 @close(i32 %13)\n br label LBL_9\n LBL_9:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @gv_2, i64 0, i64 0), i32 131, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @gv_3, i64 0, i64 0))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 0, 1, 5, 2, 3, 4, 6 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 0, 1, 2, 4, 3, 5 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder label LBL_9, { 0, 2, 4, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32*\n %sv_0 = alloca i32*, align 8\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32* null, i32** %.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 200)\n %4 = bitcast i64* %3 to i32*\n store i32* %4, i32** %sv_0, align 8\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i32* @wmemset(i32* %4, i32 65, i32 49)\n %8 = ptrtoint i64* %3 to i64\n %9 = add i64 %8, 196\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = load i32*, i32** %sv_0, align 8\n store i32* %11, i32** %.reg2mem\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC()\n %13 = trunc i64 %12 to i32\n %14 = icmp eq i32 %13, 0\n store i64 %12, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_5\n LBL_5:\n %.reload = load i32*, i32** %.reg2mem\n %15 = call i32 @wcslen(i32* %.reload)\n %16 = add i32 %15, 1\n %17 = call i64* @calloc(i32 %16, i32 4)\n %18 = icmp eq i64* %17, null\n %19 = icmp eq i1 %18, false\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %20 = bitcast i64* %17 to i32*\n %21 = call i32* @wcscpy(i32* %20, i32* %.reload)\n %22 = ptrtoint i64* %17 to i64\n %23 = call i64 @FUNC(i64 %22)\n call void @free(i64* %17)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %17, { 1, 0, 3, 2 }\n uselistorder i32** %.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printWLine, { 1, 0 }\n uselistorder i32* (i32*, i32*)* @wcscpy, { 1, 0, 2 }\n uselistorder i32 (i32*)* @wcslen, { 1, 0, 2 }\n uselistorder i32* (i32*, i32, i32)* @wmemset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_square_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %.off = add i32 %9, 65534\n %10 = icmp ugt i32 %.off, 131068\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = mul i32 %9, %9\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 2, 1, 0 }\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memcpy_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memcpy(i64* %9, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %11 = load i64, i64* %9, align 8\n %12 = call i64 @FUNC(i64 %11)\n call void @free(i64* %9)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 ptrtoint (i32* @gv_1 to i32), { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_square_07-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_square_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = load i64, i64* %sv_0, align 8\n %sext = mul i64 %8, 4294967296\n %9 = ashr exact i64 %sext, 32\n %10 = mul nsw i64 %9, %9\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_snprintf_07-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_environment_snprintf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_3\n LBL_3:\n %14 = load i32, i32* @gv_0, align 4\n %15 = icmp eq i32 %14, 5\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n store i64 0, i64* %sv_0, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %17, i32 99, i8* nonnull %1)\n %19 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_5\n LBL_5:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 99, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE377_Insecure_Temporary_File__char_tempnam_05-bad", "fun_name": "CWE377_Insecure_Temporary_File__char_tempnam_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_6, label LBL_1\n LBL_1:\n %2 = call i8* @tempnam(i8* null, i8* null)\n %3 = icmp eq i8* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %5 = ptrtoint i8* %2 to i64\n %6 = call i64 @FUNC(i64 %5)\n %7 = call i32 (i8*, i32, ...) @open(i8* %2, i32 66)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = call i64 @FUNC(i64 ptrtoint ([45 x i8]* @gv_1 to i64))\n %10 = call i32 @close(i32 %7)\n br label LBL_5\n LBL_5:\n %11 = bitcast i8* %2 to i64*\n call void @free(i64* %11)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %2, { 0, 2, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_fwrite_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge14.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_16, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_16, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n br label LBL_16\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n %sv_0.1.off = add i32 %sv_0.0.ph.reload, -1\n %31 = icmp ugt i32 %sv_0.1.off, 19\n %or.cond = or i1 %31, %30\n br i1 %or.cond, label LBL_16, label LBL_9\n LBL_9:\n %32 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %33 = icmp eq %_IO_FILE* %32, null\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_10, label LBL_11\n LBL_10:\n %35 = sext i32 %sv_0.0.ph.reload to i64\n store i64 0, i64* %storemerge14.reg2mem\n br label LBL_12\n LBL_11:\n call void @exit(i32 1)\n unreachable\n LBL_12:\n %36 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_3 to i64*), i32 1, i32 50, %_IO_FILE* %32)\n %37 = icmp eq i32 %36, 50\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n call void @exit(i32 1)\n unreachable\n LBL_14:\n %storemerge14.reload = load i64, i64* %storemerge14.reg2mem\n %38 = add nuw i64 %storemerge14.reload, 1\n %39 = icmp ult i64 %38, %35\n store i64 %38, i64* %storemerge14.reg2mem\n br i1 %39, label LBL_12, label LBL_15\n LBL_15:\n %40 = call i32 @fclose(%_IO_FILE* nonnull %32)\n br label LBL_16\n LBL_16:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %32, { 1, 0, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge14.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 -1, { 5, 0, 7, 8, 9, 10, 6, 2, 4, 11, 12, 13, 1, 14, 3 }\n uselistorder label LBL_16, { 3, 4, 1, 0, 2 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_02-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 10)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n %4 = ptrtoint i64* %1 to i64\n %5 = ptrtoint i64* %sv_0 to i64\n %6 = add i64 %5, -48\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 4\n %8 = add i64 %7, %4\n %9 = add i64 %6, %7\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = inttoptr i64 %8 to i32*\n store i32 %11, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %13, 10\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %14 = bitcast i64* %1 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %1)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_strncpy_13-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__connect_socket_strncpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* inttoptr (i64 8348 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_7, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_3 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_6, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_2, i32 7, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_6, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_2 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %.off = add i32 %21, 32768\n %22 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %22, label LBL_5, label LBL_6\n LBL_5:\n %sext3 = mul i32 %21, 65536\n %23 = ashr exact i32 %sext3, 16\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %24 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %25 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %26 = trunc i32 %sv_0.1.reload to i16\n %27 = icmp sgt i16 %26, 99\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n %28 = bitcast i64* %sv_2 to i8*\n %29 = bitcast i64* %sv_1 to i8*\n %30 = call i8* @strncpy(i8* nonnull %28, i8* nonnull %29, i32 %sv_0.1.reload)\n %31 = sext i32 %sv_0.1.reload to i64\n %32 = add i64 %0, -112\n %33 = add i64 %32, %31\n %34 = inttoptr i64 %33 to i8*\n store i8 0, i8* %34, align 1\n br label LBL_9\n LBL_9:\n %35 = call i64 @FUNC(i64* nonnull %sv_2)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %1, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 2, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 4, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0, 2 }\n uselistorder label LBL_6, { 2, 0, 3, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %7 = mul i64 %indvars.iv9.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv9.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_4, label LBL_3\n LBL_4:\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n store i64 %11, i64* %rax.2.reg2mem\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %14 = mul i64 %indvars.iv6.reload, 4\n %15 = add i64 %14, %3\n %16 = inttoptr i64 %15 to i32*\n %17 = trunc i64 %indvars.iv6.reload to i32\n store i32 %17, i32* %16, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_6, label LBL_5\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %18 = mul i64 %indvars.iv.reload, 4\n %19 = add i64 %18, %3\n %20 = inttoptr i64 %19 to i32*\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %23, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_34-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %4 = and i64 %3, -16\n store i64 %4, i64* %sv_1, align 8\n %5 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 100)\n %6 = add i64 %2, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %4\n %9 = add i64 %6, %7\n %10 = inttoptr i64 %9 to i64*\n %11 = load i64, i64* %10, align 8\n %12 = inttoptr i64 %8 to i64*\n store i64 %11, i64* %12, align 8\n %13 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %14 = inttoptr i64 %4 to i64*\n %15 = load i64, i64* %14, align 16\n %16 = call i64 @FUNC(i64 %15)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_34-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_34_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 10)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = bitcast i64* %1 to i8*\n store i64 4702111234474983745, i64* %sv_0, align 8\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strcpy(i8* %5, i8* nonnull %6)\n %8 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 3, 1, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_multiply_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 32, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %11 = zext i32 %.reload to i64\n %12 = icmp eq i32 %.reload, 5\n %13 = icmp eq i1 %12, false\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %14 = trunc i32 %sv_0.0.reload to i8\n %15 = icmp slt i8 %14, 1\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_4\n LBL_4:\n %16 = icmp sgt i8 %14, 62\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %sext2 = mul i32 %sv_0.0.reload, 33554432\n %17 = ashr exact i32 %sext2, 24\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %20 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memmove_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 11)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memmove(i64* %11, i64* nonnull %sv_1, i32 %10)\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %11)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__connect_socket_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.1.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @gv_3, i64 0, i64 0), i32 143, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_4, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_2\n LBL_2:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %rax.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_fprintf_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_1 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %5, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_0 to %sockaddr*\n %10 = call i32 @connect(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_8, label LBL_3\n LBL_3:\n %12 = sext i32 %4 to i64\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = add i64 %12, %13\n %15 = inttoptr i64 %14 to i64*\n %16 = sub i32 99, %4\n %17 = call i32 @recv(i32 %5, i64* %15, i32 %16, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n br i1 %19, label LBL_8, label LBL_4\n LBL_4:\n %20 = sext i32 %17 to i64\n %21 = add i64 %14, %20\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = call i8* @strchr(i8* nonnull %3, i32 13)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %23, align 1\n br label LBL_6\n LBL_6:\n %25 = call i8* @strchr(i8* nonnull %3, i32 10)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %25, align 1\n br label LBL_8\n LBL_8:\n %27 = call i32 @close(i32 %5)\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_2, align 4\n %29 = icmp eq i32 %28, 0\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_11:\n %31 = load %_IO_FILE*, %_IO_FILE** @gv_4, align 8\n %32 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_5, i64 0, i64 0), i64* nonnull %sv_1)\n br label LBL_12\n LBL_12:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %5, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_system_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = add i64 %6, %7\n %9 = inttoptr i64 %8 to i32*\n store i32 2764330, i32* %9, align 4\n br label LBL_3\n LBL_3:\n %10 = call i32 @system(i8* nonnull %1)\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_2 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_5:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_sub_12-bad", "fun_name": "CWE191_Integer_Underflow__int_fgets_sub_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -2, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = add i32 %sv_0.0.reload, -1\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_9\n LBL_6:\n %16 = icmp eq i32 %sv_0.0.reload, -2147483648\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n %17 = add i32 %sv_0.0.reload, -1\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n br label LBL_9\n LBL_8:\n %20 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_9\n LBL_9:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__connect_socket_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n ret i64 1\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__char_type_overrun_memcpy_12-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__char_type_overrun_memcpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 32)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = add i64 %4, 16\n %8 = inttoptr i64 %7 to i64*\n store i64 ptrtoint ([32 x i8]* @gv_0 to i64), i64* %8, align 8\n %9 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n %10 = call i64* @memcpy(i64* %3, i64* bitcast ([32 x i8]* @gv_0 to i64*), i32 32)\n %11 = add i64 %4, 15\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %4)\n %14 = load i64, i64* %8, align 8\n %15 = call i64 @FUNC(i64 %14)\n call void @free(i64* %3)\n br label LBL_7\n LBL_4:\n br i1 %6, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %16 = add i64 %4, 16\n %17 = inttoptr i64 %16 to i64*\n store i64 ptrtoint ([32 x i8]* @gv_0 to i64), i64* %17, align 8\n %18 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n %19 = call i64* @memcpy(i64* %3, i64* bitcast ([32 x i8]* @gv_0 to i64*), i32 16)\n %20 = add i64 %4, 15\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = call i64 @FUNC(i64 %4)\n %23 = load i64, i64* %17, align 8\n %24 = call i64 @FUNC(i64 %23)\n call void @free(i64* %3)\n br label LBL_7\n LBL_7:\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64 %4, { 2, 3, 5, 0, 1, 4 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder [32 x i8]* @gv_0, { 1, 0 }\n uselistorder i64 ptrtoint ([32 x i8]* @gv_0 to i64), { 1, 2, 0, 3 }\n uselistorder i32 32, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_divide_14-bad", "fun_name": "CWE369_Divide_by_Zero__int_fscanf_divide_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = udiv i32 100, %9\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_postdec_07-bad", "fun_name": "CWE191_Integer_Underflow__short_fscanf_postdec_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = load i16, i16* %sv_0, align 2\n %9 = add i16 %8, -1\n store i16 %9, i16* %sv_0, align 2\n %10 = sext i16 %9 to i64\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_pointer_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %2, i64* %storemerge.reg2mem\n br label LBL_5\n LBL_2:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = ptrtoint i64* %3 to i64\n %8 = add i64 %7, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 6, i32* %9, align 4\n %10 = load i32, i32* %6, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = load i32, i32* %9, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n store i64 %15, i64* %storemerge.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_08-bad", "fun_name": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_13, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_10, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %6, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_11, label LBL_4\n LBL_4:\n %14 = bitcast i64* %sv_0 to %sockaddr*\n %15 = call i32 @bind(i32 %6, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_5\n LBL_5:\n %17 = sub i32 99, %5\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = sext i32 %5 to i64\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i64*\n %22 = call i32 @recv(i32 %10, i64* %21, i32 %17, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = ptrtoint i64* %sv_2 to i64\n %26 = sext i32 %22 to i64\n %27 = add i64 %25, -112\n %28 = add i64 %27, %26\n %29 = inttoptr i64 %28 to i8*\n store i8 0, i8* %29, align 1\n %30 = call i8* @strchr(i8* nonnull %4, i32 13)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %30, align 1\n br label LBL_8\n LBL_8:\n %32 = call i8* @strchr(i8* nonnull %4, i32 10)\n %33 = icmp eq i8* %32, null\n br i1 %33, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %32, align 1\n br label LBL_11\n LBL_10:\n %34 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %35 = call i32 @close(i32 %6)\n %36 = call i32 @close(i32 %10)\n br label LBL_12\n LBL_12:\n %37 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_13\n LBL_13:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 0, 4, 1, 2, 3, 5 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 0, 1, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0 }\n uselistorder label LBL_11, { 2, 1, 0, 4, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_multiply_05-bad", "fun_name": "CWE191_Integer_Underflow__int_rand_multiply_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = urem i32 %2, 2\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @rand()\n %6 = mul i32 %5, 1073741824\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = xor i32 %8, %6\n %10 = call i32 @rand()\n %11 = xor i32 %9, %10\n %12 = sext i1 %4 to i32\n %storemerge.in = xor i32 %11, %12\n %13 = load i32, i32* @gv_0, align 4\n %14 = zext i32 %13 to i64\n %15 = icmp eq i32 %13, 0\n %16 = icmp slt i32 %storemerge.in, 0\n %17 = icmp eq i1 %16, false\n %or.cond = or i1 %15, %17\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_3, label LBL_2\n LBL_2:\n %18 = mul i32 %storemerge.in, 2\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 7\n %6 = urem i32 100, %spec.select\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 7, { 1, 0 }\n uselistorder i32 -1, { 9, 0, 4, 3, 10, 1, 11, 2, 8, 7, 12, 5, 13, 6 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_max_add_11-bad", "fun_name": "CWE190_Integer_Overflow__short_max_add_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 1, i64 4294934528\n %6 = call i64 @FUNC(i64 %spec.select)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_postdec_14-bad", "fun_name": "CWE191_Integer_Underflow__char_min_postdec_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %7 = select i1 %6, i64 31, i64 127\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 400)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_5, label LBL_4\n LBL_4:\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 3, 2, 0, 4 }\n uselistorder i32* @gv_0, { 0, 4, 3, 2, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fgets_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = load i32, i32* @gv_0, align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n store i32 %6, i32* %.reg2mem\n store i32 %5, i32* %sv_0.0.reg2mem\n br i1 %8, label LBL_5, label LBL_1\n LBL_1:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %10 = bitcast i64* %sv_1 to i8*\n %11 = call i8* @fgets(i8* nonnull %10, i32 20, %_IO_FILE* %9)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_3, label LBL_2\n LBL_2:\n %13 = call double @atof(i8* nonnull %10)\n %14 = fptrunc double %13 to float\n %15 = bitcast float %14 to i32\n %16 = sext i32 %15 to i128\n %17 = call i128 @FUNC(i128 %16)\n %18 = call i64 @FUNC(i128 %17)\n %19 = trunc i64 %18 to i32\n store i32 %19, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %20 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i32, i32* %.reg2mem\n %21 = icmp eq i32 %.reload, 5\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_9, label LBL_6\n LBL_6:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %23 = call i128 @__asm_movss.1(i32 %sv_0.0.reload)\n %24 = call i128 @__asm_movss.1(i32 2147483647)\n %25 = call i128 @FUNC(i128 %23, i128 %24)\n %26 = call i128 @FUNC(i128 %25)\n %27 = load i128, i128* @gv_3, align 8\n call void @FUNC(i128 %26, i128 %27)\n %28 = icmp ult i32 %.reload, 6\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n %29 = call i128 @FUNC(i128 %24, i128 %24)\n %30 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.0.reload)\n %31 = call i128 @FUNC(i64 4636737291354636288)\n %32 = call i128 @FUNC(i128 %31, i128 %30)\n %33 = call i32 @FUNC(i128 %32)\n %34 = zext i32 %33 to i64\n %35 = call i64 @FUNC(i64 %34)\n br label LBL_9\n LBL_8:\n %36 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_4 to i64))\n br label LBL_9\n LBL_9:\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %2, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %24, { 1, 0, 2 }\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i128* @gv_3, { 1, 0 }\n uselistorder double (i8*)* @atof, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* %4, i8* nonnull %6, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i8 0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %4 = call i32 @fclose(%_IO_FILE* %3)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %5 = icmp eq i32 %.reload, 5\n store i64 5, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %storemerge34.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_8, label LBL_3\n LBL_3:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_7, label LBL_4\n LBL_4:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_8, label LBL_5\n LBL_5:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_8, label LBL_6\n LBL_6:\n store i8 0, i8* %20, align 1\n br label LBL_8\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_8\n LBL_8:\n %25 = load i32, i32* inttoptr (i64 8392 to i32*), align 8\n %26 = icmp eq i32 %25, 5\n br i1 %26, label LBL_9, label LBL_11\n LBL_9:\n %27 = call i32 @strlen(i8* nonnull %3)\n %28 = icmp eq i32 %27, 0\n br i1 %28, label LBL_15, label LBL_10\n LBL_10:\n %29 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge34.reg2mem\n br label LBL_12\n LBL_11:\n %30 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %30, i64* %storemerge.reg2mem\n br label LBL_16\n LBL_12:\n %storemerge34.reload = load i64, i64* %storemerge34.reg2mem\n %31 = add i64 %storemerge34.reload, %29\n %32 = inttoptr i64 %31 to i8*\n %33 = load i8, i8* %32, align 1\n %34 = icmp eq i8 %33, 83\n %35 = icmp eq i1 %34, false\n br i1 %35, label LBL_14, label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n br label LBL_15\n LBL_14:\n %37 = add nuw i64 %storemerge34.reload, 1\n %38 = call i32 @strlen(i8* %3)\n %39 = sext i32 %38 to i64\n %40 = icmp ult i64 %37, %39\n store i64 %37, i64* %storemerge34.reg2mem\n br i1 %40, label LBL_12, label LBL_15\n LBL_15:\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_16\n LBL_16:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 2, 0, 1, 4, 3 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge34.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_15, { 0, 2, 1 }\n uselistorder label LBL_12, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memmove_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %5 = ptrtoint i64* %sv_2 to i64\n %6 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %6, align 8\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_1, i32 100)\n %10 = add i64 %sv_0.0.reload, 99\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = call i64 @FUNC(i64 %sv_0.0.reload)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_postinc_13-bad", "fun_name": "CWE190_Integer_Overflow__short_rand_postinc_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 1, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %phitmp = add i32 %sext, 65536\n %phitmp3 = ashr exact i32 %phitmp, 16\n %phitmp4 = zext i32 %phitmp3 to i64\n store i64 %phitmp4, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = call i64 @FUNC(i64 %sv_0.0.reload)\n ret i64 %12\n\n uselistorder i32 65536, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__listen_socket_malloc_05-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__listen_socket_malloc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.113.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.113.reg2mem\n br i1 %2, label LBL_10, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.113.reg2mem\n br i1 %4, label LBL_10, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_8, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_8, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_8, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 7, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_9, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -16\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n %.off = add i32 %23, 32768\n %24 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %24, label LBL_7, label LBL_9\n LBL_7:\n %sext4 = mul i32 %23, 65536\n %25 = ashr exact i32 %sext4, 16\n store i32 %25, i32* %sv_0.0.ph.reg2mem\n br label LBL_9\n LBL_8:\n %26 = call i32 @close(i32 %3)\n store i32 0, i32* %sv_0.113.reg2mem\n br label LBL_10\n LBL_9:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %27 = call i32 @close(i32 %3)\n %28 = call i32 @close(i32 %12)\n %29 = trunc i32 %sv_0.0.ph.reload to i16\n %30 = icmp sgt i16 %29, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.113.reg2mem\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.113.reload = load i32, i32* %sv_0.113.reg2mem\n %31 = call i64* @malloc(i32 %sv_0.113.reload)\n %32 = icmp eq i64* %31, null\n %33 = icmp eq i1 %32, false\n br i1 %33, label LBL_12, label LBL_11\n LBL_11:\n call void @exit(i32 -1)\n unreachable\n LBL_12:\n %34 = ptrtoint i64* %31 to i64\n %35 = add nsw i32 %sv_0.113.reload, -1\n %36 = call i64* @memset(i64* %31, i32 65, i32 %35)\n %37 = zext i32 %sv_0.113.reload to i64\n %sext3 = mul i64 %37, 281474976710656\n %38 = ashr exact i64 %sext3, 48\n %39 = add i64 %34, -1\n %40 = add i64 %39, %38\n %41 = inttoptr i64 %40 to i8*\n store i8 0, i8* %41, align 1\n %42 = call i64 @FUNC(i64 %34)\n call void @free(i64* %31)\n br label LBL_13\n LBL_13:\n %43 = call i64 @FUNC(i64 40)\n %44 = icmp eq i64 %0, %43\n store i64 0, i64* %rax.0.reg2mem\n br i1 %44, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %34, { 1, 0 }\n uselistorder i64* %31, { 0, 1, 3, 2 }\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %sv_0.113.reg2mem, { 0, 4, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 6, 0, 2, 3, 4, 5 }\n uselistorder label LBL_10, { 3, 1, 0, 2 }\n uselistorder label LBL_9, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE588_Attempt_to_Access_Child_of_Non_Structure_Pointer__struct_13-bad", "fun_name": "CWE588_Attempt_to_Access_Child_of_Non_Structure_Pointer__struct_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n store i32 100, i32* %sv_0, align 4\n %3 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n %6 = ptrtoint i32* %sv_0 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = call i64 @FUNC(i64 %spec.select)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %2, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_pointer_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 4)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = bitcast i64* %2 to i32*\n store i32 5, i32* %5, align 4\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n %7 = call i64 @FUNC(i64 5)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 3, 2, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 0, 1, 4 }\n uselistorder i32* @gv_0, { 0, 3, 2, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE390_Error_Without_Action__sqrt_01-bad", "fun_name": "CWE390_Error_Without_Action__sqrt_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32* @__errno_location()\n store i32 0, i32* %0, align 4\n %1 = call i128 @FUNC(i64 -4616189618054758400)\n %2 = trunc i128 %1 to i64\n %3 = bitcast i64 %2 to double\n %4 = call double @sqrt(double %3)\n %5 = fptrunc double %4 to float\n %6 = bitcast float %5 to i32\n %7 = sext i32 %6 to i128\n %8 = call i64 @__asm_movq.1(i128 %7)\n %9 = call i32* @__errno_location()\n %10 = call i128 @FUNC(i64 %8)\n %11 = call i64 @FUNC()\n ret i64 %11\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_divide_12-bad", "fun_name": "CWE369_Divide_by_Zero__int_fscanf_divide_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_3\n LBL_2:\n store i32 7, i32* %sv_0, align 4\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = load i32, i32* %sv_0, align 4\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %10 = udiv i32 100, %9\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_8\n LBL_5:\n %13 = icmp eq i32 %9, 0\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = udiv i32 100, %9\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_8\n LBL_7:\n %17 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 0, 2, 1 }\n uselistorder i32* %sv_0, { 1, 2, 0, 3 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_11-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__CWE135_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem4 = alloca i8*\n %.reg2mem = alloca i32*\n %sv_0 = alloca i32*, align 8\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32* null, i32** %.reg2mem\n store i8* null, i8** %.reg2mem4\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 200)\n %4 = bitcast i64* %3 to i32*\n store i32* %4, i32** %sv_0, align 8\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i32* @wmemset(i32* %4, i32 65, i32 49)\n %8 = ptrtoint i64* %3 to i64\n %9 = add i64 %8, 196\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = load i32*, i32** %sv_0, align 8\n %12 = bitcast i32* %11 to i8*\n store i32* %11, i32** %.reg2mem\n store i8* %12, i8** %.reg2mem4\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n store i64 %13, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %.reload5 = load i8*, i8** %.reg2mem4\n %16 = call i32 @strlen(i8* %.reload5)\n %17 = add i32 %16, 1\n %18 = call i64* @calloc(i32 %17, i32 4)\n %19 = icmp eq i64* %18, null\n %20 = icmp eq i1 %19, false\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %.reload = load i32*, i32** %.reg2mem\n %21 = bitcast i64* %18 to i32*\n %22 = call i32* @wcscpy(i32* %21, i32* %.reload)\n %23 = ptrtoint i64* %18 to i64\n %24 = call i64 @FUNC(i64 %23)\n call void @free(i64* %18)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %18, { 1, 0, 3, 2 }\n uselistorder i32** %.reg2mem, { 0, 2, 1 }\n uselistorder i8** %.reg2mem4, { 0, 2, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_malloc_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 8)\n %1 = load i32, i32* @gv_0, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n %5 = icmp eq i64* %0, null\n %or.cond = or i1 %5, %4\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 1, 3, 2, 4, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_divide_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n %7 = urem i32 %2, 2\n %8 = icmp eq i32 %7, 0\n %9 = mul i32 %3, 1073741824\n %10 = mul i32 %4, 32768\n %11 = xor i32 %10, %9\n %12 = xor i32 %11, %5\n %13 = sext i1 %8 to i32\n %storemerge.in = xor i32 %12, %13\n %14 = icmp eq i32 %storemerge.in, 0\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = udiv i32 100, %storemerge.in\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_sub_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i32 %6, -1\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_postdec_05-bad", "fun_name": "CWE191_Integer_Underflow__short_fscanf_postdec_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i16, i16* %sv_0, align 2\n %7 = add i16 %6, -1\n store i16 %7, i16* %sv_0, align 2\n %8 = sext i16 %7 to i64\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0, 3 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE588_Attempt_to_Access_Child_of_Non_Structure_Pointer__struct_14-bad", "fun_name": "CWE588_Attempt_to_Access_Child_of_Non_Structure_Pointer__struct_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n store i32 100, i32* %sv_0, align 4\n %3 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n %6 = ptrtoint i32* %sv_0 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = call i64 @FUNC(i64 %spec.select)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %2, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_listen_socket_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8440 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_8, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_9, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %15, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_9\n LBL_7:\n %25 = call i32 @close(i32 %4)\n br label LBL_8\n LBL_8:\n store i64 0, i64* %sv_2, align 8\n br label LBL_12\n LBL_9:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i64 0, i64* %sv_2, align 8\n %28 = icmp ugt i32 %sv_0.0.ph.reload, 9\n br i1 %28, label LBL_12, label LBL_10\n LBL_10:\n %29 = sext i32 %sv_0.0.ph.reload to i64\n %30 = mul i64 %29, 4\n %31 = add i64 %15, -64\n %32 = add i64 %30, %31\n %33 = inttoptr i64 %32 to i32*\n store i32 1, i32* %33, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_11\n LBL_11:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %34 = mul i64 %indvars.iv.reload, 4\n %35 = add i64 %34, %31\n %36 = inttoptr i64 %35 to i32*\n %37 = load i32, i32* %36, align 4\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_13, label LBL_11\n LBL_12:\n %40 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_13\n LBL_13:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i64 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 3, 0, 1, 4, 2 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %.in.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i8** %sv_1 to i64\n %5 = add i64 %4, -49\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n %8 = bitcast i8** %sv_1 to i64*\n store i64 %6, i64* %8, align 8\n store i8 0, i8* %7, align 16\n br label LBL_2\n LBL_2:\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = load i8*, i8** %sv_1, align 8\n %11 = ptrtoint i64* %sv_0 to i64\n store i8* %10, i8** %.in.reg2mem\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %.in.reload = load i8*, i8** %.in.reg2mem\n %12 = ptrtoint i8* %.in.reload to i64\n %13 = add i64 %storemerge3.reload, %12\n %14 = add i64 %storemerge3.reload, %11\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = inttoptr i64 %13 to i8*\n store i8 %16, i8* %17, align 1\n %18 = add nuw nsw i64 %storemerge3.reload, 1\n %19 = load i8*, i8** %sv_1, align 8\n %exitcond = icmp eq i64 %18, 100\n store i8* %19, i8** %.in.reg2mem\n store i64 %18, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %20 = ptrtoint i8* %19 to i64\n %21 = add i64 %20, 99\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = load i8*, i8** %sv_1, align 8\n %24 = ptrtoint i8* %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %19, { 1, 0 }\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i8** %sv_1, { 4, 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i8** %.in.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_connect_socket_08-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_connect_socket_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_6, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %26 = icmp sgt i32 %sv_0.1.reload, 9\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = sext i32 %sv_0.1.reload to i64\n %28 = mul i64 %27, 4\n %29 = add i64 %0, -64\n %30 = add i64 %29, %28\n %31 = inttoptr i64 %30 to i32*\n %32 = load i32, i32* %31, align 4\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_10\n LBL_9:\n %35 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_10:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %1, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_memcpy_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %2, i64 0, i64 50)\n %3 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 400)\n %4 = bitcast i64* %sv_1 to i32*\n %5 = load i32, i32* %4, align 8\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_multiply_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pr = load i16, i16* %sv_0, align 2\n %6 = load i32, i32* @gv_0, align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n %9 = icmp slt i16 %.pr, 1\n %or.cond = or i1 %9, %8\n br i1 %or.cond, label LBL_5, label LBL_2\n LBL_2:\n %10 = icmp sgt i16 %.pr, ptrtoint (i1* @gv_3 to i16)\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = mul i16 %.pr, 2\n %12 = sext i16 %11 to i64\n %13 = and i64 %12, 4294967294\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_5\n LBL_4:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %.pr, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n store i64 8382078947037833542, i64* %0, align 8\n %4 = add i64 %3, 8\n %5 = inttoptr i64 %4 to i32*\n store i32 1735289202, i32* %5, align 4\n %6 = add i64 %3, 12\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %8, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_8, label LBL_3\n LBL_3:\n %10 = bitcast i64* %0 to i8*\n %11 = call i32 @strlen(i8* nonnull %10)\n %12 = icmp eq i32 %11, 0\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %13 = add i64 %storemerge2.reload, %3\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = icmp eq i8 %15, 83\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n %18 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_6:\n %19 = add nuw i64 %storemerge2.reload, 1\n %20 = call i32 @strlen(i8* %10)\n %21 = sext i32 %20 to i64\n %22 = icmp ult i64 %19, %21\n store i64 %19, i64* %storemerge2.reg2mem\n br i1 %22, label LBL_4, label LBL_7\n LBL_7:\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %10, { 1, 0 }\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 4, 2, 1, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 3, 0, 2, 1, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_7, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_ncpy_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_ncpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -49\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %9, i32 99)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = add i64 %11, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %11)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__struct_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32*\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %1 = load i32*, i32** %0\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 5\n store i64 0, i64* %.reg2mem\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %phitmp = icmp eq i32 %.pre, 5\n %phitmp2 = icmp eq i1 %phitmp, false\n br i1 %phitmp2, label LBL_4, label LBL_1.LBL_3_crit_edge\n LBL_2:\n %.pre4 = load i32, i32* %1, align 4\n %phitmp5 = zext i32 %.pre4 to i64\n store i64 %phitmp5, i64* %.reg2mem\n br label LBL_3\n LBL_3:\n %.reload = load i64, i64* %.reg2mem\n %6 = call i64 @FUNC(i64 %.reload)\n br label LBL_4\n LBL_4:\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %2, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_malloc_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 4)\n %1 = icmp eq i64* %0, null\n store i64 1, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = bitcast i64* %0 to i32*\n store i32 5, i32* %2, align 4\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_17-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.08.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -112\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.08.reg2mem\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = bitcast i64* %sv_3 to %sockaddr*\n %6 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %5, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_2\n LBL_2:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_2, i32 7, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_3\n LBL_3:\n %14 = bitcast i64* %sv_2 to i8*\n %15 = sext i32 %11 to i64\n %16 = add i64 %2, %15\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i32 @atoi(i8* nonnull %14)\n %.off = add i32 %18, 32768\n %19 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %19, label LBL_4, label LBL_5\n LBL_4:\n %sext3 = mul i32 %18, 65536\n %20 = ashr exact i32 %sext3, 16\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.08.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.08.reload = load i32, i32* %sv_0.08.reg2mem\n store i64 0, i64* %sv_2, align 8\n %22 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %23 = trunc i32 %sv_0.08.reload to i16\n %24 = icmp sgt i16 %23, 99\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n %25 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.08.reload)\n %26 = sext i32 %sv_0.08.reload to i64\n %27 = add i64 %2, %26\n %28 = inttoptr i64 %27 to i8*\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %29 = call i64 @FUNC(i64* nonnull %sv_2)\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %1, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.08.reload, { 1, 2, 0 }\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_3, { 2, 1, 0 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 4, 2, 1 }\n uselistorder i32* %sv_0.08.reg2mem, { 0, 2, 1 }\n uselistorder i8 0, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 0, 3, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_for_loop_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %sv_1.0.off = add i32 %6, -1\n %7 = icmp ugt i32 %sv_1.0.off, 19\n br i1 %7, label LBL_5, label LBL_3\n LBL_3:\n %8 = sext i32 %6 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %9 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %10 = add nuw i64 %storemerge3.reload, 1\n %11 = icmp ult i64 %10, %8\n store i64 %10, i64* %storemerge3.reg2mem\n br i1 %11, label LBL_4, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 1, 0 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_5, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_fwrite_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_15, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_15\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.0.off = add i32 %sv_0.0.ph.reload, -1\n %25 = icmp ugt i32 %sv_0.0.off, 19\n br i1 %25, label LBL_15, label LBL_8\n LBL_8:\n %26 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %27 = icmp eq %_IO_FILE* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_9, label LBL_10\n LBL_9:\n %29 = sext i32 %sv_0.0.ph.reload to i64\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_11\n LBL_10:\n call void @exit(i32 1)\n unreachable\n LBL_11:\n %30 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %26)\n %31 = icmp eq i32 %30, 50\n br i1 %31, label LBL_13, label LBL_12\n LBL_12:\n call void @exit(i32 1)\n unreachable\n LBL_13:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %32 = add nuw i64 %storemerge13.reload, 1\n %33 = icmp ult i64 %32, %29\n store i64 %32, i64* %storemerge13.reg2mem\n br i1 %33, label LBL_11, label LBL_14\n LBL_14:\n %34 = call i32 @fclose(%_IO_FILE* nonnull %26)\n br label LBL_15\n LBL_15:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %26, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 0, 2, 3, 4, 5 }\n uselistorder label LBL_15, { 2, 3, 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_multiply_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp slt i32 %6, 1\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = icmp sgt i32 %6, 1073741822\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = mul i32 %6, 2\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_6\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 0, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder label LBL_6, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = bitcast i64* %sv_2 to i16*\n store i16 ptrtoint (i64* @gv_0 to i16), i16* %3, align 8\n %4 = or i64 %2, 2\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 2\n %6 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %7 = icmp eq i32 %6, 1\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_5, label LBL_1\n LBL_1:\n %9 = load i64, i64* %sv_1, align 8\n %10 = and i64 %9, 4294967295\n %11 = icmp eq i64 %10, 0\n store i32 0, i32* %storemerge3.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %11, label LBL_4, label LBL_2\n LBL_2:\n %storemerge3.reload = load i32, i32* %storemerge3.reg2mem\n %12 = add i32 %storemerge3.reload, 1\n %13 = sext i32 %12 to i64\n %14 = icmp sgt i64 %10, %13\n store i32 %12, i32* %storemerge3.reg2mem\n br i1 %14, label LBL_2, label LBL_3\n LBL_3:\n %phitmp = zext i32 %12 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %15 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0, 2 }\n uselistorder i32* %storemerge3.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_loop_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %3, align 8\n store i8* %3, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %5 = ptrtoint i8* %sv_0.0.reload to i64\n %6 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %7 = add i64 %storemerge2.reload, %5\n %8 = add i64 %storemerge2.reload, %6\n %9 = inttoptr i64 %8 to i8*\n %10 = load i8, i8* %9, align 1\n %11 = inttoptr i64 %7 to i8*\n store i8 %10, i8* %11, align 1\n %12 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %13 = add i64 %5, 99\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n %15 = call i64 @FUNC(i64 %5)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i64 %5, { 1, 2, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__open_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = load i32, i32* @gv_1, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_2:\n %4 = icmp eq i32 %0, -1\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = call i32 @close(i32 %0)\n br label LBL_4\n LBL_4:\n %6 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gv_3, i64 0, i64 0), i32 66)\n %7 = icmp eq i32 %6, -1\n store i64 -1, i64* %rax.0.reg2mem\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n %8 = call i32 @close(i32 %6)\n %9 = sext i32 %8 to i64\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %.pre = inttoptr i64 %3 to i64*\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i64* @memset(i64* %.pre, i32 65, i32 99)\n %8 = add i64 %3, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n br label LBL_2\n LBL_2:\n %10 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = call i32 @strlen(i8* %10)\n %12 = call i64* @memcpy(i64* nonnull %sv_0, i64* %.pre, i32 %11)\n %13 = call i64 @FUNC(i64 %3)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 3, 2, 0, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_square_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.off0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64 0, i64* %sv_0.0.off0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 1152921504606846976\n %9 = call i32 @rand()\n %10 = zext i32 %9 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 1073741824\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = mul i64 %16, 32768\n %18 = call i32 @rand()\n %19 = sext i32 %18 to i64\n %20 = sext i1 %5 to i64\n %21 = xor i64 %8, %20\n %22 = xor i64 %21, %11\n %23 = xor i64 %22, %14\n %24 = xor i64 %23, %17\n %storemerge = xor i64 %24, %19\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i64 %storemerge, i64* %sv_0.0.off0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %25 = icmp eq i32 %.reload, 5\n br i1 %25, label LBL_4, label LBL_3\n LBL_3:\n %26 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %26, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.off0.reload = load i64, i64* %sv_0.0.off0.reg2mem\n %sv_0.0.off0.off = add i64 %sv_0.0.off0.reload, 3037000499\n %27 = icmp ugt i64 %sv_0.0.off0.off, 6074000998\n br i1 %27, label LBL_6, label LBL_5\n LBL_5:\n %28 = mul i64 %sv_0.0.off0.reload, %sv_0.0.off0.reload\n %29 = call i64 @FUNC(i64 %28)\n store i64 %29, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %30, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.off0.reload, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.off0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_int64_t_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i64*\n store i64 5, i64* %6, align 8\n %7 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %7, 100\n store i64 %7, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %8 = load i64, i64* %0, align 8\n %9 = call i64 @FUNC(i64 %8)\n ret i64 %9\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 1, 2, 0, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 200)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i32*\n %5 = call i32* @wmemset(i32* %4, i32 65, i32 49)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 196\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %9 = call i32 @wcslen(i32* %4)\n %10 = add i32 %9, 1\n %11 = call i64* @calloc(i32 %10, i32 4)\n %12 = icmp eq i64* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %14 = bitcast i64* %11 to i32*\n %15 = call i32* @wcscpy(i32* %14, i32* %4)\n %16 = ptrtoint i64* %11 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %11)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %11, { 1, 0, 3, 2 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_listen_socket_system_32-bad", "fun_name": "CWE78_OS_Command_Injection__char_listen_socket_system_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = sext i32 %2 to i64\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = add i64 %14, %15\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n %32 = call i32 @system(i8* nonnull %1)\n %33 = icmp eq i32 %32, 0\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n %34 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_13:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_ncat_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, 49\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n store i64 0, i64* %sv_0, align 8\n %6 = call i32 @strlen(i8* nonnull %1)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i8* @strncat(i8* nonnull %7, i8* nonnull %1, i32 %6)\n %9 = call i64 @FUNC(i64 %3)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %1, { 1, 0 }\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_for_loop_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge11.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_10, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_10\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.0.off = add i32 %sv_0.0.ph.reload, -1\n %25 = icmp ugt i32 %sv_0.0.off, 19\n br i1 %25, label LBL_10, label LBL_8\n LBL_8:\n %26 = sext i32 %sv_0.0.ph.reload to i64\n store i64 0, i64* %storemerge11.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge11.reload = load i64, i64* %storemerge11.reg2mem\n %27 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n %28 = add nuw i64 %storemerge11.reload, 1\n %29 = icmp ult i64 %28, %26\n store i64 %28, i64* %storemerge11.reg2mem\n br i1 %29, label LBL_9, label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge11.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 4, 5, 6, 7, 3, 1, 8, 9, 10, 11 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_10, { 0, 3, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE469_Use_of_Pointer_Subtraction_to_Determine_Size__char_03-bad", "fun_name": "CWE469_Use_of_Pointer_Subtraction_to_Determine_Size__char_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 8246496015530812001, i64* %sv_1, align 8\n store i64 8246496015530812001, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i8* @strchr(i8* nonnull %1, i32 47)\n %3 = icmp eq i8* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %5 = ptrtoint i8* %2 to i64\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = sub i64 %5, %6\n %8 = and i64 %7, 4294967295\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %2, { 1, 0 }\n uselistorder i64 8246496015530812001, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_partial_init_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.14.reg2mem = alloca i128\n %indvars.iv8.reg2mem = alloca i64\n %xmm0.06.reg2mem = alloca i128\n %indvars.iv11.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %indvars.iv11.reg2mem\n br label LBL_1\n LBL_1:\n %xmm0.06.reload = load i128, i128* %xmm0.06.reg2mem\n %indvars.iv11.reload = load i64, i64* %indvars.iv11.reg2mem\n %2 = mul i64 %indvars.iv11.reload, 8\n %3 = add i64 %2, %1\n %4 = call i128 @FUNC(i128 %xmm0.06.reload, i128 %xmm0.06.reload)\n %5 = trunc i64 %indvars.iv11.reload to i32\n %6 = call i128 @FUNC(i32 %5)\n %7 = call i64 @FUNC(i128 %6)\n %8 = inttoptr i64 %3 to i64*\n store i64 %7, i64* %8, align 8\n %indvars.iv.next12 = add nuw nsw i64 %indvars.iv11.reload, 1\n %exitcond13 = icmp eq i64 %indvars.iv.next12, 5\n store i64 %indvars.iv.next12, i64* %indvars.iv11.reg2mem\n store i128 %6, i128* %xmm0.06.reg2mem\n store i64 0, i64* %indvars.iv8.reg2mem\n store i128 %6, i128* %xmm0.14.reg2mem\n br i1 %exitcond13, label LBL_2, label LBL_1\n LBL_2:\n %xmm0.14.reload = load i128, i128* %xmm0.14.reg2mem\n %indvars.iv8.reload = load i64, i64* %indvars.iv8.reg2mem\n %9 = mul i64 %indvars.iv8.reload, 8\n %10 = add i64 %9, %1\n %11 = call i128 @FUNC(i128 %xmm0.14.reload, i128 %xmm0.14.reload)\n %12 = trunc i64 %indvars.iv8.reload to i32\n %13 = call i128 @FUNC(i32 %12)\n %14 = call i64 @FUNC(i128 %13)\n %15 = inttoptr i64 %10 to i64*\n store i64 %14, i64* %15, align 8\n %indvars.iv.next9 = add nuw nsw i64 %indvars.iv8.reload, 1\n %exitcond10 = icmp eq i64 %indvars.iv.next9, 10\n store i64 %indvars.iv.next9, i64* %indvars.iv8.reg2mem\n store i128 %13, i128* %xmm0.14.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond10, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %16 = mul i64 %indvars.iv.reload, 8\n %17 = add i64 %16, %1\n %18 = inttoptr i64 %17 to i64*\n %19 = load i64, i64* %18, align 8\n %20 = call i128 @FUNC(i64 %19)\n %21 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.14.reload, { 1, 0 }\n uselistorder i128 %xmm0.06.reload, { 1, 0 }\n uselistorder i64* %indvars.iv11.reg2mem, { 1, 0, 2 }\n uselistorder i128* %xmm0.06.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv8.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.14.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_char_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %3)\n br label LBL_7\n LBL_4:\n br i1 %5, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n call void @free(i64* %3)\n br label LBL_7\n LBL_7:\n %6 = call i64 @FUNC()\n ret i64 %6\n\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %3, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memmove_07-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memmove_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = bitcast i64* %4 to i8*\n store i8 0, i8* %8, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %10 = inttoptr i64 %sv_0.0.reload to i64*\n %11 = call i64* @memmove(i64* %10, i64* nonnull %sv_1, i32 100)\n %12 = add i64 %sv_0.0.reload, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %10)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %4, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_ncpy_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = bitcast i8** %sv_2 to i64*\n store i64 %13, i64* %14, align 8\n br label LBL_3\n LBL_3:\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = load i8*, i8** %sv_2, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i8* @strncpy(i8* %16, i8* nonnull %17, i32 99)\n %19 = load i8*, i8** %sv_2, align 8\n %20 = ptrtoint i8* %19 to i64\n %21 = add i64 %20, 99\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = load i8*, i8** %sv_2, align 8\n %24 = ptrtoint i8* %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %1, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 4, 3, 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %storemerge23.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n store i64 8382078947037833542, i64* %0, align 8\n %4 = add i64 %3, 8\n %5 = inttoptr i64 %4 to i32*\n store i32 1735289202, i32* %5, align 4\n %6 = add i64 %3, 12\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC()\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_3, label LBL_4\n LBL_3:\n %11 = bitcast i64* %0 to i8*\n %12 = call i32 @strlen(i8* nonnull %11)\n %13 = icmp eq i32 %12, 0\n store i64 0, i64* %storemerge23.reg2mem\n br i1 %13, label LBL_8, label LBL_5\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %14, i64* %storemerge.reg2mem\n br label LBL_9\n LBL_5:\n %storemerge23.reload = load i64, i64* %storemerge23.reg2mem\n %15 = add i64 %storemerge23.reload, %3\n %16 = inttoptr i64 %15 to i8*\n %17 = load i8, i8* %16, align 1\n %18 = icmp eq i8 %17, 83\n %19 = icmp eq i1 %18, false\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n %20 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n br label LBL_8\n LBL_7:\n %21 = add nuw i64 %storemerge23.reload, 1\n %22 = call i32 @strlen(i8* %11)\n %23 = sext i32 %22 to i64\n %24 = icmp ult i64 %21, %23\n store i64 %21, i64* %storemerge23.reg2mem\n br i1 %24, label LBL_5, label LBL_8\n LBL_8:\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i8* %11, { 1, 0 }\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 4, 2, 1, 3 }\n uselistorder i64* %storemerge23.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_8, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_fwrite_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_15, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_15\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.0.off = add i32 %sv_0.0.ph.reload, -1\n %25 = icmp ugt i32 %sv_0.0.off, 19\n br i1 %25, label LBL_15, label LBL_8\n LBL_8:\n %26 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %27 = icmp eq %_IO_FILE* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_9, label LBL_10\n LBL_9:\n %29 = sext i32 %sv_0.0.ph.reload to i64\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_11\n LBL_10:\n call void @exit(i32 1)\n unreachable\n LBL_11:\n %30 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %26)\n %31 = icmp eq i32 %30, 50\n br i1 %31, label LBL_13, label LBL_12\n LBL_12:\n call void @exit(i32 1)\n unreachable\n LBL_13:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %32 = add nuw i64 %storemerge13.reload, 1\n %33 = icmp ult i64 %32, %29\n store i64 %32, i64* %storemerge13.reg2mem\n br i1 %33, label LBL_11, label LBL_14\n LBL_14:\n %34 = call i32 @fclose(%_IO_FILE* nonnull %26)\n br label LBL_15\n LBL_15:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %26, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 4, 5, 6, 7, 3, 1, 8, 9, 10, 11 }\n uselistorder label LBL_15, { 2, 3, 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fscanf_08-bad", "fun_name": "CWE124_Buffer_Underwrite__CWE839_fscanf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_7, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = icmp sgt i32 %9, 9\n br i1 %10, label LBL_6, label LBL_4\n LBL_4:\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = sext i32 %9 to i64\n %13 = mul i64 %12, 4\n %14 = add i64 %11, -48\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i32*\n store i32 1, i32* %16, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %17 = mul i64 %indvars.iv.reload, 4\n %18 = add i64 %17, %14\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_5\n LBL_6:\n %23 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_7:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_7, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_sleep_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n %10 = load i32, i32* %sv_0, align 4\n %11 = icmp slt i32 %10, 1\n %12 = icmp sgt i32 %10, ptrtoint (i1* @gv_3 to i32)\n %or.cond = or i1 %11, %12\n br i1 %or.cond, label LBL_6, label LBL_5\n LBL_5:\n %13 = call i32 @usleep(i32 %10)\n %14 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_6:\n %15 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_5 to i64))\n br label LBL_7\n LBL_7:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fscanf_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gv_1, i64 0, i64 0), i32 89, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_2, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i8*, i8*, i32, i8*)* @__assert_fail, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int64_t_14-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__int64_t_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = load i32, i32* @gv_0, align 4\n %3 = zext i32 %2 to i64\n %4 = icmp eq i32 %2, 5\n %5 = icmp eq i1 %4, false\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = inttoptr i64 %1 to i64*\n %7 = load i64, i64* %6, align 8\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_loop_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_loop_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_2 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %7 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %6, i64 %1, i64 %7\n %8 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = add i64 %2, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = mul i64 %storemerge1.reload, 8\n %11 = add i64 %10, %spec.select\n %12 = add i64 %9, %10\n %13 = inttoptr i64 %12 to i64*\n %14 = load i64, i64* %13, align 8\n %15 = inttoptr i64 %11 to i64*\n store i64 %14, i64* %15, align 8\n %16 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %17 = inttoptr i64 %spec.select to i64*\n %18 = load i64, i64* %17, align 8\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %3, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %spec.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge34.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_8, label LBL_3\n LBL_3:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_7, label LBL_4\n LBL_4:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_8, label LBL_5\n LBL_5:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_8, label LBL_6\n LBL_6:\n store i8 0, i8* %20, align 1\n br label LBL_8\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_8\n LBL_8:\n %25 = call i64 @FUNC()\n %26 = trunc i64 %25 to i32\n %27 = icmp eq i32 %26, 0\n %28 = call i32 @strlen(i8* nonnull %3)\n %29 = icmp eq i32 %28, 0\n br i1 %27, label LBL_11, label LBL_9\n LBL_9:\n br i1 %29, label LBL_16, label LBL_10\n LBL_10:\n %30 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge5.reg2mem\n br label LBL_13\n LBL_11:\n br i1 %29, label LBL_20, label LBL_12\n LBL_12:\n %31 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge34.reg2mem\n br label LBL_17\n LBL_13:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %32 = add i64 %storemerge5.reload, %30\n %33 = inttoptr i64 %32 to i8*\n %34 = load i8, i8* %33, align 1\n %35 = icmp eq i8 %34, 83\n %36 = icmp eq i1 %35, false\n br i1 %36, label LBL_15, label LBL_14\n LBL_14:\n %37 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n br label LBL_16\n LBL_15:\n %38 = add nuw i64 %storemerge5.reload, 1\n %39 = call i32 @strlen(i8* %3)\n %40 = sext i32 %39 to i64\n %41 = icmp ult i64 %38, %40\n store i64 %38, i64* %storemerge5.reg2mem\n br i1 %41, label LBL_13, label LBL_16\n LBL_16:\n call void @free(i64* %0)\n br label LBL_21\n LBL_17:\n %storemerge34.reload = load i64, i64* %storemerge34.reg2mem\n %42 = add i64 %storemerge34.reload, %31\n %43 = inttoptr i64 %42 to i8*\n %44 = load i8, i8* %43, align 1\n %45 = icmp eq i8 %44, 83\n %46 = icmp eq i1 %45, false\n br i1 %46, label LBL_19, label LBL_18\n LBL_18:\n %47 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n br label LBL_20\n LBL_19:\n %48 = add nuw i64 %storemerge34.reload, 1\n %49 = call i32 @strlen(i8* %3)\n %50 = sext i32 %49 to i64\n %51 = icmp ult i64 %48, %50\n store i64 %48, i64* %storemerge34.reg2mem\n br i1 %51, label LBL_17, label LBL_20\n LBL_20:\n call void @free(i64* %0)\n br label LBL_21\n LBL_21:\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %29, { 1, 0 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 3, 2, 0, 1, 5, 4 }\n uselistorder i64* %0, { 1, 3, 0, 2, 4, 6, 5 }\n uselistorder i64* %storemerge5.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge34.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 4, 3, 0, 2, 1, 5 }\n uselistorder i8 0, { 1, 2, 3, 4, 0 }\n uselistorder label LBL_20, { 0, 2, 1 }\n uselistorder label LBL_17, { 1, 0 }\n uselistorder label LBL_16, { 0, 2, 1 }\n uselistorder label LBL_13, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_popen_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 7955998172649846063, i64* %sv_0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 27422013814697007, i64* %6, align 8\n br label LBL_2\n LBL_2:\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call %_IO_FILE* @popen(i8* nonnull %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n %10 = call i32 @pclose(%_IO_FILE* nonnull %8)\n br label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 1, 0, 3 }\n uselistorder i32 (%_IO_FILE*)* @pclose, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_loop_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -97\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 99)\n %8 = add i64 %5, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 0\n %spec.select = select i1 %11, i64 %1, i64 %5\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %13 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %spec.select\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = add i64 %storemerge1.reload, %13\n %18 = inttoptr i64 %17 to i8*\n store i8 %16, i8* %18, align 1\n %19 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %19, 100\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %20 = call i64 @FUNC(i64 %13)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %3, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_postdec_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 32, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %11 = zext i32 %.reload to i64\n %12 = icmp eq i32 %.reload, 5\n %13 = icmp eq i1 %12, false\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %14 = trunc i32 %sv_0.0.reload to i8\n %15 = icmp eq i8 %14, -128\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = mul i32 %sv_0.0.reload, 16777216\n %sext2 = add i32 %16, -16777216\n %17 = ashr exact i32 %sext2, 24\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %20 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_ncpy_34-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = inttoptr i64 %3 to i8*\n store i8* %8, i8** %sv_1, align 8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 @strlen(i8* nonnull %10)\n %12 = call i8* @strncpy(i8* nonnull %10, i8* %8, i32 %11)\n %13 = call i64 @FUNC(i64* nonnull %sv_0)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 1, 0 }\n uselistorder i8** %sv_1, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_multiply_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = urem i32 %2, 2\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @rand()\n %6 = mul i32 %5, 1073741824\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = xor i32 %8, %6\n %10 = call i32 @rand()\n %11 = xor i32 %9, %10\n %12 = sext i1 %4 to i32\n %storemerge.in = xor i32 %11, %12\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %13 = load i32, i32* @gv_1, align 4\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %16 = icmp slt i32 %sv_0.0.reload, 0\n %17 = icmp eq i1 %16, false\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_8, label LBL_5\n LBL_5:\n %18 = icmp slt i32 %sv_0.0.reload, -1073741823\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n %19 = mul i32 %sv_0.0.reload, 2\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_7:\n %22 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memcpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_2 to i64\n %4 = add i64 %3, -161\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 16\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = load i64, i64* %sv_1, align 8\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n store i64 %8, i64* %9, align 8\n %10 = add i64 %sv_0.0.reload, 8\n %11 = inttoptr i64 %10 to i64*\n %12 = add i64 %sv_0.0.reload, 16\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %sv_0.0.reload, 24\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %sv_0.0.reload, 32\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %sv_0.0.reload, 40\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %sv_0.0.reload, 48\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %sv_0.0.reload, 56\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %sv_0.0.reload, 64\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %sv_0.0.reload, 72\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %sv_0.0.reload, 80\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %sv_0.0.reload, 88\n %31 = inttoptr i64 %30 to i64*\n %32 = add i64 %sv_0.0.reload, 96\n %33 = inttoptr i64 %32 to i32*\n %34 = add i64 %sv_0.0.reload, 99\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n %36 = call i64 @FUNC(i64 %sv_0.0.reload)\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 14, 13, 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_sub_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_1 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_07-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_square_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = load i16, i16* %sv_0, align 2\n %9 = mul i16 %8, %8\n %10 = sext i16 %9 to i64\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_rand_32-bad", "fun_name": "CWE369_Divide_by_Zero__float_rand_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %storemerge.reg2mem = alloca i128\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i64 @FUNC(i64 40)\n %4 = call i128 @FUNC(i128 %2, i128 %2)\n %5 = call i64 @FUNC(i128 %4)\n %6 = trunc i64 %5 to i32\n %7 = call i128 @__asm_movss.1(i32 %6)\n %8 = call i64 @FUNC(i128 %7)\n %9 = call i32 @rand()\n %10 = urem i32 %9, 2\n %11 = icmp eq i32 %10, 0\n %12 = call i32 @rand()\n %13 = mul i32 %12, 1073741824\n %14 = call i32 @rand()\n %15 = mul i32 %14, 32768\n %16 = xor i32 %15, %13\n %17 = call i32 @rand()\n %18 = xor i32 %16, %17\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %19 = call i128 @FUNC(i128 %7, i128 %7)\n %20 = call i128 @FUNC(i32 %18)\n store i128 %20, i128* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %21 = sub i32 0, %18\n %22 = sub i32 %21, 1\n %23 = call i128 @FUNC(i128 %7, i128 %7)\n %24 = call i128 @FUNC(i32 %22)\n store i128 %24, i128* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i128, i128* %storemerge.reg2mem\n %25 = call i64 @FUNC(i128 %storemerge.reload)\n %26 = trunc i64 %25 to i32\n %27 = call i128 @__asm_movss.1(i32 %26)\n %28 = call i64 @FUNC(i128 %27)\n %29 = trunc i64 %28 to i32\n %30 = call i128 @__asm_movss.1(i32 %29)\n %31 = call i64 @FUNC(i128 %30)\n %32 = trunc i64 %31 to i32\n %33 = call i128 @FUNC(i128 %1, i128 %1)\n %34 = call i128 @FUNC(i32 %32)\n %35 = call i128 @FUNC(i64 4636737291354636288)\n %36 = call i128 @FUNC(i128 %35, i128 %34)\n %37 = call i32 @FUNC(i128 %36)\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n %40 = call i64 @FUNC(i64 40)\n %41 = icmp eq i64 %3, %40\n store i64 0, i64* %rax.0.reg2mem\n br i1 %41, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %7, { 3, 2, 1, 0, 4 }\n uselistorder i128* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i128* %0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_05-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 10)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %sv_1 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = add i64 %7, -48\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 4\n %10 = add i64 %9, %sv_0.0.reload\n %11 = add i64 %8, %9\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = inttoptr i64 %10 to i32*\n store i32 %13, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 10\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %16 = inttoptr i64 %sv_0.0.reload to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %20 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %20)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_malloc_14-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__connect_socket_malloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.19.reg2mem = alloca i32\n %sv_0.0.ph.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.19.reg2mem\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.19.reg2mem\n br i1 %5, label LBL_7, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 7, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -16\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %.off = add i32 %21, 32768\n %22 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.ph.reg2mem\n br i1 %22, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.ph.ph.reload = load i32, i32* %sv_0.0.ph.ph.reg2mem\n %23 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.ph.reload, i32* %sv_0.19.reg2mem\n br label LBL_7\n LBL_6:\n %sext4 = mul i32 %21, 65536\n %24 = ashr exact i32 %sext4, 16\n %25 = call i32 @close(i32 %4)\n %26 = trunc i32 %24 to i16\n %27 = icmp sgt i16 %26, 99\n store i32 %24, i32* %sv_0.19.reg2mem\n br i1 %27, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.19.reload = load i32, i32* %sv_0.19.reg2mem\n %28 = call i64* @malloc(i32 %sv_0.19.reload)\n %29 = icmp eq i64* %28, null\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 -1)\n unreachable\n LBL_9:\n %31 = ptrtoint i64* %28 to i64\n %32 = add nsw i32 %sv_0.19.reload, -1\n %33 = call i64* @memset(i64* %28, i32 65, i32 %32)\n %34 = zext i32 %sv_0.19.reload to i64\n %sext3 = mul i64 %34, 281474976710656\n %35 = ashr exact i64 %sext3, 48\n %36 = add i64 %31, -1\n %37 = add i64 %36, %35\n %38 = inttoptr i64 %37 to i8*\n store i8 0, i8* %38, align 1\n %39 = call i64 @FUNC(i64 %31)\n call void @free(i64* %28)\n br label LBL_10\n LBL_10:\n %40 = call i64 @FUNC(i64 40)\n %41 = icmp eq i64 %0, %40\n store i64 0, i64* %rax.0.reg2mem\n br i1 %41, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %31, { 1, 0 }\n uselistorder i64* %28, { 0, 1, 3, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.19.reg2mem, { 0, 4, 3, 1, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 4, 0, 2, 3 }\n uselistorder label LBL_7, { 3, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__open_no_close_12-bad", "fun_name": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__open_no_close_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i1 %3, false\n %5 = icmp eq i32 %0, -1\n %or.cond = or i1 %5, %4\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i32 @close(i32 %0)\n %7 = sext i32 %6 to i64\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_listenSocket_34-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.036.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n store i32 %5, i32* %sv_0.036.reg2mem\n br i1 %7, label LBL_8, label LBL_1\n LBL_1:\n %8 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_2\n LBL_2:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_6, label LBL_4\n LBL_4:\n %17 = call i32 @recv(i32 %15, i64* nonnull %sv_1, i32 19, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %19, label LBL_7, label LBL_5\n LBL_5:\n %20 = ptrtoint i64* %sv_3 to i64\n %21 = sext i32 %17 to i64\n %22 = add i64 %20, -32\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = bitcast i64* %sv_1 to i8*\n %26 = call double @atof(i8* nonnull %25)\n %27 = fptrunc double %26 to float\n %28 = bitcast float %27 to i32\n %29 = sext i32 %28 to i128\n %30 = call i128 @FUNC(i128 %29)\n %31 = call i64 @FUNC(i128 %30)\n %32 = trunc i64 %31 to i32\n store i32 %32, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %33 = call i32 @close(i32 %6)\n store i32 %5, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %34 = call i32 @close(i32 %6)\n %35 = call i32 @close(i32 %15)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.036.reload = load i32, i32* %sv_0.036.reg2mem\n %36 = call i128 @__asm_movss.1(i32 %sv_0.036.reload)\n %37 = call i64 @FUNC(i128 %36)\n %38 = trunc i64 %37 to i32\n %39 = call i128 @__asm_movss.1(i32 %38)\n %40 = call i64 @FUNC(i128 %39)\n %41 = trunc i64 %40 to i32\n %42 = call i128 @__asm_movss.1(i32 %41)\n %43 = call i128 @__asm_movss.1(i32 2147483647)\n %44 = call i128 @FUNC(i128 %42, i128 %43)\n %45 = call i128 @__asm_cvtss2sd.2(i128 %44)\n %46 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %45, i128 %46)\n %47 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n %48 = call i64 @FUNC(i64 40)\n %49 = icmp eq i64 %2, %48\n store i64 0, i64* %rax.0.reg2mem\n br i1 %49, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i32 %5, { 1, 2, 0 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.036.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_snprintf_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = sub i32 100, %2\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = add i64 %3, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %8, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n store i64 0, i64* %sv_0, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %17, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %19 = ptrtoint i64* %sv_0 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_rand_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv7.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge3.in = xor i32 %12, %13\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32 %storemerge3.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %14 = zext i32 %.reload to i64\n %15 = icmp eq i32 %.reload, 5\n %16 = icmp eq i1 %15, false\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_11, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %17 = call i64* @malloc(i32 40)\n %18 = ptrtoint i64* %17 to i64\n %19 = icmp eq i64* %17, null\n %20 = icmp eq i1 %19, false\n store i64 0, i64* %indvars.iv7.reg2mem\n br i1 %20, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %indvars.iv7.reload = load i64, i64* %indvars.iv7.reg2mem\n %21 = mul i64 %indvars.iv7.reload, 4\n %22 = add i64 %21, %18\n %23 = inttoptr i64 %22 to i32*\n store i32 0, i32* %23, align 4\n %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7.reload, 1\n %exitcond9 = icmp eq i64 %indvars.iv.next8, 10\n store i64 %indvars.iv.next8, i64* %indvars.iv7.reg2mem\n br i1 %exitcond9, label LBL_6, label LBL_5\n LBL_6:\n %24 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %24, label LBL_9, label LBL_7\n LBL_7:\n %25 = sext i32 %sv_0.0.reload to i64\n %26 = mul i64 %25, 4\n %27 = add i64 %26, %18\n %28 = inttoptr i64 %27 to i32*\n store i32 1, i32* %28, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_8\n LBL_8:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %29 = mul i64 %indvars.iv.reload, 4\n %30 = add i64 %29, %18\n %31 = inttoptr i64 %30 to i32*\n %32 = load i32, i32* %31, align 4\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_10, label LBL_8\n LBL_9:\n %35 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_10:\n call void @free(i64* %17)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %18, { 1, 0, 2 }\n uselistorder i64* %indvars.iv7.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int64_t_11-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__int64_t_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = call i64 @FUNC()\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = inttoptr i64 %1 to i64*\n %7 = load i64, i64* %6, align 8\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memcpy_12-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_memcpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 100)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %5, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %5, -8\n store i64 %11, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %12 = call i64* @memset(i64* %4, i32 65, i32 99)\n %13 = add i64 %5, 99\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n store i64 %5, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = inttoptr i64 %storemerge.reload to i64*\n %17 = load i64, i64* %16, align 8\n store i64 %17, i64* %sv_0, align 8\n %18 = call i64 @FUNC(i64* nonnull %sv_0)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %7, { 1, 0 }\n uselistorder i64 %5, { 0, 3, 1, 2 }\n uselistorder i64* %4, { 1, 0, 2, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memcpy_13-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memcpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = bitcast i64* %4 to i8*\n store i8 0, i8* %8, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %10 = load i64, i64* %sv_1, align 8\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n store i64 %10, i64* %11, align 8\n %12 = add i64 %sv_0.0.reload, 8\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %sv_0.0.reload, 16\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %sv_0.0.reload, 24\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %sv_0.0.reload, 32\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %sv_0.0.reload, 40\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %sv_0.0.reload, 48\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %sv_0.0.reload, 56\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %sv_0.0.reload, 64\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %sv_0.0.reload, 72\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %sv_0.0.reload, 80\n %31 = inttoptr i64 %30 to i64*\n %32 = add i64 %sv_0.0.reload, 88\n %33 = inttoptr i64 %32 to i64*\n %34 = add i64 %sv_0.0.reload, 96\n %35 = inttoptr i64 %34 to i32*\n %36 = add i64 %sv_0.0.reload, 99\n %37 = inttoptr i64 %36 to i8*\n store i8 0, i8* %37, align 1\n %38 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %11)\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 14, 13, 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memmove_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = add i64 %6, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %8 = and i64 %7, -16\n %sv_2.0 = select i1 %5, i64 %1, i64 %8\n %9 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = inttoptr i64 %sv_2.0 to i64*\n %11 = call i64* @memmove(i64* %10, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %12 = load i64, i64* %10, align 8\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %2, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__char_pointer_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i8*\n %rax.0.reg2mem = alloca i64\n %1 = load i8*, i8** %0\n %2 = call i64 @FUNC()\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = trunc i64 %2 to i32\n %7 = icmp eq i32 %6, 0\n %8 = ptrtoint i8* %1 to i64\n %9 = select i1 %7, i64 %8, i64 ptrtoint ([7 x i8]* @gv_0 to i64)\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_loop_17-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_loop_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %11 = add i64 %storemerge3.reload, %8\n %12 = add i64 %storemerge3.reload, %10\n %13 = inttoptr i64 %12 to i8*\n %14 = load i8, i8* %13, align 1\n %15 = inttoptr i64 %11 to i8*\n store i8 %14, i8* %15, align 1\n %16 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %17 = add i64 %4, 91\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = call i64 @FUNC(i64 %8)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64 %4, { 1, 0, 2 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memmove_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %3 = mul i64 %storemerge2.reload, 8\n %4 = add i64 %3, %0\n %5 = add i64 %4, -816\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 8\n %7 = add i64 %4, -812\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %9 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %9, 100\n store i64 %9, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %storemerge1 = ptrtoint i64* %sv_1 to i64\n %10 = call i64* @memmove(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %11 = call i64 @FUNC(i64 %storemerge1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_loop_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = ptrtoint i64* %1 to i64\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %8 = add i64 %storemerge3.reload, %5\n %9 = add i64 %storemerge3.reload, %7\n %10 = inttoptr i64 %9 to i8*\n %11 = load i8, i8* %10, align 1\n %12 = inttoptr i64 %8 to i8*\n store i8 %11, i8* %12, align 1\n %13 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %14 = add i64 %5, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i64 %5, { 1, 2, 0 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %9 = load i32, i32* @gv_3, align 4\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_14\n LBL_6:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %12 = call i64* @malloc(i32 40)\n %13 = ptrtoint i64* %12 to i64\n %14 = icmp eq i64* %12, null\n %15 = icmp eq i1 %14, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %16 = mul i64 %indvars.iv5.reload, 4\n %17 = add i64 %16, %13\n %18 = inttoptr i64 %17 to i32*\n store i32 0, i32* %18, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_9, label LBL_8\n LBL_9:\n %19 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %19, label LBL_12, label LBL_10\n LBL_10:\n %20 = sext i32 %sv_0.0.reload to i64\n %21 = mul i64 %20, 4\n %22 = add i64 %21, %13\n %23 = inttoptr i64 %22 to i32*\n store i32 1, i32* %23, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_11\n LBL_11:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %24 = mul i64 %indvars.iv.reload, 4\n %25 = add i64 %24, %13\n %26 = inttoptr i64 %25 to i32*\n %27 = load i32, i32* %26, align 4\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_13, label LBL_11\n LBL_12:\n %30 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_5 to i64))\n br label LBL_13\n LBL_13:\n call void @free(i64* %12)\n br label LBL_14\n LBL_14:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_snprintf_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = sub i32 100, %2\n %10 = add i64 %3, %8\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %9, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64* bitcast ([15 x i8]* @gv_2 to i64*))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n store i64 0, i64* %sv_0, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %17, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %19 = call i64 @FUNC(i64* nonnull %sv_0)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_cpy_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = bitcast i64* %1 to i8*\n store i8* %2, i8** %sv_1, align 8\n %3 = icmp eq i64* %1, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i8*, i8** %sv_1, align 8\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strcpy(i8* nonnull %11, i8* %9)\n %13 = ptrtoint i64* %sv_0 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_square_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n %7 = urem i32 %2, 2\n %8 = icmp eq i32 %7, 0\n %9 = mul i32 %4, 32768\n %10 = xor i32 %5, %9\n %11 = sext i1 %8 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %12 = ashr exact i32 %sext, 16\n %13 = trunc i32 %12 to i16\n %14 = sub i16 0, %13\n %15 = icmp slt i16 %14, 0\n %16 = icmp eq i1 %15, false\n %17 = zext i16 %14 to i32\n %18 = select i1 %16, i32 %17, i32 %12\n %19 = trunc i32 %18 to i16\n %20 = icmp ult i16 %19, 182\n br i1 %20, label LBL_3, label LBL_4\n LBL_3:\n %21 = urem i32 %12, 65536\n %sext2 = mul i32 %21, %sext\n %22 = ashr exact i32 %sext2, 16\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n store i64 %24, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %25, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sext, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 4, 1 }\n uselistorder i32 65536, { 3, 0, 1, 4, 2 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_environment_popen_14-bad", "fun_name": "CWE78_OS_Command_Injection__char_environment_popen_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_3\n LBL_3:\n %14 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %15 = icmp eq %_IO_FILE* %14, null\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = call i32 @pclose(%_IO_FILE* nonnull %14)\n br label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_fprintf_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = sext i32 %2 to i64\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n %11 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %12 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_listen_socket_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv13.reg2mem = alloca i64\n %sv_0.069.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.069.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.069.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.069.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.069.reload = load i32, i32* %sv_0.069.reg2mem\n %25 = call i64* @malloc(i32 40)\n %26 = ptrtoint i64* %25 to i64\n %27 = icmp eq i64* %25, null\n %28 = icmp eq i1 %27, false\n store i64 0, i64* %indvars.iv13.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %indvars.iv13.reload = load i64, i64* %indvars.iv13.reg2mem\n %29 = mul i64 %indvars.iv13.reload, 4\n %30 = add i64 %29, %26\n %31 = inttoptr i64 %30 to i32*\n store i32 0, i32* %31, align 4\n %indvars.iv.next14 = add nuw nsw i64 %indvars.iv13.reload, 1\n %exitcond15 = icmp eq i64 %indvars.iv.next14, 10\n store i64 %indvars.iv.next14, i64* %indvars.iv13.reg2mem\n br i1 %exitcond15, label LBL_11, label LBL_10\n LBL_11:\n %32 = icmp ugt i32 %sv_0.069.reload, 9\n br i1 %32, label LBL_14, label LBL_12\n LBL_12:\n %33 = sext i32 %sv_0.069.reload to i64\n %34 = mul i64 %33, 4\n %35 = add i64 %34, %26\n %36 = inttoptr i64 %35 to i32*\n store i32 1, i32* %36, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_13\n LBL_13:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %37 = mul i64 %indvars.iv.reload, 4\n %38 = add i64 %37, %26\n %39 = inttoptr i64 %38 to i32*\n %40 = load i32, i32* %39, align 4\n %41 = zext i32 %40 to i64\n %42 = call i64 @FUNC(i64 %41)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_15, label LBL_13\n LBL_14:\n %43 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_15\n LBL_15:\n call void @free(i64* %25)\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %26, { 0, 2, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.069.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %indvars.iv13.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 7, 1, 2, 3, 4, 5, 0, 6, 8 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* inttoptr (i64 20500 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = load i32, i32* @gv_0, align 4\n %36 = icmp eq i32 %35, 5\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n %37 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_15\n LBL_14:\n %38 = call i32 @puts(i8* nonnull %1)\n br label LBL_15\n LBL_15:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_17-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0811.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -112\n %3 = bitcast i64* %sv_2 to i8*\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.0811.reg2mem\n br i1 %5, label LBL_9, label LBL_1\n LBL_1:\n %6 = bitcast i64* %sv_3 to %sockaddr*\n %7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %6, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_2\n LBL_2:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_3\n LBL_3:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_4\n LBL_4:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_2, i32 7, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_5\n LBL_5:\n %18 = sext i32 %15 to i64\n %19 = add i64 %2, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i32 @atoi(i8* nonnull %3)\n %.off = add i32 %21, 32768\n %22 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %22, label LBL_6, label LBL_8\n LBL_6:\n %sext3 = mul i32 %21, 65536\n %23 = ashr exact i32 %sext3, 16\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.0811.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %4)\n %26 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0811.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.0811.reload = load i32, i32* %sv_0.0811.reg2mem\n store i64 0, i64* %sv_2, align 8\n %27 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %28 = trunc i32 %sv_0.0811.reload to i16\n %29 = icmp sgt i16 %28, 99\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %30 = bitcast i64* %sv_1 to i8*\n %31 = call i8* @strncpy(i8* nonnull %3, i8* nonnull %30, i32 %sv_0.0811.reload)\n %32 = sext i32 %sv_0.0811.reload to i64\n %33 = add i64 %2, %32\n %34 = inttoptr i64 %33 to i8*\n store i8 0, i8* %34, align 1\n br label LBL_11\n LBL_11:\n %35 = call i64 @FUNC(i64* nonnull %sv_2)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %1, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0811.reload, { 1, 2, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_3, { 2, 1, 0 }\n uselistorder i64* %sv_2, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %sv_0.0811.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 2, 0, 3 }\n uselistorder i8 0, { 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_strncpy_01-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__connect_socket_strncpy_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.08.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n store i32 0, i32* %sv_0.08.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_3 to %sockaddr*\n %8 = call i32 @connect(i32 %2, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %9, label LBL_5, label LBL_2\n LBL_2:\n %10 = call i32 @recv(i32 %2, i64* nonnull %sv_2, i32 7, i32 0)\n %11 = add i32 %10, 1\n %12 = icmp ult i32 %11, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = sext i32 %10 to i64\n %14 = add i64 %0, -112\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_2 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n %.off = add i32 %18, 32768\n %19 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %19, label LBL_4, label LBL_5\n LBL_4:\n %sext3 = mul i32 %18, 65536\n %20 = ashr exact i32 %sext3, 16\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %2)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.08.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.08.reload = load i32, i32* %sv_0.08.reg2mem\n store i64 0, i64* %sv_2, align 8\n %22 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %23 = trunc i32 %sv_0.08.reload to i16\n %24 = icmp sgt i16 %23, 99\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n %25 = bitcast i64* %sv_2 to i8*\n %26 = bitcast i64* %sv_1 to i8*\n %27 = call i8* @strncpy(i8* nonnull %25, i8* nonnull %26, i32 %sv_0.08.reload)\n %28 = sext i32 %sv_0.08.reload to i64\n %29 = add i64 %0, -112\n %30 = add i64 %29, %28\n %31 = inttoptr i64 %30 to i8*\n store i8 0, i8* %31, align 1\n br label LBL_8\n LBL_8:\n %32 = call i64 @FUNC(i64* nonnull %sv_2)\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %1, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.08.reload, { 1, 2, 0 }\n uselistorder i32 %10, { 1, 0 }\n uselistorder i32 %2, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 4, 2, 1 }\n uselistorder i32* %sv_0.08.reg2mem, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 2, 0, 3, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* inttoptr (i64 8380 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %1)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %26 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %27 = icmp eq i32 %26, 1\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_13, label LBL_8\n LBL_8:\n %29 = load i64, i64* %sv_1, align 8\n %30 = trunc i64 %29 to i32\n %31 = icmp sgt i32 %30, ptrtoint (i1* @gv_3 to i32)\n br i1 %31, label LBL_13, label LBL_9\n LBL_9:\n %32 = and i64 %29, 4294967295\n %33 = icmp eq i64 %32, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %33, label LBL_12, label LBL_10\n LBL_10:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %34 = add i32 %storemerge4.reload, 1\n %35 = sext i32 %34 to i64\n %36 = icmp sgt i64 %32, %35\n store i32 %34, i32* %storemerge4.reg2mem\n br i1 %36, label LBL_10, label LBL_11\n LBL_11:\n %phitmp = zext i32 %34 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_12\n LBL_12:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %37 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_13\n LBL_13:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %34, { 1, 0, 2 }\n uselistorder i64 %11, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_7, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_pointer_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 8)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = bitcast i64* %4 to i32*\n store i32 5, i32* %7, align 4\n %8 = ptrtoint i64* %4 to i64\n %9 = add i64 %8, 4\n %10 = inttoptr i64 %9 to i32*\n store i32 6, i32* %10, align 4\n store i32* %7, i32** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %sv_0.0.reload = load i32*, i32** %sv_0.0.reg2mem\n %14 = load i32, i32* %sv_0.0.reload, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %17 = ptrtoint i32* %sv_0.0.reload to i64\n %18 = add i64 %17, 4\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv8.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_7\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n %10 = call i32 @atoi(i8* nonnull %5)\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_7\n LBL_6:\n %11 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_7\n LBL_7:\n %12 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n %16 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %15, label LBL_12, label LBL_8\n LBL_8:\n br i1 %16, label LBL_11, label LBL_9\n LBL_9:\n %17 = sext i32 %sv_0.0.reload to i64\n %18 = mul i64 %17, 4\n %19 = add i64 %12, -64\n %20 = add i64 %18, %19\n %21 = inttoptr i64 %20 to i32*\n store i32 1, i32* %21, align 4\n store i64 0, i64* %indvars.iv8.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv8.reload = load i64, i64* %indvars.iv8.reg2mem\n %22 = mul i64 %indvars.iv8.reload, 4\n %23 = add i64 %22, %19\n %24 = inttoptr i64 %23 to i32*\n %25 = load i32, i32* %24, align 4\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %indvars.iv.next9 = add nuw nsw i64 %indvars.iv8.reload, 1\n %exitcond10 = icmp eq i64 %indvars.iv.next9, 10\n store i64 %indvars.iv.next9, i64* %indvars.iv8.reg2mem\n br i1 %exitcond10, label LBL_16, label LBL_10\n LBL_11:\n %28 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_16\n LBL_12:\n br i1 %16, label LBL_15, label LBL_13\n LBL_13:\n %29 = sext i32 %sv_0.0.reload to i64\n %30 = mul i64 %29, 4\n %31 = add i64 %12, -64\n %32 = add i64 %30, %31\n %33 = inttoptr i64 %32 to i32*\n store i32 1, i32* %33, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_14\n LBL_14:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %34 = mul i64 %indvars.iv.reload, 4\n %35 = add i64 %34, %31\n %36 = inttoptr i64 %35 to i32*\n %37 = load i32, i32* %36, align 4\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_16, label LBL_14\n LBL_15:\n %40 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_16\n LBL_16:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i1 %7, { 1, 0 }\n uselistorder i8* %5, { 1, 0, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 4, 3, 2, 1 }\n uselistorder i64* %indvars.iv8.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_16, { 2, 1, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memmove_07-bad", "fun_name": "CWE126_Buffer_Overread__char_declare_memmove_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %5, 5\n %7 = icmp eq i1 %6, false\n %8 = ptrtoint i64* %sv_2 to i64\n %spec.select = select i1 %7, i64 %1, i64 %8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 @strlen(i8* nonnull %10)\n %12 = inttoptr i64 %spec.select to i64*\n %13 = call i64* @memmove(i64* nonnull %sv_0, i64* %12, i32 %11)\n %14 = call i64 @FUNC(i64* nonnull %sv_0)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %2, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_multiply_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = mul i32 %4, 32768\n %6 = call i32 @rand()\n %7 = xor i32 %6, %5\n %8 = sext i1 %2 to i32\n %storemerge.in = xor i32 %7, %8\n %storemerge = zext i32 %storemerge.in to i64\n %9 = trunc i32 %storemerge.in to i16\n %10 = icmp slt i16 %9, 1\n store i64 %storemerge, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_1\n LBL_1:\n %11 = icmp sgt i16 %9, ptrtoint (i1* @gv_0 to i16)\n br i1 %11, label LBL_3, label LBL_2\n LBL_2:\n %sext = mul i32 %storemerge.in, 131072\n %12 = ashr exact i32 %sext, 16\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_postdec_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i64, i64* %sv_0, align 8\n %9 = icmp eq i64 %8, -9223372036854775808\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %10 = add i64 %8, -1\n store i64 %10, i64* %sv_0, align 8\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_7\n LBL_6:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_7:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memcpy_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = add i64 %0, -161\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = inttoptr i64 %5 to i64*\n %11 = call i64* @memset(i64* %10, i32 65, i32 99)\n %12 = add i64 %5, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i32 @strlen(i8* nonnull %15)\n %17 = call i64* @memcpy(i64* nonnull %sv_0, i64* %10, i32 %16)\n %18 = call i64 @FUNC(i64* nonnull %sv_0)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64 %3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 8\n %10 = add i64 %9, %8\n %11 = add i64 %10, -816\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 8\n %13 = add i64 %10, -812\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %16 = inttoptr i64 %sv_0.0.reload to i64*\n %17 = call i64* @memcpy(i64* %16, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_0 to i32))\n %18 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %16)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 ptrtoint (i32* @gv_0 to i32), { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_sleep_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @usleep(i32 20)\n %5 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_1 to i64))\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i32)* @usleep, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32* @gv_0, { 6, 0, 5, 1, 4, 2, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_execl_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %3, %4\n %6 = inttoptr i64 %5 to i32*\n store i32 2764330, i32* %6, align 4\n %7 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__strdup_char_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -97\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_0, align 8\n %7 = inttoptr i64 %6 to i64*\n store i64 7453010373645639777, i64* %7, align 16\n %8 = or i64 %6, 8\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 8\n %10 = load i64, i64* %sv_0, align 8\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_2\n LBL_2:\n %12 = call i64 @FUNC()\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 0, 1, 3, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_multiply_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = call i32 @rand()\n %8 = xor i32 %7, %6\n %9 = sext i1 %3 to i32\n %storemerge6.in = xor i32 %8, %9\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n %13 = trunc i32 %storemerge6.in to i16\n %14 = icmp slt i16 %13, 0\n %15 = icmp eq i1 %14, false\n br i1 %12, label LBL_5, label LBL_1\n LBL_1:\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %15, label LBL_9, label LBL_2\n LBL_2:\n %16 = icmp slt i16 %13, -16383\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %sext2 = mul i32 %storemerge6.in, 131072\n %17 = ashr exact i32 %sext2, 16\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_4:\n %20 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_5:\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %15, label LBL_9, label LBL_6\n LBL_6:\n %21 = icmp slt i16 %13, -16383\n br i1 %21, label LBL_8, label LBL_7\n LBL_7:\n %sext3 = mul i32 %storemerge6.in, 131072\n %22 = ashr exact i32 %sext3, 16\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n store i64 %24, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_8:\n %25 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %25, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %15, { 1, 0 }\n uselistorder i16 %13, { 1, 0, 2 }\n uselistorder i64 %10, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 5, 4, 6, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_sub_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge1.in = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge1.in, -2147483648\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = add i32 %storemerge1.in, -1\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %15, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i32 %storemerge1.in, { 1, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memcpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = add i64 %6, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 %6, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %9 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %10)\n %12 = call i64 @FUNC(i64 %.pre-phi.reload)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 3, 4, 1, 2, 0 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_rand_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %sv_0.0.in.reg2mem = alloca i64\n %storemerge.reg2mem = alloca i128\n %1 = load i128, i128* %0\n %2 = call i128 @FUNC(i128 %1, i128 %1)\n %3 = call i64 @FUNC(i128 %2)\n %4 = load i32, i32* inttoptr (i64 8448 to i32*), align 256\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 %3, i64* %sv_0.0.in.reg2mem\n br i1 %6, label LBL_5, label LBL_1\n LBL_1:\n %7 = call i32 @rand()\n %8 = urem i32 %7, 2\n %9 = icmp eq i32 %8, 0\n %10 = call i32 @rand()\n %11 = mul i32 %10, 1073741824\n %12 = call i32 @rand()\n %13 = mul i32 %12, 32768\n %14 = xor i32 %13, %11\n %15 = call i32 @rand()\n %16 = xor i32 %14, %15\n br i1 %9, label LBL_3, label LBL_2\n LBL_2:\n %17 = call i128 @FUNC(i128 %2, i128 %2)\n %18 = call i128 @FUNC(i32 %16)\n store i128 %18, i128* %storemerge.reg2mem\n br label LBL_4\n LBL_3:\n %19 = sub i32 0, %16\n %20 = sub i32 %19, 1\n %21 = call i128 @FUNC(i128 %2, i128 %2)\n %22 = call i128 @FUNC(i32 %20)\n store i128 %22, i128* %storemerge.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge.reload = load i128, i128* %storemerge.reg2mem\n %23 = call i64 @FUNC(i128 %storemerge.reload)\n store i64 %23, i64* %sv_0.0.in.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %24 = call i128 @__asm_movss.1(i32 %sv_0.0)\n %25 = call i128 @__asm_movss.1(i32 2147483647)\n %26 = call i128 @FUNC(i128 %24, i128 %25)\n %27 = call i128 @FUNC(i128 %26)\n %28 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %27, i128 %28)\n %29 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n ret i64 %29\n\n uselistorder i128 %2, { 3, 2, 1, 0, 4 }\n uselistorder i128* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_14-bad", "fun_name": "CWE675_Duplicate_Operations_on_Resource__open_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %4 = call i32 @close(i32 %3)\n store i32 %3, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %5 = load i32, i32* @gv_1, align 4\n %6 = zext i32 %5 to i64\n %7 = icmp eq i32 %5, 5\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %9 = call i32 @close(i32 %sv_0.0.reload)\n %10 = sext i32 %9 to i64\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = add i64 %8, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = mul i64 %storemerge1.reload, 8\n %12 = add i64 %11, %sv_0.0.reload\n %13 = add i64 %10, %11\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = inttoptr i64 %12 to i64*\n store i64 %15, i64* %16, align 8\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %18 = inttoptr i64 %sv_0.0.reload to i64*\n %19 = load i64, i64* %18, align 8\n %20 = call i64 @FUNC(i64 %19)\n call void @free(i64* %18)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_multiply_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = icmp slt i64 %3, 0\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %6 = icmp slt i64 %3, -4611686018427387903\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = mul i64 %3, 2\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_snprintf_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = add i64 %6, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 %6, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %9 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %11, i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %13 = call i64 @FUNC(i64 %.pre-phi.reload)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 3, 4, 1, 2, 0 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_ncpy_05-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_ncpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = add i64 %6, -8\n %11 = inttoptr i64 %10 to i8*\n store i8* %11, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %13 = bitcast i64* %sv_1 to i8*\n %14 = call i32 @strlen(i8* nonnull %13)\n %15 = call i8* @strncpy(i8* nonnull %13, i8* %sv_0.0.reload, i32 %14)\n %16 = call i64 @FUNC(i64* nonnull %sv_1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_modulo_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n %10 = load i32, i32* %sv_0, align 4\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = urem i32 100, %10\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_7\n LBL_6:\n %15 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_sub_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, -2147483648\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = add i64 %6, 4294967295\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_5\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_34-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -401\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i32*\n store i32 5, i32* %4, align 16\n %5 = call i64 @FUNC(i64 5)\n store i64 %3, i64* %sv_0, align 8\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %1, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_divide_05-bad", "fun_name": "CWE369_Divide_by_Zero__int_fgets_divide_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = udiv i32 100, %sv_0.0.ph.reload\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_6\n LBL_6:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_6, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_sub_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 4294967295)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_square_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %12 = ashr exact i32 %sext, 16\n store i32 %12, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %13 = load i32, i32* @gv_0, align 4\n %14 = icmp eq i32 %13, 5\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %16 = trunc i32 %sv_0.0.reload to i16\n %17 = sub i16 0, %16\n %18 = icmp slt i16 %17, 0\n %19 = icmp eq i1 %18, false\n %20 = zext i16 %17 to i32\n %21 = select i1 %19, i32 %20, i32 %sv_0.0.reload\n %22 = trunc i32 %21 to i16\n %23 = icmp ult i16 %22, 182\n br i1 %23, label LBL_5, label LBL_6\n LBL_5:\n %24 = urem i32 %sv_0.0.reload, 65536\n %narrow = mul i32 %sv_0.0.reload, 65536\n %sext2 = mul i32 %narrow, %24\n %25 = ashr exact i32 %sext2, 16\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n store i64 %27, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %28 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %28, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 3, 2, 0, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_multiply_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = call i32 @rand()\n %8 = xor i32 %7, %6\n %9 = sext i1 %3 to i32\n %storemerge6.in = xor i32 %8, %9\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n %13 = trunc i32 %storemerge6.in to i16\n %14 = icmp slt i16 %13, 1\n br i1 %12, label LBL_5, label LBL_1\n LBL_1:\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %14, label LBL_9, label LBL_2\n LBL_2:\n %15 = icmp sgt i16 %13, 16382\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n %sext2 = mul i32 %storemerge6.in, 131072\n %16 = ashr exact i32 %sext2, 16\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_4:\n %19 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_5:\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %14, label LBL_9, label LBL_6\n LBL_6:\n %20 = icmp sgt i16 %13, ptrtoint (i1* @gv_1 to i16)\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n %sext3 = mul i32 %storemerge6.in, 131072\n %21 = ashr exact i32 %sext3, 16\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_8:\n %24 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %24, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %14, { 1, 0 }\n uselistorder i16 %13, { 1, 0, 2 }\n uselistorder i64 %10, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 5, 4, 6, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_sub_11-bad", "fun_name": "CWE191_Integer_Underflow__int_rand_sub_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n %phitmp = add i32 %storemerge.in, -1\n %phitmp1 = zext i32 %phitmp to i64\n store i64 %phitmp1, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %17 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_snprintf_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %1, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = call i64 @FUNC(i64 %4)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_realloc_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 20)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i64* %0, null\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i16*\n store i16 25978, i16* %7, align 2\n %8 = add i64 %5, 10\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE469_Use_of_Pointer_Subtraction_to_Determine_Size__char_07-bad", "fun_name": "CWE469_Use_of_Pointer_Subtraction_to_Determine_Size__char_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 8246496015530812001, i64* %sv_1, align 8\n store i64 8246496015530812001, i64* %sv_0, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @strchr(i8* nonnull %4, i32 47)\n %6 = icmp eq i8* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %8 = ptrtoint i8* %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = sub i64 %8, %9\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %5, { 1, 0 }\n uselistorder i64 8246496015530812001, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_divide_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_1, align 8\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i8* @fgets(i8* nonnull %1, i32 14, %_IO_FILE* %2)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.05.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %1)\n %7 = icmp eq i32 %6, 0\n store i32 %6, i32* %sv_0.05.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.05.reload = load i32, i32* %sv_0.05.reg2mem\n %8 = udiv i32 100, %sv_0.05.reload\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memcpy_31-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 400)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 50)\n %5 = call i64* @memcpy(i64* %1, i64* nonnull %sv_0, i32 400)\n %6 = bitcast i64* %1 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 0, 2, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_11-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC()\n %36 = trunc i64 %35 to i32\n %37 = icmp eq i32 %36, 0\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n %38 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n br label LBL_14\n LBL_14:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE459_Incomplete_Cleanup__char_04-bad", "fun_name": "CWE459_Incomplete_Cleanup__char_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 6365935209751535970, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @mkstemp(i8* nonnull %1)\n %3 = icmp eq i32 %2, -1\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call %_IO_FILE* @fdopen(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_0, i64 0, i64 0))\n %5 = icmp eq %_IO_FILE* %4, null\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = call i32 @fwrite(i64* bitcast ([15 x i8]* @gv_1 to i64*), i32 1, i32 14, %_IO_FILE* nonnull %4)\n %7 = call i32 @fclose(%_IO_FILE* nonnull %4)\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %4, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_multiply_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %spec.store.select = select i1 %1, i32 32, i32 -128\n %2 = zext i32 %0 to i64\n %3 = trunc i32 %spec.store.select to i8\n %4 = icmp slt i8 %3, 0\n %5 = icmp eq i1 %4, false\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = icmp slt i8 %3, -63\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = mul i32 %spec.store.select, 2\n %8 = and i32 %7, 64\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %1, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__rand_15-bad", "fun_name": "CWE617_Reachable_Assertion__rand_15_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge.in = xor i32 %9, %10\n %storemerge = zext i32 %storemerge.in to i64\n %11 = icmp sgt i32 %storemerge.in, 5\n store i64 %storemerge, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([126 x i8], [126 x i8]* @gv_1, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @gv_2, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fixed_06-bad", "fun_name": "CWE617_Reachable_Assertion__fixed_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([127 x i8], [127 x i8]* @gv_1, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @gv_2, i64 0, i64 0))\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -161\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_1, i32 100)\n %11 = add i64 %sv_0.0.reload, 99\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE390_Error_Without_Action__sqrt_05-bad", "fun_name": "CWE390_Error_Without_Action__sqrt_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32* @__errno_location()\n store i32 0, i32* %2, align 4\n %3 = call i128 @FUNC(i64 -4616189618054758400)\n %4 = trunc i128 %3 to i64\n %5 = bitcast i64 %4 to double\n %6 = call double @sqrt(double %5)\n %7 = fptrunc double %6 to float\n %8 = bitcast float %7 to i32\n %9 = sext i32 %8 to i128\n %10 = call i64 @__asm_movq.1(i128 %9)\n %11 = call i32* @__errno_location()\n %12 = call i128 @FUNC(i64 %10)\n %13 = call i64 @FUNC()\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* ()* @__errno_location, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i16, i16* %sv_0, align 2\n %10 = sub i16 0, %9\n %11 = icmp slt i16 %10, 0\n %12 = icmp eq i1 %11, false\n %.v = select i1 %12, i16 %10, i16 %9\n %13 = icmp ult i16 %.v, 182\n br i1 %13, label LBL_4, label LBL_5\n LBL_4:\n %14 = mul i16 %9, %9\n %15 = sext i16 %14 to i64\n %16 = and i64 %15, 4294967295\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_6\n LBL_5:\n %18 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %9, { 1, 0, 2, 3 }\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE506_Embedded_Malicious_Code__file_transfer_listen_socket_02-bad", "fun_name": "CWE506_Embedded_Malicious_Code__file_transfer_listen_socket_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %rsp.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 %0, i64* %rsp.0.reg2mem\n br label LBL_1\n LBL_1:\n %rsp.0.reload = load i64, i64* %rsp.0.reg2mem\n %2 = add i64 %rsp.0.reload, -4096\n %3 = icmp eq i64 %2, %1\n %4 = icmp eq i1 %3, false\n store i64 %2, i64* %rsp.0.reg2mem\n br i1 %4, label LBL_1, label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @fgets(i8* nonnull %8, i32 65535, %_IO_FILE* nonnull %6)\n %10 = icmp eq i8* %9, null\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i64 0, i64* %sv_1, align 8\n br label LBL_5\n LBL_5:\n %13 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_6\n LBL_6:\n %14 = call i32 @socket(i32 2, i32 1, i32 6)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_12, label LBL_7\n LBL_7:\n %16 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %17 = call i16 @htons(i16 27015)\n %18 = bitcast i64* %sv_0 to %sockaddr*\n %19 = call i32 @bind(i32 %14, %sockaddr* nonnull %18, i32 16)\n %20 = icmp eq i32 %19, -1\n br i1 %20, label LBL_10, label LBL_8\n LBL_8:\n %21 = call i32 @listen(i32 %14, i32 5)\n %22 = icmp eq i32 %21, -1\n br i1 %22, label LBL_10, label LBL_9\n LBL_9:\n %23 = call i32 @accept(i32 %14, %sockaddr* null, i32* null)\n %24 = icmp eq i32 %23, -1\n br i1 %24, label LBL_10, label LBL_11\n LBL_10:\n %25 = call i32 @close(i32 %14)\n br label LBL_12\n LBL_11:\n %26 = bitcast i64* %sv_1 to i8*\n %27 = call i32 @strlen(i8* nonnull %26)\n %28 = call i32 @send(i32 %23, i64* nonnull %sv_1, i32 %27, i32 0)\n %29 = call i32 @strlen(i8* nonnull %26)\n %30 = call i32 @close(i32 %14)\n %31 = call i32 @close(i32 %23)\n br label LBL_12\n LBL_12:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %5, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %14, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %rsp.0.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_12, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncat_32-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncat_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 0, i64* %sv_0, align 8\n %8 = bitcast i64* %1 to i8*\n %9 = call i32 @strlen(i8* %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strncat(i8* nonnull %10, i8* %8, i32 %9)\n %12 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %8, { 1, 0 }\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_postinc_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 1152921504606846976\n %9 = call i32 @rand()\n %10 = zext i32 %9 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 1073741824\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = mul i64 %16, 32768\n %18 = call i32 @rand()\n %19 = sext i32 %18 to i64\n %20 = sext i1 %5 to i64\n %21 = xor i64 %8, %20\n %22 = xor i64 %21, %11\n %23 = xor i64 %22, %14\n %24 = xor i64 %23, %17\n %storemerge = xor i64 %24, %19\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64 %storemerge, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %25 = zext i32 %.reload to i64\n %26 = icmp eq i32 %.reload, 5\n %27 = icmp eq i1 %26, false\n store i64 %25, i64* %rax.0.reg2mem\n br i1 %27, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %28 = icmp eq i64 %sv_0.0.reload, 9223372036854775807\n br i1 %28, label LBL_5, label LBL_4\n LBL_4:\n %29 = add i64 %sv_0.0.reload, 1\n %30 = call i64 @FUNC(i64 %29)\n store i64 %30, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %31 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %31, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_square_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 4)\n ret i64 %2\n\n uselistorder i64 (i64)* @printUnsignedLine, { 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %storemerge34.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %0 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n br i1 %15, label LBL_5, label LBL_7\n LBL_5:\n %16 = call i32 @strlen(i8* nonnull %3)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_11, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge34.reg2mem\n br label LBL_8\n LBL_7:\n %19 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %19, i64* %storemerge.reg2mem\n br label LBL_12\n LBL_8:\n %storemerge34.reload = load i64, i64* %storemerge34.reg2mem\n %20 = add i64 %storemerge34.reload, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 83\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_10, label LBL_9\n LBL_9:\n %25 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_10:\n %26 = add nuw i64 %storemerge34.reload, 1\n %27 = call i32 @strlen(i8* %3)\n %28 = sext i32 %27 to i64\n %29 = icmp ult i64 %26, %28\n store i64 %26, i64* %storemerge34.reg2mem\n br i1 %29, label LBL_8, label LBL_11\n LBL_11:\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_12\n LBL_12:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i8* %3, { 1, 0, 3, 2 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge34.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_11, { 0, 2, 1 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 3, 2, 4 }\n uselistorder void (i32)* @exit, { 2, 3, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 2, 3, 0, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %2 = call i32 @fclose(%_IO_FILE* %1)\n %3 = call i64 @FUNC(i64 40)\n %4 = icmp eq i64 %0, %3\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_preinc_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = icmp eq i32 %sv_0.1.reload, 2147483647\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n %32 = add i32 %sv_0.1.reload, 1\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_13\n LBL_12:\n %35 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_predec_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = call i32 @rand()\n %8 = xor i32 %7, %6\n %9 = sext i1 %3 to i32\n %storemerge6.in = xor i32 %8, %9\n %storemerge5.in = mul i32 %storemerge6.in, 65536\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n %13 = trunc i32 %storemerge6.in to i16\n %14 = icmp eq i16 %13, -32768\n br i1 %12, label LBL_4, label LBL_1\n LBL_1:\n br i1 %14, label LBL_3, label LBL_2\n LBL_2:\n %sext2 = add i32 %storemerge5.in, -65536\n %15 = ashr exact i32 %sext2, 16\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_3:\n %18 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n %sext3 = add i32 %storemerge5.in, -65536\n %19 = ashr exact i32 %sext3, 16\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %14, { 1, 0 }\n uselistorder i32 %storemerge5.in, { 1, 0 }\n uselistorder i32 %storemerge6.in, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_zero_divide_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 14)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 5, 4, 6 }\n uselistorder i32* @gv_0, { 4, 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE511_Logic_Time_Bomb__rand_05-bad", "fun_name": "CWE511_Logic_Time_Bomb__rand_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call i32 @time(i32* null)\n call void @srand(i32 %2)\n %3 = call i32 @rand()\n %4 = sext i32 %3 to i64\n %5 = icmp eq i32 %3, 20000\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @unlink(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_1, i64 0, i64 0))\n %8 = sext i32 %7 to i64\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_preinc_09-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge.in = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge.in, -1\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = add i32 %storemerge.in, 1\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_fprintf_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = sub i32 100, %2\n %10 = add i64 %3, %8\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %9, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n %17 = load %_IO_FILE*, %_IO_FILE** @gv_3, align 8\n %18 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_0)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fprintf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_3, { 2, 1, 0 }\n uselistorder i8 0, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_alloca_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge24.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 400)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %storemerge5.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %8 = mul i64 %storemerge5.reload, 4\n %9 = add i64 %8, %4\n %10 = inttoptr i64 %9 to i32*\n store i32 5, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge5.reload, 1\n %exitcond6 = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge5.reg2mem\n br i1 %exitcond6, label LBL_7, label LBL_3\n LBL_4:\n store i64 0, i64* %storemerge24.reg2mem\n br i1 %6, label LBL_6, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_6:\n %storemerge24.reload = load i64, i64* %storemerge24.reg2mem\n %13 = mul i64 %storemerge24.reload, 4\n %14 = add i64 %13, %4\n %15 = inttoptr i64 %14 to i32*\n store i32 5, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge24.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge24.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %17 = bitcast i64* %3 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge24.reg2mem, { 2, 0, 1 }\n uselistorder i64 100, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* %4, i8* nonnull %6, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fscanf_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %spec.store.select = select i1 %2, i32 -1, i32 20\n %3 = mul i32 %spec.store.select, 4\n %4 = call i64* @malloc(i32 %3)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_1, label LBL_2\n LBL_1:\n %7 = ptrtoint i64* %4 to i64\n %8 = sext i32 %spec.store.select to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 4\n %10 = add i64 %9, %7\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw i64 %storemerge1.reload, 1\n %13 = icmp ult i64 %12, %8\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %13, label LBL_3, label LBL_4\n LBL_4:\n %14 = bitcast i64* %4 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %4)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i32 %spec.store.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE467_Use_of_sizeof_on_Pointer_Type__short_01-bad", "fun_name": "CWE467_Use_of_sizeof_on_Pointer_Type__short_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i16*\n store i16 5, i16* %3, align 2\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_calloc_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i32** %sv_0 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i32*\n store i32* %7, i32** %sv_0, align 8\n store i32 0, i32* %7, align 16\n %8 = load i32*, i32** %sv_0, align 8\n %9 = ptrtoint i32* %8 to i64\n %10 = add i64 %9, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = load i32*, i32** %sv_0, align 8\n %13 = ptrtoint i32* %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_2\n LBL_2:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_0, { 4, 3, 2, 0, 1 }\n uselistorder i64 (i64)* @printStructLine, { 3, 2, 1, 0 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_char_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %storemerge.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %4, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %5 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %6 = icmp eq i32 %5, 5\n %7 = icmp eq i1 %6, false\n %.op = mul i32 %1, 16777216\n %.op.op = ashr exact i32 %.op, 24\n %8 = zext i32 %.op.op to i64\n %9 = select i1 %7, i64 %8, i64 67\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__short_listen_socket_12-bad", "fun_name": "CWE197_Numeric_Truncation_Error__short_listen_socket_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 122, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 7, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -16\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %sext = mul i32 %24, 65536\n %25 = ashr exact i32 %sext, 16\n store i32 %25, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %26 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %27 = call i32 @close(i32 %4)\n %28 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext2 = mul i32 %sv_0.1.reload, 16777216\n %29 = ashr exact i32 %sext2, 24\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 4, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_9, { 3, 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__char_type_overrun_memmove_14-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__char_type_overrun_memmove_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 32)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = add i64 %7, 16\n %9 = inttoptr i64 %8 to i64*\n store i64 ptrtoint ([32 x i8]* @gv_0 to i64), i64* %9, align 8\n %10 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n store i64 3978425819141910832, i64* %4, align 8\n %11 = add i64 %7, 8\n %12 = inttoptr i64 %11 to i64*\n store i64 7378413942531504440, i64* %12, align 8\n store i64 3978425819141910832, i64* %9, align 8\n %13 = add i64 %7, 24\n %14 = inttoptr i64 %13 to i64*\n store i64 28539350662854968, i64* %14, align 8\n %15 = add i64 %7, 15\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = call i64 @FUNC(i64 %7)\n %18 = load i64, i64* %9, align 8\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 0, 1, 3, 2, 4 }\n uselistorder i64* %4, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_multiply_07-bad", "fun_name": "CWE190_Integer_Overflow__int_listen_socket_multiply_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_10, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_10, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n br label LBL_10\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n %31 = icmp slt i32 %sv_0.0.ph.reload, 1\n %or.cond3 = or i1 %31, %30\n br i1 %or.cond3, label LBL_10, label LBL_9\n LBL_9:\n %32 = mul i32 %sv_0.0.ph.reload, 2\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_10\n LBL_10:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_10, { 3, 4, 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_memcpy_17-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_memcpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %3, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = inttoptr i64 %8 to i64*\n %11 = load i64, i64* %10, align 8\n store i64 %11, i64* %sv_0, align 8\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_environment_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 13617, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = or i64 %2, 2\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 2\n %5 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %6 = icmp eq i32 %5, 1\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_5, label LBL_1\n LBL_1:\n %8 = load i64, i64* %sv_1, align 8\n %9 = and i64 %8, 4294967295\n %10 = icmp eq i64 %9, 0\n store i32 0, i32* %storemerge3.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %10, label LBL_4, label LBL_2\n LBL_2:\n %storemerge3.reload = load i32, i32* %storemerge3.reg2mem\n %11 = add i32 %storemerge3.reload, 1\n %12 = sext i32 %11 to i64\n %13 = icmp sgt i64 %9, %12\n store i32 %11, i32* %storemerge3.reg2mem\n br i1 %13, label LBL_2, label LBL_3\n LBL_3:\n %phitmp = zext i32 %11 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %14 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0, 2 }\n uselistorder i64* %sv_2, { 1, 2, 0 }\n uselistorder i32* %storemerge3.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memmove_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %4 = and i64 %3, -16\n %5 = call i64 @FUNC()\n store i64 %4, i64* %sv_1, align 8\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %6 = mul i64 %storemerge2.reload, 8\n %7 = add i64 %6, %2\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %13 = load i64, i64* %sv_1, align 8\n %14 = inttoptr i64 %13 to i64*\n %15 = call i64* @memmove(i64* %14, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %16 = load i64, i64* %sv_1, align 8\n %17 = call i64 @FUNC(i64 %16)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_cpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = inttoptr i64 %3 to i8*\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strcpy(i8* nonnull %10, i8* %8)\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memmove_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 40)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %sv_1, align 8\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_1, i32 40)\n %10 = inttoptr i64 %sv_0.0.reload to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n call void @free(i64* %8)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 40, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__five_12-bad", "fun_name": "CWE398_Poor_Code_Quality__five_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n store i64 %3, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64 @FUNC(i64 ptrtoint ([18 x i8]* @gv_1 to i64))\n store i64 %4, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_postinc_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05810.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.05810.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.05810.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp eq i32 %sv_0.0.ph.reload, 2147483647\n store i32 %sv_0.0.ph.reload, i32* %sv_0.05810.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.05810.reload = load i32, i32* %sv_0.05810.reg2mem\n %26 = add i32 %sv_0.05810.reload, 1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.05810.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_popen_10-bad", "fun_name": "CWE78_OS_Command_Injection__char_console_popen_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_2\n LBL_2:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %sv_0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = call i32 @strlen(i8* nonnull %1)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_7, label LBL_4\n LBL_4:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %20, align 1\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_7\n LBL_7:\n %25 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_3, i64 0, i64 0))\n %26 = icmp eq %_IO_FILE* %25, null\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = call i32 @pclose(%_IO_FILE* nonnull %25)\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_struct_static_04-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_struct_static_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %0 = mul i64 %storemerge1.reload, 8\n %1 = add i64 %0, ptrtoint (i64* @gv_0 to i64)\n %2 = inttoptr i64 %1 to i32*\n store i32 1, i32* %2, align 8\n %3 = add i64 %0, ptrtoint (i64* @gv_1 to i64)\n %4 = inttoptr i64 %3 to i32*\n store i32 1, i32* %4, align 8\n %5 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %5, 100\n store i64 %5, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint (i64* @gv_0 to i64))\n call void @free(i64* nonnull @gv_0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_fgets_12-bad", "fun_name": "CWE126_Buffer_Overread__CWE129_fgets_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 7, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_8, label LBL_5\n LBL_5:\n %14 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %10, -64\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n br label LBL_11\n LBL_7:\n %23 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_8:\n %24 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %24, label LBL_10, label LBL_9\n LBL_9:\n %25 = sext i32 %sv_0.0.reload to i64\n %26 = mul i64 %25, 4\n %27 = add i64 %10, -64\n %28 = add i64 %27, %26\n %29 = inttoptr i64 %28 to i32*\n %30 = load i32, i32* %29, align 4\n %31 = zext i32 %30 to i64\n %32 = call i64 @FUNC(i64 %31)\n br label LBL_11\n LBL_10:\n %33 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 3, 0, 2 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_predec_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %12 = ashr exact i32 %sext, 16\n store i32 %12, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n store i64 %13, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %16 = trunc i32 %sv_0.0.reload to i16\n %17 = icmp eq i16 %16, -32768\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = mul i32 %sv_0.0.reload, 65536\n %sext2 = add i32 %18, -65536\n %19 = ashr exact i32 %sext2, 16\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__struct_calloc_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 8)\n %1 = ptrtoint i64* %0 to i64\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = icmp eq i64* %0, null\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = bitcast i64* %0 to i32*\n store i32 1, i32* %6, align 4\n %7 = add i64 %1, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n %9 = call i64 @FUNC(i64 %1)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_3:\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %5, label LBL_5, label LBL_4\n LBL_4:\n %10 = bitcast i64* %0 to i32*\n store i32 1, i32* %10, align 4\n %11 = add i64 %1, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 1, i32* %12, align 4\n %13 = call i64 @FUNC(i64 %1)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %2, { 1, 0, 2 }\n uselistorder i64 %1, { 2, 3, 0, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 4, 1, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_for_loop_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge1.in = xor i32 %9, %10\n %storemerge1.in.off = add i32 %storemerge1.in, -1\n %11 = icmp ugt i32 %storemerge1.in.off, 19\n store i64 5, i64* %rax.0.reg2mem\n br i1 %11, label LBL_3, label LBL_1\n LBL_1:\n %12 = sext i32 %storemerge1.in to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %13 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n %14 = add nuw i64 %storemerge3.reload, 1\n %15 = icmp ult i64 %14, %12\n store i64 %14, i64* %storemerge3.reg2mem\n store i64 %12, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge1.in, { 1, 0 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder i64 5, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_square_14-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_fscanf_square_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i128, align 8\n %0 = call i64 @FUNC(i64 40)\n store i128 0, i128* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i128* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 0)\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE404_Improper_Resource_Shutdown__open_fclose_31-bad", "fun_name": "CWE404_Improper_Resource_Shutdown__open_fclose_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = icmp eq i32 %0, -1\n store i64 4294967295, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = zext i32 %0 to i64\n %3 = inttoptr i64 %2 to %_IO_FILE*\n %4 = call i32 @fclose(%_IO_FILE* %3)\n %5 = sext i32 %4 to i64\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_fprintf_07-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_environment_fprintf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_3\n LBL_3:\n %14 = load i32, i32* @gv_0, align 4\n %15 = icmp eq i32 %14, 5\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n %17 = load %_IO_FILE*, %_IO_FILE** @gv_2, align 8\n %18 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %17, i8* nonnull %1)\n br label LBL_5\n LBL_5:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_2, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_32-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.056.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.056.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.056.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp sgt i32 %19, 99\n store i32 %19, i32* %sv_0.056.reg2mem\n br i1 %21, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.056.reload = load i32, i32* %sv_0.056.reg2mem\n %22 = call i64* @malloc(i32 %sv_0.056.reload)\n %23 = icmp eq i64* %22, null\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %25 = ptrtoint i64* %22 to i64\n %26 = add i32 %sv_0.056.reload, -1\n %27 = call i64* @memset(i64* %22, i32 65, i32 %26)\n %28 = sext i32 %sv_0.056.reload to i64\n %29 = add nsw i64 %28, -1\n %30 = add i64 %29, %25\n %31 = inttoptr i64 %30 to i8*\n store i8 0, i8* %31, align 1\n %32 = call i64 @FUNC(i64 %25)\n call void @free(i64* %22)\n br label LBL_8\n LBL_8:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %25, { 1, 0 }\n uselistorder i64* %22, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.056.reload, { 1, 0, 2 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.056.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 5, 1, 3, 0, 4 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_32-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_snprintf_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n store i64 0, i64* %sv_0, align 8\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %23, i32 99, i8* nonnull %1)\n %25 = ptrtoint i64* %sv_0 to i64\n %26 = call i64 @FUNC(i64 %25)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_no_init_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %3 = icmp eq i32 %2, 5\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %5 = mul i64 %indvars.iv5.reload, 4\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = trunc i64 %indvars.iv5.reload to i32\n store i32 %8, i32* %7, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %9 = mul i64 %indvars.iv.reload, 4\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_10\n LBL_10:\n %29 = load i32, i32* @gv_1, align 4\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_11, label LBL_13\n LBL_11:\n %31 = call i32 @strlen(i8* nonnull %4)\n %32 = icmp eq i32 %31, 0\n br i1 %32, label LBL_17, label LBL_12\n LBL_12:\n %33 = ptrtoint i64* %1 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_14\n LBL_13:\n %34 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_18\n LBL_14:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %35 = add i64 %storemerge4.reload, %33\n %36 = inttoptr i64 %35 to i8*\n %37 = load i8, i8* %36, align 1\n %38 = icmp eq i8 %37, 83\n %39 = icmp eq i1 %38, false\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n %40 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n br label LBL_17\n LBL_16:\n %41 = add nuw i64 %storemerge4.reload, 1\n %42 = call i32 @strlen(i8* %4)\n %43 = sext i32 %42 to i64\n %44 = icmp ult i64 %41, %43\n store i64 %41, i64* %storemerge4.reg2mem\n br i1 %44, label LBL_14, label LBL_17\n LBL_17:\n call void @free(i64* %1)\n br label LBL_18\n LBL_18:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_20, label LBL_19\n LBL_19:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_20\n LBL_20:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 3, 0, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_17, { 0, 2, 1 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_sleep_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %9 = load i32, i32* @gv_3, align 4\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_9\n LBL_6:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %12 = icmp slt i32 %sv_0.0.reload, 1\n %13 = icmp sgt i32 %sv_0.0.reload, ptrtoint (i1* @gv_5 to i32)\n %or.cond = or i1 %12, %13\n br i1 %or.cond, label LBL_8, label LBL_7\n LBL_7:\n %14 = call i32 @usleep(i32 %sv_0.0.reload)\n %15 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_6 to i64))\n br label LBL_9\n LBL_8:\n %16 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_7 to i64))\n br label LBL_9\n LBL_9:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_src_char_cat_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 49)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strcat(i8* nonnull %12, i8* %11)\n %14 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 2, 5, 1, 3, 0, 4 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_fgets_to_char_10-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_fgets_to_char_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n %phitmp = mul i32 %7, 16777216\n %phitmp1 = ashr exact i32 %phitmp, 24\n %phitmp2 = zext i32 %phitmp1 to i64\n store i64 %phitmp2, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i64 @FUNC(i64 %sv_0.0.reload)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fscanf_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -20\n %3 = inttoptr i64 %2 to i32*\n store i32 1, i32* %3, align 4\n %4 = add i64 %0, -48\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_1\n LBL_1:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %5 = mul i64 %indvars.iv.reload, 4\n %6 = add i64 %4, %5\n %7 = inttoptr i64 %6 to i32*\n %8 = load i32, i32* %7, align 4\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_system_17-bad", "fun_name": "CWE78_OS_Command_Injection__char_console_system_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %8 = sub i32 100, %2\n %9 = add i64 %3, %6\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %8, %_IO_FILE* %7)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = add i64 %6, -1\n %16 = sext i32 %13 to i64\n %17 = add i64 %15, %16\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 @system(i8* nonnull %1)\n %24 = icmp eq i32 %23, 0\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n %25 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_2 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i8* %1, { 2, 0, 1 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder label LBL_6, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_accept_bind_08-bad", "fun_name": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_accept_bind_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_13, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = call i32 @listen(i32 %6, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_10, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_10, label LBL_4\n LBL_4:\n %14 = bitcast i64* %sv_0 to %sockaddr*\n %15 = call i32 @bind(i32 %6, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_5\n LBL_5:\n %17 = sub i32 99, %5\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = sext i32 %5 to i64\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i64*\n %22 = call i32 @recv(i32 %12, i64* %21, i32 %17, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = ptrtoint i64* %sv_2 to i64\n %26 = sext i32 %22 to i64\n %27 = add i64 %25, -112\n %28 = add i64 %27, %26\n %29 = inttoptr i64 %28 to i8*\n store i8 0, i8* %29, align 1\n %30 = call i8* @strchr(i8* nonnull %4, i32 13)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %30, align 1\n br label LBL_8\n LBL_8:\n %32 = call i8* @strchr(i8* nonnull %4, i32 10)\n %33 = icmp eq i8* %32, null\n br i1 %33, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %32, align 1\n br label LBL_11\n LBL_10:\n %34 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %35 = call i32 @close(i32 %6)\n %36 = call i32 @close(i32 %12)\n br label LBL_12\n LBL_12:\n %37 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_13\n LBL_13:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 0, 4, 1, 2, 3, 5 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 0, 1, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i128 @FUNC(i64 4617315517961601024)\n %3 = call i64 @__asm_movsd.1(i128 %2)\n %4 = call i128 @FUNC(i64 %3)\n %5 = call i64 @FUNC()\n ret i64 %5\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_sub_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = zext i32 %3 to i64\n %5 = mul i64 %4, 1152921504606846976\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 35184372088832\n %9 = call i32 @rand()\n %10 = sext i32 %9 to i64\n %11 = mul i64 %10, 1073741824\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 32768\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = sext i1 %2 to i64\n %18 = xor i64 %5, %17\n %19 = xor i64 %18, %8\n %20 = xor i64 %19, %11\n %21 = xor i64 %20, %14\n %storemerge = xor i64 %21, %16\n %22 = icmp eq i64 %storemerge, -9223372036854775808\n br i1 %22, label LBL_2, label LBL_1\n LBL_1:\n %23 = add i64 %storemerge, -1\n %24 = call i64 @FUNC(i64 %23)\n store i64 %24, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %25 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %25, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__open_no_close_32-bad", "fun_name": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__open_no_close_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %2 = call i64 @FUNC(i64 40)\n %3 = icmp eq i64 %0, %2\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_07-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.04.reg2mem = alloca i8*\n %sv_0.05.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_8, label LBL_3\n LBL_3:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_7, label LBL_4\n LBL_4:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_8, label LBL_5\n LBL_5:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_8, label LBL_6\n LBL_6:\n store i8 0, i8* %20, align 1\n br label LBL_8\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_8\n LBL_8:\n %25 = load i32, i32* @gv_2, align 4\n %26 = zext i32 %25 to i64\n %27 = icmp eq i32 %25, 5\n %28 = icmp eq i1 %27, false\n store i64 %26, i64* %rax.0.reg2mem\n br i1 %28, label LBL_14, label LBL_9\n LBL_9:\n %29 = load i8, i8* %3, align 1\n %30 = icmp eq i8 %29, 0\n %31 = icmp eq i1 %30, false\n store i8 %29, i8* %.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n store i8* %3, i8** %sv_0.04.reg2mem\n br i1 %31, label LBL_10, label LBL_13\n LBL_10:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %32 = icmp eq i8 %.reload, 83\n %33 = icmp eq i1 %32, false\n br i1 %33, label LBL_12, label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n store i8* %sv_0.05.reload, i8** %sv_0.04.reg2mem\n br label LBL_13\n LBL_12:\n %35 = ptrtoint i8* %sv_0.05.reload to i64\n %36 = add i64 %35, 1\n %37 = inttoptr i64 %36 to i8*\n %38 = load i8, i8* %37, align 1\n %39 = icmp eq i8 %38, 0\n %40 = icmp eq i1 %39, false\n store i8 %38, i8* %.reg2mem\n store i8* %37, i8** %sv_0.05.reg2mem\n store i8* %37, i8** %sv_0.04.reg2mem\n br i1 %40, label LBL_10, label LBL_13\n LBL_13:\n %sv_0.04.reload = load i8*, i8** %sv_0.04.reg2mem\n %41 = bitcast i8* %sv_0.04.reload to i64*\n call void @free(i64* %41)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.05.reload, { 1, 0 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 0, 1, 2, 3, 5, 4 }\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.05.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.04.reg2mem, { 0, 1, 3, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder i8 0, { 2, 0, 3, 4, 5, 6, 1 }\n uselistorder label LBL_13, { 0, 2, 1 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_snprintf_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n %7 = ptrtoint i64* %1 to i64\n %8 = call i64 @FUNC(i64 %7)\n call void @free(i64* %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 100, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_sub_08-bad", "fun_name": "CWE191_Integer_Underflow__short_rand_sub_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %phitmp = add i32 %sext, -65536\n %phitmp3 = ashr exact i32 %phitmp, 16\n %phitmp4 = zext i32 %phitmp3 to i64\n store i64 %phitmp4, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %12 = call i64 @FUNC()\n %13 = trunc i64 %12 to i32\n %14 = icmp eq i32 %13, 0\n store i64 %12, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %15 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_rand_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 %4, i64* %sv_0.0.in.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i128 @__asm_movss.1(i32 1073741824)\n %9 = call i64 @FUNC(i128 %8)\n store i64 %9, i64* %sv_0.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %13 = call i128 @FUNC(i128 %1, i128 %1)\n %14 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.0)\n %15 = call i128 @FUNC(i64 4636737291354636288)\n %16 = call i128 @FUNC(i128 %15, i128 %14)\n %17 = call i32 @FUNC(i128 %16)\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %2, { 1, 0 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }\n uselistorder i32 1073741824, { 2, 3, 0, 1, 4 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_multiply_11-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_12\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %27 = icmp slt i32 %sv_0.1.reload, 1\n br i1 %27, label LBL_12, label LBL_9\n LBL_9:\n %28 = icmp sgt i32 %sv_0.1.reload, 1073741822\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n %29 = mul i32 %sv_0.1.reload, 2\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n br label LBL_12\n LBL_11:\n %32 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_12\n LBL_12:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 2, 0, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memcpy_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %9)\n %11 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 3, 5, 4 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_17-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = add i64 %3, 99\n %6 = inttoptr i64 %5 to i8*\n %7 = call i64* @memset(i64* %4, i32 65, i32 99)\n store i8 0, i8* %6, align 1\n %8 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strncpy(i8* nonnull %10, i8* %8, i32 %9)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %8, { 1, 0 }\n uselistorder i64 %3, { 2, 3, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n br label LBL_2\n LBL_2:\n %10 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = call i32 @strlen(i8* %10)\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strncpy(i8* nonnull %12, i8* %10, i32 %11)\n %14 = call i64 @FUNC(i64 %3)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %10, { 1, 0 }\n uselistorder i64 %3, { 0, 3, 2, 1, 4 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_pointer_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = call i128 @FUNC(i64 4617315517961601024)\n %4 = call i64 @__asm_movsd.1(i128 %3)\n store i64 %4, i64* %0, align 8\n %5 = call i128 @FUNC(i64 %4)\n %6 = call i64 @FUNC()\n ret i64 %6\n\n uselistorder i64 ()* @printDoubleLine, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 3, 0, 2, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_listen_socket_12-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_listen_socket_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 7, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n store i64 0, i64* %sv_2, align 8\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %31 = icmp sgt i32 %sv_0.1.reload, 9\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %34, %33\n %36 = inttoptr i64 %35 to i32*\n %37 = load i32, i32* %36, align 4\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n br label LBL_16\n LBL_12:\n %40 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_0 to i64))\n br label LBL_16\n LBL_13:\n %41 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %41, label LBL_15, label LBL_14\n LBL_14:\n %42 = sext i32 %sv_0.1.reload to i64\n %43 = mul i64 %42, 4\n %44 = add i64 %0, -64\n %45 = add i64 %44, %43\n %46 = inttoptr i64 %45 to i32*\n %47 = load i32, i32* %46, align 4\n %48 = zext i32 %47 to i64\n %49 = call i64 @FUNC(i64 %48)\n br label LBL_16\n LBL_15:\n %50 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_16\n LBL_16:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %1, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 3, 0, 2 }\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 2, 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 4, 2, 1, 3 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 2, 3, 4, 5, 0, 6 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_9, { 3, 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_malloc_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n store i64 7453010373643542593, i64* %3, align 8\n %7 = add i64 %6, 8\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC(i64 %6)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %10 = zext i32 %.reload to i64\n %11 = icmp eq i32 %.reload, 5\n %12 = icmp eq i1 %11, false\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 400)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fgets_11-bad", "fun_name": "CWE369_Divide_by_Zero__float_fgets_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %3 = call i64 @FUNC(i64 40)\n %4 = call i128 @FUNC(i128 %2, i128 %2)\n %5 = call i64 @FUNC(i128 %4)\n %6 = trunc i64 %5 to i32\n %7 = call i64 @FUNC()\n %8 = trunc i64 %7 to i32\n %9 = icmp eq i32 %8, 0\n store i32 %6, i32* %sv_0.0.reg2mem\n br i1 %9, label LBL_4, label LBL_1\n LBL_1:\n %10 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %11 = bitcast i64* %sv_1 to i8*\n %12 = call i8* @fgets(i8* nonnull %11, i32 20, %_IO_FILE* %10)\n %13 = icmp eq i8* %12, null\n br i1 %13, label LBL_3, label LBL_2\n LBL_2:\n %14 = call double @atof(i8* nonnull %11)\n %15 = fptrunc double %14 to float\n %16 = bitcast float %15 to i32\n %17 = sext i32 %16 to i128\n %18 = call i128 @FUNC(i128 %17)\n %19 = call i64 @FUNC(i128 %18)\n %20 = trunc i64 %19 to i32\n store i32 %20, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %21 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 %6, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %22 = call i64 @FUNC()\n %23 = trunc i64 %22 to i32\n %24 = icmp eq i32 %23, 0\n br i1 %24, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %25 = call i128 @FUNC(i128 %1, i128 %1)\n %26 = call i128 @FUNC(i32 %sv_0.0.reload)\n %27 = call i128 @FUNC(i64 4636737291354636288)\n %28 = call i128 @FUNC(i128 %27, i128 %26)\n %29 = call i32 @FUNC(i128 %28)\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n br label LBL_6\n LBL_6:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %3, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memmove_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = inttoptr i64 %sv_0.0.reload to i64*\n %13 = call i64* @memmove(i64* %12, i64* nonnull %sv_1, i32 100)\n %14 = add i64 %sv_0.0.reload, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %sv_0.0.reload)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 100, { 0, 1, 3, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fscanf_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n %spec.store.select = select i1 %1, i32 -1, i32 20\n %2 = mul i32 %spec.store.select, 4\n %3 = call i64* @malloc(i32 %2)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_1, label LBL_2\n LBL_1:\n %6 = ptrtoint i64* %3 to i64\n %7 = sext i32 %spec.store.select to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 4\n %9 = add i64 %8, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = add nuw i64 %storemerge1.reload, 1\n %12 = icmp ult i64 %11, %7\n store i64 %11, i64* %storemerge1.reg2mem\n br i1 %12, label LBL_3, label LBL_4\n LBL_4:\n %13 = bitcast i64* %3 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.store.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE481_Assigning_Instead_of_Comparing__basic_14-bad", "fun_name": "CWE481_Assigning_Instead_of_Comparing__basic_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = call i64 @FUNC(i64 ptrtoint ([8 x i8]* @gv_0 to i64))\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_32-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %storemerge8.reg2mem = alloca i64\n %.reg2mem = alloca i8\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = ptrtoint i64* %1 to i64\n store i8 0, i8* %4, align 1\n %6 = call i32 @strlen(i8* %4)\n %7 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %7, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %10 = call i16 @htons(i16 27015)\n %11 = bitcast i64* %sv_0 to %sockaddr*\n %12 = call i32 @connect(i32 %7, %sockaddr* nonnull %11, i32 16)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = sext i32 %6 to i64\n %15 = add i64 %14, %5\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %6\n %18 = call i32 @recv(i32 %7, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %7)\n br label LBL_10\n LBL_10:\n %29 = load i8, i8* %4, align 1\n %30 = icmp eq i8 %29, 0\n %31 = icmp eq i1 %30, false\n store i8 %29, i8* %.reg2mem\n store i64 %5, i64* %storemerge8.reg2mem\n store i64 %5, i64* %storemerge7.reg2mem\n br i1 %31, label LBL_11, label LBL_14\n LBL_11:\n %storemerge8.reload = load i64, i64* %storemerge8.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %32 = icmp eq i8 %.reload, 83\n %33 = icmp eq i1 %32, false\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n %34 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n store i64 %storemerge8.reload, i64* %storemerge7.reg2mem\n br label LBL_14\n LBL_13:\n %35 = add i64 %storemerge8.reload, 1\n %36 = inttoptr i64 %35 to i8*\n %37 = load i8, i8* %36, align 1\n %38 = icmp eq i8 %37, 0\n %39 = icmp eq i1 %38, false\n store i8 %37, i8* %.reg2mem\n store i64 %35, i64* %storemerge8.reg2mem\n store i64 %35, i64* %storemerge7.reg2mem\n br i1 %39, label LBL_11, label LBL_14\n LBL_14:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %40 = inttoptr i64 %storemerge7.reload to i64*\n call void @free(i64* %40)\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge8.reload, { 1, 0 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %7, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 0, 3, 2, 1, 4 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge8.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge7.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4, 5, 6 }\n uselistorder i32 -1, { 1, 0, 2 }\n uselistorder label LBL_14, { 0, 2, 1 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_for_loop_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_4:\n %8 = load i32, i32* %sv_0, align 4\n %.off = add i32 %8, -1\n %9 = icmp ugt i32 %.off, 19\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %10 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_4 to i64))\n %11 = add nuw i64 %storemerge2.reload, 1\n %12 = load i32, i32* %sv_0, align 4\n %13 = sext i32 %12 to i64\n %14 = icmp ult i64 %11, %13\n store i64 %11, i64* %storemerge2.reg2mem\n br i1 %14, label LBL_5, label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_modulo_04-bad", "fun_name": "CWE369_Divide_by_Zero__int_fgets_modulo_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %2)\n store i32 %5, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = urem i32 100, %sv_0.0.reload\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__connect_socket_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @gv_1, i64 0, i64 0), i32 165, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_2, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i8*, i8*, i32, i8*)* @__assert_fail, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %4 = add i64 %2, 49\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n store i64 0, i64* %sv_0, align 8\n %6 = call i32 @strlen(i8* nonnull %1)\n %7 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %6)\n %8 = call i64 @FUNC(i64 %2)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_calloc_16-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_0, align 8\n %4 = inttoptr i64 %3 to i64*\n store i64 5, i64* %4, align 16\n %5 = load i64, i64* %sv_0, align 8\n %6 = inttoptr i64 %5 to i64*\n %7 = load i64, i64* %6, align 8\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 99, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %5 = ptrtoint i64* %sv_3 to i64\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n store i64 0, i64* %sv_2, align 8\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %7 = bitcast i64* %sv_2 to i8*\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @strncpy(i8* nonnull %7, i8* nonnull %8, i32 %sv_0.0.reload)\n %10 = sext i32 %sv_0.0.reload to i64\n %11 = add i64 %5, -112\n %12 = add i64 %11, %10\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 0, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge36.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %sv_2 to i64\n %7 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %8 = sub i32 100, %2\n %9 = add i64 %3, %6\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %8, %_IO_FILE* %7)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = add i64 %6, -1\n %16 = sext i32 %13 to i64\n %17 = add i64 %15, %16\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %24 = icmp eq i32 %23, 1\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_12, label LBL_7\n LBL_7:\n %26 = load i64, i64* %sv_1, align 8\n %27 = trunc i64 %26 to i32\n %28 = icmp sgt i32 %27, ptrtoint (i1* @gv_3 to i32)\n br i1 %28, label LBL_12, label LBL_8\n LBL_8:\n %29 = and i64 %26, 4294967295\n %30 = icmp eq i64 %29, 0\n store i32 0, i32* %storemerge36.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %30, label LBL_11, label LBL_9\n LBL_9:\n %storemerge36.reload = load i32, i32* %storemerge36.reg2mem\n %31 = add i32 %storemerge36.reload, 1\n %32 = sext i32 %31 to i64\n %33 = icmp sgt i64 %29, %32\n store i32 %31, i32* %storemerge36.reg2mem\n br i1 %33, label LBL_9, label LBL_10\n LBL_10:\n %phitmp = zext i32 %31 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %34 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %31, { 1, 0, 2 }\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge36.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_sub_11-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %5 = trunc i64 %0 to i32\n %6 = icmp eq i32 %5, 0\n %spec.select = select i1 %6, i32 32, i32 -128\n %7 = trunc i32 %spec.select to i8\n %8 = icmp eq i8 %7, -128\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = mul i32 %spec.select, 16777216\n %sext = add i32 %9, -16777216\n %10 = ashr exact i32 %sext, 24\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %13 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_1 to i64))\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_file_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_2 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = call i64 @FUNC()\n %21 = trunc i64 %20 to i32\n %22 = icmp eq i32 %21, 0\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n %23 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_14\n LBL_8:\n %24 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n %25 = icmp eq i32 %24, 1\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_14, label LBL_9\n LBL_9:\n %27 = load i64, i64* %sv_1, align 8\n %28 = trunc i64 %27 to i32\n %29 = icmp sgt i32 %28, ptrtoint (i1* @gv_5 to i32)\n br i1 %29, label LBL_14, label LBL_10\n LBL_10:\n %30 = and i64 %27, 4294967295\n %31 = icmp eq i64 %30, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %31, label LBL_13, label LBL_11\n LBL_11:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %32 = add i32 %storemerge5.reload, 1\n %33 = sext i32 %32 to i64\n %34 = icmp sgt i64 %30, %33\n store i32 %32, i32* %storemerge5.reg2mem\n br i1 %34, label LBL_11, label LBL_12\n LBL_12:\n %phitmp = zext i32 %32 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_13\n LBL_13:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %35 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_14\n LBL_14:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %32, { 1, 0, 2 }\n uselistorder i8* %1, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_snprintf_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %3 = add i64 %1, 49\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 1\n store i64 0, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %7, i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %9 = call i64 @FUNC(i64 %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %5 = icmp eq i32 %4, 5\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 49)\n %9 = add i64 %3, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_3\n LBL_3:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strcat(i8* nonnull %12, i8* %11)\n %14 = call i64 @FUNC(i64 %3)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 3, 2, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__listen_socket_malloc_13-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__listen_socket_malloc_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.113.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.113.reg2mem\n br i1 %3, label LBL_10, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.113.reg2mem\n br i1 %5, label LBL_10, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_8, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_8, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 7, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_9, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -16\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %.off = add i32 %24, 32768\n %25 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %25, label LBL_7, label LBL_9\n LBL_7:\n %sext4 = mul i32 %24, 65536\n %26 = ashr exact i32 %sext4, 16\n store i32 %26, i32* %sv_0.0.ph.reg2mem\n br label LBL_9\n LBL_8:\n %27 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.113.reg2mem\n br label LBL_10\n LBL_9:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %28 = call i32 @close(i32 %4)\n %29 = call i32 @close(i32 %13)\n %30 = trunc i32 %sv_0.0.ph.reload to i16\n %31 = icmp sgt i16 %30, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.113.reg2mem\n br i1 %31, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.113.reload = load i32, i32* %sv_0.113.reg2mem\n %32 = call i64* @malloc(i32 %sv_0.113.reload)\n %33 = icmp eq i64* %32, null\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_12, label LBL_11\n LBL_11:\n call void @exit(i32 -1)\n unreachable\n LBL_12:\n %35 = ptrtoint i64* %32 to i64\n %36 = add nsw i32 %sv_0.113.reload, -1\n %37 = call i64* @memset(i64* %32, i32 65, i32 %36)\n %38 = zext i32 %sv_0.113.reload to i64\n %sext3 = mul i64 %38, 281474976710656\n %39 = ashr exact i64 %sext3, 48\n %40 = add i64 %35, -1\n %41 = add i64 %40, %39\n %42 = inttoptr i64 %41 to i8*\n store i8 0, i8* %42, align 1\n %43 = call i64 @FUNC(i64 %35)\n call void @free(i64* %32)\n br label LBL_13\n LBL_13:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %35, { 1, 0 }\n uselistorder i64* %32, { 0, 1, 3, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %sv_0.113.reg2mem, { 0, 4, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 6, 0, 2, 3, 4, 5 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_10, { 3, 1, 0, 2 }\n uselistorder label LBL_9, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %3 = add i64 %2, 8\n %4 = inttoptr i64 %3 to i64*\n store i64 32777976880262761, i64* %4, align 8\n store i64 0, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %5, i32 99, i8* nonnull %1)\n %7 = call i64 @FUNC(i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_square_11-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %5 = trunc i64 %0 to i32\n %6 = icmp ne i32 %5, 0\n %spec.select = sext i1 %6 to i32\n %7 = mul nsw i32 %spec.select, %spec.select\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_17-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_connect_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge37.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to %sockaddr*\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %4, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = ptrtoint i64* %sv_3 to i64\n %11 = sext i32 %2 to i64\n %12 = add i64 %11, %10\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %27 = icmp eq i32 %26, 1\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_13, label LBL_9\n LBL_9:\n %29 = load i64, i64* %sv_1, align 8\n %30 = and i64 %29, 4294967295\n %31 = icmp eq i64 %30, 0\n store i32 0, i32* %storemerge37.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %31, label LBL_12, label LBL_10\n LBL_10:\n %storemerge37.reload = load i32, i32* %storemerge37.reg2mem\n %32 = add i32 %storemerge37.reload, 1\n %33 = sext i32 %32 to i64\n %34 = icmp sgt i64 %30, %33\n store i32 %32, i32* %storemerge37.reg2mem\n br i1 %34, label LBL_10, label LBL_11\n LBL_11:\n %phitmp = zext i32 %32 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_12\n LBL_12:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %35 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %32, { 1, 0, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %storemerge37.reg2mem, { 2, 0, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i32*, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i32** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, -609\n %4 = and i64 %3, -16\n %5 = bitcast i32** %sv_1 to i64*\n store i64 %4, i64* %5, align 8\n %6 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 50)\n %7 = add i64 %2, -416\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %8 = mul i64 %storemerge3.reload, 4\n %9 = load i32*, i32** %sv_1, align 8\n %10 = ptrtoint i32* %9 to i64\n %11 = add i64 %8, %10\n %12 = add i64 %7, %8\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = inttoptr i64 %11 to i32*\n store i32 %14, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %17 = load i32*, i32** %sv_1, align 8\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_1, { 3, 2, 0, 1 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE681_Incorrect_Conversion_Between_Numeric_Types__double2float_17-bad", "fun_name": "CWE681_Incorrect_Conversion_Between_Numeric_Types__double2float_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %3 = call i64 @FUNC(i64 40)\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i128 @FUNC(i128 %2, i128 %2)\n %6 = call i64 @FUNC(i128 %5)\n %7 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %8 = call i8* @fgets(i8* nonnull %4, i32 256, %_IO_FILE* %7)\n %9 = icmp eq i8* %8, null\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n %10 = call double @atof(i8* nonnull %4)\n %11 = fptrunc double %10 to float\n %12 = bitcast float %11 to i32\n %13 = sext i32 %12 to i128\n %14 = call i64 @FUNC(i128 %13)\n store i64 %14, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %16 = call i128 @FUNC(i128 %1, i128 %1)\n %17 = call i128 @FUNC(i64 %sv_0.0.reload)\n %18 = call i32 @FUNC(i128 %17)\n %19 = call i128 @__asm_movd.1(i32 %18)\n %20 = call i64 @FUNC()\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %3, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n %spec.store.select = select i1 %2, i32 -1, i32 99\n store i64 0, i64* %sv_1, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_1 to i8*\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* nonnull %5, i8* nonnull %6, i32 %spec.store.select)\n %8 = sext i32 %spec.store.select to i64\n %9 = add i64 %4, -112\n %10 = add i64 %9, %8\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = ptrtoint i64* %sv_1 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 2, 1, 3, 0 }\n uselistorder i32 -1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_square_11-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_square_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = mul i32 %9, %9\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_fprintf_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = add i64 %1, 8\n %3 = inttoptr i64 %2 to i64*\n store i64 8247343692658534758, i64* %sv_0, align 8\n store i64 32777976880262761, i64* %3, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %6 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %5, i8* nonnull %4)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fprintf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fread_01-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fread_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 @fread(i64* nonnull %sv_0, i32 1, i32 99, %_IO_FILE* %1)\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncat_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %3, align 8\n store i8* %3, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @strncat(i8* %sv_0.0.reload, i8* nonnull %5, i32 100)\n %7 = ptrtoint i8* %sv_0.0.reload to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memmove_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 100)\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %8 = load i64, i64* %6, align 16\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %1, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_partial_init_07-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_partial_init_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %indvars.iv6.reg2mem\n store i32 %2, i32* %.reg2mem\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %5 = mul i64 %indvars.iv6.reload, 8\n %6 = add i64 %5, %1\n %7 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %8 = trunc i64 %indvars.iv6.reload to i32\n %9 = call i128 @FUNC(i32 %8)\n %10 = call i64 @FUNC(i128 %9)\n %11 = inttoptr i64 %6 to i64*\n store i64 %10, i64* %11, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 5\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %9, i128* %xmm0.04.reg2mem\n br i1 %exitcond8, label LBL_2, label LBL_1\n LBL_2:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_3\n LBL_3:\n %.reload = load i32, i32* %.reg2mem\n %12 = icmp eq i32 %.reload, 5\n %13 = icmp eq i1 %12, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 8\n %15 = add i64 %14, %1\n %16 = inttoptr i64 %15 to i64*\n %17 = load i64, i64* %16, align 8\n %18 = call i128 @FUNC(i64 %17)\n %19 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__long_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 5)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLine, { 3, 2, 1, 0 }\n uselistorder i64 5, { 1, 0, 2, 3 }\n uselistorder i32* @gv_0, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__equals_12-bad", "fun_name": "CWE398_Poor_Code_Quality__equals_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64 @FUNC(i64 1)\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 1)\n store i64 %4, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %5 = call i64 @FUNC(i64 5)\n store i64 %5, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i64*\n store i64 32777976880262761, i64* %7, align 8\n %8 = call i32 (i8*, ...) @printf(i8* nonnull %4)\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2, 3 }\n uselistorder i32 5, { 1, 0, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cat_03-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %2, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strcat(i8* nonnull %2, i8* nonnull %4)\n %6 = call i64 @FUNC(i64 %1)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_34-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %4 = mul i64 %indvars.iv.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 10, { 0, 2, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_memmove_04-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_memmove_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %3, -8\n store i64 %8, i64* %sv_1, align 8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = load i64, i64* %sv_1, align 8\n %11 = inttoptr i64 %10 to i64*\n %12 = call i64* @memmove(i64* nonnull %sv_0, i64* %11, i32 100)\n %13 = call i64 @FUNC(i64* nonnull %sv_0)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_no_init_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %indvars.iv6.reg2mem\n store i32 %2, i32* %.reg2mem\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %5 = mul i64 %indvars.iv6.reload, 8\n %6 = add i64 %5, %1\n %7 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %8 = trunc i64 %indvars.iv6.reload to i32\n %9 = call i128 @FUNC(i32 %8)\n %10 = call i64 @FUNC(i128 %9)\n %11 = inttoptr i64 %6 to i64*\n store i64 %10, i64* %11, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %9, i128* %xmm0.04.reg2mem\n br i1 %exitcond8, label LBL_2, label LBL_1\n LBL_2:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_3\n LBL_3:\n %.reload = load i32, i32* %.reg2mem\n %12 = icmp eq i32 %.reload, 5\n %13 = icmp eq i1 %12, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 8\n %15 = add i64 %14, %1\n %16 = inttoptr i64 %15 to i64*\n %17 = load i64, i64* %16, align 8\n %18 = call i128 @FUNC(i64 %17)\n %19 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @printDoubleLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder i32* @gv_0, { 0, 4, 3, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_malloc_12-bad", "fun_name": "CWE690_NULL_Deref_From_Return__int_malloc_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 4)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %0 to i32*\n store i32 5, i32* %4, align 4\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %6 = icmp eq i64* %0, null\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = bitcast i64* %0 to i32*\n store i32 5, i32* %7, align 4\n %8 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_add_01-bad", "fun_name": "CWE190_Integer_Overflow__int_connect_socket_add_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i64 1, i64* %sv_0.05.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i64 1, i64* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i64 1, i64* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -22\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n %phitmp = add i32 %18, 1\n %phitmp3 = zext i32 %phitmp to i64\n store i64 %phitmp3, i64* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i64, i64* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i64 %sv_0.0.ph.reload, i64* %sv_0.05.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.05.reload = load i64, i64* %sv_0.05.reg2mem\n %20 = call i64 @FUNC(i64 %sv_0.05.reload)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %sv_0.05.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_environment_12-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_environment_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_1, align 8\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i64 @FUNC()\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 0\n %12 = call i32 @strlen(i8* nonnull %8)\n %13 = sext i32 %12 to i64\n br i1 %11, label LBL_3, label LBL_1\n LBL_1:\n %14 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_4, label LBL_2\n LBL_2:\n %16 = ptrtoint i64* %sv_1 to i64\n %17 = add i64 %13, %16\n %18 = inttoptr i64 %17 to i8*\n %19 = sub i32 249, %12\n %20 = call i8* @strncat(i8* %18, i8* nonnull %14, i32 %19)\n br label LBL_4\n LBL_3:\n %21 = ptrtoint i64* %sv_1 to i64\n %22 = add i64 %13, %21\n %23 = inttoptr i64 %22 to i32*\n store i32 1852400175, i32* %23, align 4\n %24 = add i64 %22, 4\n %25 = inttoptr i64 %24 to i8*\n store i8 0, i8* %25, align 1\n br label LBL_4\n LBL_4:\n %26 = call i32 @putenv(i8* nonnull %8)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %2, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %22, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE481_Assigning_Instead_of_Comparing__basic_02-bad", "fun_name": "CWE481_Assigning_Instead_of_Comparing__basic_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = call i64 @FUNC(i64 ptrtoint ([8 x i8]* @gv_0 to i64))\n ret i64 %1\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_negative_07-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_negative_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -68\n %6 = inttoptr i64 %5 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %sv_3 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %5\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %13 = inttoptr i64 %sv_0.0.reload to i64*\n %14 = call i64* @memcpy(i64* %13, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_2 to i32))\n %15 = call i64 @FUNC(i64 %sv_0.0.reload)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memmove_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 100)\n %5 = call i64* @memmove(i64* %1, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %6 = load i64, i64* %1, align 8\n %7 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_multiply_31-bad", "fun_name": "CWE191_Integer_Underflow__short_rand_multiply_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = mul i32 %4, 32768\n %6 = call i32 @rand()\n %7 = xor i32 %6, %5\n %8 = sext i1 %2 to i32\n %storemerge.in = xor i32 %7, %8\n %9 = urem i32 %storemerge.in, 65536\n %10 = zext i32 %9 to i64\n %11 = trunc i32 %storemerge.in to i16\n %12 = icmp slt i16 %11, 0\n %13 = icmp eq i1 %12, false\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n %sext = mul i32 %storemerge.in, 131072\n %14 = ashr exact i32 %sext, 16\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_alloca_cat_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__dest_char_alloca_cat_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -49\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strcat(i8* %sv_0.0.reload, i8* nonnull %9)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__int_alloca_use_05-bad", "fun_name": "CWE758_Undefined_Behavior__int_alloca_use_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = add i64 %3, -1\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i32*\n %7 = load i32, i32* %6, align 16\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_square_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.off0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 2, i64* %sv_0.0.off0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.off0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.off0.reload = load i64, i64* %sv_0.0.off0.reg2mem\n %7 = mul nuw nsw i64 %sv_0.0.off0.reload, %sv_0.0.off0.reload\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.off0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_multiply_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = icmp slt i64 %3, 1\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp sgt i64 %3, 4611686018427387902\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = mul i64 %3, 2\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fscanf_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = call i128 @__asm_movss.1(i32 %5)\n %7 = call i64 @FUNC(i128 %6)\n %8 = trunc i64 %7 to i32\n store i32 %8, i32* %sv_0, align 4\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %11 = load i32, i32* %sv_0, align 4\n %12 = call i128 @__asm_movss.1(i32 %11)\n %13 = call i64 @FUNC(i128 %12)\n %14 = trunc i64 %13 to i32\n %15 = call i128 @__asm_movss.1(i32 %14)\n %16 = call i64 @FUNC(i128 %15)\n %17 = trunc i64 %16 to i32\n %18 = call i128 @__asm_movss.1(i32 %17)\n %19 = call i128 @__asm_movss.1(i32 2147483647)\n %20 = call i128 @FUNC(i128 %18, i128 %19)\n %21 = call i128 @__asm_cvtss2sd.2(i128 %20)\n %22 = load i128, i128* @gv_2, align 8\n call void @FUNC(i128 %21, i128 %22)\n %23 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %2, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_remove_05-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_remove_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call i32 @remove(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_1, i64 0, i64 0))\n %3 = sext i32 %2 to i64\n %4 = icmp eq i32 %2, 0\n %5 = icmp eq i1 %4, false\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_01-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, -193\n %4 = and i64 %3, -16\n %5 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 50)\n store i64 0, i64* %sv_1, align 8\n %6 = add i64 %2, -416\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %7 = mul i64 %storemerge2.reload, 4\n %8 = add i64 %7, %4\n %9 = add i64 %6, %7\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = inttoptr i64 %8 to i32*\n store i32 %11, i32* %12, align 4\n %13 = load i64, i64* %sv_1, align 8\n %14 = add i64 %13, 1\n store i64 %14, i64* %sv_1, align 8\n %15 = icmp ult i64 %14, 100\n store i64 %14, i64* %storemerge2.reg2mem\n br i1 %15, label LBL_1, label LBL_2\n LBL_2:\n %16 = inttoptr i64 %4 to i32*\n %17 = load i32, i32* %16, align 16\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %1, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %14, { 0, 2, 1 }\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_10-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fgets_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = call i64 @FUNC(i64 ptrtoint ([24 x i8]* @gv_1 to i64))\n %5 = load %_IO_FILE*, %_IO_FILE** @gv_2, align 8\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @fgets(i8* nonnull %6, i32 100, %_IO_FILE* %5)\n %8 = call i64 @FUNC(i64 %3)\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_declare_05-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_char_declare_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = ptrtoint i64* %sv_1 to i64\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %5 = call i64 @FUNC(i64 %sv_0.0.reload)\n %6 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %6)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE665_Improper_Initialization__char_ncat_31-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i8* @strncat(i8* nonnull %1, i8* nonnull %4, i32 %5)\n %7 = call i64 @FUNC(i64 %2)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE170_char_strncpy_07-bad", "fun_name": "CWE126_Buffer_Overread__CWE170_char_strncpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 149)\n %5 = bitcast i64* %sv_1 to i8*\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* nonnull %5, i8* nonnull %6, i32 99)\n %8 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_connect_socket_32-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_connect_socket_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_2, align 8\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_2 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %10, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %11 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %12 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %13 = call i16 @htons(i16 27015)\n %14 = bitcast i64* %sv_0 to %sockaddr*\n %15 = call i32 @connect(i32 %10, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_7, label LBL_2\n LBL_2:\n %17 = sext i32 %9 to i64\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 249, %9\n %22 = call i32 @recv(i32 %10, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_7, label LBL_3\n LBL_3:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %8, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %28, align 1\n br label LBL_5\n LBL_5:\n %30 = call i8* @strchr(i8* nonnull %8, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %30, align 1\n br label LBL_7\n LBL_7:\n %32 = call i32 @close(i32 %10)\n br label LBL_8\n LBL_8:\n %33 = call i32 @putenv(i8* nonnull %8)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %2, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %10, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_snprintf_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 49)\n %9 = add i64 %3, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_3\n LBL_3:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %13, i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* %11)\n %15 = call i64 @FUNC(i64 %3)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %11, { 1, 0 }\n uselistorder i64 %3, { 1, 3, 2, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fgets_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 %4, i64* %sv_0.0.in.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i128 @__asm_movss.1(i32 1073741824)\n %9 = call i64 @FUNC(i128 %8)\n store i64 %9, i64* %sv_0.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %13 = call i128 @FUNC(i128 %1, i128 %1)\n %14 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.0)\n %15 = call i128 @FUNC(i64 4636737291354636288)\n %16 = call i128 @FUNC(i128 %15, i128 %14)\n %17 = call i32 @FUNC(i128 %16)\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %2, { 1, 0 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_alloca_32-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_int_alloca_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %2 = add i64 %0, -401\n %3 = and i64 %2, -16\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 4\n %5 = add i64 %4, %3\n %6 = inttoptr i64 %5 to i32*\n store i32 5, i32* %6, align 4\n %7 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %7, 100\n store i64 %7, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n store i64 %3, i64* %sv_0, align 8\n %8 = inttoptr i64 %3 to i32*\n %9 = load i32, i32* %8, align 16\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = inttoptr i64 %3 to i64*\n call void @free(i64* %12)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 1, 3, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memmove_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_3, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %7 = ptrtoint i64* %sv_2 to i64\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memmove(i64* nonnull %sv_1, i64* %11, i32 %10)\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* %sv_1, { 3, 0, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_01-bad", "fun_name": "CWE126_Buffer_Overread__malloc_char_loop_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 50)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = add i64 %4, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = sext i32 %10 to i64\n %13 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %4\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = add i64 %storemerge1.reload, %13\n %18 = inttoptr i64 %17 to i8*\n store i8 %16, i8* %18, align 1\n %19 = add nuw i64 %storemerge1.reload, 1\n %20 = icmp ult i64 %19, %12\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %20, label LBL_4, label LBL_5\n LBL_5:\n %21 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %1)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %10, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_multiply_31-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_multiply_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp slt i16 %3, 1\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = zext i16 %3 to i32\n %sext = mul i32 %5, 131072\n %6 = ashr exact i32 %sext, 16\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_predec_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %sv_0.1.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_7\n LBL_7:\n %.reload = load i32, i32* %.reg2mem\n %23 = icmp eq i32 %.reload, 5\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_12\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %25 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %25, label LBL_11, label LBL_10\n LBL_10:\n %26 = add i32 %sv_0.1.reload, -1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_12\n LBL_11:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_12:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_multiply_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n %13 = icmp slt i32 %sv_0.0.reload, 1\n %or.cond = or i1 %13, %12\n br i1 %or.cond, label LBL_8, label LBL_5\n LBL_5:\n %14 = icmp sgt i32 %sv_0.0.reload, 1073741822\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n %15 = mul i32 %sv_0.0.reload, 2\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_8\n LBL_7:\n %18 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_char_12-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_char_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 122, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext = mul i32 %sv_0.1.reload, 16777216\n %23 = ashr exact i32 %sext, 24\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 1, 2 }\n uselistorder i32 -1, { 2, 1, 3, 0, 4 }\n uselistorder label LBL_6, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_postinc_05-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_rand_postinc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %8 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = zext i32 %3 to i64\n %10 = mul i64 %9, 1152921504606846976\n %11 = zext i32 %4 to i64\n %12 = mul i64 %11, 35184372088832\n %13 = sext i32 %5 to i64\n %14 = mul i64 %13, 1073741824\n %15 = sext i32 %6 to i64\n %16 = mul i64 %15, 32768\n %17 = sext i32 %7 to i64\n %18 = urem i32 %2, 2\n %19 = icmp eq i32 %18, 0\n %20 = sext i1 %19 to i64\n %21 = xor i64 %10, %20\n %22 = xor i64 %21, %12\n %23 = xor i64 %22, %14\n %24 = xor i64 %23, %16\n %storemerge = xor i64 %24, %17\n %phitmp = add i64 %storemerge, 1\n %25 = call i64 @FUNC(i64 %phitmp)\n store i64 %25, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memcpy_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = load i64, i64* %sv_0, align 8\n store i64 %9, i64* %1, align 8\n %10 = add i64 %4, 8\n %11 = inttoptr i64 %10 to i64*\n %12 = add i64 %4, 16\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %4, 24\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %4, 32\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %4, 40\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %4, 48\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %4, 56\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %4, 64\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %4, 72\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %4, 80\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %4, 88\n %31 = inttoptr i64 %30 to i64*\n %32 = add i64 %4, 96\n %33 = inttoptr i64 %32 to i32*\n store i8 0, i8* %7, align 1\n %34 = call i64 @FUNC(i64 %4)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 0, 1, 9, 2, 12, 3, 4, 5, 6, 7, 8, 10, 11, 13 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_snprintf_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_0.LBL_3_crit_edge, label LBL_2\n LBL_1:\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %10, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %12 = call i64 @FUNC(i64 %.pre-phi.reload)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 4, 2, 3, 0 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_multiply_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = call i64 @FUNC()\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = load i16, i16* %sv_0, align 2\n %8 = icmp slt i16 %7, 0\n %9 = icmp eq i1 %8, false\n br i1 %6, label LBL_5, label LBL_1\n LBL_1:\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = icmp slt i16 %7, -16383\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = mul i16 %7, 2\n %12 = sext i16 %11 to i64\n %13 = and i64 %12, 4294967294\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_9\n LBL_4:\n %15 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_9\n LBL_5:\n br i1 %9, label LBL_9, label LBL_6\n LBL_6:\n %16 = icmp slt i16 %7, -16383\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n %17 = mul i16 %7, 2\n %18 = sext i16 %17 to i64\n %19 = and i64 %18, 4294967294\n %20 = call i64 @FUNC(i64 %19)\n br label LBL_9\n LBL_8:\n %21 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_9\n LBL_9:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %9, { 1, 0 }\n uselistorder i16 %7, { 0, 3, 1, 2, 4 }\n uselistorder i16* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_sub_11-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_fscanf_sub_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = add i64 %9, -1\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE170_char_memcpy_17-bad", "fun_name": "CWE126_Buffer_Overread__CWE170_char_memcpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 149)\n %2 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 99)\n %3 = call i64 @FUNC(i64* nonnull %sv_0)\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_calloc_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @calloc(i32 100, i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %3, align 8\n %6 = call i64 @FUNC(i64 5)\n br label LBL_7\n LBL_4:\n br i1 %5, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n store i64 5, i64* %3, align 8\n %7 = call i64 @FUNC(i64 5)\n br label LBL_7\n LBL_7:\n %8 = call i64 @FUNC()\n call void @free(i64* nonnull %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %3, { 0, 2, 1, 3 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fixed_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %spec.store.select = select i1 %2, i32 -1, i32 20\n %3 = mul i32 %spec.store.select, 4\n %4 = call i64* @malloc(i32 %3)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_1, label LBL_2\n LBL_1:\n %7 = ptrtoint i64* %4 to i64\n %8 = sext i32 %spec.store.select to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 4\n %10 = add i64 %9, %7\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw i64 %storemerge1.reload, 1\n %13 = icmp ult i64 %12, %8\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %13, label LBL_3, label LBL_4\n LBL_4:\n %14 = bitcast i64* %4 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %4)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i32 %spec.store.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_fwrite_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge11.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_12, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_12\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %sv_3.0.off = add i32 %19, -1\n %21 = icmp ugt i32 %sv_3.0.off, 19\n br i1 %21, label LBL_12, label LBL_5\n LBL_5:\n %22 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %23 = icmp eq %_IO_FILE* %22, null\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_6, label LBL_7\n LBL_6:\n %25 = sext i32 %19 to i64\n store i64 0, i64* %storemerge11.reg2mem\n br label LBL_8\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %26 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_3 to i64*), i32 1, i32 50, %_IO_FILE* %22)\n %27 = icmp eq i32 %26, 50\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 1)\n unreachable\n LBL_10:\n %storemerge11.reload = load i64, i64* %storemerge11.reg2mem\n %28 = add nuw i64 %storemerge11.reload, 1\n %29 = icmp ult i64 %28, %25\n store i64 %28, i64* %storemerge11.reg2mem\n br i1 %29, label LBL_8, label LBL_11\n LBL_11:\n %30 = call i32 @fclose(%_IO_FILE* nonnull %22)\n br label LBL_12\n LBL_12:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %22, { 1, 0, 2 }\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %storemerge11.reg2mem, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 3, 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_listen_socket_32-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_listen_socket_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05810.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @bind(i32 %2, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call i32 @listen(i32 %2, i32 5)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = call i32 @accept(i32 %2, %sockaddr* null, i32* null)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_4\n LBL_4:\n %13 = call i32 @recv(i32 %11, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %2)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n store i32 -1, i32* %sv_0.05810.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %2)\n %24 = call i32 @close(i32 %11)\n store i64 0, i64* %sv_2, align 8\n %25 = icmp sgt i32 %sv_0.0.ph.reload, 9\n store i32 %sv_0.0.ph.reload, i32* %sv_0.05810.reg2mem\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n %sv_0.05810.reload = load i32, i32* %sv_0.05810.reg2mem\n %26 = sext i32 %sv_0.05810.reload to i64\n %27 = mul i64 %26, 4\n %28 = add i64 %0, -64\n %29 = add i64 %28, %27\n %30 = inttoptr i64 %29 to i32*\n %31 = load i32, i32* %30, align 4\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_11\n LBL_10:\n %34 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %1, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %2, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 3, 0, 1, 4, 2 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_snprintf_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %8 = inttoptr i64 %3 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %3, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n br label LBL_3\n LBL_3:\n %12 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %13 = call i32 @strlen(i8* %12)\n %14 = bitcast i64* %sv_0 to i8*\n %15 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %14, i32 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* %12)\n %16 = call i64 @FUNC(i64 %3)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %12, { 1, 0 }\n uselistorder i64 %3, { 2, 3, 0, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_square_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = sub i8 0, %3\n %5 = icmp slt i8 %4, 0\n %6 = icmp eq i1 %5, false\n %.v = select i1 %6, i8 %4, i8 %3\n %7 = icmp ult i8 %.v, 12\n br i1 %7, label LBL_1, label LBL_2\n LBL_1:\n %8 = mul i8 %3, %3\n %9 = sext i8 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_2:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8 %3, { 1, 0, 2, 3 }\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %spec.select = select i1 %5, i32 0, i32 20\n %6 = call i64* @malloc(i32 %spec.select)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %9 = ptrtoint i64* %6 to i64\n %10 = bitcast i64* %6 to i32*\n store i32 1819043176, i32* %10, align 4\n %11 = add i64 %9, 4\n %12 = inttoptr i64 %11 to i16*\n store i16 111, i16* %12, align 2\n %13 = call i64 @FUNC(i64 %9)\n call void @free(i64* %6)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %6, { 0, 1, 3, 2 }\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 0, 1, 6, 2, 3, 4, 5, 11, 7, 8, 9, 10 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_memmove_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %5 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 100)\n %6 = inttoptr i64 %sv_0.0.reload to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %8 = load i64, i64* %6, align 8\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_for_loop_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n %sv_0.1.off = add i32 %sv_0.1.reload, -1\n %26 = icmp ugt i32 %sv_0.1.off, 19\n %27 = or i1 %26, %25\n br i1 %27, label LBL_9, label LBL_7\n LBL_7:\n %28 = sext i32 %sv_0.1.reload to i64\n store i64 0, i64* %storemerge7.reg2mem\n br label LBL_8\n LBL_8:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %29 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n %30 = add nuw i64 %storemerge7.reload, 1\n %31 = icmp ult i64 %30, %28\n store i64 %30, i64* %storemerge7.reg2mem\n br i1 %31, label LBL_8, label LBL_9\n LBL_9:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %storemerge7.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 -1, { 8, 3, 2, 10, 0, 11, 1, 9, 7, 6, 12, 4, 13, 5 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_calloc_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 4)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = bitcast i64* %0 to i32*\n store i32 5, i32* %5, align 4\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_calloc_04-bad", "fun_name": "CWE690_NULL_Deref_From_Return__char_calloc_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @calloc(i32 20, i32 1)\n %1 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %2 = add i64 %1, 8\n %3 = inttoptr i64 %2 to i16*\n store i16 25978, i16* %3, align 2\n %4 = add i64 %1, 10\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64 @FUNC(i64 %1)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %1, { 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_13-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %7 = mul i64 %indvars.iv5.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv5.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 5\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n ret i64 %16\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_square_17-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_rand_square_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = urem i32 %0, 2\n %7 = icmp eq i32 %6, 0\n %8 = zext i32 %1 to i64\n %9 = mul i64 %8, 1152921504606846976\n %10 = zext i32 %2 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = sext i32 %3 to i64\n %13 = mul i64 %12, 1073741824\n %14 = sext i32 %4 to i64\n %15 = mul i64 %14, 32768\n %16 = sext i32 %5 to i64\n %17 = sext i1 %7 to i64\n %18 = xor i64 %9, %17\n %19 = xor i64 %18, %11\n %20 = xor i64 %19, %13\n %21 = xor i64 %20, %15\n %storemerge3.le = xor i64 %21, %16\n %22 = mul i64 %storemerge3.le, %storemerge3.le\n %23 = call i64 @FUNC(i64 %22)\n ret i64 %23\n\n uselistorder i64 %storemerge3.le, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_snprintf_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_0.LBL_3_crit_edge, label LBL_2\n LBL_1:\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %10, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %12 = call i64 @FUNC(i64 %.pre-phi.reload)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 4, 2, 3, 0 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_modulo_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = urem i32 100, %3\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_17-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 10)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = sext i32 %6 to i64\n %8 = add nsw i64 %7, 1\n %9 = icmp eq i64 %8, 0\n br i1 %9, label LBL_5, label LBL_3\n LBL_3:\n %10 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %11 = add i64 %storemerge3.reload, %4\n %12 = add i64 %storemerge3.reload, %10\n %13 = inttoptr i64 %12 to i8*\n %14 = load i8, i8* %13, align 1\n %15 = inttoptr i64 %11 to i8*\n store i8 %14, i8* %15, align 1\n %16 = add nuw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %16, %8\n store i64 %16, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %17 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_snprintf_32-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_snprintf_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %3, i64* %sv_1, align 8\n store i64 0, i64* %sv_0, align 8\n %8 = inttoptr i64 %3 to i8*\n %9 = call i32 @strlen(i8* %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %10, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i8* %8)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 4, 3, 2, 5 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_32-bad", "fun_name": "CWE369_Divide_by_Zero__int_connect_socket_divide_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.05.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -22\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.05.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.05.reload = load i32, i32* %sv_0.05.reg2mem\n %20 = udiv i32 100, %sv_0.05.reload\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.05.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 2, 1, 3, 0, 4 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_declare_07-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_char_declare_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = ptrtoint i64* %sv_1 to i64\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %6 = call i64 @FUNC(i64 %sv_0.0.reload)\n %7 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %7)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_31-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i32, align 4\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_2, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_2)\n %3 = load i32, i32* %sv_2, align 4\n store i64 0, i64* %sv_1, align 8\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %5 = icmp sgt i32 %3, 99\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %sv_3 to i64\n %7 = bitcast i64* %sv_1 to i8*\n %8 = bitcast i64* %sv_0 to i8*\n %9 = call i8* @strncpy(i8* nonnull %7, i8* nonnull %8, i32 %3)\n %10 = sext i32 %3 to i64\n %11 = add i64 %6, -112\n %12 = add i64 %11, %10\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n br label LBL_2\n LBL_2:\n %14 = call i64 @FUNC(i64* nonnull %sv_1)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 1, 0, 2 }\n uselistorder i32* %sv_2, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_loop_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %.reg2mem3 = alloca i32*\n %.reg2mem = alloca i32*\n %sv_0 = alloca i32*, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32* null, i32** %.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i32** %sv_0 to i64\n %4 = add i64 %3, -33\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i32*\n store i32* %6, i32** %sv_0, align 8\n store i32* %6, i32** %.reg2mem\n br label LBL_2\n LBL_2:\n %7 = ptrtoint i64* %sv_1 to i64\n %.reload = load i32*, i32** %.reg2mem\n %8 = add i64 %7, -48\n store i32* %.reload, i32** %.reg2mem3\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %.reload4 = load i32*, i32** %.reg2mem3\n %9 = mul i64 %storemerge2.reload, 4\n %10 = ptrtoint i32* %.reload4 to i64\n %11 = add i64 %9, %10\n %12 = add i64 %8, %9\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = inttoptr i64 %11 to i32*\n store i32 %14, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %16, 10\n %17 = load i32*, i32** %sv_0, align 8\n store i32* %17, i32** %.reg2mem3\n store i64 %16, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %17, { 1, 0 }\n uselistorder i32** %sv_0, { 3, 2, 0, 1 }\n uselistorder i32** %.reg2mem, { 0, 2, 1 }\n uselistorder i32** %.reg2mem3, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_07-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = load i32, i32* @gv_0, align 4\n %36 = icmp eq i32 %35, 5\n %37 = icmp eq i1 %36, false\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n %38 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n br label LBL_14\n LBL_14:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_13-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n store i64 0, i64* %sv_0, align 8\n %35 = bitcast i64* %sv_0 to i8*\n %36 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %35, i32 99, i8* nonnull %1)\n %37 = call i64 @FUNC(i64* nonnull %sv_0)\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n uselistorder i32 5, { 1, 0, 2 }\n uselistorder label LBL_12, { 3, 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_add_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.03.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp eq i32 %6, 2147483647\n store i32 %6, i32* %sv_0.03.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.03.reload = load i32, i32* %sv_0.03.reg2mem\n %8 = add i32 %sv_0.03.reload, 1\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__long_malloc_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 8)\n %1 = load i32, i32* @gv_0, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n %5 = icmp eq i64* %0, null\n %or.cond = or i1 %5, %4\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 1, 3, 2, 4, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_sub_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = urem i32 %2, 2\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @rand()\n %6 = mul i32 %5, 1073741824\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = xor i32 %8, %6\n %10 = call i32 @rand()\n %11 = xor i32 %9, %10\n %12 = sext i1 %4 to i32\n %storemerge.in = xor i32 %11, %12\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %13 = load i32, i32* @gv_1, align 4\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %16 = icmp eq i32 %sv_0.0.reload, -2147483648\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = add i32 %sv_0.0.reload, -1\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %20 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_sub_13-bad", "fun_name": "CWE191_Integer_Underflow__int_min_sub_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = select i1 %2, i64 4294967295, i64 2147483647\n %4 = call i64 @FUNC(i64 %3)\n ret i64 %4\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_loop_06-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE131_loop_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %.reg2mem = alloca i32*\n %sv_0 = alloca i32*, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = add i64 %0, -17\n %4 = and i64 %3, -16\n %5 = inttoptr i64 %4 to i32*\n store i32* %5, i32** %sv_0, align 8\n %6 = add i64 %2, -48\n store i32* %5, i32** %.reg2mem\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %.reload = load i32*, i32** %.reg2mem\n %7 = mul i64 %storemerge2.reload, 4\n %8 = ptrtoint i32* %.reload to i64\n %9 = add i64 %7, %8\n %10 = add i64 %6, %7\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = inttoptr i64 %9 to i32*\n store i32 %12, i32* %13, align 4\n %14 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %14, 10\n %15 = load i32*, i32** %sv_0, align 8\n store i32* %15, i32** %.reg2mem\n store i64 %14, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %15, { 1, 0 }\n uselistorder i32** %sv_0, { 2, 1, 0 }\n uselistorder i32** %.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_max_multiply_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 4)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_08-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC()\n %36 = trunc i64 %35 to i32\n %37 = icmp eq i32 %36, 0\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n %38 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n br label LBL_14\n LBL_14:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_13-bad", "fun_name": "CWE126_Buffer_Overread__CWE129_connect_socket_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8388 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_4, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_1 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_44, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_0, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n br i1 %14, label LBL_44, label LBL_6\n LBL_4:\n store i64 0, i64* %sv_1, align 8\n br label LBL_8\n LBL_5:\n %15 = call i32 @close(i32 %4)\n store i64 0, i64* %sv_1, align 8\n br label LBL_8\n LBL_6:\n %16 = ptrtoint i64* %sv_2 to i64\n %17 = sext i32 %12 to i64\n %18 = add i64 %16, -22\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = bitcast i64* %sv_0 to i8*\n %22 = call i32 @atoi(i8* nonnull %21)\n %23 = call i32 @close(i32 %4)\n store i64 0, i64* %sv_1, align 8\n %24 = icmp slt i32 %22, 0\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n %25 = sext i32 %22 to i64\n %26 = mul i64 %25, 4\n %27 = add i64 %16, -64\n %28 = add i64 %27, %26\n %29 = inttoptr i64 %28 to i32*\n %30 = load i32, i32* %29, align 4\n %31 = zext i32 %30 to i64\n %32 = call i64 @FUNC(i64 %31)\n br label LBL_9\n LBL_8:\n %33 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i64 %16, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 4, 0, 1, 2, 5, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_rand_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = mul i32 %4, 1073741824\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = xor i32 %7, %5\n %9 = call i32 @rand()\n %10 = xor i32 %8, %9\n %11 = sext i1 %3 to i32\n %storemerge1.in = xor i32 %10, %11\n %12 = icmp ugt i32 %storemerge1.in, 9\n br i1 %12, label LBL_3, label LBL_1\n LBL_1:\n %13 = ptrtoint i64* %sv_0 to i64\n %14 = sext i32 %storemerge1.in to i64\n %15 = mul i64 %14, 4\n %16 = add i64 %13, -64\n %17 = add i64 %15, %16\n %18 = inttoptr i64 %17 to i32*\n store i32 1, i32* %18, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %19 = mul i64 %indvars.iv.reload, 4\n %20 = add i64 %19, %16\n %21 = inttoptr i64 %20 to i32*\n %22 = load i32, i32* %21, align 4\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_2\n LBL_3:\n %25 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_4:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge1.in, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i16, i16* %sv_0, align 2\n %9 = sub i16 0, %8\n %10 = icmp slt i16 %9, 0\n %11 = icmp eq i1 %10, false\n %.v = select i1 %11, i16 %9, i16 %8\n %12 = icmp ult i16 %.v, 182\n br i1 %12, label LBL_4, label LBL_5\n LBL_4:\n %13 = mul i16 %8, %8\n %14 = sext i16 %13 to i64\n %15 = and i64 %14, 4294967295\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_6\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %8, { 1, 0, 2, 3 }\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__char_pointer_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_0, i64 0, i64 0), i8** %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %7 = ptrtoint i8* %sv_0.0.reload to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i8* null, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 11)\n %5 = bitcast i64* %4 to i8*\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i8* %5, i8** %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %8)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %12)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_sleep_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8424 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_10, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_10, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n br label LBL_10\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n %28 = icmp slt i32 %sv_0.0.ph.reload, 1\n %29 = icmp sgt i32 %sv_0.0.ph.reload, ptrtoint (i1* @gv_0 to i32)\n %or.cond4 = or i1 %28, %29\n br i1 %or.cond4, label LBL_10, label LBL_9\n LBL_9:\n %30 = call i32 @usleep(i32 %sv_0.0.ph.reload)\n %31 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_11\n LBL_10:\n %32 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_11:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 0, 2, 1 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_10, { 3, 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = call i32 @close(i32 %0)\n %2 = sext i32 %1 to i64\n ret i64 %2\n\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, ...)* @open, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_fwrite_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %sv_1.0.off = add i32 %6, -1\n %7 = icmp ugt i32 %sv_1.0.off, 19\n br i1 %7, label LBL_10, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_4, label LBL_5\n LBL_4:\n %11 = sext i32 %6 to i64\n store i64 0, i64* %storemerge5.reg2mem\n br label LBL_6\n LBL_5:\n call void @exit(i32 1)\n unreachable\n LBL_6:\n %12 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_4 to i64*), i32 1, i32 50, %_IO_FILE* %8)\n %13 = icmp eq i32 %12, 50\n br i1 %13, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %14 = add nuw i64 %storemerge5.reload, 1\n %15 = icmp ult i64 %14, %11\n store i64 %14, i64* %storemerge5.reg2mem\n br i1 %15, label LBL_6, label LBL_9\n LBL_9:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_10\n LBL_10:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %8, { 1, 0, 2 }\n uselistorder i32 %6, { 1, 0 }\n uselistorder i64* %storemerge5.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 3, 1, 0, 2, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 2, 0 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_for_loop_17-bad", "fun_name": "CWE400_Resource_Exhaustion__fscanf_for_loop_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %3 = icmp eq i32 %.pre, 0\n store i64 0, i64* %storemerge13.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %4 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %5 = add nuw i64 %storemerge13.reload, 1\n %6 = load i32, i32* %sv_0, align 4\n %7 = sext i32 %6 to i64\n %8 = icmp ult i64 %5, %7\n store i64 %5, i64* %storemerge13.reg2mem\n br i1 %8, label LBL_1, label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 0, 1, 3 }\n uselistorder i64* %storemerge13.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %storemerge45.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %20 = icmp eq i32 %19, 5\n br i1 %20, label LBL_8, label LBL_10\n LBL_8:\n %21 = call i32 @strlen(i8* nonnull %3)\n %22 = icmp eq i32 %21, 0\n br i1 %22, label LBL_14, label LBL_9\n LBL_9:\n %23 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge45.reg2mem\n br label LBL_11\n LBL_10:\n %24 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n store i64 %24, i64* %storemerge.reg2mem\n br label LBL_15\n LBL_11:\n %storemerge45.reload = load i64, i64* %storemerge45.reg2mem\n %25 = add i64 %storemerge45.reload, %23\n %26 = inttoptr i64 %25 to i8*\n %27 = load i8, i8* %26, align 1\n %28 = icmp eq i8 %27, 83\n %29 = icmp eq i1 %28, false\n br i1 %29, label LBL_13, label LBL_12\n LBL_12:\n %30 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_4 to i64))\n br label LBL_14\n LBL_13:\n %31 = add nuw i64 %storemerge45.reload, 1\n %32 = call i32 @strlen(i8* %3)\n %33 = sext i32 %32 to i64\n %34 = icmp ult i64 %31, %33\n store i64 %31, i64* %storemerge45.reg2mem\n br i1 %34, label LBL_11, label LBL_14\n LBL_14:\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_15\n LBL_15:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i8* %3, { 1, 0, 3, 2 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge45.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_14, { 0, 2, 1 }\n uselistorder label LBL_11, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_6, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_11, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %26 = icmp slt i32 %sv_0.1.reload, 0\n br i1 %26, label LBL_10, label LBL_8\n LBL_8:\n %27 = sext i32 %sv_0.1.reload to i64\n %28 = mul i64 %27, 4\n %29 = add i64 %0, -64\n %30 = add i64 %28, %29\n %31 = inttoptr i64 %30 to i32*\n store i32 1, i32* %31, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_9\n LBL_9:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %32 = mul i64 %indvars.iv.reload, 4\n %33 = add i64 %32, %29\n %34 = inttoptr i64 %33 to i32*\n %35 = load i32, i32* %34, align 4\n %36 = zext i32 %35 to i64\n %37 = call i64 @FUNC(i64 %36)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_11, label LBL_9\n LBL_10:\n %38 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_11:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %1, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_11, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_rand_sub_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge2.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = mul i32 %1, 1073741824\n %7 = mul i32 %2, 32768\n %8 = xor i32 %7, %6\n %9 = xor i32 %8, %3\n %10 = sext i1 %5 to i32\n %storemerge4.in.le = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge4.in.le, 0\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = add i32 %storemerge4.in.le, -1\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %15, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n ret i64 %storemerge2.reload\n\n uselistorder i32 %storemerge4.in.le, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_environment_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_3\n LBL_3:\n %13 = load i32, i32* @gv_2, align 4\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_11\n LBL_5:\n %16 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n %17 = icmp eq i32 %16, 1\n %18 = icmp eq i1 %17, false\n br i1 %18, label LBL_11, label LBL_6\n LBL_6:\n %19 = load i64, i64* %sv_1, align 8\n %20 = trunc i64 %19 to i32\n %21 = icmp sgt i32 %20, ptrtoint (i1* @gv_5 to i32)\n br i1 %21, label LBL_11, label LBL_7\n LBL_7:\n %22 = and i64 %19, 4294967295\n %23 = icmp eq i64 %22, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %23, label LBL_10, label LBL_8\n LBL_8:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %24 = add i32 %storemerge4.reload, 1\n %25 = sext i32 %24 to i64\n %26 = icmp sgt i64 %22, %25\n store i32 %24, i32* %storemerge4.reg2mem\n br i1 %26, label LBL_8, label LBL_9\n LBL_9:\n %phitmp = zext i32 %24 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %27 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_11\n LBL_11:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %24, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_multiply_32-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_multiply_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp slt i32 %3, 1\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = mul i32 %3, 2\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_partial_init_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %indvars.iv9.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %indvars.iv9.reg2mem\n store i32 %2, i32* %.reg2mem\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %5 = mul i64 %indvars.iv9.reload, 4\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = trunc i64 %indvars.iv9.reload to i32\n store i32 %8, i32* %7, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_2, label LBL_1\n LBL_2:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_3\n LBL_3:\n %.reload = load i32, i32* %.reg2mem\n %9 = icmp eq i32 %.reload, 5\n %10 = icmp eq i1 %9, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %10, label LBL_6, label LBL_4\n LBL_4:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %11 = mul i64 %indvars.iv6.reload, 4\n %12 = add i64 %11, %1\n %13 = inttoptr i64 %12 to i32*\n %14 = trunc i64 %indvars.iv6.reload to i32\n store i32 %14, i32* %13, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_5, label LBL_4\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %15 = mul i64 %indvars.iv.reload, 4\n %16 = add i64 %15, %1\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_listenSocket_07-bad", "fun_name": "CWE369_Divide_by_Zero__float_listenSocket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %3 = call i64 @FUNC(i64 40)\n %4 = call i128 @FUNC(i128 %2, i128 %2)\n %5 = call i64 @FUNC(i128 %4)\n %6 = trunc i64 %5 to i32\n %7 = load i32, i32* @gv_0, align 4\n %8 = icmp eq i32 %7, 5\n %9 = icmp eq i1 %8, false\n store i32 %6, i32* %sv_0.1.reg2mem\n br i1 %9, label LBL_9, label LBL_1\n LBL_1:\n %10 = call i32 @socket(i32 2, i32 1, i32 6)\n %11 = icmp eq i32 %10, -1\n store i32 %6, i32* %sv_0.1.reg2mem\n br i1 %11, label LBL_9, label LBL_2\n LBL_2:\n %12 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %13 = call i16 @htons(i16 27015)\n %14 = bitcast i64* %sv_2 to %sockaddr*\n %15 = call i32 @bind(i32 %10, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_7, label LBL_3\n LBL_3:\n %17 = call i32 @listen(i32 %10, i32 5)\n %18 = icmp eq i32 %17, -1\n br i1 %18, label LBL_7, label LBL_4\n LBL_4:\n %19 = call i32 @accept(i32 %10, %sockaddr* null, i32* null)\n %20 = icmp eq i32 %19, -1\n br i1 %20, label LBL_7, label LBL_5\n LBL_5:\n %21 = call i32 @recv(i32 %19, i64* nonnull %sv_1, i32 19, i32 0)\n %22 = add i32 %21, 1\n %23 = icmp ult i32 %22, 2\n store i32 %6, i32* %sv_0.0.ph.reg2mem\n br i1 %23, label LBL_8, label LBL_6\n LBL_6:\n %24 = ptrtoint i64* %sv_3 to i64\n %25 = sext i32 %21 to i64\n %26 = add i64 %24, -32\n %27 = add i64 %26, %25\n %28 = inttoptr i64 %27 to i8*\n store i8 0, i8* %28, align 1\n %29 = bitcast i64* %sv_1 to i8*\n %30 = call double @atof(i8* nonnull %29)\n %31 = fptrunc double %30 to float\n %32 = bitcast float %31 to i32\n %33 = sext i32 %32 to i128\n %34 = call i128 @FUNC(i128 %33)\n %35 = call i64 @FUNC(i128 %34)\n %36 = trunc i64 %35 to i32\n store i32 %36, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %37 = call i32 @close(i32 %10)\n store i32 %6, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %38 = call i32 @close(i32 %10)\n %39 = call i32 @close(i32 %19)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %40 = load i32, i32* @gv_0, align 4\n %41 = icmp eq i32 %40, 5\n %42 = icmp eq i1 %41, false\n br i1 %42, label LBL_11, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %43 = call i128 @FUNC(i128 %1, i128 %1)\n %44 = call i128 @FUNC(i32 %sv_0.1.reload)\n %45 = call i128 @FUNC(i64 4636737291354636288)\n %46 = call i128 @FUNC(i128 %45, i128 %44)\n %47 = call i32 @FUNC(i128 %46)\n %48 = zext i32 %47 to i64\n %49 = call i64 @FUNC(i64 %48)\n br label LBL_11\n LBL_11:\n %50 = call i64 @FUNC(i64 40)\n %51 = icmp eq i64 %3, %50\n store i64 0, i64* %rax.0.reg2mem\n br i1 %51, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %21, { 1, 0 }\n uselistorder i32 %10, { 4, 0, 1, 2, 3, 5 }\n uselistorder i32 %6, { 1, 3, 0, 2 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_fwrite_13-bad", "fun_name": "CWE400_Resource_Exhaustion__connect_socket_fwrite_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8424 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %24 = icmp eq %_IO_FILE* %23, null\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_7, label LBL_8\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = sext i32 %sv_0.1.reload to i64\n %27 = icmp eq i32 %sv_0.1.reload, 0\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %27, label LBL_12, label LBL_9\n LBL_8:\n call void @exit(i32 1)\n unreachable\n LBL_9:\n %28 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_3 to i64*), i32 1, i32 50, %_IO_FILE* %23)\n %29 = icmp eq i32 %28, 50\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n call void @exit(i32 1)\n unreachable\n LBL_11:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %30 = add nuw i64 %storemerge4.reload, 1\n %31 = icmp ult i64 %30, %26\n store i64 %30, i64* %storemerge4.reg2mem\n br i1 %31, label LBL_9, label LBL_12\n LBL_12:\n %32 = call i32 @fclose(%_IO_FILE* nonnull %23)\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 0 }\n uselistorder %_IO_FILE* %23, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_6, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__deref_after_check_12-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__deref_after_check_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @llvm.trap()\n unreachable\n LBL_2:\n %3 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n ret i64 %3\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_postinc_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.04713.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.04713.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %3, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = add i64 %15, -22\n %17 = bitcast i64* %sv_1 to i8*\n %18 = sext i32 %12 to i64\n %19 = add i64 %16, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i32 @atoi(i8* nonnull %17)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.04713.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp eq i32 %sv_0.0.ph.reload, 2147483647\n store i32 %sv_0.0.ph.reload, i32* %sv_0.04713.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.04713.reload = load i32, i32* %sv_0.04713.reg2mem\n %26 = add i32 %sv_0.04713.reload, 1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.04713.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE506_Embedded_Malicious_Code__file_transfer_listen_socket_05-bad", "fun_name": "CWE506_Embedded_Malicious_Code__file_transfer_listen_socket_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %rsp.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 %0, i64* %rsp.0.reg2mem\n br label LBL_1\n LBL_1:\n %rsp.0.reload = load i64, i64* %rsp.0.reg2mem\n %2 = add i64 %rsp.0.reload, -4096\n %3 = icmp eq i64 %2, %1\n %4 = icmp eq i1 %3, false\n store i64 %2, i64* %rsp.0.reg2mem\n br i1 %4, label LBL_1, label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = load i32, i32* @gv_0, align 4\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_13, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = bitcast i64* %sv_1 to i8*\n %11 = call i8* @fgets(i8* nonnull %10, i32 65535, %_IO_FILE* nonnull %8)\n %12 = icmp eq i8* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i64 0, i64* %sv_1, align 8\n br label LBL_6\n LBL_6:\n %15 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %16 = call i32 @socket(i32 2, i32 1, i32 6)\n %17 = icmp eq i32 %16, -1\n br i1 %17, label LBL_13, label LBL_8\n LBL_8:\n %18 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %19 = call i16 @htons(i16 27015)\n %20 = bitcast i64* %sv_0 to %sockaddr*\n %21 = call i32 @bind(i32 %16, %sockaddr* nonnull %20, i32 16)\n %22 = icmp eq i32 %21, -1\n br i1 %22, label LBL_11, label LBL_9\n LBL_9:\n %23 = call i32 @listen(i32 %16, i32 5)\n %24 = icmp eq i32 %23, -1\n br i1 %24, label LBL_11, label LBL_10\n LBL_10:\n %25 = call i32 @accept(i32 %16, %sockaddr* null, i32* null)\n %26 = icmp eq i32 %25, -1\n br i1 %26, label LBL_11, label LBL_12\n LBL_11:\n %27 = call i32 @close(i32 %16)\n br label LBL_13\n LBL_12:\n %28 = bitcast i64* %sv_1 to i8*\n %29 = call i32 @strlen(i8* nonnull %28)\n %30 = call i32 @send(i32 %25, i64* nonnull %sv_1, i32 %29, i32 0)\n %31 = call i32 @strlen(i8* nonnull %28)\n %32 = call i32 @close(i32 %16)\n %33 = call i32 @close(i32 %25)\n br label LBL_13\n LBL_13:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %5, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %rsp.0.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_13, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_calloc_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 4)\n %1 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = bitcast i64* %0 to i32*\n store i32 5, i32* %2, align 4\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 5, { 2, 3, 0, 1 }\n uselistorder i64 5, { 2, 0, 3, 1 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_multiply_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp slt i32 %6, 1\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = icmp sgt i32 %6, 1073741822\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = mul i32 %6, 2\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_6\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder label LBL_6, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_square_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n %10 = load i64, i64* %sv_0, align 8\n %11 = trunc i64 %10 to i32\n %.off = add i32 %11, 46339\n %12 = icmp ugt i32 %.off, 92678\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %sext = mul i64 %10, 4294967296\n %13 = ashr exact i64 %sext, 32\n %14 = mul nsw i64 %13, %13\n %15 = and i64 %14, 4294967295\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_7\n LBL_6:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_cpy_17-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_cpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %3, -8\n %9 = inttoptr i64 %8 to i8*\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strcpy(i8* nonnull %11, i8* nonnull %9)\n %13 = call i64 @FUNC(i64* nonnull %sv_0)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_multiply_07-bad", "fun_name": "CWE190_Integer_Overflow__short_rand_multiply_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = call i32 @rand()\n %11 = xor i32 %10, %9\n %12 = sext i1 %6 to i32\n %storemerge.in = xor i32 %11, %12\n %.pre = load i32, i32* @gv_0, align 4\n %13 = zext i32 %.pre to i64\n %14 = icmp eq i32 %.pre, 5\n %15 = icmp eq i1 %14, false\n %16 = trunc i32 %storemerge.in to i16\n %17 = icmp slt i16 %16, 1\n %or.cond = or i1 %15, %17\n store i64 %13, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %sext2 = mul i32 %storemerge.in, 131072\n %18 = ashr exact i32 %sext2, 16\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_loop_08-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_loop_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_8, label LBL_6\n LBL_6:\n %14 = sext i32 %12 to i64\n %15 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = add i64 %storemerge2.reload, %.pre-phi.reload\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = add i64 %storemerge2.reload, %15\n %20 = inttoptr i64 %19 to i8*\n store i8 %18, i8* %20, align 1\n %21 = add nuw i64 %storemerge2.reload, 1\n %22 = icmp ult i64 %21, %14\n store i64 %21, i64* %storemerge2.reg2mem\n br i1 %22, label LBL_7, label LBL_8\n LBL_8:\n %23 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i64* %1, { 1, 5, 2, 3, 0, 4 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_pointer_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 4)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n ret i64 %4\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = call i32 @close(i32 %0)\n %2 = sext i32 %1 to i64\n ret i64 %2\n\n uselistorder i32 (i32)* @close, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i8*, i32, ...)* @open, { 2, 0, 1, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_connect_socket_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n br label LBL_8\n LBL_2:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_17, label LBL_3\n LBL_3:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_17, label LBL_5\n LBL_4:\n %12 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n br label LBL_8\n LBL_5:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n %21 = icmp ugt i32 %19, 9\n br i1 %21, label LBL_8, label LBL_6\n LBL_6:\n %22 = sext i32 %19 to i64\n %23 = mul i64 %22, 4\n %24 = add i64 %13, -64\n %25 = add i64 %23, %24\n %26 = inttoptr i64 %25 to i32*\n store i32 1, i32* %26, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %27 = mul i64 %indvars.iv.reload, 4\n %28 = add i64 %27, %24\n %29 = inttoptr i64 %28 to i32*\n %30 = load i32, i32* %29, align 4\n %31 = zext i32 %30 to i64\n %32 = call i64 @FUNC(i64 %31)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %33 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i64 %13, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 4, 0, 2, 5, 3, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_rand_to_short_08-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_rand_to_short_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %phitmp = mul i32 %storemerge.in, 65536\n %phitmp1 = ashr exact i32 %phitmp, 16\n %phitmp2 = zext i32 %phitmp1 to i64\n store i64 %phitmp2, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = call i64 @FUNC(i64 %sv_0.0.reload)\n ret i64 %12\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_memmove_13-bad", "fun_name": "CWE124_Buffer_Underwrite__char_alloca_memmove_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %9 = icmp eq i32 %8, 5\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = add i64 %3, -8\n store i64 %11, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %13 = load i64, i64* %sv_1, align 8\n %14 = inttoptr i64 %13 to i64*\n %15 = call i64* @memmove(i64* %14, i64* nonnull %sv_0, i32 100)\n %16 = load i64, i64* %sv_1, align 8\n %17 = add i64 %16, 99\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = load i64, i64* %sv_1, align 8\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_system_02-bad", "fun_name": "CWE78_OS_Command_Injection__char_file_system_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = sub i32 100, %2\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %3, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %8, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n %17 = call i32 @system(i8* nonnull %1)\n %18 = icmp eq i32 %17, 0\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n %19 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_3 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_7:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int64_t_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %sv_0 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 5, i64* %sv_0, align 8\n %3 = call i64 @FUNC()\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = trunc i64 %3 to i32\n %8 = icmp eq i32 %7, 0\n %9 = ptrtoint i64* %sv_0 to i64\n %spec.select = select i1 %8, i64 %1, i64 %9\n %10 = inttoptr i64 %spec.select to i64*\n %11 = load i64, i64* %10, align 8\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_2\n LBL_2:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %2, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_rand_14-bad", "fun_name": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_rand_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge1.in = xor i32 %12, %13\n store i32 %storemerge1.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %14 = mul i32 %sv_0.0.reload, 4\n %15 = call i64* @malloc(i32 %14)\n %16 = icmp eq i64* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_3, label LBL_4\n LBL_3:\n %18 = ptrtoint i64* %15 to i64\n %19 = sext i32 %sv_0.0.reload to i64\n %20 = icmp eq i32 %sv_0.0.reload, 0\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %21 = mul i64 %storemerge2.reload, 4\n %22 = add i64 %21, %18\n %23 = inttoptr i64 %22 to i32*\n store i32 0, i32* %23, align 4\n %24 = add nuw i64 %storemerge2.reload, 1\n %25 = icmp ult i64 %24, %19\n store i64 %24, i64* %storemerge2.reg2mem\n br i1 %25, label LBL_5, label LBL_6\n LBL_6:\n %26 = bitcast i64* %15 to i32*\n %27 = load i32, i32* %26, align 4\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n call void @free(i64* %15)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %15, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_calloc_14-bad", "fun_name": "CWE690_NULL_Deref_From_Return__int_calloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 4)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = bitcast i64* %0 to i32*\n store i32 5, i32* %5, align 4\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_multiply_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = zext i32 %4 to i64\n %6 = mul i64 %5, 1152921504606846976\n %7 = call i32 @rand()\n %8 = zext i32 %7 to i64\n %9 = mul i64 %8, 35184372088832\n %10 = call i32 @rand()\n %11 = sext i32 %10 to i64\n %12 = mul i64 %11, 1073741824\n %13 = call i32 @rand()\n %14 = sext i32 %13 to i64\n %15 = mul i64 %14, 32768\n %16 = call i32 @rand()\n %17 = sext i32 %16 to i64\n %18 = sext i1 %3 to i64\n %19 = xor i64 %6, %18\n %20 = xor i64 %19, %9\n %21 = xor i64 %20, %12\n %22 = xor i64 %21, %15\n %storemerge2 = xor i64 %22, %17\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n %26 = icmp slt i64 %storemerge2, 0\n %27 = icmp eq i1 %26, false\n br i1 %25, label LBL_5, label LBL_1\n LBL_1:\n store i64 %23, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_2\n LBL_2:\n %28 = icmp slt i64 %storemerge2, -4611686018427387903\n br i1 %28, label LBL_4, label LBL_3\n LBL_3:\n %29 = mul i64 %storemerge2, 2\n %30 = call i64 @FUNC(i64 %29)\n store i64 %30, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_4:\n %31 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %31, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_5:\n store i64 %23, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_6\n LBL_6:\n %32 = icmp slt i64 %storemerge2, -4611686018427387903\n br i1 %32, label LBL_8, label LBL_7\n LBL_7:\n %33 = mul i64 %storemerge2, 2\n %34 = call i64 @FUNC(i64 %33)\n store i64 %34, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_8:\n %35 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %35, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %27, { 1, 0 }\n uselistorder i64 %23, { 1, 0, 2 }\n uselistorder i64 %storemerge2, { 0, 3, 1, 2, 4 }\n uselistorder i64* %rax.0.reg2mem, { 0, 5, 4, 6, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_multiply_06-bad", "fun_name": "CWE190_Integer_Overflow__char_rand_multiply_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = sext i1 %2 to i32\n %storemerge = xor i32 %5, %6\n %7 = trunc i32 %storemerge to i8\n %8 = icmp slt i8 %7, 1\n store i64 5, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %sext2 = mul i32 %storemerge, 33554432\n %9 = ashr exact i32 %sext2, 24\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_console_34-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_console_34_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i8*, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_2, align 8\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_2 to i8*\n store i8* %8, i8** %sv_0, align 8\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = sext i32 %9 to i64\n %11 = sub nsw i64 250, %10\n %12 = icmp ult i64 %11, 2\n br i1 %12, label LBL_6, label LBL_1\n LBL_1:\n %13 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %14 = sub i32 250, %9\n %15 = ptrtoint i64* %sv_2 to i64\n %16 = add i64 %10, %15\n %17 = inttoptr i64 %16 to i8*\n %18 = call i8* @fgets(i8* %17, i32 %14, %_IO_FILE* %13)\n %19 = icmp eq i8* %18, null\n br i1 %19, label LBL_5, label LBL_2\n LBL_2:\n %20 = call i32 @strlen(i8* nonnull %8)\n %21 = icmp eq i32 %20, 0\n br i1 %21, label LBL_6, label LBL_3\n LBL_3:\n %22 = sext i32 %20 to i64\n %23 = add i64 %15, -1\n %24 = add i64 %23, %22\n %25 = inttoptr i64 %24 to i8*\n %26 = load i8, i8* %25, align 1\n %27 = icmp eq i8 %26, 10\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %25, align 1\n br label LBL_6\n LBL_5:\n %29 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %17, align 1\n br label LBL_6\n LBL_6:\n %30 = load i8*, i8** %sv_0, align 8\n %31 = call i32 @putenv(i8* %30)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %2, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8 0, { 1, 2, 3, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %5, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_1 to %sockaddr*\n %10 = call i32 @connect(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_8, label LBL_3\n LBL_3:\n %12 = sext i32 %4 to i64\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = add i64 %12, %13\n %15 = inttoptr i64 %14 to i64*\n %16 = sub i32 99, %4\n %17 = call i32 @recv(i32 %5, i64* %15, i32 %16, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n br i1 %19, label LBL_8, label LBL_4\n LBL_4:\n %20 = sext i32 %17 to i64\n %21 = add i64 %14, %20\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = call i8* @strchr(i8* nonnull %3, i32 13)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %23, align 1\n br label LBL_6\n LBL_6:\n %25 = call i8* @strchr(i8* nonnull %3, i32 10)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %25, align 1\n br label LBL_8\n LBL_8:\n %27 = call i32 @close(i32 %5)\n br label LBL_9\n LBL_9:\n %.pr = load i32, i32* @gv_0, align 4\n %28 = icmp eq i32 %.pr, 0\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n store i64 0, i64* %sv_0, align 8\n %29 = bitcast i64* %sv_0 to i8*\n %30 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %29, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_2)\n %31 = ptrtoint i64* %sv_0 to i64\n %32 = call i64 @FUNC(i64 %31)\n br label LBL_11\n LBL_11:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %5, { 3, 1, 2, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 1 }\n uselistorder label LBL_11, { 1, 2, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_loop_03-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_loop_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = add i64 %storemerge1.reload, %8\n %12 = add i64 %storemerge1.reload, %10\n %13 = inttoptr i64 %12 to i8*\n %14 = load i8, i8* %13, align 1\n %15 = inttoptr i64 %11 to i8*\n store i8 %14, i8* %15, align 1\n %16 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %17 = add i64 %4, 91\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = call i64 @FUNC(i64 %8)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_sub_11-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %5 = trunc i64 %0 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_3, label LBL_4\n LBL_3:\n %7 = call i64 @FUNC(i64 4294967295)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %8 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_1 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_preinc_14-bad", "fun_name": "CWE190_Integer_Overflow__int_fgets_preinc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 1, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n %phitmp = add i32 %8, 1\n %phitmp2 = zext i32 %phitmp to i64\n store i64 %phitmp2, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 1, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_2, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n br label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_file_17-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_file_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge47.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = sub i32 100, %2\n %10 = add i64 %3, %8\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %9, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n %17 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %18 = icmp eq i32 %17, 1\n %19 = icmp eq i1 %18, false\n br i1 %19, label LBL_10, label LBL_6\n LBL_6:\n %20 = load i64, i64* %sv_1, align 8\n %21 = and i64 %20, 4294967295\n %22 = icmp eq i64 %21, 0\n store i32 0, i32* %storemerge47.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %22, label LBL_9, label LBL_7\n LBL_7:\n %storemerge47.reload = load i32, i32* %storemerge47.reg2mem\n %23 = add i32 %storemerge47.reload, 1\n %24 = sext i32 %23 to i64\n %25 = icmp sgt i64 %21, %24\n store i32 %23, i32* %storemerge47.reg2mem\n br i1 %25, label LBL_7, label LBL_8\n LBL_8:\n %phitmp = zext i32 %23 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %26 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_10\n LBL_10:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %23, { 1, 0, 2 }\n uselistorder i32* %storemerge47.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 11)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = call i8* @strncpy(i8* %4, i8* nonnull %5, i32 %7)\n %9 = ptrtoint i64* %1 to i64\n %10 = call i64 @FUNC(i64 %9)\n call void @free(i64* %1)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_4:\n %10 = load i32, i32* %sv_0, align 4\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_8, label LBL_5\n LBL_5:\n %12 = icmp ult i32 %10, 2147483647\n br i1 %12, label LBL_6, label LBL_7\n LBL_6:\n %13 = mul i32 %10, 2\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_8\n LBL_7:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_08-bad", "fun_name": "CWE369_Divide_by_Zero__int_listen_socket_modulo_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = urem i32 100, %sv_0.1.reload\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -401\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i32*\n store i32* %4, i32** %sv_0, align 8\n store i32 5, i32* %4, align 16\n %5 = load i32*, i32** %sv_0, align 8\n %6 = load i32, i32* %5, align 4\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_0, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_snprintf_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n br label LBL_2\n LBL_2:\n %10 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = call i32 @strlen(i8* %10)\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %12, i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* %10)\n %14 = call i64 @FUNC(i64 %3)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %10, { 1, 0 }\n uselistorder i64 %3, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 11)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = bitcast i64* %1 to i8*\n %9 = call i8* @strncpy(i8* %8, i8* nonnull %5, i32 %7)\n %10 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_ncpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 5\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = bitcast i8** %sv_2 to i64*\n store i64 %13, i64* %14, align 8\n br label LBL_2\n LBL_2:\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = load i8*, i8** %sv_2, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i8* @strncpy(i8* %16, i8* nonnull %17, i32 99)\n %19 = load i8*, i8** %sv_2, align 8\n %20 = ptrtoint i8* %19 to i64\n %21 = add i64 %20, 99\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = load i8*, i8** %sv_2, align 8\n %24 = ptrtoint i8* %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %1, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 4, 3, 2, 0, 1 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_postdec_11-bad", "fun_name": "CWE191_Integer_Underflow__unsigned_int_fscanf_postdec_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = add i32 %9, -1\n store i32 %10, i32* %sv_0, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_divide_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 13, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %27 = load i32, i32* @gv_1, align 4\n %28 = icmp eq i32 %27, 0\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n %29 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_14\n LBL_11:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %30 = icmp eq i32 %sv_0.1.reload, 0\n br i1 %30, label LBL_13, label LBL_12\n LBL_12:\n %31 = udiv i32 100, %sv_0.1.reload\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_14\n LBL_13:\n %34 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n br label LBL_14\n LBL_14:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_sub_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_4:\n %9 = load i64, i64* %sv_0, align 8\n %10 = icmp eq i64 %9, -9223372036854775808\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = add i64 %9, -1\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_7\n LBL_6:\n %13 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_7:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 11)\n %5 = bitcast i64* %4 to i8*\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i8* %5, i8** %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %8)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %12)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_14-bad", "fun_name": "CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n store i32 1, i32* %sv_0, align 4\n %4 = ptrtoint i32* %sv_0 to i64\n %5 = or i64 %4, 2\n %6 = inttoptr i64 %5 to i8*\n %7 = load i8, i8* %6, align 2\n %8 = sext i8 %7 to i64\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_2\n LBL_2:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_2 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 8\n %10 = add i64 %9, %8\n %11 = add i64 %10, -816\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 8\n %13 = add i64 %10, -812\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %16 = inttoptr i64 %sv_0.0.reload to i64*\n %17 = call i64* @memcpy(i64* %16, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_2 to i32))\n %18 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %16)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_char_05-bad", "fun_name": "CWE415_Double_Free__malloc_free_char_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 100)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %2)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_5, label LBL_4\n LBL_4:\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__zero_15-bad", "fun_name": "CWE617_Reachable_Assertion__zero_15_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n call void @__assert_fail(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([126 x i8], [126 x i8]* @gv_1, i64 0, i64 0), i32 28, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @gv_2, i64 0, i64 0))\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memmove_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = ptrtoint i64* %4 to i64\n %8 = bitcast i64* %4 to i8*\n store i8 0, i8* %8, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %10 = inttoptr i64 %sv_0.0.reload to i64*\n %11 = call i64* @memmove(i64* %10, i64* nonnull %sv_1, i32 100)\n %12 = add i64 %sv_0.0.reload, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %10)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_pointer_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = call i128 @FUNC(i64 4617315517961601024)\n %4 = call i64 @__asm_movsd.1(i128 %3)\n store i64 %4, i64* %0, align 8\n %5 = call i128 @FUNC(i64 %4)\n %6 = call i64 @FUNC()\n ret i64 %6\n\n uselistorder i64 ()* @printDoubleLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_loop_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %5 = ptrtoint i64* %sv_2 to i64\n %6 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %6, align 8\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %7 = bitcast i64* %sv_1 to i8*\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = sext i32 %8 to i64\n %10 = add nsw i64 %9, 1\n %11 = icmp eq i64 %10, 0\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %sv_0.0.reload\n %14 = add i64 %storemerge1.reload, %12\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = inttoptr i64 %13 to i8*\n store i8 %16, i8* %17, align 1\n %18 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, %10\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %19 = call i64 @FUNC(i64 %sv_0.0.reload)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_min_predec_11-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %5 = trunc i64 %0 to i32\n %6 = icmp eq i32 %5, 0\n %spec.select = select i1 %6, i32 0, i32 -32768\n %7 = trunc i32 %spec.select to i16\n %8 = icmp eq i16 %7, -32768\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = mul i32 %spec.select, 65536\n %sext = add i32 %9, -65536\n %10 = ashr exact i32 %sext, 16\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %13 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__negative_strncpy_01-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__negative_strncpy_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %3 = bitcast i64* %sv_1 to i8*\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strncpy(i8* nonnull %3, i8* nonnull %4, i32 -1)\n %6 = add i64 %0, -113\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC(i64* nonnull %sv_1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 20)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = bitcast i64* %4 to i32*\n store i32 1819043176, i32* %8, align 4\n %9 = add i64 %5, 4\n %10 = inttoptr i64 %9 to i16*\n store i16 111, i16* %10, align 2\n %11 = call i64 @FUNC(i64 %5)\n call void @free(i64* %4)\n br label LBL_7\n LBL_4:\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %12 = bitcast i64* %4 to i32*\n store i32 1819043176, i32* %12, align 4\n %13 = add i64 %5, 4\n %14 = inttoptr i64 %13 to i16*\n store i16 111, i16* %14, align 2\n %15 = call i64 @FUNC(i64 %5)\n call void @free(i64* %4)\n br label LBL_7\n LBL_7:\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %7, { 1, 0 }\n uselistorder i64 %5, { 2, 3, 1, 0 }\n uselistorder i64* %4, { 2, 3, 1, 0, 4, 5 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 0, 1, 5, 6, 2, 4, 3 }\n uselistorder i64* (i32)* @malloc, { 2, 1, 0, 3 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_multiply_11-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_min_multiply_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp ne i32 %1, 0\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n %6 = icmp eq i1 %2, false\n %or.cond = or i1 %5, %6\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i64 @FUNC(i64 0)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_postdec_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = add i32 %9, -1\n store i32 %11, i32* %sv_0, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_printf_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 @puts(i8* nonnull %1)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 0 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 3, 2, 0, 1, 4 }\n uselistorder label LBL_6, { 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_12-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_3\n LBL_2:\n store i32 2, i32* %sv_0, align 4\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = load i32, i32* %sv_0, align 4\n %10 = icmp eq i32 %9, 0\n br i1 %8, label LBL_6, label LBL_4\n LBL_4:\n br i1 %10, label LBL_10, label LBL_5\n LBL_5:\n %11 = mul i32 %9, 2\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_10\n LBL_6:\n br i1 %10, label LBL_10, label LBL_7\n LBL_7:\n %14 = icmp ult i32 %9, 2147483647\n br i1 %14, label LBL_8, label LBL_9\n LBL_8:\n %15 = mul i32 %9, 2\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_10\n LBL_9:\n %18 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %10, { 1, 0 }\n uselistorder i32 %9, { 0, 2, 1, 3 }\n uselistorder i32* %sv_0, { 1, 2, 0, 3 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_printf_07-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_connect_socket_printf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = load i32, i32* @gv_0, align 4\n %30 = icmp eq i32 %29, 5\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n %32 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n br label LBL_11\n LBL_11:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_struct_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n store i64 0, i64* %sv_0, align 8\n %5 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n store i64 1, i64* %sv_0, align 8\n %9 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_5\n LBL_5:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 0, 2, 1, 3 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_memmove_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %8, 5\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n %10 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n store i64 %3, i64* %sv_1, align 8\n br label LBL_3\n LBL_3:\n %11 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %12 = load i64, i64* %sv_1, align 8\n %13 = inttoptr i64 %12 to i64*\n %14 = call i64* @memmove(i64* %13, i64* nonnull %sv_0, i32 100)\n %15 = load i64, i64* %sv_1, align 8\n %16 = add i64 %15, 99\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = load i64, i64* %sv_1, align 8\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %1, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_square_14-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_square_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = mul i32 %9, %9\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_short_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = select i1 %2, i64 4294967295, i64 122\n %4 = call i64 @FUNC(i64 %3)\n ret i64 %4\n\n uselistorder i64 (i64)* @printShortLine, { 1, 0 }\n uselistorder i64 122, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_31-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = icmp ult i64 %3, 6\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = trunc i64 %3 to i32\n %6 = call i64* @malloc(i32 %5)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %9 = ptrtoint i64* %6 to i64\n %10 = bitcast i64* %6 to i32*\n store i32 1819043176, i32* %10, align 4\n %11 = add i64 %9, 4\n %12 = inttoptr i64 %11 to i16*\n store i16 111, i16* %12, align 2\n %13 = call i64 @FUNC(i64 %9)\n call void @free(i64* %6)\n br label LBL_5\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %6, { 0, 1, 3, 2 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE511_Logic_Time_Bomb__counter_05-bad", "fun_name": "CWE511_Logic_Time_Bomb__counter_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i32 0, i32* %storemerge.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %storemerge.reload = load i32, i32* %storemerge.reg2mem\n %2 = icmp eq i32 %storemerge.reload, 20000\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_2\n LBL_2:\n %4 = call i32 @unlink(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_1, i64 0, i64 0))\n br label LBL_3\n LBL_3:\n %5 = add i32 %storemerge.reload, 1\n store i32 %5, i32* %storemerge.reg2mem\n br label LBL_1\n LBL_4:\n ret i64 0\n\n uselistorder i32 %storemerge.reload, { 1, 0 }\n uselistorder i32* %storemerge.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_fscanf_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp ugt i32 %3, 9\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = sext i32 %3 to i64\n %7 = mul i64 %6, 4\n %8 = add i64 %5, -48\n %9 = add i64 %8, %7\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_3\n LBL_2:\n %14 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_rand_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n %14 = sext i1 %6 to i32\n %storemerge.in = xor i32 %13, %14\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %15 = load i32, i32* @gv_0, align 4\n %16 = icmp eq i32 %15, 5\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %18 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n %19 = ptrtoint i64* %sv_1 to i64\n %20 = sext i32 %sv_0.0.reload to i64\n %21 = mul i64 %20, 4\n %22 = add i64 %19, -64\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i32*\n %25 = load i32, i32* %24, align 4\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n br label LBL_7\n LBL_6:\n %28 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_7:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 400)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 2, 3, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 1, 0, 2, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memmove_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64* %4, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = bitcast i64* %sv_1 to i8*\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = call i64* @memmove(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 %13)\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %sv_0.0.reload)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 3, 0, 1, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 0, 2, 1, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__struct_realloc_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i64* %0, null\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %0 to i64\n %6 = bitcast i64* %0 to i32*\n store i32 1, i32* %6, align 4\n %7 = add i64 %5, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n %9 = call i64 @FUNC(i64 %5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_postdec_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = load i32, i32* @gv_0, align 4\n %15 = icmp eq i32 %14, 5\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n %16 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %17 = icmp eq i32 %sv_0.0.reload, -2147483648\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n %18 = add i32 %sv_0.0.reload, -1\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %21 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_static_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %3 to i64\n %8 = call i64* @memset(i64* %3, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n %12 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %12)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = icmp slt i8 %3, 0\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %6 = icmp slt i8 %3, -63\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = mul i8 %3, 2\n %8 = sext i8 %7 to i64\n %9 = and i64 %8, 4294967294\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_4\n LBL_3:\n %11 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n uselistorder i8 0, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_postinc_07-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_postinc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = load i16, i16* %sv_0, align 2\n %9 = add i16 %8, 1\n store i16 %9, i16* %sv_0, align 2\n %10 = sext i16 %9 to i64\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memcpy_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memcpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -401\n %5 = and i64 %4, -16\n %6 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n %spec.select = select i1 %8, i64 %1, i64 %5\n %9 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = inttoptr i64 %spec.select to i64*\n %11 = call i64* @memcpy(i64* %10, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %12 = load i64, i64* %10, align 8\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %3, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_postinc_03-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 2147483647\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i64 %3, 4294967296\n %sext = add i64 %6, 4294967296\n %7 = ashr exact i64 %sext, 32\n store i64 %7, i64* %sv_0, align 8\n %8 = and i64 %7, 4294967295\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE685_Function_Call_With_Incorrect_Number_of_Arguments__basic_05-bad", "fun_name": "CWE685_Function_Call_With_Incorrect_Number_of_Arguments__basic_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @gv_1, i64 0, i64 0))\n %5 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_add_13-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_add_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 1, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i64, i64* %sv_0, align 8\n %phitmp = add i64 %.pre, 1\n %phitmp1 = and i64 %phitmp, 4294967295\n store i64 %phitmp1, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %6 = call i64 @FUNC(i64 %.reload)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_listenSocket_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.058.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = call i128 @__asm_movss.1(i32 %5)\n %7 = call i64 @FUNC(i128 %6)\n %8 = trunc i64 %7 to i32\n %9 = call i32 @socket(i32 2, i32 1, i32 6)\n %10 = icmp eq i32 %9, -1\n store i32 %8, i32* %sv_0.058.reg2mem\n br i1 %10, label LBL_8, label LBL_1\n LBL_1:\n %11 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %12 = call i16 @htons(i16 27015)\n %13 = bitcast i64* %sv_2 to %sockaddr*\n %14 = call i32 @bind(i32 %9, %sockaddr* nonnull %13, i32 16)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_6, label LBL_2\n LBL_2:\n %16 = call i32 @listen(i32 %9, i32 5)\n %17 = icmp eq i32 %16, -1\n br i1 %17, label LBL_6, label LBL_3\n LBL_3:\n %18 = call i32 @accept(i32 %9, %sockaddr* null, i32* null)\n %19 = icmp eq i32 %18, -1\n br i1 %19, label LBL_6, label LBL_4\n LBL_4:\n %20 = call i32 @recv(i32 %18, i64* nonnull %sv_1, i32 19, i32 0)\n %21 = add i32 %20, 1\n %22 = icmp ult i32 %21, 2\n store i32 %8, i32* %sv_0.0.ph.reg2mem\n br i1 %22, label LBL_7, label LBL_5\n LBL_5:\n %23 = ptrtoint i64* %sv_3 to i64\n %24 = sext i32 %20 to i64\n %25 = add i64 %23, -32\n %26 = add i64 %25, %24\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = bitcast i64* %sv_1 to i8*\n %29 = call double @atof(i8* nonnull %28)\n %30 = fptrunc double %29 to float\n %31 = bitcast float %30 to i32\n %32 = sext i32 %31 to i128\n %33 = call i128 @FUNC(i128 %32)\n %34 = call i64 @FUNC(i128 %33)\n %35 = trunc i64 %34 to i32\n store i32 %35, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %36 = call i32 @close(i32 %9)\n store i32 %8, i32* %sv_0.058.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %37 = call i32 @close(i32 %9)\n %38 = call i32 @close(i32 %18)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.058.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.058.reload = load i32, i32* %sv_0.058.reg2mem\n %39 = call i128 @__asm_movss.1(i32 %sv_0.058.reload)\n %40 = call i64 @FUNC(i128 %39)\n %41 = trunc i64 %40 to i32\n %42 = call i128 @__asm_movss.1(i32 %41)\n %43 = call i64 @FUNC(i128 %42)\n %44 = trunc i64 %43 to i32\n %45 = call i128 @__asm_movss.1(i32 %44)\n %46 = call i128 @__asm_movss.1(i32 2147483647)\n %47 = call i128 @FUNC(i128 %45, i128 %46)\n %48 = call i128 @__asm_cvtss2sd.2(i128 %47)\n %49 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %48, i128 %49)\n %50 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %2, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %20, { 1, 0 }\n uselistorder i32 %9, { 4, 0, 1, 2, 3, 5 }\n uselistorder i32 %8, { 1, 2, 0 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.058.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_connect_socket_31-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = call i128 @__asm_movss.1(i32 1073741824)\n %6 = call i64 @FUNC(i128 %5)\n %7 = trunc i64 %6 to i32\n %8 = call i128 @__asm_movss.1(i32 %7)\n %9 = call i64 @FUNC(i128 %8)\n %10 = trunc i64 %9 to i32\n %11 = call i128 @__asm_movss.1(i32 %10)\n %12 = call i64 @FUNC(i128 %11)\n %13 = trunc i64 %12 to i32\n %14 = call i128 @FUNC(i128 %1, i128 %1)\n %15 = call i128 @FUNC(i32 %13)\n %16 = call i128 @FUNC(i64 4636737291354636288)\n %17 = call i128 @FUNC(i128 %16, i128 %15)\n %18 = call i32 @FUNC(i128 %17)\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n ret i64 %20\n\n uselistorder i128 %2, { 1, 0 }\n uselistorder i128* %0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_multiply_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = icmp slt i64 %3, 0\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %6 = icmp slt i64 %3, -4611686018427387903\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = mul i64 %3, 2\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_for_loop_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 8368 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %.off = add i32 %.pre, -1\n %6 = icmp ugt i32 %.off, 19\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %7 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %8 = add nuw i64 %storemerge2.reload, 1\n %9 = load i32, i32* %sv_0, align 4\n %10 = sext i32 %9 to i64\n %11 = icmp ult i64 %8, %10\n store i64 %8, i64* %storemerge2.reg2mem\n br i1 %11, label LBL_2, label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 0, 1, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_fread_10-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_fread_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 @fread(i64* nonnull %sv_0, i32 1, i32 99, %_IO_FILE* %3)\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i32*, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i32** %sv_1 to i64\n %5 = add i64 %4, -609\n %6 = and i64 %5, -16\n %7 = bitcast i32** %sv_1 to i64*\n store i64 %6, i64* %7, align 8\n br label LBL_3\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 50)\n %10 = add i64 %8, -416\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %11 = mul i64 %storemerge3.reload, 4\n %12 = load i32*, i32** %sv_1, align 8\n %13 = ptrtoint i32* %12 to i64\n %14 = add i64 %11, %13\n %15 = add i64 %10, %11\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = inttoptr i64 %14 to i32*\n store i32 %17, i32* %18, align 4\n %19 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %19, 100\n store i64 %19, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %20 = load i32*, i32** %sv_1, align 8\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_1, { 3, 2, 0, 1 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_ncpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i8* null, i8** %.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = bitcast i64* %4 to i8*\n store i8* %5, i8** %sv_1, align 8\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = ptrtoint i64* %4 to i64\n %10 = add i64 %9, 99\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = load i8*, i8** %sv_1, align 8\n store i8* %12, i8** %.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i8*, i8** %.reg2mem\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = bitcast i64* %sv_0 to i8*\n %15 = call i32 @strlen(i8* nonnull %14)\n %16 = call i8* @strncpy(i8* nonnull %14, i8* %.reload, i32 %15)\n %17 = ptrtoint i64* %sv_0 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i8** %.reg2mem, { 0, 2, 1 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_postdec_11-bad", "fun_name": "CWE191_Integer_Underflow__int_listen_socket_postdec_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = add i32 %sv_0.1.reload, -1\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_execlp_08-bad", "fun_name": "CWE78_OS_Command_Injection__char_connect_socket_execlp_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_calloc_08-bad", "fun_name": "CWE690_NULL_Deref_From_Return__int_calloc_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 4)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %0 to i32*\n store i32 5, i32* %4, align 4\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 49)\n %9 = add i64 %3, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_3\n LBL_3:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n store i64 0, i64* %sv_1, align 8\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_6, label LBL_4\n LBL_4:\n %14 = sext i32 %12 to i64\n %15 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = add i64 %storemerge2.reload, %3\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = add i64 %storemerge2.reload, %15\n %20 = inttoptr i64 %19 to i8*\n store i8 %18, i8* %20, align 1\n %21 = load i64, i64* %sv_1, align 8\n %22 = add i64 %21, 1\n store i64 %22, i64* %sv_1, align 8\n %23 = icmp ult i64 %22, %14\n store i64 %22, i64* %storemerge2.reg2mem\n br i1 %23, label LBL_5, label LBL_6\n LBL_6:\n %24 = call i64 @FUNC(i64 %3)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %1, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %22, { 0, 2, 1 }\n uselistorder i64 %storemerge2.reload, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i64 %3, { 2, 0, 4, 3, 1 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_multiply_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem2 = alloca i8\n %.reg2mem = alloca i32\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n store i8 32, i8* %.reg2mem2\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i8, i8* %sv_0, align 1\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i8 %.pr, i8* %.reg2mem2\n br label LBL_2\n LBL_2:\n %.reload3 = load i8, i8* %.reg2mem2\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n %8 = icmp slt i8 %.reload3, 1\n %or.cond = or i1 %8, %7\n br i1 %or.cond, label LBL_6, label LBL_3\n LBL_3:\n %9 = icmp sgt i8 %.reload3, 62\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = mul i8 %.reload3, 2\n %11 = sext i8 %10 to i64\n %12 = and i64 %11, 4294967294\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8 %.reload3, { 2, 0, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i8* %.reg2mem2, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memmove_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memmove_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %5 = mul i64 %storemerge2.reload, 8\n %6 = add i64 %5, %0\n %7 = add i64 %6, -816\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 8\n %9 = add i64 %6, -812\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %sv_1.stack_var_-2024 = select i1 %4, i64* %sv_1, i64* %sv_2\n %storemerge1 = ptrtoint i64* %sv_1.stack_var_-2024 to i64\n %12 = call i64* @memmove(i64* nonnull %sv_1.stack_var_-2024, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %13 = call i64 @FUNC(i64 %storemerge1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memcpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = add i64 %6, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %8 = and i64 %7, -16\n %sv_2.0 = select i1 %5, i64 %1, i64 %8\n %9 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = inttoptr i64 %sv_2.0 to i64*\n %11 = call i64* @memcpy(i64* %10, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_2 to i32))\n %12 = load i64, i64* %10, align 8\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %2, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = sub i16 0, %3\n %5 = icmp slt i16 %4, 0\n %6 = icmp eq i1 %5, false\n %.v = select i1 %6, i16 %4, i16 %3\n %7 = icmp ult i16 %.v, 182\n br i1 %7, label LBL_1, label LBL_2\n LBL_1:\n %8 = mul i16 %3, %3\n %9 = sext i16 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_2:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %3, { 1, 0, 2, 3 }\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncat_08-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncat_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strncat(i8* %sv_0.0.reload, i8* nonnull %6, i32 100)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_8, label LBL_3\n LBL_3:\n %8 = load i64, i64* %sv_0, align 8\n %.off = add i64 %8, -6\n %9 = icmp ult i64 %.off, 94\n br i1 %9, label LBL_4, label LBL_7\n LBL_4:\n %10 = trunc i64 %8 to i32\n %11 = call i64* @malloc(i32 %10)\n %12 = icmp eq i64* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %14 = ptrtoint i64* %11 to i64\n %15 = bitcast i64* %11 to i32*\n store i32 1819043176, i32* %15, align 4\n %16 = add i64 %14, 4\n %17 = inttoptr i64 %16 to i16*\n store i16 111, i16* %17, align 2\n %18 = call i64 @FUNC(i64 %14)\n call void @free(i64* %11)\n br label LBL_8\n LBL_7:\n %19 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %11, { 0, 1, 3, 2 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_snprintf_01-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_file_snprintf_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = sub i32 100, %2\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = add i64 %3, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %8, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n store i64 0, i64* %sv_0, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %17, i32 99, i8* nonnull %1)\n %19 = ptrtoint i64* %sv_0 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_postinc_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 2147483647\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i64 %3, 4294967296\n %sext = add i64 %6, 4294967296\n %7 = ashr exact i64 %sext, 32\n store i64 %7, i64* %sv_0, align 8\n %8 = and i64 %7, 4294967295\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memcpy_02-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memcpy_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 200)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 50)\n %5 = call i64* @memcpy(i64* %1, i64* nonnull %sv_0, i32 400)\n %6 = bitcast i64* %1 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_fscanf_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n %10 = load i32, i32* %sv_0, align 4\n %11 = icmp ugt i32 %10, 9\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = ptrtoint i64* %sv_1 to i64\n %13 = sext i32 %10 to i64\n %14 = mul i64 %13, 4\n %15 = add i64 %12, -48\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n br label LBL_7\n LBL_6:\n %21 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %10, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_partial_init_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %rax.1.reg2mem\n br i1 %5, label LBL_6, label LBL_3\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %6 = mul i64 %indvars.iv5.reload, 8\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n %9 = trunc i64 %indvars.iv5.reload to i32\n store i32 %9, i32* %8, align 4\n %10 = add i64 %7, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 %9, i32* %11, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %12 = icmp eq i32 %.pr, 0\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 0, i64* %rax.1.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 8\n %14 = add i64 %13, %3\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = add i64 %14, 4\n %20 = inttoptr i64 %19 to i32*\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %23, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64* %rax.1.reg2mem, { 0, 1, 3, 2 }\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder i32* @gv_0, { 0, 5, 4, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 2, 0, 3, 1, 4 }\n uselistorder label LBL_6, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* %1, i32 %9)\n %11 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 3, 5, 4 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_loop_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %8 = inttoptr i64 %3 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %3, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n br label LBL_3\n LBL_3:\n %12 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %13 = call i32 @strlen(i8* %12)\n store i64 0, i64* %sv_1, align 8\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_4\n LBL_4:\n %15 = sext i32 %13 to i64\n %16 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %17 = add i64 %storemerge2.reload, %3\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = add i64 %storemerge2.reload, %16\n %21 = inttoptr i64 %20 to i8*\n store i8 %19, i8* %21, align 1\n %22 = load i64, i64* %sv_1, align 8\n %23 = add i64 %22, 1\n store i64 %23, i64* %sv_1, align 8\n %24 = icmp ult i64 %23, %15\n store i64 %23, i64* %storemerge2.reg2mem\n br i1 %24, label LBL_5, label LBL_6\n LBL_6:\n %25 = call i64 @FUNC(i64 %3)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %1, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %23, { 0, 2, 1 }\n uselistorder i64 %storemerge2.reload, { 1, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64 %3, { 3, 0, 4, 1, 2 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_modulo_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = urem i32 100, %3\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_partial_init_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %indvars.iv9.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv9.reg2mem\n store i32 %4, i32* %.reg2mem\n br i1 %6, label LBL_3, label LBL_1\n LBL_1:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %7 = mul i64 %indvars.iv9.reload, 8\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv9.reload to i32\n store i32 %10, i32* %9, align 8\n %11 = or i64 %8, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 %10, i32* %12, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_2, label LBL_1\n LBL_2:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_3\n LBL_3:\n %.reload = load i32, i32* %.reg2mem\n %13 = icmp eq i32 %.reload, 5\n %14 = icmp eq i1 %13, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %14, label LBL_6, label LBL_4\n LBL_4:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %15 = mul i64 %indvars.iv6.reload, 8\n %16 = add i64 %15, %3\n %17 = inttoptr i64 %16 to i32*\n %18 = trunc i64 %indvars.iv6.reload to i32\n store i32 %18, i32* %17, align 8\n %19 = or i64 %16, 4\n %20 = inttoptr i64 %19 to i32*\n store i32 %18, i32* %20, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_5, label LBL_4\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %21 = mul i64 %indvars.iv.reload, 8\n %22 = add i64 %21, %3\n %23 = inttoptr i64 %22 to i32*\n %24 = load i32, i32* %23, align 8\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n %27 = or i64 %22, 4\n %28 = inttoptr i64 %27 to i32*\n %29 = load i32, i32* %28, align 4\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %1, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_predec_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = call i32 @rand()\n %7 = sext i1 %3 to i32\n %storemerge.v = xor i32 %6, %7\n %storemerge = trunc i32 %storemerge.v to i8\n %8 = icmp eq i8 %storemerge, -128\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %sext4 = mul i32 %storemerge.v, 16777216\n %sext = add i32 %sext4, -16777216\n %9 = ashr exact i32 %sext, 24\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_2:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE688_Function_Call_With_Incorrect_Variable_or_Reference_as_Argument__basic_14-bad", "fun_name": "CWE688_Function_Call_With_Incorrect_Variable_or_Reference_as_Argument__basic_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i8* inttoptr (i64 5 to i8*))\n %6 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__char_type_overrun_memcpy_14-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__char_type_overrun_memcpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 32)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = add i64 %7, 16\n %9 = inttoptr i64 %8 to i64*\n store i64 ptrtoint ([32 x i8]* @gv_0 to i64), i64* %9, align 8\n %10 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n %11 = call i64* @memcpy(i64* %4, i64* bitcast ([32 x i8]* @gv_0 to i64*), i32 32)\n %12 = add i64 %7, 15\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %7)\n %15 = load i64, i64* %9, align 8\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder [32 x i8]* @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_loop_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_3, label LBL_1\n LBL_1:\n %7 = ptrtoint i64* %sv_1 to i64\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %7\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge1.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = add nuw i64 %storemerge1.reload, 1\n %16 = icmp ult i64 %15, %8\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %16, label LBL_2, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64* nonnull %sv_0)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 5, 4, 3, 2, 6 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_modulo_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge1.in = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge1.in, 0\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = urem i32 100, %storemerge1.in\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n store i64 %15, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i32 %storemerge1.in, { 1, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_strncpy_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %3 = bitcast i64* %sv_1 to i8*\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strncpy(i8* nonnull %3, i8* nonnull %4, i32 99)\n %6 = add i64 %0, -13\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %1, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_calloc_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 8)\n %1 = icmp eq i64* %0, null\n store i64 1, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %2 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.18.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.18.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.18.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.18.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n %28 = icmp eq i32 %sv_0.0.ph.reload, 0\n store i32 %sv_0.0.ph.reload, i32* %sv_0.18.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n %sv_0.18.reload = load i32, i32* %sv_0.18.reg2mem\n %29 = urem i32 100, %sv_0.18.reload\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n br label LBL_11\n LBL_10:\n %32 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.18.reg2mem, { 0, 4, 2, 1, 3 }\n uselistorder label LBL_9, { 3, 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fixed_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n %spec.store.select = select i1 %1, i32 -1, i32 20\n %2 = mul i32 %spec.store.select, 4\n %3 = call i64* @malloc(i32 %2)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_1, label LBL_2\n LBL_1:\n %6 = ptrtoint i64* %3 to i64\n %7 = sext i32 %spec.store.select to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 4\n %9 = add i64 %8, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = add nuw i64 %storemerge1.reload, 1\n %12 = icmp ult i64 %11, %7\n store i64 %11, i64* %storemerge1.reg2mem\n br i1 %12, label LBL_3, label LBL_4\n LBL_4:\n %13 = bitcast i64* %3 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.store.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memcpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %5, 0\n %7 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %6, i64 %1, i64 %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = inttoptr i64 %spec.select to i64*\n %12 = call i64* @memcpy(i64* nonnull %sv_0, i64* %11, i32 %10)\n %13 = ptrtoint i64* %sv_0 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %2, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 5, 1, 0, 4, 3, 2, 6 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_multiply_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8436 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_2, label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_3:\n %9 = call i32 @atoi(i8* nonnull %5)\n %10 = icmp slt i32 %9, 1\n br i1 %10, label LBL_7, label LBL_4\n LBL_4:\n %11 = icmp sgt i32 %9, 1073741822\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = mul i32 %9, 2\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_7\n LBL_6:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_7:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 0, 2, 1 }\n uselistorder label LBL_7, { 2, 3, 4, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_32-bad", "fun_name": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %2 = call i64 @FUNC(i64 40)\n %3 = icmp eq i64 %0, %2\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE571_Expression_Always_True__string_equals_01-bad", "fun_name": "CWE571_Expression_Always_True__string_equals_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 1702195828, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strcmp(i8* nonnull %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_0, i64 0, i64 0))\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_08-bad", "fun_name": "CWE369_Divide_by_Zero__int_connect_socket_divide_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = udiv i32 100, %sv_0.1.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_8\n LBL_8:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_14-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = bitcast i64* %3 to i32*\n store i32 1, i32* %7, align 4\n %8 = add i64 %6, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 2, i32* %9, align 4\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %10 = call i64 @FUNC(i64 %sv_0.0.reload)\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %11)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %3, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_for_loop_13-bad", "fun_name": "CWE400_Resource_Exhaustion__rand_for_loop_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.04.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8344 to i32*), align 8\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 -1, i64* %sv_0.03.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge1.in = xor i32 %12, %13\n %phitmp = sext i32 %storemerge1.in to i64\n %14 = icmp eq i32 %storemerge1.in, 0\n store i64 %phitmp, i64* %sv_0.03.reg2mem\n store i64 0, i64* %sv_0.04.reg2mem\n br i1 %14, label LBL_4, label LBL_2\n LBL_2:\n %sv_0.03.reload = load i64, i64* %sv_0.03.reg2mem\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %15 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n %16 = add nuw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %16, %sv_0.03.reload\n store i64 %16, i64* %storemerge2.reg2mem\n store i64 %sv_0.03.reload, i64* %sv_0.04.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %sv_0.04.reload = load i64, i64* %sv_0.04.reg2mem\n ret i64 %sv_0.04.reload\n\n uselistorder i64* %sv_0.03.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_calloc_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @calloc(i32 100, i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = bitcast i64* %0 to i32*\n store i32 0, i32* %4, align 4\n %5 = add i64 %3, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %7 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fscanf_34-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fscanf_34_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 -1, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %5 = icmp slt i32 %4, 0\n br i1 %5, label LBL_3, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %sv_1 to i64\n %sext = mul i64 %3, 4294967296\n %7 = ashr exact i64 %sext, 30\n %8 = add i64 %6, -48\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_2\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE510_Trapdoor__network_connection_13-bad", "fun_name": "CWE510_Trapdoor__network_connection_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8352 to i32*), align 32\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %4, -1\n br i1 %cond, label LBL_3, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_0, i64 0, i64 0))\n %7 = call i16 @htons(i16 80)\n %8 = bitcast i64* %sv_0 to %sockaddr*\n %9 = call i32 @connect(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = call i32 @close(i32 %4)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %4, { 2, 1, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_putc_14-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_putc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 @putc(i32 65, %_IO_FILE* %4)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_sub_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 -3)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i64 -3, { 1, 0 }\n uselistorder i32* @gv_0, { 5, 0, 4, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_predec_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8428 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i64, i64* %sv_0, align 8\n %6 = icmp eq i64 %.pr, -9223372036854775808\n store i64 %.pr, i64* %.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %7 = add i64 %.reload, -1\n store i64 %7, i64* %sv_0, align 8\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1, 3 }\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i32 %3, 1\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncat_12-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncat_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_7\n LBL_4:\n %8 = call i64* @malloc(i32 100)\n %9 = icmp eq i64* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = bitcast i64* %8 to i8*\n store i8 0, i8* %11, align 1\n store i8* %11, i8** %sv_0.0.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %13 = bitcast i64* %sv_1 to i8*\n %14 = call i8* @strncat(i8* nonnull %sv_0.0.reload, i8* nonnull %13, i32 100)\n %15 = ptrtoint i8* %sv_0.0.reload to i64\n %16 = call i64 @FUNC(i64 %15)\n %17 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %17)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %8, { 1, 0 }\n uselistorder i64* %4, { 1, 0 }\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i32 100, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i16\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* inttoptr (i64 8428 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i16 0, i16* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i16, i16* %sv_0, align 2\n store i16 %.pre, i16* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i16, i16* %.reg2mem\n %6 = sub i16 0, %.reload\n %7 = icmp slt i16 %6, 0\n %8 = icmp eq i1 %7, false\n %.v = select i1 %8, i16 %6, i16 %.reload\n %9 = icmp ult i16 %.v, 182\n br i1 %9, label LBL_3, label LBL_4\n LBL_3:\n %10 = mul i16 %.reload, %.reload\n %11 = sext i16 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_5\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %.reload, { 1, 0, 2, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_postdec_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i32, i32* %sv_0, align 4\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = add i32 %8, -1\n store i32 %10, i32* %sv_0, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_6\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_max_multiply_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp eq i32 %3, 0\n %spec.store.select = select i1 %4, i32 32, i32 127\n %5 = trunc i32 %spec.store.select to i8\n %6 = icmp ugt i8 %5, 62\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %sext = mul i32 %spec.store.select, 33554432\n %7 = ashr exact i32 %sext, 24\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_memmove_08-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_memmove_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC()\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = add i64 %3, -8\n store i64 %11, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %13 = load i64, i64* %sv_1, align 8\n %14 = inttoptr i64 %13 to i64*\n %15 = call i64* @memmove(i64* nonnull %sv_0, i64* %14, i32 100)\n %16 = call i64 @FUNC(i64* nonnull %sv_0)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fgets_strncpy_05-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__fgets_strncpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %.pre-phi.reg2mem = alloca i8*\n %.pre.pre-phi.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_0.LBL_4_crit_edge, label LBL_2\n LBL_1:\n %.pre2 = bitcast i64* %sv_2 to i8*\n store i8* %.pre2, i8** %.pre.pre-phi.reg2mem\n br label LBL_4\n LBL_2:\n store i64 0, i64* %sv_2, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_2 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_5\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i8* %4, i8** %.pre.pre-phi.reg2mem\n br label LBL_4\n LBL_4:\n %.pre.pre-phi.reload = load i8*, i8** %.pre.pre-phi.reg2mem\n store i64 0, i64* %sv_2, align 8\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i8* %.pre.pre-phi.reload, i8** %.pre-phi.reg2mem\n store i32 -1, i32* %sv_0.01.reg2mem\n br label LBL_6\n LBL_5:\n %9 = call i32 @atoi(i8* nonnull %4)\n store i64 0, i64* %sv_2, align 8\n %10 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %11 = icmp sgt i32 %9, 99\n store i8* %4, i8** %.pre-phi.reg2mem\n store i32 %9, i32* %sv_0.01.reg2mem\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n %12 = ptrtoint i64* %sv_3 to i64\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %.pre-phi.reload = load i8*, i8** %.pre-phi.reg2mem\n %13 = bitcast i64* %sv_1 to i8*\n %14 = call i8* @strncpy(i8* nonnull %.pre-phi.reload, i8* nonnull %13, i32 %sv_0.01.reload)\n %15 = sext i32 %sv_0.01.reload to i64\n %16 = add i64 %12, -112\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n br label LBL_7\n LBL_7:\n %19 = ptrtoint i64* %sv_2 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.01.reload, { 1, 0 }\n uselistorder i8* %4, { 0, 2, 1, 3 }\n uselistorder i64* %sv_2, { 3, 4, 1, 2, 5, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0 = alloca i8*, align 8\n %0 = call i64* @malloc(i32 50)\n %1 = bitcast i64* %0 to i8*\n store i8* %1, i8** %sv_0, align 8\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = call i64* @memset(i64* %0, i32 65, i32 49)\n %5 = ptrtoint i64* %0 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i8*, i8** %sv_0, align 8\n %9 = call i32 @strlen(i8* %8)\n %10 = add i32 %9, 1\n %11 = call i64* @calloc(i32 %10, i32 1)\n %12 = icmp eq i64* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %14 = bitcast i64* %11 to i8*\n %15 = call i8* @strcpy(i8* %14, i8* %8)\n %16 = ptrtoint i64* %11 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %11)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %11, { 1, 0, 3, 2 }\n uselistorder i8* %8, { 1, 0 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32, i32)* @calloc, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 7, 6, 5, 4, 3, 2, 1, 0, 8 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_memcpy_01-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_memcpy_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.034.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_2, align 8\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.034.reg2mem\n br label LBL_6\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_3 to %sockaddr*\n %9 = call i32 @connect(i32 %2, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %2, i64* nonnull %sv_2, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = sext i32 %11 to i64\n %15 = add i64 %0, -112\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_2 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n store i32 %19, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %20 = call i32 @close(i32 %2)\n store i64 0, i64* %sv_2, align 8\n %21 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %22 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.034.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n %sv_0.034.reload = load i32, i32* %sv_0.034.reg2mem\n %23 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.034.reload)\n %24 = sext i32 %sv_0.034.reload to i64\n %25 = add i64 %0, -112\n %26 = add i64 %25, %24\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n br label LBL_7\n LBL_7:\n %28 = call i64 @FUNC(i64* nonnull %sv_2)\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %1, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.034.reload, { 1, 0 }\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %2, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 1, 2, 5, 3, 4, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0, 4 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memmove_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %5 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %6 = ptrtoint i64* %5 to i64\n %7 = icmp eq i64* %5, null\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %sv_0.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = inttoptr i64 %sv_0.0.reload to i64*\n %11 = call i64* @memmove(i64* %10, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %12 = load i64, i64* %10, align 8\n %13 = call i64 @FUNC(i64 %12)\n call void @free(i64* %10)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_06-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_console_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %24 = icmp eq i32 %23, 1\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_11, label LBL_7\n LBL_7:\n %26 = load i64, i64* %sv_1, align 8\n %27 = and i64 %26, 4294967295\n %28 = icmp eq i64 %27, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %29 = add i32 %storemerge4.reload, 1\n %30 = sext i32 %29 to i64\n %31 = icmp sgt i64 %27, %30\n store i32 %29, i32* %storemerge4.reg2mem\n br i1 %31, label LBL_8, label LBL_9\n LBL_9:\n %phitmp = zext i32 %29 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %32 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_11\n LBL_11:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %29, { 1, 0, 2 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_6, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memmove_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memmove_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = add i32 %7, 1\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_1, i32 %8)\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__listen_socket_memcpy_14-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__listen_socket_memcpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_10, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_10, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_3 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_8, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_8, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_2, i32 7, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_9, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -112\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_2 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %.off = add i32 %24, 32768\n %25 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %25, label LBL_7, label LBL_9\n LBL_7:\n %sext3 = mul i32 %24, 65536\n %26 = ashr exact i32 %sext3, 16\n store i32 %26, i32* %sv_0.0.ph.reg2mem\n br label LBL_9\n LBL_8:\n %27 = call i32 @close(i32 %5)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_10\n LBL_9:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %28 = call i32 @close(i32 %5)\n %29 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %30 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %31 = trunc i32 %sv_0.1.reload to i16\n %32 = icmp sgt i16 %31, 99\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n %33 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.1.reload)\n %34 = sext i32 %sv_0.1.reload to i64\n %35 = add i64 %0, -112\n %36 = add i64 %35, %34\n %37 = inttoptr i64 %36 to i8*\n store i8 0, i8* %37, align 1\n br label LBL_12\n LBL_12:\n %38 = call i64 @FUNC(i64* nonnull %sv_2)\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %1, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 2, 0 }\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_10, { 2, 1, 0, 3 }\n uselistorder label LBL_9, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE681_Incorrect_Conversion_Between_Numeric_Types__doubleNaN2int_12-bad", "fun_name": "CWE681_Incorrect_Conversion_Between_Numeric_Types__doubleNaN2int_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %xmm0.0.reg2mem = alloca i128\n %sv_0.0.in.reg2mem = alloca i64\n %sv_1.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n %6 = call i128 @FUNC(i128 %1, i128 %1)\n %7 = call i64 @FUNC(i128 %6)\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = bitcast i64* %sv_2 to i8*\n %10 = call i8* @fgets(i8* nonnull %9, i32 256, %_IO_FILE* %8)\n %11 = icmp eq i8* %10, null\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n br i1 %11, label LBL_3, label LBL_2\n LBL_2:\n %12 = call double @atof(i8* nonnull %9)\n %13 = fptrunc double %12 to float\n %14 = bitcast float %13 to i32\n %15 = sext i32 %14 to i128\n %16 = call i64 @FUNC(i128 %15)\n store i64 %16, i64* %sv_1.0.reg2mem\n br label LBL_4\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 %7, i64* %sv_1.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_1.0.reload = load i64, i64* %sv_1.0.reg2mem\n %18 = call i128 @__asm_movq.1(i64 %sv_1.0.reload)\n %19 = trunc i128 %18 to i64\n %20 = bitcast i64 %19 to double\n %21 = call double @sqrt(double %20)\n %22 = fptrunc double %21 to float\n %23 = bitcast float %22 to i32\n %24 = sext i32 %23 to i128\n %25 = call i32 @FUNC(i128 %24)\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n br label LBL_11\n LBL_5:\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n %28 = call double @atof(i8* nonnull %9)\n %29 = fptrunc double %28 to float\n %30 = bitcast float %29 to i32\n %31 = sext i32 %30 to i128\n %32 = call i64 @FUNC(i128 %31)\n store i64 %32, i64* %sv_0.0.in.reg2mem\n store i128 %31, i128* %xmm0.0.reg2mem\n br label LBL_8\n LBL_7:\n %33 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 %7, i64* %sv_0.0.in.reg2mem\n store i128 %6, i128* %xmm0.0.reg2mem\n br label LBL_8\n LBL_8:\n %xmm0.0.reload = load i128, i128* %xmm0.0.reg2mem\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = sext i64 %sv_0.0.in.reload to i128\n %34 = call i128 @FUNC(i128 %xmm0.0.reload, i128 %xmm0.0.reload)\n call void @FUNC(i128 %34, i128 %sv_0.0)\n br i1 %11, label LBL_10, label LBL_9\n LBL_9:\n %35 = call i64 @FUNC(i64 ptrtoint ([18 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_10:\n %36 = call i128 @__asm_movq.1(i64 %sv_0.0.in.reload)\n %37 = trunc i128 %36 to i64\n %38 = bitcast i64 %37 to double\n %39 = call double @sqrt(double %38)\n %40 = fptrunc double %39 to float\n %41 = bitcast float %40 to i32\n %42 = sext i32 %41 to i128\n %43 = call i32 @FUNC(i128 %42)\n %44 = zext i32 %43 to i64\n %45 = call i64 @FUNC(i64 %44)\n br label LBL_11\n LBL_11:\n %46 = call i64 @FUNC(i64 40)\n %47 = icmp eq i64 %2, %46\n store i64 0, i64* %rax.0.reg2mem\n br i1 %47, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.in.reload, { 1, 0 }\n uselistorder i1 %11, { 1, 2, 0 }\n uselistorder i8* %9, { 1, 0, 2 }\n uselistorder i64* %sv_1.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.in.reg2mem, { 0, 2, 1 }\n uselistorder i128* %xmm0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder double (double)* @sqrt, { 1, 0, 2 }\n uselistorder double (i8*)* @atof, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_rand_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %4 = mul i64 %indvars.iv6.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %7 = add i64 %1, 28\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %9 = mul i64 %indvars.iv.reload, 4\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %1, { 0, 2, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__bind_accept_listen_01-bad", "fun_name": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__bind_accept_listen_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %3, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_10, label LBL_4\n LBL_4:\n %14 = sub i32 99, %2\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = sext i32 %2 to i64\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i64*\n %19 = call i32 @recv(i32 %10, i64* %18, i32 %14, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = ptrtoint i64* %sv_2 to i64\n %23 = sext i32 %19 to i64\n %24 = add i64 %22, -112\n %25 = add i64 %24, %23\n %26 = inttoptr i64 %25 to i8*\n store i8 0, i8* %26, align 1\n %27 = call i8* @strchr(i8* nonnull %1, i32 13)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %27, align 1\n br label LBL_7\n LBL_7:\n %29 = call i8* @strchr(i8* nonnull %1, i32 10)\n %30 = icmp eq i8* %29, null\n br i1 %30, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %29, align 1\n br label LBL_10\n LBL_9:\n %31 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %3)\n %33 = call i32 @close(i32 %10)\n br label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64* nonnull %sv_1)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 0, 4, 1, 2, 3, 5 }\n uselistorder i32 %2, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 0, 1, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE667_Improper_Locking__basic_05-bad", "fun_name": "CWE667_Improper_Locking__basic_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n %3 = call i64 @FUNC(i64 ptrtoint (i32* @gv_2 to i64))\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([22 x i8]* @gv_3 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([18 x i8]* @gv_4 to i64))\n %9 = load i32, i32* @gv_2, align 4\n %10 = sext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* @gv_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_init_variable_char_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %3 = call i64 @FUNC(i64 67)\n store i64 %3, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_divide_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 14)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 6, 0, 5, 1, 4, 2, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_popen_08-bad", "fun_name": "CWE426_Untrusted_Search_Path__char_popen_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = bitcast i64* %sv_0 to i32*\n store i32 757101420, i32* %5, align 8\n %6 = or i64 %4, 4\n %7 = inttoptr i64 %6 to i16*\n store i16 24940, i16* %7, align 4\n %8 = or i64 %4, 6\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 2\n br label LBL_2\n LBL_2:\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call %_IO_FILE* @popen(i8* nonnull %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0))\n %12 = icmp eq %_IO_FILE* %11, null\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %13 = call i32 @pclose(%_IO_FILE* nonnull %11)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_predec_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 4294967293)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }\n uselistorder i64 4294967293, { 1, 0 }\n uselistorder i32* @gv_0, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_no_init_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv7.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %4 = mul i64 %indvars.iv.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n %7 = trunc i64 %indvars.iv.reload to i32\n store i32 %7, i32* %6, align 4\n %8 = add i64 %5, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 %7, i32* %9, align 4\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 0, i64* %indvars.iv7.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv7.reload = load i64, i64* %indvars.iv7.reg2mem\n %10 = mul i64 %indvars.iv7.reload, 8\n %11 = add i64 %10, %1\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = add i64 %11, 4\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7.reload, 1\n %exitcond9 = icmp eq i64 %indvars.iv.next8, 10\n store i64 %indvars.iv.next8, i64* %indvars.iv7.reg2mem\n br i1 %exitcond9, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %20\n\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv7.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_loop_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_1 to i64\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %6 = add i64 %5, -816\n %7 = add i64 %5, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %8 = mul i64 %storemerge13.reload, 8\n %9 = add i64 %8, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 8\n %11 = add i64 %7, %8\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge13.reg2mem\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %exitcond4, label LBL_5, label LBL_4\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %14 = mul i64 %storemerge2.reload, 8\n %15 = add i64 %14, %sv_0.0.reload\n %16 = add i64 %14, %6\n %17 = inttoptr i64 %16 to i64*\n %18 = load i64, i64* %17, align 8\n %19 = inttoptr i64 %15 to i64*\n store i64 %18, i64* %19, align 8\n %20 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %20, 100\n store i64 %20, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %21 = call i64 @FUNC(i64 %sv_0.0.reload)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %14, { 1, 0 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_ncpy_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i8* null, i8** %.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = bitcast i64* %4 to i8*\n store i8* %5, i8** %sv_1, align 8\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = ptrtoint i64* %4 to i64\n %10 = add i64 %9, 99\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = load i8*, i8** %sv_1, align 8\n store i8* %12, i8** %.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i8*, i8** %.reg2mem\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = bitcast i64* %sv_0 to i8*\n %15 = call i32 @strlen(i8* nonnull %14)\n %16 = call i8* @strncpy(i8* nonnull %14, i8* %.reload, i32 %15)\n %17 = ptrtoint i64* %sv_0 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i8** %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int64_t_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC(i64 5)\n %2 = call i64 @FUNC(i64 40)\n %3 = icmp eq i64 %0, %2\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_05-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 10)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %7 = bitcast i64* %sv_1 to i8*\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = sext i32 %8 to i64\n %10 = add nsw i64 %9, 1\n %11 = icmp eq i64 %10, 0\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %sv_0.0.reload\n %14 = add i64 %storemerge1.reload, %12\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = inttoptr i64 %13 to i8*\n store i8 %16, i8* %17, align 1\n %18 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, %10\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %19 = call i64 @FUNC(i64 %sv_0.0.reload)\n %20 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %20)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__struct_realloc_01-bad", "fun_name": "CWE690_NULL_Deref_From_Return__struct_realloc_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = ptrtoint i64* %0 to i64\n %2 = bitcast i64* %0 to i32*\n store i32 1, i32* %2, align 4\n %3 = add i64 %1, 4\n %4 = inttoptr i64 %3 to i32*\n store i32 1, i32* %4, align 4\n %5 = call i64 @FUNC(i64 %1)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_08-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %9, i32 99)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = add i64 %11, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %11)\n %15 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %15)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_fprintf_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = sub i32 100, %2\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %3, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %8, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n %17 = load %_IO_FILE*, %_IO_FILE** @gv_3, align 8\n %18 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_0)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_loop_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = bitcast i64* %1 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = add i64 %storemerge1.reload, %4\n %9 = add i64 %storemerge1.reload, %7\n %10 = inttoptr i64 %9 to i8*\n %11 = load i8, i8* %10, align 1\n %12 = inttoptr i64 %8 to i8*\n store i8 %11, i8* %12, align 1\n %13 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %14 = add i64 %4, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %4, { 1, 2, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_17-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05.reg2mem = alloca i8*\n %sv_0.06.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_13, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_13\n LBL_10:\n %sv_0.06.reload = load i8*, i8** %sv_0.06.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %29 = icmp eq i8 %.reload, 83\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_12, label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n store i8* %sv_0.06.reload, i8** %sv_0.05.reg2mem\n br label LBL_14\n LBL_12:\n %32 = ptrtoint i8* %sv_0.06.reload to i64\n %33 = add i64 %32, 1\n %34 = inttoptr i64 %33 to i8*\n %35 = load i8, i8* %34, align 1\n %36 = icmp eq i8 %35, 0\n %37 = icmp eq i1 %36, false\n store i8 %35, i8* %.reg2mem\n store i8* %34, i8** %sv_0.06.reg2mem\n store i8* %34, i8** %sv_0.05.reg2mem\n br i1 %37, label LBL_10, label LBL_14\n LBL_13:\n %38 = load i8, i8* %4, align 1\n %39 = icmp eq i8 %38, 0\n %40 = icmp eq i1 %39, false\n store i8 %38, i8* %.reg2mem\n store i8* %4, i8** %sv_0.06.reg2mem\n store i8* %4, i8** %sv_0.05.reg2mem\n br i1 %40, label LBL_10, label LBL_14\n LBL_14:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %41 = bitcast i8* %sv_0.05.reload to i64*\n call void @free(i64* %41)\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.06.reload, { 1, 0 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 0, 1, 2, 3, 4, 6, 5 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 1, 2, 0 }\n uselistorder i8** %sv_0.06.reg2mem, { 1, 2, 0 }\n uselistorder i8** %sv_0.05.reg2mem, { 0, 2, 1, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0, 2 }\n uselistorder label LBL_14, { 2, 0, 1 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_add_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 3)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 3, 2, 1, 0 }\n uselistorder i64 3, { 1, 0 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memmove_12-bad", "fun_name": "CWE126_Buffer_Overread__malloc_char_memmove_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 49)\n %9 = add i64 %7, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_7\n LBL_4:\n %11 = call i64* @malloc(i32 100)\n %12 = icmp eq i64* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %14 = ptrtoint i64* %11 to i64\n %15 = call i64* @memset(i64* %11, i32 65, i32 99)\n %16 = add i64 %14, 99\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n store i64 %14, i64* %sv_0.0.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %18 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @strlen(i8* nonnull %19)\n %21 = inttoptr i64 %sv_0.0.reload to i64*\n %22 = call i64* @memmove(i64* nonnull %sv_1, i64* %21, i32 %20)\n %23 = call i64 @FUNC(i64* nonnull %sv_1)\n call void @free(i64* %21)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %11, { 0, 2, 1 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 0, 1, 3 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_fputc_07-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_fputc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 @fputc(i32 65, %_IO_FILE* %4)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_loop_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %4\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge1.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %16 = call i64 @FUNC(i64 %9)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %9, { 1, 0 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncat_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %2, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strncat(i8* nonnull %2, i8* nonnull %4, i32 100)\n %6 = call i64 @FUNC(i64 %1)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_06-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %2, i64 0, i64 50)\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %0, -416\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %5 = mul i64 %storemerge2.reload, 4\n %6 = add i64 %5, %3\n %7 = add i64 %4, %5\n %8 = inttoptr i64 %7 to i32*\n %9 = load i32, i32* %8, align 4\n %10 = inttoptr i64 %6 to i32*\n store i32 %9, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %12 = bitcast i64* %sv_1 to i32*\n %13 = load i32, i32* %12, align 8\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_rand_predec_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %14 = icmp eq i32 %.reload, 5\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %16 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = add i32 %sv_0.0.reload, -1\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %20 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_int64_t_06-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i64*\n store i64 5, i64* %6, align 8\n %7 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %7, 100\n store i64 %7, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n call void @free(i64* %0)\n ret i64 5\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__freopen_13-bad", "fun_name": "CWE675_Duplicate_Operations_on_Resource__freopen_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca %_IO_FILE*\n %0 = load i32, i32* inttoptr (i64 8364 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store %_IO_FILE* null, %_IO_FILE** %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %4 = call %_IO_FILE* @freopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), %_IO_FILE* %3)\n %5 = call i32 @fclose(%_IO_FILE* %4)\n store %_IO_FILE* %4, %_IO_FILE** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load %_IO_FILE*, %_IO_FILE** %sv_0.0.reg2mem\n %6 = call i32 @fclose(%_IO_FILE* %sv_0.0.reload)\n %7 = sext i32 %6 to i64\n ret i64 %7\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_alloca_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 100)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %2 to i64\n %7 = call i64* @memset(i64* %2, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %10 = call i64 @FUNC(i64 %sv_0.0.reload)\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %11)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %2, { 0, 2, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE467_Use_of_sizeof_on_Pointer_Type__int_14-bad", "fun_name": "CWE467_Use_of_sizeof_on_Pointer_Type__int_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 8)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i32*\n store i32 5, i32* %7, align 4\n %8 = call i64 @FUNC(i64 5)\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__char_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 71)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 4, 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_max_multiply_05-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_max_multiply_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 -2)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_realloc_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n store i64 7453010373643542593, i64* %0, align 8\n %4 = add i64 %3, 8\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i64*, i32)* @realloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_multiply_13-bad", "fun_name": "CWE191_Integer_Underflow__char_rand_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %10 = trunc i32 %storemerge to i8\n %11 = icmp slt i8 %10, 0\n %12 = icmp eq i1 %11, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %12, label LBL_3, label LBL_2\n LBL_2:\n %sext2 = mul i32 %storemerge, 33554432\n %13 = ashr exact i32 %sext2, 24\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 5, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memcpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 4702111234474983745, i64* %sv_0, align 8\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = add i32 %4, 1\n %6 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %5)\n %7 = call i64 @FUNC(i64 %2)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_predec_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0368.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.0368.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.0368.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp eq i32 %sv_0.0.ph.reload, -2147483648\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0368.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.0368.reload = load i32, i32* %sv_0.0368.reg2mem\n %26 = add i32 %sv_0.0368.reload, -1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0368.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 49)\n %9 = add i64 %3, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_3\n LBL_3:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i8* @strncpy(i8* nonnull %13, i8* %11, i32 %12)\n %15 = call i64 @FUNC(i64 %3)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %11, { 1, 0 }\n uselistorder i64 %3, { 1, 3, 2, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_malloc_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = bitcast i64* %3 to i32*\n store i32 0, i32* %7, align 4\n %8 = add i64 %6, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 4\n %10 = call i64 @FUNC(i64 %6)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %11 = zext i32 %.reload to i64\n %12 = icmp eq i32 %.reload, 5\n %13 = icmp eq i1 %12, false\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 8\n %9 = add i64 %8, %5\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n %11 = add i64 %9, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 2, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__open_no_close_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.in.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = icmp eq i32 %0, -1\n store i64 -1, i64* %rax.0.in.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @close(i32 %0)\n %phitmp = sext i32 %2 to i64\n store i64 %phitmp, i64* %rax.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.in.reload = load i64, i64* %rax.0.in.reg2mem\n ret i64 %rax.0.in.reload\n\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__rand_strncpy_13-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__rand_strncpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_2, align 8\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.01.reg2mem\n br label LBL_3\n LBL_2:\n %5 = call i32 @rand()\n %6 = urem i32 %5, 2\n %7 = icmp eq i32 %6, 0\n %8 = call i32 @rand()\n %9 = mul i32 %8, 1073741824\n %10 = call i32 @rand()\n %11 = mul i32 %10, 32768\n %12 = xor i32 %11, %9\n %13 = call i32 @rand()\n %14 = xor i32 %12, %13\n %15 = sext i1 %7 to i32\n %storemerge.in = xor i32 %14, %15\n store i64 0, i64* %sv_2, align 8\n %16 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %17 = icmp sgt i32 %storemerge.in, 99\n store i32 %storemerge.in, i32* %sv_0.01.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n %18 = ptrtoint i64* %sv_3 to i64\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %19 = bitcast i64* %sv_2 to i8*\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i8* @strncpy(i8* nonnull %19, i8* nonnull %20, i32 %sv_0.01.reload)\n %22 = sext i32 %sv_0.01.reload to i64\n %23 = add i64 %18, -128\n %24 = add i64 %23, %22\n %25 = inttoptr i64 %24 to i8*\n store i8 0, i8* %25, align 1\n br label LBL_4\n LBL_4:\n %26 = call i64 @FUNC(i64* nonnull %sv_2)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.01.reload, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 2, 3, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_17-bad", "fun_name": "CWE126_Buffer_Overread__CWE129_connect_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n br label LBL_7\n LBL_2:\n %3 = bitcast i64* %sv_1 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %3, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_18, label LBL_3\n LBL_3:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_18, label LBL_5\n LBL_4:\n %12 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n br label LBL_7\n LBL_5:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = add i64 %13, -22\n %15 = bitcast i64* %sv_0 to i8*\n %16 = sext i32 %9 to i64\n %17 = add i64 %14, %16\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = call i32 @atoi(i8* nonnull %15)\n %20 = call i32 @close(i32 %1)\n %21 = icmp slt i32 %19, 0\n store i64 0, i64* %sv_1, align 8\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n %22 = add i64 %13, -64\n %23 = sext i32 %19 to i64\n %24 = mul i64 %23, 4\n %25 = add i64 %22, %24\n %26 = inttoptr i64 %25 to i32*\n %27 = load i32, i32* %26, align 4\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_8\n LBL_7:\n %30 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_8\n LBL_8:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 4, 0, 5, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05.reg2mem = alloca i8*\n %sv_0.06.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %20 = zext i32 %19 to i64\n %21 = icmp eq i32 %19, 5\n %22 = icmp eq i1 %21, false\n store i64 %20, i64* %rax.0.reg2mem\n br i1 %22, label LBL_13, label LBL_8\n LBL_8:\n %23 = load i8, i8* %3, align 1\n %24 = icmp eq i8 %23, 0\n %25 = icmp eq i1 %24, false\n store i8 %23, i8* %.reg2mem\n store i8* %3, i8** %sv_0.06.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n br i1 %25, label LBL_9, label LBL_12\n LBL_9:\n %sv_0.06.reload = load i8*, i8** %sv_0.06.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %26 = icmp eq i8 %.reload, 83\n %27 = icmp eq i1 %26, false\n br i1 %27, label LBL_11, label LBL_10\n LBL_10:\n %28 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n store i8* %sv_0.06.reload, i8** %sv_0.05.reg2mem\n br label LBL_12\n LBL_11:\n %29 = ptrtoint i8* %sv_0.06.reload to i64\n %30 = add i64 %29, 1\n %31 = inttoptr i64 %30 to i8*\n %32 = load i8, i8* %31, align 1\n %33 = icmp eq i8 %32, 0\n %34 = icmp eq i1 %33, false\n store i8 %32, i8* %.reg2mem\n store i8* %31, i8** %sv_0.06.reg2mem\n store i8* %31, i8** %sv_0.05.reg2mem\n br i1 %34, label LBL_9, label LBL_12\n LBL_12:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %35 = bitcast i8* %sv_0.05.reload to i64*\n call void @free(i64* %35)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.06.reload, { 1, 0 }\n uselistorder i8* %3, { 0, 1, 2, 4, 3 }\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.06.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.05.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4 }\n uselistorder label LBL_12, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %2)\n store i32 %5, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = call i64* @malloc(i32 40)\n %8 = ptrtoint i64* %7 to i64\n %9 = icmp eq i64* %7, null\n %10 = icmp eq i1 %9, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %11 = mul i64 %indvars.iv5.reload, 4\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_6, label LBL_5\n LBL_6:\n %14 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %14, label LBL_9, label LBL_7\n LBL_7:\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %16, %8\n %18 = inttoptr i64 %17 to i32*\n store i32 1, i32* %18, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_8\n LBL_8:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %19 = mul i64 %indvars.iv.reload, 4\n %20 = add i64 %19, %8\n %21 = inttoptr i64 %20 to i32*\n %22 = load i32, i32* %21, align 4\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_10, label LBL_8\n LBL_9:\n %25 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n call void @free(i64* %7)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_alloca_no_init_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.03.reg2mem = alloca i128\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %5 = icmp eq i32 %4, 5\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_2:\n %xmm0.03.reload = load i128, i128* %xmm0.03.reg2mem\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %7 = mul i64 %indvars.iv5.reload, 8\n %8 = add i64 %7, %3\n %9 = call i128 @FUNC(i128 %xmm0.03.reload, i128 %xmm0.03.reload)\n %10 = trunc i64 %indvars.iv5.reload to i32\n %11 = call i128 @FUNC(i32 %10)\n %12 = call i64 @FUNC(i128 %11)\n %13 = inttoptr i64 %8 to i64*\n store i64 %12, i64* %13, align 8\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i128 %11, i128* %xmm0.03.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 8\n %15 = add i64 %14, %3\n %16 = inttoptr i64 %15 to i64*\n %17 = load i64, i64* %16, align 8\n %18 = call i128 @FUNC(i64 %17)\n %19 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %1, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.03.reload, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.03.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_cpy_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i8*\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i8*, i8** %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = bitcast i64* %sv_1 to i8*\n %spec.select = select i1 %6, i8* %1, i8* %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strcpy(i8* %spec.select, i8* nonnull %9)\n %11 = ptrtoint i8* %spec.select to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %2, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_declare_cat_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, 49\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n store i64 0, i64* %sv_0, align 8\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i8* @strcat(i8* nonnull %7, i8* nonnull %1)\n %9 = call i64 @FUNC(i64 %4)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_popen_17-bad", "fun_name": "CWE78_OS_Command_Injection__char_console_popen_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %8 = sub i32 100, %2\n %9 = add i64 %3, %6\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %8, %_IO_FILE* %7)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = add i64 %6, -1\n %16 = sext i32 %13 to i64\n %17 = add i64 %15, %16\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %24 = icmp eq %_IO_FILE* %23, null\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n %25 = call i32 @pclose(%_IO_FILE* nonnull %23)\n br label LBL_8\n LBL_8:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i8* %1, { 2, 0, 1 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_6, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_postdec_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_7\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n %10 = call i32 @atoi(i8* nonnull %5)\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_7\n LBL_6:\n %11 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %12 = call i64 @FUNC()\n %13 = trunc i64 %12 to i32\n %14 = icmp eq i32 %13, 0\n %15 = icmp eq i32 %sv_0.0.reload, -2147483648\n br i1 %14, label LBL_11, label LBL_8\n LBL_8:\n br i1 %15, label LBL_10, label LBL_9\n LBL_9:\n %16 = add i32 %sv_0.0.reload, -1\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n br label LBL_14\n LBL_10:\n %19 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_14\n LBL_11:\n br i1 %15, label LBL_13, label LBL_12\n LBL_12:\n %20 = add i32 %sv_0.0.reload, -1\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n br label LBL_14\n LBL_13:\n %23 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_14\n LBL_14:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %15, { 1, 0 }\n uselistorder i32 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i1 %7, { 1, 0 }\n uselistorder i8* %5, { 1, 0, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 4, 3, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32*\n %rax.0.reg2mem = alloca i64\n %1 = load i32*, i32** %0\n %2 = load i32, i32* inttoptr (i64 8372 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i32* %1, null\n %5 = or i1 %4, %3\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = load i32, i32* %1, align 4\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_0 to i64))\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_execlp_01-bad", "fun_name": "CWE78_OS_Command_Injection__char_file_execlp_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = sub i32 100, %2\n %10 = add i64 %3, %8\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %9, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n %17 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_no_init_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_4:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %7 = mul i64 %indvars.iv5.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv5.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_5, label LBL_4\n LBL_5:\n %11 = load i32, i32* @gv_2, align 4\n %12 = icmp eq i32 %11, 0\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 0, i64* %rax.1.reg2mem\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 4\n %14 = add i64 %13, %3\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %18, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE170_char_strncpy_14-bad", "fun_name": "CWE126_Buffer_Overread__CWE170_char_strncpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 149)\n %5 = bitcast i64* %sv_1 to i8*\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* nonnull %5, i8* nonnull %6, i32 99)\n %8 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_16-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_16_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0479.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_3 to %sockaddr*\n %7 = call i32 @bind(i32 %2, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call i32 @listen(i32 %2, i32 5)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = call i32 @accept(i32 %2, %sockaddr* null, i32* null)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_4\n LBL_4:\n %13 = call i32 @recv(i32 %11, i64* nonnull %sv_2, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_2 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %2)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n %23 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.0479.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %24 = call i32 @close(i32 %2)\n %25 = call i32 @close(i32 %11)\n store i64 0, i64* %sv_2, align 8\n %26 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %27 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0479.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %sv_0.0479.reload = load i32, i32* %sv_0.0479.reg2mem\n %28 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.0479.reload)\n %29 = sext i32 %sv_0.0479.reload to i64\n %30 = add i64 %0, -112\n %31 = add i64 %30, %29\n %32 = inttoptr i64 %31 to i8*\n store i8 0, i8* %32, align 1\n br label LBL_10\n LBL_10:\n %33 = call i64 @FUNC(i64* nonnull %sv_2)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %1, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0479.reload, { 1, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %2, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 1, 2, 5, 0, 3, 4 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2, 3 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_sub_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n %32 = add i32 %sv_0.1.reload, -1\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_13\n LBL_12:\n %35 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n br label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_square_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 32, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %11 = icmp eq i32 %.reload, 5\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = trunc i32 %sv_0.0.reload to i8\n %14 = sub i8 0, %13\n %15 = icmp slt i8 %14, 0\n %16 = icmp eq i1 %15, false\n %17 = zext i8 %14 to i32\n %18 = select i1 %16, i32 %17, i32 %sv_0.0.reload\n %19 = trunc i32 %18 to i8\n %20 = icmp ult i8 %19, 12\n br i1 %20, label LBL_5, label LBL_6\n LBL_5:\n %21 = urem i32 %sv_0.0.reload, 256\n %narrow = mul i32 %sv_0.0.reload, 16777216\n %sext2 = mul i32 %narrow, %21\n %22 = ashr exact i32 %sext2, 24\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n store i64 %24, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %25, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 3, 2, 0, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_rand_postdec_12-bad", "fun_name": "CWE191_Integer_Underflow__unsigned_int_rand_postdec_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 -2, i32* %storemerge1.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i32, i32* %storemerge1.reg2mem\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = add i32 %storemerge1.reload, -1\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %20 = icmp eq i32 %storemerge1.reload, 0\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n %21 = add i32 %storemerge1.reload, -1\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %24, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32* %storemerge1.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fscanf_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n store i32 %5, i32* %sv_0, align 4\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n %14 = load i32, i32* %sv_0, align 4\n %15 = call i128 @__asm_movss.1(i32 %14)\n %16 = call i128 @__asm_movss.1(i32 2147483647)\n %17 = call i128 @FUNC(i128 %15, i128 %16)\n %18 = call i128 @FUNC(i128 %17)\n %19 = load i128, i128* @gv_2, align 8\n call void @FUNC(i128 %18, i128 %19)\n %20 = load i32, i32* %sv_0, align 4\n %21 = call i128 @__asm_movss.1(i32 %20)\n %22 = call i128 @FUNC(i128 %16, i128 %16)\n %23 = call i128 @FUNC(i128 %21)\n %24 = call i128 @FUNC(i64 4636737291354636288)\n %25 = call i128 @FUNC(i128 %24, i128 %23)\n %26 = call i32 @FUNC(i128 %25)\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_4\n LBL_4:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %2, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %16, { 1, 0, 2 }\n uselistorder i32* %sv_0, { 3, 2, 0, 1 }\n uselistorder i128* @gv_2, { 1, 0 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_square_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = call i64 @FUNC()\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = load i8, i8* %sv_0, align 1\n %8 = sub i8 0, %7\n %9 = icmp slt i8 %8, 0\n %10 = icmp eq i1 %9, false\n %.v1 = select i1 %10, i8 %8, i8 %7\n %11 = icmp ult i8 %.v1, 12\n br i1 %6, label LBL_4, label LBL_1\n LBL_1:\n br i1 %11, label LBL_2, label LBL_3\n LBL_2:\n %12 = mul i8 %7, %7\n %13 = sext i8 %12 to i64\n %14 = and i64 %13, 4294967295\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_7\n LBL_3:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n br i1 %11, label LBL_5, label LBL_6\n LBL_5:\n %17 = mul i8 %7, %7\n %18 = sext i8 %17 to i64\n %19 = and i64 %18, 4294967295\n %20 = call i64 @FUNC(i64 %19)\n br label LBL_7\n LBL_6:\n %21 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_7:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %11, { 1, 0 }\n uselistorder i8 %7, { 3, 2, 1, 0, 4, 5 }\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE464_Addition_of_Data_Structure_Sentinel__basic_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n store i8 120, i8* %sv_0, align 1\n %4 = ptrtoint i8* %sv_0 to i64\n %5 = call i64 @FUNC(i64 %4)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_square_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i128, align 8\n %0 = call i64 @FUNC(i64 40)\n store i128 0, i128* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i128* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n %10 = load i128, i128* %sv_0, align 8\n %11 = trunc i128 %10 to i64\n %.off = add i64 %11, 3037000499\n %12 = icmp ugt i64 %.off, 6074000998\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 0)\n br label LBL_7\n LBL_6:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128* %sv_0, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE367_TOC_TOU__stat_08-bad", "fun_name": "CWE367_TOC_TOU__stat_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8, align 1\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n store i8 0, i8* %sv_1, align 1\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i8* @fgets(i8* nonnull %sv_1, i32 100, %_IO_FILE* %4)\n %6 = icmp eq i8* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %sv_1, align 1\n br label LBL_5\n LBL_3:\n %.pr = load i8, i8* %sv_1, align 1\n %9 = icmp eq i8 %.pr, 0\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = ptrtoint i64* %sv_2 to i64\n %11 = call i32 @strlen(i8* nonnull %sv_1)\n %12 = sext i32 %11 to i64\n %13 = add i64 %10, -113\n %14 = add i64 %13, %12\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n br label LBL_5\n LBL_5:\n %16 = bitcast i64* %sv_0 to %stat*\n %17 = call i32 @stat(i8* nonnull %sv_1, %stat* nonnull %16)\n %18 = icmp eq i32 %17, -1\n %19 = icmp eq i1 %18, false\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 1)\n unreachable\n LBL_7:\n %20 = call i32 (i8*, i32, ...) @open(i8* nonnull %sv_1, i32 2)\n %21 = icmp eq i32 %20, -1\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 1)\n unreachable\n LBL_9:\n %23 = call i32 @write(i32 %20, i64* bitcast ([12 x i8]* @gv_2 to i64*), i32 11)\n %24 = icmp eq i32 %23, -1\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_11, label LBL_10\n LBL_10:\n call void @exit(i32 1)\n unreachable\n LBL_11:\n %26 = call i32 @close(i32 %20)\n br label LBL_12\n LBL_12:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_1, { 6, 5, 4, 0, 2, 3, 1 }\n uselistorder void (i32)* @exit, { 2, 1, 0, 3 }\n uselistorder i8 0, { 3, 4, 0, 1, 5, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_ncpy_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = bitcast i64* %1 to i8*\n store i8* %2, i8** %sv_1, align 8\n %3 = icmp eq i64* %1, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i8*, i8** %sv_1, align 8\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i32 @strlen(i8* nonnull %11)\n %13 = call i8* @strncpy(i8* nonnull %11, i8* %9, i32 %12)\n %14 = ptrtoint i64* %sv_0 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 0, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_08-bad", "fun_name": "CWE401_Memory_Leak__int_calloc_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @calloc(i32 100, i32 4)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = call i64 @FUNC(i64 5)\n br label LBL_4\n LBL_4:\n %8 = call i64 @FUNC()\n ret i64 %8\n\n uselistorder i64* %3, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %2 = load i32, i32* %0\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n store i64 1, i64* %sv_1.0.reg2mem\n store i64 2, i64* %sv_0.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %phitmp = zext i32 %2 to i64\n %phitmp1 = zext i32 %1 to i64\n store i64 %phitmp, i64* %sv_1.0.reg2mem\n store i64 %phitmp1, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %7 = call i64 @FUNC()\n %8 = trunc i64 %7 to i32\n %9 = icmp eq i32 %8, 0\n store i64 %7, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %sv_1.0.reload = load i64, i64* %sv_1.0.reg2mem\n %10 = call i64 @FUNC(i64 %sv_1.0.reload)\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i32* %0, { 1, 0 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_printf_04-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_printf_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder label LBL_6, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_fwrite_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_4:\n %9 = load i32, i32* %sv_0, align 4\n %.off = add i32 %9, -1\n %10 = icmp ugt i32 %.off, 19\n br i1 %10, label LBL_12, label LBL_5\n LBL_5:\n %11 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_5, i64 0, i64 0))\n %12 = icmp eq %_IO_FILE* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_6, label LBL_7\n LBL_6:\n %14 = load i32, i32* %sv_0, align 4\n %15 = icmp eq i32 %14, 0\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %15, label LBL_11, label LBL_8\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %16 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_6 to i64*), i32 1, i32 50, %_IO_FILE* %11)\n %17 = icmp eq i32 %16, 50\n br i1 %17, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 1)\n unreachable\n LBL_10:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %18 = add nuw i64 %storemerge4.reload, 1\n %19 = load i32, i32* %sv_0, align 4\n %20 = sext i32 %19 to i64\n %21 = icmp ult i64 %18, %20\n store i64 %18, i64* %storemerge4.reg2mem\n br i1 %21, label LBL_8, label LBL_11\n LBL_11:\n %22 = call i32 @fclose(%_IO_FILE* nonnull %11)\n br label LBL_12\n LBL_12:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %11, { 1, 0, 2 }\n uselistorder i32* %sv_0, { 2, 0, 3, 1, 4 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_sleep_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_11\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %27 = icmp slt i32 %sv_0.1.reload, 1\n %28 = icmp sgt i32 %sv_0.1.reload, ptrtoint (i1* @gv_2 to i32)\n %or.cond3 = or i1 %27, %28\n br i1 %or.cond3, label LBL_10, label LBL_9\n LBL_9:\n %29 = call i32 @usleep(i32 %sv_0.1.reload)\n %30 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_3 to i64))\n br label LBL_11\n LBL_10:\n %31 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_4 to i64))\n br label LBL_11\n LBL_11:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_snprintf_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 49)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %13, i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* %1)\n %15 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 2, 6, 3, 4, 0, 5 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_listen_socket_execlp_01-bad", "fun_name": "CWE78_OS_Command_Injection__char_listen_socket_execlp_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = sext i32 %2 to i64\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = add i64 %14, %15\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n %32 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0))\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memcpy_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = add i64 %0, -161\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = inttoptr i64 %5 to i64*\n %11 = call i64* @memset(i64* %10, i32 65, i32 99)\n %12 = add i64 %5, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i32 @strlen(i8* nonnull %15)\n %17 = call i64* @memcpy(i64* nonnull %sv_0, i64* %10, i32 %16)\n %18 = call i64 @FUNC(i64* nonnull %sv_0)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 5, 4, 3, 2, 1, 0, 6 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_sub_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_4:\n %9 = load i16, i16* %sv_0, align 2\n %10 = icmp eq i16 %9, -32768\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = add i16 %9, -1\n %12 = sext i16 %11 to i64\n %13 = and i64 %12, 4294967295\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_7\n LBL_6:\n %15 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_7:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE459_Incomplete_Cleanup__char_17-bad", "fun_name": "CWE459_Incomplete_Cleanup__char_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_0 to i8*\n store i64 6365935209751535970, i64* %sv_0, align 8\n %2 = call i32 @mkstemp(i8* nonnull %1)\n %3 = icmp eq i32 %2, -1\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call %_IO_FILE* @fdopen(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_0, i64 0, i64 0))\n %5 = icmp eq %_IO_FILE* %4, null\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = call i32 @fwrite(i64* bitcast ([15 x i8]* @gv_1 to i64*), i32 1, i32 14, %_IO_FILE* nonnull %4)\n %7 = call i32 @fclose(%_IO_FILE* nonnull %4)\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %4, { 1, 0, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder label LBL_3, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_postdec_10-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %22 = load i32, i32* @gv_2, align 4\n %23 = icmp eq i32 %22, 0\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_11\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %25 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n %26 = add i32 %sv_0.1.reload, -1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_11\n LBL_10:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_11\n LBL_11:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 11)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = sext i32 %6 to i64\n %8 = add nsw i64 %7, 1\n %9 = icmp eq i64 %8, 0\n br i1 %9, label LBL_5, label LBL_3\n LBL_3:\n %10 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = add i64 %storemerge1.reload, %4\n %12 = add i64 %storemerge1.reload, %10\n %13 = inttoptr i64 %12 to i8*\n %14 = load i8, i8* %13, align 1\n %15 = inttoptr i64 %11 to i8*\n store i8 %14, i8* %15, align 1\n %16 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %16, %8\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %17 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__malloc_realloc_char_14-bad", "fun_name": "CWE401_Memory_Leak__malloc_realloc_char_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n store i64 7453010373643542593, i64* %4, align 8\n %8 = add i64 %7, 8\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %7)\n %11 = call i64* @realloc(i64* %4, i32 130000)\n %12 = ptrtoint i64* %11 to i64\n %13 = icmp eq i64* %11, null\n store i64 %12, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n store i64 7598263421703251278, i64* %11, align 8\n %14 = add i64 %12, 8\n %15 = inttoptr i64 %14 to i16*\n store i16 26478, i16* %15, align 2\n %16 = add i64 %12, 10\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i64 @FUNC(i64 %12)\n call void @free(i64* nonnull %11)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %12, { 1, 2, 3, 0 }\n uselistorder i64* %4, { 0, 1, 3, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %5 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %6 = ptrtoint i64* %5 to i64\n %7 = icmp eq i64* %5, null\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %sv_0.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %9 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %10 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %10, i64 0, i64 100)\n %11 = add i64 %9, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %12 = mul i64 %storemerge1.reload, 8\n %13 = add i64 %12, %sv_0.0.reload\n %14 = add i64 %11, %12\n %15 = inttoptr i64 %14 to i64*\n %16 = load i64, i64* %15, align 8\n %17 = inttoptr i64 %13 to i64*\n store i64 %16, i64* %17, align 8\n %18 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %19 = inttoptr i64 %sv_0.0.reload to i64*\n %20 = load i64, i64* %19, align 8\n %21 = call i64 @FUNC(i64 %20)\n call void @free(i64* %19)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 8\n %10 = add i64 %9, %8\n %11 = add i64 %10, -816\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 8\n %13 = add i64 %10, -812\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %16 = inttoptr i64 %sv_0.0.reload to i64*\n %17 = call i64* @memcpy(i64* %16, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %18 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %16)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 ptrtoint (i32* @gv_1 to i32), { 0, 1, 3, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_multiply_14-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_rand_multiply_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = load i32, i32* @gv_0, align 4\n %4 = zext i32 %3 to i64\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %5 = call i32 @rand()\n %6 = urem i32 %5, 2\n %7 = icmp eq i32 %6, 0\n %8 = call i32 @rand()\n %9 = zext i32 %8 to i64\n %10 = mul i64 %9, 1152921504606846976\n %11 = call i32 @rand()\n %12 = zext i32 %11 to i64\n %13 = mul i64 %12, 35184372088832\n %14 = call i32 @rand()\n %15 = sext i32 %14 to i64\n %16 = mul i64 %15, 1073741824\n %17 = call i32 @rand()\n %18 = sext i32 %17 to i64\n %19 = mul i64 %18, 32768\n %20 = call i32 @rand()\n %21 = sext i32 %20 to i64\n %22 = sext i1 %7 to i64\n %23 = xor i64 %10, %22\n %24 = xor i64 %23, %13\n %25 = xor i64 %24, %16\n %26 = xor i64 %25, %19\n %storemerge = xor i64 %26, %21\n %27 = load i32, i32* @gv_0, align 4\n %28 = zext i32 %27 to i64\n %29 = icmp eq i32 %27, 5\n %30 = icmp eq i1 %29, false\n %31 = icmp slt i64 %storemerge, 1\n %or.cond = or i1 %30, %31\n store i64 %28, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %32 = mul i64 %storemerge, 2\n %33 = call i64 @FUNC(i64 %32)\n store i64 %33, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %5)\n %7 = ptrtoint i8* %sv_0.0.reload to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__malloc_realloc_struct_twoIntsStruct_01-bad", "fun_name": "CWE401_Memory_Leak__malloc_realloc_struct_twoIntsStruct_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = bitcast i64* %0 to i32*\n store i32 0, i32* %4, align 4\n %5 = add i64 %3, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %7 = call i64 @FUNC(i64 %3)\n %8 = call i64* @realloc(i64* %0, i32 1040000)\n %9 = ptrtoint i64* %8 to i64\n %10 = icmp eq i64* %8, null\n store i64 %9, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = bitcast i64* %8 to i32*\n store i32 1, i32* %11, align 4\n %12 = add i64 %9, 4\n %13 = inttoptr i64 %12 to i32*\n store i32 1, i32* %13, align 4\n %14 = call i64 @FUNC(i64 %9)\n call void @free(i64* nonnull %8)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %9, { 1, 2, 0 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_fprintf_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_12, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_1 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %6, label LBL_12, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_0 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_10, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_10, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_10, label LBL_5\n LBL_5:\n %16 = sext i32 %4 to i64\n %17 = ptrtoint i64* %sv_1 to i64\n %18 = add i64 %16, %17\n %19 = inttoptr i64 %18 to i64*\n %20 = sub i32 99, %4\n %21 = call i32 @recv(i32 %14, i64* %19, i32 %20, i32 0)\n %22 = add i32 %21, 1\n %23 = icmp ult i32 %22, 2\n br i1 %23, label LBL_11, label LBL_6\n LBL_6:\n %24 = sext i32 %21 to i64\n %25 = add i64 %18, %24\n %26 = inttoptr i64 %25 to i8*\n store i8 0, i8* %26, align 1\n %27 = call i8* @strchr(i8* nonnull %3, i32 13)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %27, align 1\n br label LBL_8\n LBL_8:\n %29 = call i8* @strchr(i8* nonnull %3, i32 10)\n %30 = icmp eq i8* %29, null\n br i1 %30, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %29, align 1\n br label LBL_11\n LBL_10:\n %31 = call i32 @close(i32 %5)\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %5)\n %33 = call i32 @close(i32 %14)\n br label LBL_12\n LBL_12:\n %34 = load i32, i32* @gv_1, align 4\n %35 = icmp eq i32 %34, 0\n br i1 %35, label LBL_14, label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_15\n LBL_14:\n %37 = load %_IO_FILE*, %_IO_FILE** @gv_3, align 8\n %38 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n br label LBL_15\n LBL_15:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %21, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_add_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp eq i16 %3, 32767\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = zext i16 %3 to i32\n %6 = mul i32 %5, 65536\n %sext = add i32 %6, 65536\n %7 = ashr exact i32 %sext, 16\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 65536, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE404_Improper_Resource_Shutdown__open_fclose_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = load i32, i32* @gv_1, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 0\n %4 = icmp eq i32 %0, -1\n %or.cond = or i1 %4, %3\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @close(i32 %0)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_bind_accept_13-bad", "fun_name": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_bind_accept_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_13, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = call i32 @listen(i32 %6, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_10, label LBL_3\n LBL_3:\n %12 = bitcast i64* %sv_0 to %sockaddr*\n %13 = call i32 @bind(i32 %6, %sockaddr* nonnull %12, i32 16)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sub i32 99, %5\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = sext i32 %5 to i64\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i64*\n %22 = call i32 @recv(i32 %15, i64* %21, i32 %17, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = ptrtoint i64* %sv_2 to i64\n %26 = sext i32 %22 to i64\n %27 = add i64 %25, -112\n %28 = add i64 %27, %26\n %29 = inttoptr i64 %28 to i8*\n store i8 0, i8* %29, align 1\n %30 = call i8* @strchr(i8* nonnull %4, i32 13)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %30, align 1\n br label LBL_8\n LBL_8:\n %32 = call i8* @strchr(i8* nonnull %4, i32 10)\n %33 = icmp eq i8* %32, null\n br i1 %33, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %32, align 1\n br label LBL_11\n LBL_10:\n %34 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %35 = call i32 @close(i32 %6)\n %36 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %37 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_13\n LBL_13:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_square_12-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_fscanf_square_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i128, align 8\n %0 = call i64 @FUNC(i64 40)\n store i128 0, i128* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i128* nonnull %sv_0)\n br label LBL_3\n LBL_2:\n store i128 2, i128* %sv_0, align 8\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = call i64 @FUNC(i64 0)\n br label LBL_8\n LBL_5:\n %10 = load i128, i128* %sv_0, align 8\n %11 = trunc i128 %10 to i64\n %.off = add i64 %11, 3037000499\n %12 = icmp ugt i64 %.off, 6074000998\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n %13 = call i64 @FUNC(i64 0)\n br label LBL_8\n LBL_7:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128* %sv_0, { 3, 2, 0, 1 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_fwrite_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_10, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_10, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %.off = add i32 %6, -1\n %7 = icmp ugt i32 %.off, 19\n br i1 %7, label LBL_10, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_4, label LBL_5\n LBL_4:\n %11 = load i32, i32* %sv_0, align 4\n %12 = icmp eq i32 %11, 0\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %12, label LBL_9, label LBL_6\n LBL_5:\n call void @exit(i32 1)\n unreachable\n LBL_6:\n %13 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_5 to i64*), i32 1, i32 50, %_IO_FILE* %8)\n %14 = icmp eq i32 %13, 50\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %15 = add nuw i64 %storemerge4.reload, 1\n %16 = load i32, i32* %sv_0, align 4\n %17 = sext i32 %16 to i64\n %18 = icmp ult i64 %15, %17\n store i64 %15, i64* %storemerge4.reg2mem\n br i1 %18, label LBL_6, label LBL_9\n LBL_9:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_10\n LBL_10:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %8, { 1, 0, 2 }\n uselistorder i32* %sv_0, { 2, 0, 3, 1, 4 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32 -1, { 0, 2, 1, 3 }\n uselistorder label LBL_10, { 1, 2, 3, 0 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 2)\n ret i64 %0\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_loop_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %4\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge1.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %16 = call i64 @FUNC(i64* nonnull %sv_0)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_system_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_0 to i8*\n %2 = ptrtoint i64* %sv_0 to i64\n store i64 7955998172649846063, i64* %sv_0, align 8\n %3 = add i64 %2, 8\n %4 = inttoptr i64 %3 to i64*\n store i64 27422013814697007, i64* %4, align 8\n %5 = call i32 @system(i8* nonnull %1)\n %6 = icmp eq i32 %5, 0\n %7 = icmp slt i32 %5, 0\n %8 = icmp eq i1 %7, false\n %9 = icmp eq i1 %6, false\n %10 = icmp eq i1 %8, %9\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 2)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__malloc_realloc_int64_t_01-bad", "fun_name": "CWE401_Memory_Leak__malloc_realloc_int64_t_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 5, i64* %0, align 8\n %3 = call i64 @FUNC(i64 5)\n %4 = call i64* @realloc(i64* %0, i32 1040000)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n store i64 10, i64* %4, align 8\n %7 = call i64 @FUNC(i64 10)\n call void @free(i64* nonnull %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_max_multiply_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n ret i64 %2\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_realloc_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = load i32, i32* @gv_0, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n %5 = icmp eq i64* %0, null\n %or.cond = or i1 %5, %4\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 1, 3, 2, 4, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_postinc_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0368.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.0368.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.0368.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp eq i32 %sv_0.0.ph.reload, 2147483647\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0368.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.0368.reload = load i32, i32* %sv_0.0368.reg2mem\n %26 = add i32 %sv_0.0368.reload, 1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0368.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_1, align 8\n br label LBL_3\n LBL_3:\n %7 = ptrtoint i64* %sv_2 to i64\n %8 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = add i64 %7, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = mul i64 %storemerge1.reload, 8\n %11 = load i64, i64* %sv_1, align 8\n %12 = add i64 %11, %10\n %13 = add i64 %9, %10\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = inttoptr i64 %12 to i64*\n store i64 %15, i64* %16, align 8\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %18 = load i64, i64* %sv_1, align 8\n %19 = inttoptr i64 %18 to i64*\n %20 = load i64, i64* %19, align 8\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_sub_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 4294967293)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printUnsignedLine, { 3, 2, 1, 0 }\n uselistorder i64 4294967293, { 1, 0 }\n uselistorder i32* @gv_0, { 5, 0, 4, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_multiply_13-bad", "fun_name": "CWE191_Integer_Underflow__int_rand_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n %14 = icmp slt i32 %storemerge.in, 0\n %15 = icmp eq i1 %14, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %15, label LBL_3, label LBL_2\n LBL_2:\n %16 = mul i32 %storemerge.in, 2\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 5, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 -4, i64 28\n %6 = call i64* @malloc(i32 40)\n %7 = ptrtoint i64* %6 to i64\n %8 = icmp eq i64* %6, null\n %9 = icmp eq i1 %8, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %9, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %10 = mul i64 %indvars.iv5.reload, 4\n %11 = add i64 %10, %7\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n br i1 %5, label LBL_7, label LBL_5\n LBL_5:\n %13 = add i64 %spec.select, %7\n %14 = inttoptr i64 %13 to i32*\n store i32 1, i32* %14, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_6\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %15 = mul i64 %indvars.iv.reload, 4\n %16 = add i64 %15, %7\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_6\n LBL_7:\n %21 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_8\n LBL_8:\n call void @free(i64* %6)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0, 2 }\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 4, 5 }\n uselistorder void (i32)* @exit, { 0, 2, 3, 1, 4 }\n uselistorder i32 -1, { 1, 2, 0, 3, 4 }\n uselistorder i64* (i32)* @malloc, { 0, 2, 3, 1, 4 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__negative_memcpy_12-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__negative_memcpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %. = select i1 %3, i32 99, i32 -1\n store i64 0, i64* %sv_1, align 8\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %5 = trunc i32 %. to i16\n %6 = icmp sgt i16 %5, 99\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = ptrtoint i64* %sv_2 to i64\n %8 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %.)\n %9 = sext i32 %. to i64\n %10 = add i64 %7, -112\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n br label LBL_2\n LBL_2:\n %13 = call i64 @FUNC(i64* nonnull %sv_1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %., { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_max_square_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 0)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_listen_socket_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_13, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_3 to i64\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = sext i32 %15 to i64\n %19 = add i64 %3, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %4)\n %26 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_9:\n %.pr = load i32, i32* @gv_0, align 4\n %27 = icmp eq i32 %.pr, 0\n br i1 %27, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n store i64 0, i64* %sv_2, align 8\n %28 = icmp ugt i32 %sv_0.1.ph.reload, 9\n br i1 %28, label LBL_12, label LBL_11\n LBL_11:\n %29 = sext i32 %sv_0.1.ph.reload to i64\n %30 = mul i64 %29, 4\n %31 = add i64 %3, -64\n %32 = add i64 %31, %30\n %33 = inttoptr i64 %32 to i32*\n %34 = load i32, i32* %33, align 4\n %35 = zext i32 %34 to i64\n %36 = call i64 @FUNC(i64 %35)\n br label LBL_13\n LBL_12:\n %37 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_13\n LBL_13:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 2, 7, 8, 9, 0, 10, 4, 6, 11, 12, 13, 3, 14, 5 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_13, { 1, 2, 3, 0 }\n uselistorder label LBL_9, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_loop_05-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_loop_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 200)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 50)\n %9 = add i64 %7, -416\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = mul i64 %storemerge1.reload, 4\n %11 = add i64 %10, %sv_0.0.reload\n %12 = add i64 %9, %10\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = inttoptr i64 %11 to i32*\n store i32 %14, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %17 = inttoptr i64 %sv_0.0.reload to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %21)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %6, i64 %1, i64 %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = inttoptr i64 %spec.select to i64*\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* %9, i32 100)\n %11 = ptrtoint i64* %sv_0 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %2, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 0, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cpy_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i8*\n store i8 0, i8* %6, align 1\n store i8* %6, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %8)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %12)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int64_t_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 5)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_31-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge5.reg2mem = alloca i64\n %storemerge6.reg2mem = alloca i64\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = ptrtoint i64* %0 to i64\n %20 = load i8, i8* %3, align 1\n %21 = icmp eq i8 %20, 0\n %22 = icmp eq i1 %21, false\n store i8 %20, i8* %.reg2mem\n store i64 %19, i64* %storemerge6.reg2mem\n store i64 %19, i64* %storemerge5.reg2mem\n br i1 %22, label LBL_8, label LBL_11\n LBL_8:\n %storemerge6.reload = load i64, i64* %storemerge6.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %23 = icmp eq i8 %.reload, 83\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_10, label LBL_9\n LBL_9:\n %25 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n store i64 %storemerge6.reload, i64* %storemerge5.reg2mem\n br label LBL_11\n LBL_10:\n %26 = add i64 %storemerge6.reload, 1\n %27 = inttoptr i64 %26 to i8*\n %28 = load i8, i8* %27, align 1\n %29 = icmp eq i8 %28, 0\n %30 = icmp eq i1 %29, false\n store i8 %28, i8* %.reg2mem\n store i64 %26, i64* %storemerge6.reg2mem\n store i64 %26, i64* %storemerge5.reg2mem\n br i1 %30, label LBL_8, label LBL_11\n LBL_11:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %31 = inttoptr i64 %storemerge5.reload to i64*\n call void @free(i64* %31)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %storemerge6.reload, { 1, 0 }\n uselistorder i8* %3, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge5.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4 }\n uselistorder label LBL_11, { 0, 2, 1 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_04-bad", "fun_name": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_9, label LBL_2\n LBL_2:\n %9 = call i32 @listen(i32 %3, i32 5)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_10, label LBL_3\n LBL_3:\n %11 = bitcast i64* %sv_0 to %sockaddr*\n %12 = call i32 @bind(i32 %3, %sockaddr* nonnull %11, i32 16)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_10, label LBL_4\n LBL_4:\n %14 = sub i32 99, %2\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = sext i32 %2 to i64\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i64*\n %19 = call i32 @recv(i32 %7, i64* %18, i32 %14, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = ptrtoint i64* %sv_2 to i64\n %23 = sext i32 %19 to i64\n %24 = add i64 %22, -112\n %25 = add i64 %24, %23\n %26 = inttoptr i64 %25 to i8*\n store i8 0, i8* %26, align 1\n %27 = call i8* @strchr(i8* nonnull %1, i32 13)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %27, align 1\n br label LBL_7\n LBL_7:\n %29 = call i8* @strchr(i8* nonnull %1, i32 10)\n %30 = icmp eq i8* %29, null\n br i1 %30, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %29, align 1\n br label LBL_10\n LBL_9:\n %31 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %3)\n %33 = call i32 @close(i32 %7)\n br label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64* nonnull %sv_1)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 0, 4, 1, 2, 3, 5 }\n uselistorder i32 %2, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n uselistorder label LBL_10, { 2, 1, 0, 4, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_02-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv4.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = call i64* @malloc(i32 40)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv4.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %7 = mul i64 %indvars.iv4.reload, 4\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 10\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n br i1 %exitcond6, label LBL_3, label LBL_2\n LBL_3:\n %10 = load i32, i32* %sv_0, align 4\n %11 = icmp slt i32 %10, 0\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = sext i32 %10 to i64\n %13 = mul i64 %12, 4\n %14 = add i64 %13, %4\n %15 = inttoptr i64 %14 to i32*\n store i32 1, i32* %15, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %16 = mul i64 %indvars.iv.reload, 4\n %17 = add i64 %16, %4\n %18 = inttoptr i64 %17 to i32*\n %19 = load i32, i32* %18, align 4\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_5\n LBL_6:\n %22 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_7:\n call void @free(i64* %3)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_no_init_05-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_no_init_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 0, i64* %rax.1.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %6 = mul i64 %indvars.iv.reload, 8\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n %9 = load i32, i32* %8, align 4\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = add i64 %7, 4\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %16, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_alloca_no_init_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.19.reg2mem = alloca i128\n %xmm0.07.reg2mem = alloca i128\n %indvars.iv10.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = ptrtoint i32* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n store i32 0, i32* %sv_0, align 4\n br label LBL_3\n LBL_1:\n %xmm0.07.reload = load i128, i128* %xmm0.07.reg2mem\n %indvars.iv10.reload = load i64, i64* %indvars.iv10.reg2mem\n %4 = mul i64 %indvars.iv10.reload, 8\n %5 = add i64 %4, %3\n %6 = call i128 @FUNC(i128 %xmm0.07.reload, i128 %xmm0.07.reload)\n %7 = trunc i64 %indvars.iv10.reload to i32\n %8 = call i128 @FUNC(i32 %7)\n %9 = call i64 @FUNC(i128 %8)\n %10 = inttoptr i64 %5 to i64*\n store i64 %9, i64* %10, align 8\n %indvars.iv.next11 = add nuw nsw i64 %indvars.iv10.reload, 1\n %exitcond12 = icmp eq i64 %indvars.iv.next11, 10\n store i64 %indvars.iv.next11, i64* %indvars.iv10.reg2mem\n store i128 %8, i128* %xmm0.07.reg2mem\n br i1 %exitcond12, label LBL_2, label LBL_1\n LBL_2:\n %11 = load i32, i32* %sv_0, align 4\n %12 = add i32 %11, 1\n store i32 %12, i32* %sv_0, align 4\n %13 = icmp slt i32 %12, 1\n store i128 %8, i128* %xmm0.19.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %13, label LBL_3, label LBL_4\n LBL_3:\n %xmm0.19.reload = load i128, i128* %xmm0.19.reg2mem\n store i64 0, i64* %indvars.iv10.reg2mem\n store i128 %xmm0.19.reload, i128* %xmm0.07.reg2mem\n br label LBL_1\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 8\n %15 = add i64 %14, %3\n %16 = inttoptr i64 %15 to i64*\n %17 = load i64, i64* %16, align 8\n %18 = call i128 @FUNC(i64 %17)\n %19 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %1, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i128 %xmm0.07.reload, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 3, 0, 2 }\n uselistorder i64* %indvars.iv10.reg2mem, { 2, 1, 0 }\n uselistorder i128* %xmm0.07.reg2mem, { 2, 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @printDoubleLine, { 1, 0 }\n uselistorder i64 10, { 1, 0, 2, 3 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int64_t_12-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__int64_t_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 5, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = ptrtoint i64* %sv_0 to i64\n %storemerge = select i1 %3, i64 %4, i64 0\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %8 = inttoptr i64 %storemerge to i64*\n %9 = load i64, i64* %8, align 8\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_2:\n %11 = icmp eq i64 %storemerge, 0\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = inttoptr i64 %storemerge to i64*\n %13 = load i64, i64* %12, align 8\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_5\n LBL_4:\n %15 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_0 to i64))\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge, { 2, 0, 1 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memmove_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -49\n %5 = and i64 %4, -16\n %6 = add i64 %2, -161\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %5 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %5, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = inttoptr i64 %7 to i64*\n %13 = call i64* @memset(i64* %12, i32 65, i32 99)\n %14 = add i64 %7, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC()\n %17 = trunc i64 %16 to i32\n %18 = icmp eq i32 %17, 0\n %spec.select = select i1 %18, i64 %1, i64 %7\n %19 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %20 = bitcast i64* %sv_0 to i8*\n %21 = call i32 @strlen(i8* nonnull %20)\n %22 = inttoptr i64 %spec.select to i64*\n %23 = call i64* @memmove(i64* nonnull %sv_0, i64* %22, i32 %21)\n %24 = ptrtoint i64* %sv_0 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %3, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 0, 2, 1 }\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 5, 4, 3, 2, 1, 0, 6 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memmove_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = call i64* @memmove(i64* nonnull %sv_0, i64* %1, i32 %10)\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fscanf_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = load i32, i32* %sv_0, align 4\n %9 = icmp ugt i32 %8, 9\n br i1 %9, label LBL_6, label LBL_4\n LBL_4:\n %10 = ptrtoint i64* %sv_1 to i64\n %11 = sext i32 %8 to i64\n %12 = mul i64 %11, 4\n %13 = add i64 %10, -48\n %14 = add i64 %12, %13\n %15 = inttoptr i64 %14 to i32*\n store i32 1, i32* %15, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %16 = mul i64 %indvars.iv.reload, 4\n %17 = add i64 %16, %13\n %18 = inttoptr i64 %17 to i32*\n %19 = load i32, i32* %18, align 4\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_5\n LBL_6:\n %22 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %8, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_7, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_char_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = select i1 %2, i64 4294967295, i64 122\n %4 = call i64 @FUNC(i64 %3)\n ret i64 %4\n\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n uselistorder i64 122, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_snprintf_07-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_file_snprintf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_1 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = load i32, i32* @gv_0, align 4\n %21 = icmp eq i32 %20, 5\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n store i64 0, i64* %sv_0, align 8\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %23, i32 99, i8* nonnull %1)\n %25 = ptrtoint i64* %sv_0 to i64\n %26 = call i64 @FUNC(i64 %25)\n br label LBL_8\n LBL_8:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_malloc_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n store i64 7453010373643542593, i64* %0, align 8\n %4 = add i64 %3, 8\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_01-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n %2 = icmp eq i32 %1, 0\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 40)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %8 = mul i64 %indvars.iv5.reload, 4\n %9 = add i64 %8, %5\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %11 = add i64 %5, 28\n %12 = inttoptr i64 %11 to i32*\n store i32 1, i32* %12, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 4\n %14 = add i64 %13, %5\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 5, 6, 0, 7, 1, 2, 8, 3, 4 }\n uselistorder i64* (i32)* @malloc, { 0, 2, 3, 1, 4 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_memmove_17-bad", "fun_name": "CWE124_Buffer_Underwrite__char_alloca_memmove_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %3, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = inttoptr i64 %8 to i64*\n %11 = call i64* @memmove(i64* nonnull %10, i64* nonnull %sv_0, i32 100)\n %12 = add i64 %3, 91\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %8)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 1, 3, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_1 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = sext i32 %2 to i64\n %15 = ptrtoint i64* %sv_2 to i64\n %16 = add i64 %14, %15\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n store i64 0, i64* %sv_0, align 8\n %32 = bitcast i64* %sv_0 to i8*\n %33 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %32, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_2)\n %34 = call i64 @FUNC(i64* nonnull %sv_0)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 99, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 11)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memcpy(i64* %11, i64* nonnull %sv_1, i32 %10)\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %11)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_ncpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n store i8* null, i8** %sv_2, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i8* null, i8** %.reg2mem\n br label LBL_5\n LBL_2:\n %5 = call i64* @malloc(i32 100)\n %6 = bitcast i64* %5 to i8*\n store i8* %6, i8** %sv_1, align 8\n %7 = icmp eq i64* %5, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %9 = call i64* @memset(i64* %5, i32 65, i32 99)\n %10 = ptrtoint i64* %5 to i64\n %11 = add i64 %10, 99\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = load i8*, i8** %sv_1, align 8\n %14 = ptrtoint i8* %13 to i64\n %15 = bitcast i8** %sv_2 to i64*\n store i64 %14, i64* %15, align 8\n store i8* %13, i8** %.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i8*, i8** %.reg2mem\n %16 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i8* @strncpy(i8* %.reload, i8* nonnull %17, i32 99)\n %19 = ptrtoint i8* %.reload to i64\n %20 = add i64 %19, 99\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = load i8*, i8** %sv_2, align 8\n %23 = ptrtoint i8* %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_2, { 2, 0, 1 }\n uselistorder i8** %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i32*, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i32** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i64 %0, -193\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i32*\n store i32* %7, i32** %sv_1, align 8\n br label LBL_3\n LBL_2:\n %8 = add i64 %0, -609\n %9 = and i64 %8, -16\n %10 = bitcast i32** %sv_1 to i64*\n store i64 %9, i64* %10, align 8\n br label LBL_3\n LBL_3:\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %12, i64 0, i64 50)\n %13 = add i64 %11, -416\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %14 = mul i64 %storemerge3.reload, 4\n %15 = load i32*, i32** %sv_1, align 8\n %16 = ptrtoint i32* %15 to i64\n %17 = add i64 %14, %16\n %18 = add i64 %13, %14\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = inttoptr i64 %17 to i32*\n store i32 %20, i32* %21, align 4\n %22 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %22, 100\n store i64 %22, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %23 = load i32*, i32** %sv_1, align 8\n %24 = load i32, i32* %23, align 4\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %1, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_1, { 4, 3, 0, 2, 1 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memcpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %6 = ptrtoint i64* %sv_2 to i64\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = load i64, i64* %8, align 8\n store i64 %9, i64* %sv_1, align 8\n %10 = ptrtoint i64* %sv_1 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_multiply_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge.in = xor i32 %9, %10\n %11 = icmp slt i32 %storemerge.in, 0\n %12 = icmp eq i1 %11, false\n store i64 1, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_1\n LBL_1:\n %13 = icmp slt i32 %storemerge.in, -1073741823\n br i1 %13, label LBL_3, label LBL_2\n LBL_2:\n %14 = mul i32 %storemerge.in, 2\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_max_square_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %6 = select i1 %5, i64 0, i64 4\n %7 = call i64 @FUNC(i64 %6)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_rand_17-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_rand_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv21.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = mul i32 %1, 1073741824\n %7 = mul i32 %2, 32768\n %8 = xor i32 %7, %6\n %9 = xor i32 %8, %3\n %10 = sext i1 %5 to i32\n %storemerge4.in.le = xor i32 %9, %10\n %11 = icmp slt i32 %storemerge4.in.le, 0\n %12 = sext i32 %storemerge4.in.le to i64\n %13 = mul i64 %12, 4\n %14 = call i64* @malloc(i32 40)\n %15 = ptrtoint i64* %14 to i64\n %16 = icmp eq i64* %14, null\n %17 = icmp eq i1 %16, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %17, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %18 = mul i64 %indvars.iv.reload, 4\n %19 = add i64 %18, %15\n %20 = inttoptr i64 %19 to i32*\n store i32 0, i32* %20, align 4\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %21 = add i64 %13, %15\n %22 = inttoptr i64 %21 to i32*\n store i32 1, i32* %22, align 4\n store i64 0, i64* %indvars.iv21.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv21.reload = load i64, i64* %indvars.iv21.reg2mem\n %23 = mul i64 %indvars.iv21.reload, 4\n %24 = add i64 %23, %15\n %25 = inttoptr i64 %24 to i32*\n %26 = load i32, i32* %25, align 4\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n %indvars.iv.next22 = add nuw nsw i64 %indvars.iv21.reload, 1\n %exitcond23 = icmp eq i64 %indvars.iv.next22, 10\n store i64 %indvars.iv.next22, i64* %indvars.iv21.reg2mem\n br i1 %exitcond23, label LBL_7, label LBL_5\n LBL_6:\n %29 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_7\n LBL_7:\n call void @free(i64* %14)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i32 %storemerge4.in.le, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv21.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq %_IO_FILE* %0, null\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %4, label LBL_5, label LBL_2\n LBL_2:\n %5 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_3:\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %4, label LBL_5, label LBL_4\n LBL_4:\n %7 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %8 = sext i32 %7 to i64\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %4, { 1, 0 }\n uselistorder i64 %1, { 1, 0, 2 }\n uselistorder %_IO_FILE* %0, { 1, 2, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 4, 1, 2 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_fwrite_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_11, label LBL_3\n LBL_3:\n %8 = load i32, i32* %sv_0, align 4\n %.off = add i32 %8, -1\n %9 = icmp ugt i32 %.off, 19\n br i1 %9, label LBL_11, label LBL_4\n LBL_4:\n %10 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0))\n %11 = icmp eq %_IO_FILE* %10, null\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_5, label LBL_6\n LBL_5:\n %13 = load i32, i32* %sv_0, align 4\n %14 = icmp eq i32 %13, 0\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %14, label LBL_10, label LBL_7\n LBL_6:\n call void @exit(i32 1)\n unreachable\n LBL_7:\n %15 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_5 to i64*), i32 1, i32 50, %_IO_FILE* %10)\n %16 = icmp eq i32 %15, 50\n br i1 %16, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 1)\n unreachable\n LBL_9:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %17 = add nuw i64 %storemerge4.reload, 1\n %18 = load i32, i32* %sv_0, align 4\n %19 = sext i32 %18 to i64\n %20 = icmp ult i64 %17, %19\n store i64 %17, i64* %storemerge4.reg2mem\n br i1 %20, label LBL_7, label LBL_10\n LBL_10:\n %21 = call i32 @fclose(%_IO_FILE* nonnull %10)\n br label LBL_11\n LBL_11:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %10, { 1, 0, 2 }\n uselistorder i32* %sv_0, { 2, 0, 3, 1, 4 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder i32 -1, { 0, 2, 1, 3 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE377_Insecure_Temporary_File__char_tempnam_08-bad", "fun_name": "CWE377_Insecure_Temporary_File__char_tempnam_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i8* @tempnam(i8* null, i8* null)\n %4 = icmp eq i8* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %6 = ptrtoint i8* %3 to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i32 (i8*, i32, ...) @open(i8* %3, i32 66)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([45 x i8]* @gv_0 to i64))\n %11 = call i32 @close(i32 %8)\n br label LBL_5\n LBL_5:\n %12 = bitcast i8* %3 to i64*\n call void @free(i64* %12)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %3, { 0, 2, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 20)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = bitcast i64* %4 to i32*\n store i32 1819043176, i32* %8, align 4\n %9 = add i64 %7, 4\n %10 = inttoptr i64 %9 to i16*\n store i16 111, i16* %10, align 2\n %11 = call i64 @FUNC(i64 %7)\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 0, 1, 4, 2, 3, 7, 5, 6 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_rand_postdec_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %14 = zext i32 %.reload to i64\n %15 = icmp eq i32 %.reload, 5\n %16 = icmp eq i1 %15, false\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %17 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = add i32 %sv_0.0.reload, -1\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %21 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_short_01-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_short_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i64 4294967295, i64* %sv_0.05.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i64 4294967295, i64* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i64 4294967295, i64* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -22\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n %phitmp = mul i32 %18, 65536\n %phitmp2 = ashr exact i32 %phitmp, 16\n %phitmp3 = zext i32 %phitmp2 to i64\n store i64 %phitmp3, i64* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i64, i64* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i64 %sv_0.0.ph.reload, i64* %sv_0.05.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.05.reload = load i64, i64* %sv_0.05.reg2mem\n %20 = call i64 @FUNC(i64 %sv_0.05.reload)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %sv_0.05.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_07-bad", "fun_name": "CWE415_Double_Free__malloc_free_int64_t_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %3)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %6 = zext i32 %.reload to i64\n %7 = icmp eq i32 %.reload, 5\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* null, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_rand_to_short_05-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_rand_to_short_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = urem i32 %2, 2\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @rand()\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = call i32 @rand()\n %9 = xor i32 %8, %7\n %10 = sext i1 %4 to i32\n %storemerge.in = xor i32 %9, %10\n %phitmp = mul i32 %storemerge.in, 65536\n %phitmp1 = ashr exact i32 %phitmp, 16\n %phitmp2 = zext i32 %phitmp1 to i64\n store i64 %phitmp2, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n ret i64 %11\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_sub_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_10, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %.pr = load i32, i32* @gv_0, align 4\n %22 = icmp eq i32 %.pr, 0\n br i1 %22, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %23 = icmp eq i32 %sv_0.1.ph.reload, -2147483648\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n %24 = add i32 %sv_0.1.ph.reload, -1\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n br label LBL_10\n LBL_9:\n %27 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 2, 3, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_cpy_34-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = inttoptr i64 %3 to i8*\n store i8* %8, i8** %sv_1, align 8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strcpy(i8* %8, i8* nonnull %10)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1 }\n uselistorder i8** %sv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n br label LBL_7\n LBL_2:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_16, label LBL_3\n LBL_3:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_16, label LBL_5\n LBL_4:\n %12 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n br label LBL_7\n LBL_5:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n %21 = icmp ugt i32 %19, 9\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n %22 = sext i32 %19 to i64\n %23 = mul i64 %22, 4\n %24 = add i64 %13, -64\n %25 = add i64 %24, %23\n %26 = inttoptr i64 %25 to i32*\n %27 = load i32, i32* %26, align 4\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_8\n LBL_7:\n %30 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_8\n LBL_8:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i64 %13, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 4, 0, 2, 5, 3, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_7, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = call i64 @FUNC()\n %30 = trunc i64 %29 to i32\n %31 = icmp eq i32 %30, 0\n br i1 %31, label LBL_16, label LBL_10\n LBL_10:\n %32 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %33 = icmp eq i32 %32, 1\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_16, label LBL_11\n LBL_11:\n %35 = load i64, i64* %sv_1, align 8\n %36 = trunc i64 %35 to i32\n %37 = icmp sgt i32 %36, 9999\n br i1 %37, label LBL_16, label LBL_12\n LBL_12:\n %38 = and i64 %35, 4294967295\n %39 = icmp eq i64 %38, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %39, label LBL_15, label LBL_13\n LBL_13:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %40 = add i32 %storemerge5.reload, 1\n %41 = sext i32 %40 to i64\n %42 = icmp sgt i64 %38, %41\n store i32 %40, i32* %storemerge5.reg2mem\n br i1 %42, label LBL_13, label LBL_14\n LBL_14:\n %phitmp = zext i32 %40 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_15\n LBL_15:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %43 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_16\n LBL_16:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %40, { 1, 0, 2 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 1 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_14\n LBL_11:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %32 = icmp eq i32 %sv_0.1.reload, 0\n br i1 %32, label LBL_13, label LBL_12\n LBL_12:\n %33 = urem i32 100, %sv_0.1.reload\n %34 = zext i32 %33 to i64\n %35 = call i64 @FUNC(i64 %34)\n br label LBL_14\n LBL_13:\n %36 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_14\n LBL_14:\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__int_pointer_malloc_use_12-bad", "fun_name": "CWE758_Undefined_Behavior__int_pointer_malloc_use_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = load i64, i64* %3, align 8\n call void @free(i64* %3)\n %7 = inttoptr i64 %6 to i32*\n %8 = load i32, i32* %7, align 4\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %storemerge.reg2mem\n br label LBL_9\n LBL_4:\n br i1 %5, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = call i64* @malloc(i32 4)\n %12 = icmp eq i64* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %14 = bitcast i64* %11 to i32*\n store i32 5, i32* %14, align 4\n %15 = ptrtoint i64* %11 to i64\n store i64 %15, i64* %3, align 8\n %16 = load i32, i32* %14, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n call void @free(i64* %3)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %11, { 0, 2, 1 }\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_for_loop_07-bad", "fun_name": "CWE400_Resource_Exhaustion__listen_socket_for_loop_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_12, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = sext i32 %sv_0.1.reload to i64\n %32 = icmp eq i32 %sv_0.1.reload, 0\n store i64 0, i64* %storemerge7.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %33 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n %34 = add nuw i64 %storemerge7.reload, 1\n %35 = icmp ult i64 %34, %31\n store i64 %34, i64* %storemerge7.reg2mem\n br i1 %35, label LBL_11, label LBL_12\n LBL_12:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %storemerge7.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_preinc_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 2147483647\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = mul i64 %6, 4294967296\n %sext = add i64 %9, 4294967296\n %10 = ashr exact i64 %sext, 32\n store i64 %10, i64* %sv_0, align 8\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_5\n LBL_4:\n %13 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_large_to_char_07-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_large_to_char_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = select i1 %2, i64 4294967295, i64 4\n %4 = call i64 @FUNC(i64 %3)\n ret i64 %4\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_predec_05-bad", "fun_name": "CWE191_Integer_Underflow__unsigned_int_fscanf_predec_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = add i32 %6, -1\n store i32 %7, i32* %sv_0, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_system_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = add i64 %6, %7\n %9 = inttoptr i64 %8 to i32*\n store i32 2764330, i32* %9, align 4\n br label LBL_2\n LBL_2:\n %10 = call i32 @system(i8* nonnull %1)\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__empty_else_05-bad", "fun_name": "CWE398_Poor_Code_Quality__empty_else_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = srem i32 %2, 3\n %4 = icmp eq i32 %3, 0\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_system_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = sext i32 %4 to i64\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i32*\n store i32 2764330, i32* %8, align 4\n br label LBL_2\n LBL_2:\n %9 = call i32 @system(i8* nonnull %1)\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 (i8*)* @system, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = add i64 %8, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = mul i64 %storemerge1.reload, 8\n %12 = add i64 %11, %sv_0.0.reload\n %13 = add i64 %10, %11\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = inttoptr i64 %12 to i64*\n store i64 %15, i64* %16, align 8\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %18 = inttoptr i64 %sv_0.0.reload to i64*\n %19 = load i64, i64* %18, align 8\n %20 = call i64 @FUNC(i64 %19)\n call void @free(i64* %18)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_10, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %.pr = load i32, i32* @gv_0, align 4\n %22 = icmp eq i32 %.pr, 0\n br i1 %22, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %23 = icmp eq i32 %sv_0.1.ph.reload, 0\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n %24 = urem i32 100, %sv_0.1.ph.reload\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n br label LBL_10\n LBL_9:\n %27 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 2, 3, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 4)\n ret i64 %0\n\n uselistorder i64 (i64)* @printUnsignedLine, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %9)\n %11 = call i64 @FUNC(i64 %.pre-phi.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 4, 1, 3, 0 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_multiply_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_4:\n %8 = load i64, i64* %sv_0, align 8\n %9 = icmp slt i64 %8, 1\n br i1 %9, label LBL_8, label LBL_5\n LBL_5:\n %10 = icmp sgt i64 %8, 4611686018427387902\n br i1 %10, label LBL_7, label LBL_6\n LBL_6:\n %11 = mul i64 %8, 2\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_8\n LBL_7:\n %13 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_8\n LBL_8:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_16, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_3 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %5, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_8, label LBL_3\n LBL_3:\n %12 = sext i32 %4 to i64\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = add i64 %12, %13\n %15 = inttoptr i64 %14 to i64*\n %16 = sub i32 99, %4\n %17 = call i32 @recv(i32 %5, i64* %15, i32 %16, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n br i1 %19, label LBL_8, label LBL_4\n LBL_4:\n %20 = sext i32 %17 to i64\n %21 = add i64 %14, %20\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = call i8* @strchr(i8* nonnull %3, i32 13)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %23, align 1\n br label LBL_6\n LBL_6:\n %25 = call i8* @strchr(i8* nonnull %3, i32 10)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %25, align 1\n br label LBL_8\n LBL_8:\n %27 = call i32 @close(i32 %5)\n br label LBL_9\n LBL_9:\n %.pr = load i32, i32* @gv_0, align 4\n %28 = icmp eq i32 %.pr, 0\n br i1 %28, label LBL_16, label LBL_10\n LBL_10:\n %29 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %30 = icmp eq i32 %29, 1\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_16, label LBL_11\n LBL_11:\n %32 = load i64, i64* %sv_1, align 8\n %33 = trunc i64 %32 to i32\n %34 = icmp sgt i32 %33, 9999\n br i1 %34, label LBL_16, label LBL_12\n LBL_12:\n %35 = and i64 %32, 4294967295\n %36 = icmp eq i64 %35, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %36, label LBL_15, label LBL_13\n LBL_13:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %37 = add i32 %storemerge5.reload, 1\n %38 = sext i32 %37 to i64\n %39 = icmp sgt i64 %35, %38\n store i32 %37, i32* %storemerge5.reg2mem\n br i1 %39, label LBL_13, label LBL_14\n LBL_14:\n %phitmp = zext i32 %37 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_15\n LBL_15:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %40 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_16\n LBL_16:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %37, { 1, 0, 2 }\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %5, { 3, 1, 2, 0 }\n uselistorder i8* %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 1 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_16, { 1, 2, 3, 4, 0 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_system_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = ptrtoint i64* %sv_0 to i64\n %3 = call i32 @strlen(i8* nonnull %1)\n %4 = sext i32 %3 to i64\n %5 = add i64 %4, %2\n %6 = inttoptr i64 %5 to i32*\n store i32 2764330, i32* %6, align 4\n %7 = call i32 @system(i8* nonnull %1)\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %9 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memcpy_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 40)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 0, i64* %sv_0, align 8\n %4 = call i64* @memcpy(i64* %1, i64* nonnull %sv_0, i32 40)\n %5 = bitcast i64* %1 to i32*\n %6 = load i32, i32* %5, align 4\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n call void @free(i64* %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 40, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_calloc_05-bad", "fun_name": "CWE401_Memory_Leak__struct_twoIntsStruct_calloc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @calloc(i32 100, i32 8)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = bitcast i64* %2 to i32*\n store i32 0, i32* %5, align 4\n %6 = ptrtoint i64* %2 to i64\n %7 = add i64 %6, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %9 = call i64 @FUNC(i64 %6)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE546_Suspicious_Comment__BUG_13-bad", "fun_name": "CWE546_Suspicious_Comment__BUG_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8344 to i32*), align 8\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_sub_08-bad", "fun_name": "CWE191_Integer_Underflow__char_fscanf_sub_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i8, i8* %sv_0, align 1\n %10 = add i8 %9, -1\n %11 = sext i8 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_malloc_31-bad", "fun_name": "CWE401_Memory_Leak__struct_twoIntsStruct_malloc_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 0, i32* %3, align 4\n %4 = ptrtoint i64* %0 to i64\n %5 = add i64 %4, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %7 = call i64 @FUNC(i64 %4)\n ret i64 %4\n\n uselistorder i64* %0, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_ncat_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -161\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n %5 = call i64 @FUNC()\n store i8 0, i8* %4, align 16\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i8* @strncat(i8* %4, i8* nonnull %7, i32 100)\n %9 = call i64 @FUNC(i64 %3)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %1, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_malloc_01-bad", "fun_name": "CWE690_NULL_Deref_From_Return__int_malloc_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 4)\n %1 = bitcast i64* %0 to i32*\n store i32 5, i32* %1, align 4\n %2 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memmove_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 49)\n %7 = add i64 %3, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* %5, i32 %9)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 1, 0, 3 }\n uselistorder i8** %sv_1, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_max_square_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %narrow = select i1 %5, i64 0, i64 4\n %6 = call i64 @FUNC(i64 %narrow)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_07-bad", "fun_name": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_1 to i32))\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = bitcast i64* %4 to i32*\n store i32 0, i32* %8, align 4\n %9 = add i64 %7, 4\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = call i64 @FUNC(i64 %7)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* null, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_min_postdec_12-bad", "fun_name": "CWE191_Integer_Underflow__unsigned_int_min_postdec_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %. = select i1 %2, i32 -2, i32 0\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = add nsw i32 %., -1\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n br i1 %2, label LBL_3, label LBL_4\n LBL_3:\n %9 = add nsw i32 %., -1\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %., { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_multiply_17-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_rand_multiply_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = urem i32 %0, 2\n %7 = icmp eq i32 %6, 0\n %8 = zext i32 %1 to i64\n %9 = mul i64 %8, 1152921504606846976\n %10 = zext i32 %2 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = sext i32 %3 to i64\n %13 = mul i64 %12, 1073741824\n %14 = sext i32 %4 to i64\n %15 = mul i64 %14, 32768\n %16 = sext i32 %5 to i64\n %17 = sext i1 %7 to i64\n %18 = xor i64 %9, %17\n %19 = xor i64 %18, %11\n %20 = xor i64 %19, %13\n %21 = xor i64 %20, %15\n %storemerge2.le = xor i64 %21, %16\n %22 = icmp slt i64 %storemerge2.le, 1\n store i64 %storemerge2.le, i64* %rax.1.reg2mem\n br i1 %22, label LBL_2, label LBL_1\n LBL_1:\n %23 = mul i64 %storemerge2.le, 2\n %24 = call i64 @FUNC(i64 %23)\n store i64 %24, i64* %rax.1.reg2mem\n br label LBL_2\n LBL_2:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64 %storemerge2.le, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_multiply_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %spec.store.select = select i1 %2, i32 32, i32 -128\n %4 = trunc i32 %spec.store.select to i8\n %5 = icmp slt i8 %4, 0\n %6 = icmp eq i1 %5, false\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n %7 = icmp slt i8 %4, -63\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = mul i32 %spec.store.select, 2\n %9 = and i32 %8, 64\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %2, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_declare_cat_32-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__src_char_declare_cat_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = add i64 %2, 99\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n store i64 0, i64* %sv_0, align 8\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strcat(i8* nonnull %6, i8* nonnull %1)\n %8 = call i64 @FUNC(i64 %2)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__listen_socket_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.1.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @gv_3, i64 0, i64 0), i32 149, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_4, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_2\n LBL_2:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %rax.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 2, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n store i64 %13, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %16 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 2, 3, 1, 0, 4 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = call i32 @fclose(%_IO_FILE* %0)\n %2 = sext i32 %1 to i64\n ret i64 %2\n\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 3, 0, 2, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 3, 0, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_declare_partial_init_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %indvars.iv5.reg2mem\n store i32 %2, i32* %.reg2mem\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %5 = mul i64 %indvars.iv5.reload, 8\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = trunc i64 %indvars.iv5.reload to i32\n store i32 %8, i32* %7, align 8\n %9 = or i64 %6, 4\n %10 = inttoptr i64 %9 to i32*\n store i32 %8, i32* %10, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_2, label LBL_1\n LBL_2:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_3\n LBL_3:\n %.reload = load i32, i32* %.reg2mem\n %11 = icmp eq i32 %.reload, 5\n %12 = icmp eq i1 %11, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 8\n %14 = add i64 %13, %1\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 8\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = or i64 %14, 4\n %20 = inttoptr i64 %19 to i32*\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder i32* @gv_0, { 0, 7, 6, 5, 1, 4, 2, 3 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_05-bad", "fun_name": "CWE416_Use_After_Free__malloc_free_struct_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_6, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %3 = ptrtoint i64* %2 to i64\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n %9 = add i64 %7, 4\n %10 = inttoptr i64 %9 to i32*\n store i32 2, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %2)\n %.pr = load i32, i32* @gv_0, align 4\n %12 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 %3)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder label LBL_6, { 1, 2, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_partial_init_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %indvars.iv9.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv9.reg2mem\n store i32 %4, i32* %.reg2mem\n br i1 %6, label LBL_5, label LBL_3\n LBL_3:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %7 = mul i64 %indvars.iv9.reload, 8\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv9.reload to i32\n store i32 %10, i32* %9, align 4\n %11 = add i64 %8, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 %10, i32* %12, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_4, label LBL_3\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i32, i32* %.reg2mem\n %13 = icmp eq i32 %.reload, 5\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %14, i64* %rax.2.reg2mem\n br label LBL_9\n LBL_7:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %15 = mul i64 %indvars.iv6.reload, 8\n %16 = add i64 %15, %3\n %17 = inttoptr i64 %16 to i32*\n %18 = trunc i64 %indvars.iv6.reload to i32\n store i32 %18, i32* %17, align 4\n %19 = add i64 %16, 4\n %20 = inttoptr i64 %19 to i32*\n store i32 %18, i32* %20, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_8, label LBL_7\n LBL_8:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %21 = mul i64 %indvars.iv.reload, 8\n %22 = add i64 %21, %3\n %23 = inttoptr i64 %22 to i32*\n %24 = load i32, i32* %23, align 4\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n %27 = add i64 %22, 4\n %28 = inttoptr i64 %27 to i32*\n %29 = load i32, i32* %28, align 4\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %31, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_8\n LBL_9:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_listen_socket_system_08-bad", "fun_name": "CWE78_OS_Command_Injection__char_listen_socket_system_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = call i32 @system(i8* nonnull %1)\n %36 = icmp eq i32 %35, 0\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n %37 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_14:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_4:\n %9 = load i8, i8* %sv_0, align 1\n %10 = icmp slt i8 %9, 0\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_8, label LBL_5\n LBL_5:\n %12 = icmp slt i8 %9, -63\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n %13 = mul i8 %9, 2\n %14 = sext i8 %13 to i64\n %15 = and i64 %14, 4294967294\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_8\n LBL_7:\n %17 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_4 to i64))\n br label LBL_8\n LBL_8:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memcpy_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, 49\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n store i64 0, i64* %sv_0, align 8\n %6 = call i32 @strlen(i8* nonnull %1)\n %7 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %6)\n %8 = call i64 @FUNC(i64 %3)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = trunc i64 %1 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = ptrtoint i64* %sv_0 to i64\n %spec.select = select i1 %6, i64 -4, i64 28\n %8 = add i64 %7, -48\n %9 = add i64 %8, %spec.select\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_3:\n %14 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_4:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_declare_no_init_07-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__struct_array_declare_no_init_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %5 = mul i64 %indvars.iv.reload, 8\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = load i32, i32* %7, align 8\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = or i64 %6, 4\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_zero_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %storemerge.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %sv_0 = alloca i64, align 8\n %2 = call i128 @FUNC(i128 %1, i128 %1)\n %3 = call i64 @FUNC(i128 %2)\n %4 = call i128 @FUNC(i128 %2, i128 %2)\n %5 = call i64 @FUNC(i128 %4)\n %6 = trunc i64 %5 to i32\n %7 = call i128 @__asm_movss.1(i32 %6)\n %8 = call i64 @FUNC(i128 %7)\n %9 = trunc i64 %8 to i32\n %10 = call i128 @__asm_movss.1(i32 %9)\n %11 = call i64 @FUNC(i128 %10)\n %12 = trunc i64 %11 to i32\n %13 = call i128 @__asm_movss.1(i32 %12)\n %14 = call i128 @__asm_movss.1(i32 2147483647)\n %15 = call i128 @FUNC(i128 %13, i128 %14)\n %16 = call i128 @__asm_cvtss2sd.2(i128 %15)\n %17 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %16, i128 %17)\n %18 = icmp ugt i64* %sv_0, inttoptr (i64 16 to i64*)\n br i1 %18, label LBL_1, label LBL_2\n LBL_1:\n %19 = call i128 @FUNC(i128 %14, i128 %14)\n %20 = call i128 @FUNC(i32 %12)\n %21 = call i128 @FUNC(i64 4636737291354636288)\n %22 = call i128 @FUNC(i128 %21, i128 %20)\n %23 = call i32 @FUNC(i128 %22)\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n store i64 %25, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %26 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n store i64 %26, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i128 %14, { 1, 0, 2 }\n uselistorder i128 %2, { 2, 1, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_alloca_no_init_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.03.reg2mem = alloca i128\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n store i64 0, i64* %indvars.iv5.reg2mem\n br label LBL_1\n LBL_1:\n %xmm0.03.reload = load i128, i128* %xmm0.03.reg2mem\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 8\n %5 = add i64 %4, %3\n %6 = call i128 @FUNC(i128 %xmm0.03.reload, i128 %xmm0.03.reload)\n %7 = trunc i64 %indvars.iv5.reload to i32\n %8 = call i128 @FUNC(i32 %7)\n %9 = call i64 @FUNC(i128 %8)\n %10 = inttoptr i64 %5 to i64*\n store i64 %9, i64* %10, align 8\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i128 %8, i128* %xmm0.03.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_2, label LBL_1\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 8\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i64*\n %14 = load i64, i64* %13, align 8\n %15 = call i128 @FUNC(i64 %14)\n %16 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.03.reload, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 1, 0, 2 }\n uselistorder i128* %xmm0.03.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memcpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 40)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 0, i64* %sv_0, align 8\n %4 = call i64* @memcpy(i64* %1, i64* nonnull %sv_0, i32 40)\n %5 = bitcast i64* %1 to i32*\n %6 = load i32, i32* %5, align 4\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n call void @free(i64* %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 0, 2, 3 }\n uselistorder i32 40, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_rand_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv8.reg2mem = alloca i64\n %indvars.iv11.reg2mem = alloca i64\n %indvars.iv14.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 40)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n store i64 0, i64* %indvars.iv14.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv14.reload = load i64, i64* %indvars.iv14.reg2mem\n %8 = mul i64 %indvars.iv14.reload, 4\n %9 = add i64 %8, %5\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %indvars.iv.next15 = add nuw nsw i64 %indvars.iv14.reload, 1\n %exitcond16 = icmp eq i64 %indvars.iv.next15, 10\n store i64 %indvars.iv.next15, i64* %indvars.iv14.reg2mem\n br i1 %exitcond16, label LBL_4, label LBL_3\n LBL_4:\n %11 = add i64 %5, 28\n %12 = inttoptr i64 %11 to i32*\n store i32 1, i32* %12, align 4\n store i64 0, i64* %indvars.iv11.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv11.reload = load i64, i64* %indvars.iv11.reg2mem\n %13 = mul i64 %indvars.iv11.reload, 4\n %14 = add i64 %13, %5\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next12 = add nuw nsw i64 %indvars.iv11.reload, 1\n %exitcond13 = icmp eq i64 %indvars.iv.next12, 10\n store i64 %indvars.iv.next12, i64* %indvars.iv11.reg2mem\n br i1 %exitcond13, label LBL_6, label LBL_5\n LBL_6:\n call void @free(i64* %4)\n br label LBL_13\n LBL_7:\n store i64 0, i64* %indvars.iv8.reg2mem\n br i1 %7, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 -1)\n unreachable\n LBL_9:\n %indvars.iv8.reload = load i64, i64* %indvars.iv8.reg2mem\n %19 = mul i64 %indvars.iv8.reload, 4\n %20 = add i64 %19, %5\n %21 = inttoptr i64 %20 to i32*\n store i32 0, i32* %21, align 4\n %indvars.iv.next9 = add nuw nsw i64 %indvars.iv8.reload, 1\n %exitcond10 = icmp eq i64 %indvars.iv.next9, 10\n store i64 %indvars.iv.next9, i64* %indvars.iv8.reg2mem\n br i1 %exitcond10, label LBL_10, label LBL_9\n LBL_10:\n %22 = add i64 %5, 28\n %23 = inttoptr i64 %22 to i32*\n store i32 1, i32* %23, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_11\n LBL_11:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %24 = mul i64 %indvars.iv.reload, 4\n %25 = add i64 %24, %5\n %26 = inttoptr i64 %25 to i32*\n %27 = load i32, i32* %26, align 4\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_11\n LBL_12:\n call void @free(i64* %4)\n br label LBL_13\n LBL_13:\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %7, { 1, 0 }\n uselistorder i64 %5, { 0, 5, 1, 2, 4, 3 }\n uselistorder i64* %indvars.iv14.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv11.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv8.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 3, 2, 1, 0, 7, 6, 5, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_square_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %.off = add i32 %3, 46339\n %4 = icmp ugt i32 %.off, 92678\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = mul i32 %3, %3\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 2, 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_square_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i8, i8* %sv_0, align 1\n %7 = sub i8 0, %6\n %8 = icmp slt i8 %7, 0\n %9 = icmp eq i1 %8, false\n %.v = select i1 %9, i8 %7, i8 %6\n %10 = icmp ult i8 %.v, 12\n br i1 %10, label LBL_3, label LBL_4\n LBL_3:\n %11 = mul i8 %6, %6\n %12 = sext i8 %11 to i64\n %13 = and i64 %12, 4294967295\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_5\n LBL_4:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8 %6, { 1, 0, 2, 3 }\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_fgets_07-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_fgets_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp sgt i32 %sv_0.0.reload, 9\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %14, -64\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n br label LBL_8\n LBL_7:\n %23 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_snprintf_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_snprintf_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_3 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i8* %5, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %7 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %sv_0.0.reload, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_34-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 49)\n %6 = add i64 %3, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = inttoptr i64 %3 to i8*\n store i8* %8, i8** %sv_1, align 8\n store i64 0, i64* %sv_0, align 8\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strcpy(i8* nonnull %9, i8* %8)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1 }\n uselistorder i8** %sv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_multiply_07-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_multiply_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n %.pre2 = load i16, i16* %sv_0, align 2\n %6 = icmp eq i32 %.pre, 5\n %7 = icmp eq i1 %6, false\n %8 = icmp slt i16 %.pre2, 1\n %or.cond = or i1 %7, %8\n br i1 %or.cond, label LBL_3, label LBL_2\n LBL_2:\n %9 = mul i16 %.pre2, 2\n %10 = sext i16 %9 to i64\n %11 = and i64 %10, 4294967294\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_3\n LBL_3:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_postdec_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = add i32 %sv_0.1.reload, -1\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_10\n LBL_9:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_postdec_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %8 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_5, label LBL_2\n LBL_2:\n %9 = urem i32 %2, 2\n %10 = icmp eq i32 %9, 0\n %11 = zext i32 %3 to i64\n %12 = mul i64 %11, 1152921504606846976\n %13 = zext i32 %4 to i64\n %14 = mul i64 %13, 35184372088832\n %15 = sext i32 %5 to i64\n %16 = mul i64 %15, 1073741824\n %17 = sext i32 %6 to i64\n %18 = mul i64 %17, 32768\n %19 = sext i32 %7 to i64\n %20 = sext i1 %10 to i64\n %21 = xor i64 %12, %20\n %22 = xor i64 %21, %14\n %23 = xor i64 %22, %16\n %24 = xor i64 %23, %18\n %storemerge = xor i64 %24, %19\n %25 = icmp eq i64 %storemerge, -9223372036854775808\n br i1 %25, label LBL_4, label LBL_3\n LBL_3:\n %26 = add i64 %storemerge, -1\n %27 = call i64 @FUNC(i64 %26)\n store i64 %27, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %28 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %28, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_divide_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %18 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n %19 = udiv i32 100, %sv_0.0.reload\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__struct_realloc_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = add i64 %1, 4\n %4 = inttoptr i64 %3 to i32*\n %5 = bitcast i64* %0 to i32*\n store i32 1, i32* %5, align 4\n store i32 1, i32* %4, align 4\n %6 = call i64 @FUNC(i64 %1)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %1, { 1, 2, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fputc_08-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fputc_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %4 = call i32 @fputc(i32 65, %_IO_FILE* %3)\n %5 = sext i32 %4 to i64\n %6 = icmp eq i32 %4, 0\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_05-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i128 @FUNC(i64 %1)\n %5 = call i64 @FUNC()\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_ncpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i8* null, i8** %.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = bitcast i64* %4 to i8*\n store i8* %5, i8** %sv_1, align 8\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = ptrtoint i64* %4 to i64\n %10 = add i64 %9, 99\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = load i8*, i8** %sv_1, align 8\n store i8* %12, i8** %.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i8*, i8** %.reg2mem\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = bitcast i64* %sv_0 to i8*\n %15 = call i32 @strlen(i8* nonnull %14)\n %16 = call i8* @strncpy(i8* nonnull %14, i8* %.reload, i32 %15)\n %17 = ptrtoint i64* %sv_0 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i8** %.reg2mem, { 0, 2, 1 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__fopen_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = load i32, i32* inttoptr (i64 8372 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq %_IO_FILE* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %0, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 25, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -48\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @strtoul(i8* nonnull %23, i8** null, i32 0)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_15, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sv_0.1.off = add i32 %sv_0.1.reload, -6\n %31 = icmp ult i32 %sv_0.1.off, 94\n br i1 %31, label LBL_11, label LBL_14\n LBL_11:\n %32 = call i64* @malloc(i32 %sv_0.1.reload)\n %33 = icmp eq i64* %32, null\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @exit(i32 -1)\n unreachable\n LBL_13:\n %35 = ptrtoint i64* %32 to i64\n %36 = bitcast i64* %32 to i32*\n store i32 1819043176, i32* %36, align 4\n %37 = add i64 %35, 4\n %38 = inttoptr i64 %37 to i16*\n store i16 111, i16* %38, align 2\n %39 = call i64 @FUNC(i64 %35)\n call void @free(i64* %32)\n br label LBL_15\n LBL_14:\n %40 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_1 to i64))\n br label LBL_15\n LBL_15:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %32, { 0, 1, 3, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*, i8**, i32)* @strtoul, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_square_13-bad", "fun_name": "CWE190_Integer_Overflow__int_fgets_square_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8352 to i32*), align 32\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %10 = mul i32 %sv_0.0.reload, %sv_0.0.reload\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_4, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memcpy_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 100)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %5, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_7\n LBL_4:\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = call i64* @memset(i64* %4, i32 65, i32 99)\n %12 = add i64 %5, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i32 @strlen(i8* nonnull %15)\n %17 = call i64* @memcpy(i64* nonnull %sv_0, i64* %4, i32 %16)\n %18 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %4)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %7, { 1, 0 }\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %4, { 0, 1, 3, 2, 4, 5 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2, 3 }\n uselistorder i32 99, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_08-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.06.reg2mem = alloca i8*\n %sv_0.07.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_10\n LBL_10:\n %29 = call i64 @FUNC()\n %30 = trunc i64 %29 to i32\n %31 = icmp eq i32 %30, 0\n br i1 %31, label LBL_16, label LBL_11\n LBL_11:\n %32 = load i8, i8* %4, align 1\n %33 = icmp eq i8 %32, 0\n %34 = icmp eq i1 %33, false\n store i8 %32, i8* %.reg2mem\n store i8* %4, i8** %sv_0.07.reg2mem\n store i8* %4, i8** %sv_0.06.reg2mem\n br i1 %34, label LBL_12, label LBL_15\n LBL_12:\n %sv_0.07.reload = load i8*, i8** %sv_0.07.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %35 = icmp eq i8 %.reload, 83\n %36 = icmp eq i1 %35, false\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n %37 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n store i8* %sv_0.07.reload, i8** %sv_0.06.reg2mem\n br label LBL_15\n LBL_14:\n %38 = ptrtoint i8* %sv_0.07.reload to i64\n %39 = add i64 %38, 1\n %40 = inttoptr i64 %39 to i8*\n %41 = load i8, i8* %40, align 1\n %42 = icmp eq i8 %41, 0\n %43 = icmp eq i1 %42, false\n store i8 %41, i8* %.reg2mem\n store i8* %40, i8** %sv_0.07.reg2mem\n store i8* %40, i8** %sv_0.06.reg2mem\n br i1 %43, label LBL_12, label LBL_15\n LBL_15:\n %sv_0.06.reload = load i8*, i8** %sv_0.06.reg2mem\n %44 = bitcast i8* %sv_0.06.reload to i64*\n call void @free(i64* %44)\n br label LBL_16\n LBL_16:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.07.reload, { 1, 0 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 0, 1, 2, 3, 4, 6, 5 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.07.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.06.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4, 5, 6 }\n uselistorder i32 -1, { 1, 0, 2 }\n uselistorder label LBL_15, { 0, 2, 1 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_memcpy_31-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_memcpy_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.034.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_2, align 8\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.034.reg2mem\n br label LBL_6\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_3 to %sockaddr*\n %9 = call i32 @connect(i32 %2, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %2, i64* nonnull %sv_2, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = sext i32 %11 to i64\n %15 = add i64 %0, -112\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_2 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n store i32 %19, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %20 = call i32 @close(i32 %2)\n store i64 0, i64* %sv_2, align 8\n %21 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %22 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.034.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n %sv_0.034.reload = load i32, i32* %sv_0.034.reg2mem\n %23 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.034.reload)\n %24 = sext i32 %sv_0.034.reload to i64\n %25 = add i64 %0, -112\n %26 = add i64 %25, %24\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n br label LBL_7\n LBL_7:\n %28 = call i64 @FUNC(i64* nonnull %sv_2)\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %1, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %2, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 1, 2, 5, 3, 4, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0, 4 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fscanf_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8544 to i32*), align 32\n %1 = icmp eq i32 %0, 5\n store i64 5, i64* %rax.1.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gv_2, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_3, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_2\n LBL_2:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %rax.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %5 = ptrtoint i64* %sv_2 to i64\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %7 = inttoptr i64 %sv_0.0.reload to i64*\n %8 = call i64* @memmove(i64* nonnull %sv_1, i64* %7, i32 100)\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* %sv_1, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_sub_04-bad", "fun_name": "CWE191_Integer_Underflow__unsigned_int_fscanf_sub_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = add i32 %3, -1\n %5 = zext i32 %4 to i64\n %6 = call i64 @FUNC(i64 %5)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_calloc_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 8)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n store i64 5, i64* %0, align 8\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %24 = icmp eq i32 %23, 1\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_12, label LBL_7\n LBL_7:\n %26 = load i64, i64* %sv_1, align 8\n %27 = trunc i64 %26 to i32\n %28 = icmp sgt i32 %27, ptrtoint (i1* @gv_3 to i32)\n br i1 %28, label LBL_12, label LBL_8\n LBL_8:\n %29 = and i64 %26, 4294967295\n %30 = icmp eq i64 %29, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %30, label LBL_11, label LBL_9\n LBL_9:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %31 = add i32 %storemerge5.reload, 1\n %32 = sext i32 %31 to i64\n %33 = icmp sgt i64 %29, %32\n store i32 %31, i32* %storemerge5.reg2mem\n br i1 %33, label LBL_9, label LBL_10\n LBL_10:\n %phitmp = zext i32 %31 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %34 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %31, { 1, 0, 2 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i8 0, { 1, 2, 3, 4, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__strdup_char_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n store i64 7453010373643565421, i64* %sv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @strdup(i8* nonnull %2)\n %4 = ptrtoint i8* %3 to i64\n %5 = call i64 @FUNC(i64 %4)\n %6 = call i64 @FUNC()\n %7 = bitcast i8* %3 to i64*\n call void @free(i64* %7)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_calloc_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -97\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_0, align 8\n %7 = inttoptr i64 %6 to i64*\n store i64 7453010373643542593, i64* %7, align 16\n %8 = or i64 %6, 8\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 8\n %10 = load i64, i64* %sv_0, align 8\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_2\n LBL_2:\n %12 = call i64 @FUNC()\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 0, 1, 3, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_sub_17-bad", "fun_name": "CWE191_Integer_Underflow__int_connect_socket_sub_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.04.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.04.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %3, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = add i64 %12, -22\n %14 = bitcast i64* %sv_1 to i8*\n %15 = sext i32 %9 to i64\n %16 = add i64 %13, %15\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i32 @atoi(i8* nonnull %14)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.04.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.04.reload = load i32, i32* %sv_0.04.reg2mem\n %20 = add i32 %sv_0.04.reload, -1\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.04.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_sub_10-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_fscanf_sub_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = add i64 %6, -1\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memmove_31-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memmove_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0368.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_3 to %sockaddr*\n %7 = call i32 @bind(i32 %2, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call i32 @listen(i32 %2, i32 5)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = call i32 @accept(i32 %2, %sockaddr* null, i32* null)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_4\n LBL_4:\n %13 = call i32 @recv(i32 %11, i64* nonnull %sv_2, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_2 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %2)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n %23 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.0368.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %24 = call i32 @close(i32 %2)\n %25 = call i32 @close(i32 %11)\n store i64 0, i64* %sv_2, align 8\n %26 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %27 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0368.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %sv_0.0368.reload = load i32, i32* %sv_0.0368.reg2mem\n %28 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.0368.reload)\n %29 = sext i32 %sv_0.0368.reload to i64\n %30 = add i64 %0, -112\n %31 = add i64 %30, %29\n %32 = inttoptr i64 %31 to i8*\n store i8 0, i8* %32, align 1\n br label LBL_10\n LBL_10:\n %33 = call i64 @FUNC(i64* nonnull %sv_2)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %1, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %2, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 1, 2, 5, 0, 3, 4 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 0, 1, 3 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__short_rand_04-bad", "fun_name": "CWE197_Numeric_Truncation_Error__short_rand_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = sext i1 %2 to i32\n %storemerge.in = xor i32 %5, %6\n %sext2 = mul i32 %storemerge.in, 16777216\n %7 = ashr exact i32 %sext2, 24\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n ret i64 %9\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memmove_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 40)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 0, i64* %sv_0, align 8\n %4 = call i64* @memmove(i64* %1, i64* nonnull %sv_0, i32 40)\n %5 = bitcast i64* %1 to i32*\n %6 = load i32, i32* %5, align 4\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n call void @free(i64* %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 0, 2, 3 }\n uselistorder i32 40, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_fgets_to_char_32-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_fgets_to_char_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %2)\n %phitmp = mul i32 %5, 16777216\n %phitmp3 = ashr exact i32 %phitmp, 24\n %phitmp4 = zext i32 %phitmp3 to i64\n store i64 %phitmp4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64 @FUNC(i64 %sv_0.0.reload)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_file_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* inttoptr (i64 8396 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_2 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %21 = icmp eq i32 %20, 1\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_12, label LBL_7\n LBL_7:\n %23 = load i64, i64* %sv_1, align 8\n %24 = trunc i64 %23 to i32\n %25 = icmp sgt i32 %24, ptrtoint (i1* @gv_4 to i32)\n br i1 %25, label LBL_12, label LBL_8\n LBL_8:\n %26 = and i64 %23, 4294967295\n %27 = icmp eq i64 %26, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %27, label LBL_11, label LBL_9\n LBL_9:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %28 = add i32 %storemerge5.reload, 1\n %29 = sext i32 %28 to i64\n %30 = icmp sgt i64 %26, %29\n store i32 %28, i32* %storemerge5.reg2mem\n br i1 %30, label LBL_9, label LBL_10\n LBL_10:\n %phitmp = zext i32 %28 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %31 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_12\n LBL_12:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %28, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_6, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv8.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_16\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %27 = call i64* @malloc(i32 40)\n %28 = ptrtoint i64* %27 to i64\n %29 = icmp eq i64* %27, null\n %30 = icmp eq i1 %29, false\n store i64 0, i64* %indvars.iv8.reg2mem\n br i1 %30, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %indvars.iv8.reload = load i64, i64* %indvars.iv8.reg2mem\n %31 = mul i64 %indvars.iv8.reload, 4\n %32 = add i64 %31, %28\n %33 = inttoptr i64 %32 to i32*\n store i32 0, i32* %33, align 4\n %indvars.iv.next9 = add nuw nsw i64 %indvars.iv8.reload, 1\n %exitcond10 = icmp eq i64 %indvars.iv.next9, 10\n store i64 %indvars.iv.next9, i64* %indvars.iv8.reg2mem\n br i1 %exitcond10, label LBL_11, label LBL_10\n LBL_11:\n %34 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %34, label LBL_14, label LBL_12\n LBL_12:\n %35 = sext i32 %sv_0.1.reload to i64\n %36 = mul i64 %35, 4\n %37 = add i64 %36, %28\n %38 = inttoptr i64 %37 to i32*\n store i32 1, i32* %38, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_13\n LBL_13:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %39 = mul i64 %indvars.iv.reload, 4\n %40 = add i64 %39, %28\n %41 = inttoptr i64 %40 to i32*\n %42 = load i32, i32* %41, align 4\n %43 = zext i32 %42 to i64\n %44 = call i64 @FUNC(i64 %43)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_15, label LBL_13\n LBL_14:\n %45 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_15\n LBL_15:\n call void @free(i64* %27)\n br label LBL_16\n LBL_16:\n %46 = call i64 @FUNC(i64 40)\n %47 = icmp eq i64 %0, %46\n store i64 0, i64* %rax.0.reg2mem\n br i1 %47, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %28, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv8.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_rand_postdec_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %18 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n %19 = add i32 %sv_0.0.reload, -1\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_no_init_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = call i64 @FUNC()\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %5, label LBL_3, label LBL_1\n LBL_1:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %6 = mul i64 %indvars.iv6.reload, 8\n %7 = add i64 %6, %1\n %8 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %9 = trunc i64 %indvars.iv6.reload to i32\n %10 = call i128 @FUNC(i32 %9)\n %11 = call i64 @FUNC(i128 %10)\n %12 = inttoptr i64 %7 to i64*\n store i64 %11, i64* %12, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %10, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_2, label LBL_1\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 8\n %14 = add i64 %13, %1\n %15 = inttoptr i64 %14 to i64*\n %16 = load i64, i64* %15, align 8\n %17 = call i128 @FUNC(i64 %16)\n %18 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__empty_block_13-bad", "fun_name": "CWE398_Poor_Code_Quality__empty_block_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8356 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__struct_malloc_use_12-bad", "fun_name": "CWE758_Undefined_Behavior__struct_malloc_use_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %storemerge.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i64* @malloc(i32 8)\n %6 = icmp eq i64* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = load i64, i64* %5, align 8\n call void @free(i64* %5)\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n %11 = zext i32 %1 to i64\n %12 = call i64 @FUNC(i64 %11)\n store i64 %12, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n store i64 1, i64* %5, align 8\n %13 = call i64 @FUNC(i64 1)\n %14 = zext i32 %1 to i64\n %15 = call i64 @FUNC(i64 %14)\n call void @free(i64* %5)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i1 %7, { 1, 0 }\n uselistorder i64* %5, { 0, 3, 1, 2, 4 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_postdec_12-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_fscanf_postdec_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_3\n LBL_2:\n store i64 -2, i64* %sv_0, align 8\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = load i64, i64* %sv_0, align 8\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %10 = add i64 %9, -1\n store i64 %10, i64* %sv_0, align 8\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_8\n LBL_5:\n %12 = icmp eq i64 %9, -9223372036854775808\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n %13 = add i64 %9, -1\n store i64 %13, i64* %sv_0, align 8\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_8\n LBL_7:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %9, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 3, 2, 4, 0, 5 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_divide_11-bad", "fun_name": "CWE369_Divide_by_Zero__int_listen_socket_divide_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = udiv i32 100, %sv_0.1.reload\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_no_init_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %5 = icmp eq i32 %4, 5\n store i64 0, i64* %indvars.iv4.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_2:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %7 = mul i64 %indvars.iv4.reload, 8\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv4.reload to i32\n store i32 %10, i32* %9, align 8\n %11 = or i64 %8, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 %10, i32* %12, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 10\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond6, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 8\n %14 = add i64 %13, %3\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 8\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = or i64 %14, 4\n %20 = inttoptr i64 %19 to i32*\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %1, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_13, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %4, label LBL_9, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 13, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_9:\n %.pr = load i32, i32* @gv_0, align 4\n %27 = icmp eq i32 %.pr, 0\n br i1 %27, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %28 = icmp eq i32 %sv_0.1.ph.reload, 0\n br i1 %28, label LBL_12, label LBL_11\n LBL_11:\n %29 = urem i32 100, %sv_0.1.ph.reload\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n br label LBL_13\n LBL_12:\n %32 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_13\n LBL_13:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_13, { 1, 2, 3, 0 }\n uselistorder label LBL_9, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %5 = icmp eq i32 %4, 5\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 49)\n %9 = add i64 %3, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_3\n LBL_3:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strcpy(i8* nonnull %12, i8* %11)\n %14 = call i64 @FUNC(i64 %3)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 3, 2, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_square_01-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_square_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %sext = mul i64 %3, 4294967296\n %4 = ashr exact i64 %sext, 32\n %5 = mul nsw i64 %4, %4\n %6 = and i64 %5, 4294967295\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_src_char_cpy_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %8 = call i64* @memset(i64* %1, i32 65, i32 49)\n %9 = ptrtoint i64* %1 to i64\n %10 = add i64 %9, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n store i64 %9, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %12 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i8* @strcpy(i8* nonnull %13, i8* %12)\n %15 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 3, 5, 1, 2, 0, 4 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_init_variable_char_03-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 67)\n ret i64 %0\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__negative_malloc_02-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__negative_malloc_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 -1)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64* @memset(i64* %0, i32 65, i32 -2)\n %5 = add i64 %3, -2\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder i32 -1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int_06-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 400)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %0)\n ret i64 5\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_fprintf_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 32777976880262761, i64* %6, align 8\n br label LBL_2\n LBL_2:\n %7 = call i64 @FUNC()\n %8 = trunc i64 %7 to i32\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n %10 = bitcast i64* %sv_0 to i8*\n %11 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %12 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %11, i8* nonnull %10)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1, 3 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fprintf, { 3, 2, 1, 0, 4 }\n uselistorder %_IO_FILE** @gv_0, { 4, 3, 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_17-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE135_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i32*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0.0.reg2mem\n store i32 0, i32* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i32, i32* %storemerge2.reg2mem\n %sv_0.0.reload = load i32*, i32** %sv_0.0.reg2mem\n %1 = add nuw nsw i32 %storemerge2.reload, 1\n %exitcond = icmp eq i32 %1, 2\n store i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0), i32** %sv_0.0.reg2mem\n store i32 %1, i32* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = bitcast i32* %sv_0.0.reload to i8*\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = mul i64 %5, 4\n %7 = add nsw i64 %6, 27\n %8 = udiv i64 %7, 16\n %9 = mul i64 %8, 16\n %10 = and i64 %9, -4096\n %11 = and i64 %9, 4080\n %12 = add i64 %2, 15\n %13 = sub i64 %12, %10\n %14 = sub i64 %13, %11\n %15 = and i64 %14, -16\n %16 = inttoptr i64 %15 to i32*\n %17 = call i32* @wcscpy(i32* %16, i32* %sv_0.0.reload)\n %18 = call i64 @FUNC(i64 %15)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %15, { 1, 0 }\n uselistorder i64 %9, { 1, 0 }\n uselistorder i32* %sv_0.0.reload, { 1, 0 }\n uselistorder i32** %sv_0.0.reg2mem, { 1, 0, 2 }\n uselistorder i32* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_large_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_large_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8372 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -8\n %6 = inttoptr i64 %5 to i32*\n store i32 1, i32* %6, align 8\n %7 = add i64 %4, -48\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_2\n LBL_3:\n %14 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_4:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_34-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_34_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, -193\n %4 = and i64 %3, -16\n store i64 %4, i64* %sv_1, align 8\n %5 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 50)\n %6 = add i64 %2, -416\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %7 = mul i64 %storemerge2.reload, 4\n %8 = add i64 %7, %4\n %9 = add i64 %6, %7\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = inttoptr i64 %8 to i32*\n store i32 %11, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %14 = inttoptr i64 %4 to i32*\n %15 = load i32, i32* %14, align 16\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 2, 0, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memcpy_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %10 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %11 = bitcast i64* %sv_1 to i8*\n %12 = call i32 @strlen(i8* nonnull %11)\n %13 = call i64* @memcpy(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 %12)\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = call i64 @FUNC(i64 %14)\n call void @free(i64* %sv_0.0.reload)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 3, 0, 1, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 2, 1, 3, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_ncpy_18-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n store i8* null, i8** %sv_2, align 8\n %1 = call i64* @malloc(i32 100)\n %2 = bitcast i64* %1 to i8*\n store i8* %2, i8** %sv_1, align 8\n %3 = icmp eq i64* %1, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i8*, i8** %sv_1, align 8\n %10 = ptrtoint i8* %9 to i64\n %11 = bitcast i8** %sv_2 to i64*\n store i64 %10, i64* %11, align 8\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i8* @strncpy(i8* %9, i8* nonnull %13, i32 99)\n %15 = add i64 %10, 99\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = load i8*, i8** %sv_2, align 8\n %18 = ptrtoint i8* %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8** %sv_2, { 2, 0, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_add_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i16, i16* %sv_0, align 2\n %9 = icmp eq i16 %8, 32767\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = add i16 %8, 1\n %11 = sext i16 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE467_Use_of_sizeof_on_Pointer_Type__int_08-bad", "fun_name": "CWE467_Use_of_sizeof_on_Pointer_Type__int_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = call i64 @FUNC(i64 5)\n call void @free(i64* %3)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_listen_socket_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 7, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = load i32, i32* @gv_2, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %6 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n %7 = ptrtoint i64* %sv_1 to i64\n %8 = sext i32 %sv_0.0.reload to i64\n %9 = mul i64 %8, 4\n %10 = add i64 %7, -48\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_6\n LBL_5:\n %16 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 0, 2, 3, 8, 9, 10, 1, 11, 5, 7, 12, 13, 14, 4, 15, 6 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_environment_popen_05-bad", "fun_name": "CWE78_OS_Command_Injection__char_environment_popen_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_3\n LBL_3:\n %13 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %14 = icmp eq %_IO_FILE* %13, null\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = call i32 @pclose(%_IO_FILE* nonnull %13)\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_2 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %2\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = icmp eq i1 %5, false\n %spec.select = select i1 %14, i64 %1, i64 %13\n %15 = inttoptr i64 %spec.select to i64*\n %16 = call i64* @memcpy(i64* %15, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %17 = call i64 @FUNC(i64 %spec.select)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %3, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__rand_memcpy_03-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__rand_memcpy_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = mul i32 %4, 1073741824\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = xor i32 %7, %5\n %9 = call i32 @rand()\n %10 = xor i32 %8, %9\n %11 = sext i1 %3 to i32\n %storemerge.in = xor i32 %10, %11\n store i64 0, i64* %sv_1, align 8\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %13 = icmp sgt i32 %storemerge.in, 99\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %storemerge.in)\n %16 = sext i32 %storemerge.in to i64\n %17 = add i64 %14, -128\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n br label LBL_2\n LBL_2:\n %20 = call i64 @FUNC(i64* nonnull %sv_1)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 1, 2, 0 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_09-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_snprintf_09_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n store i64 0, i64* %sv_0, align 8\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %23, i32 99, i8* nonnull %1)\n %25 = ptrtoint i64* %sv_0 to i64\n %26 = call i64 @FUNC(i64 %25)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder label LBL_6, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_02-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %12, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n br label LBL_11\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i64 0, i64* %sv_2, align 8\n %25 = icmp slt i32 %sv_0.0.ph.reload, 0\n br i1 %25, label LBL_11, label LBL_9\n LBL_9:\n %26 = sext i32 %sv_0.0.ph.reload to i64\n %27 = mul i64 %26, 4\n %28 = add i64 %12, -64\n %29 = add i64 %27, %28\n %30 = inttoptr i64 %29 to i32*\n store i32 1, i32* %30, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %31 = mul i64 %indvars.iv.reload, 4\n %32 = add i64 %31, %28\n %33 = inttoptr i64 %32 to i32*\n %34 = load i32, i32* %33, align 4\n %35 = zext i32 %34 to i64\n %36 = call i64 @FUNC(i64 %35)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_10\n LBL_11:\n %37 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_12\n LBL_12:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 3, 0, 1, 4, 2 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_pointer_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = ptrtoint i64* %0 to i64\n %5 = add i64 %4, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 6, i32* %6, align 4\n %7 = load i32, i32* %3, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = load i32, i32* %6, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n ret i64 %12\n\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 3, 1, 2, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_square_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.06.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.06.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %sv_0.0.off = add i32 %6, 46339\n %7 = icmp ugt i32 %sv_0.0.off, 92678\n store i32 %6, i32* %sv_0.06.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.06.reload = load i32, i32* %sv_0.06.reg2mem\n %8 = mul i32 %sv_0.06.reload, %sv_0.06.reload\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.06.reload, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_predec_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0368.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.0368.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.0368.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp eq i32 %sv_0.0.ph.reload, -2147483648\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0368.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.0368.reload = load i32, i32* %sv_0.0368.reg2mem\n %26 = add i32 %sv_0.0368.reload, -1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0368.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_loop_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %4\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge1.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %16 = call i64 @FUNC(i64 %9)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %9, { 1, 0 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_struct_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %1)\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_17-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 10)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @strcpy(i8* %4, i8* nonnull %5)\n %7 = ptrtoint i64* %1 to i64\n %8 = call i64 @FUNC(i64 %7)\n call void @free(i64* %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_snprintf_13-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_snprintf_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %13, i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* %1)\n %15 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 2, 6, 3, 4, 0, 5 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_loop_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = bitcast i8** %sv_1 to i64*\n store i64 %3, i64* %4, align 8\n %.cast = inttoptr i64 %3 to i8*\n store i8 0, i8* %.cast, align 16\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = sext i32 %6 to i64\n %8 = add nsw i64 %7, 1\n %9 = icmp eq i64 %8, 0\n %10 = load i8*, i8** %sv_1, align 8\n %11 = ptrtoint i8* %10 to i64\n store i64 %11, i64* %.lcssa.reg2mem\n br i1 %9, label LBL_3, label LBL_1\n LBL_1:\n %12 = ptrtoint i64* %sv_0 to i64\n store i64 %11, i64* %.reg2mem\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %.reload = load i64, i64* %.reg2mem\n %13 = add i64 %storemerge4.reload, %.reload\n %14 = add i64 %storemerge4.reload, %12\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = inttoptr i64 %13 to i8*\n store i8 %16, i8* %17, align 1\n %18 = add nuw i64 %storemerge4.reload, 1\n %19 = load i8*, i8** %sv_1, align 8\n %20 = ptrtoint i8* %19 to i64\n %exitcond = icmp eq i64 %18, %8\n store i64 %20, i64* %.reg2mem\n store i64 %18, i64* %storemerge4.reg2mem\n store i64 %20, i64* %.lcssa.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %.lcssa.reload = load i64, i64* %.lcssa.reg2mem\n %21 = call i64 @FUNC(i64 %.lcssa.reload)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge4.reload, { 0, 2, 1 }\n uselistorder i64 %11, { 1, 0 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i8** %sv_1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64* %.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__zero_06-bad", "fun_name": "CWE617_Reachable_Assertion__zero_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n call void @__assert_fail(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([126 x i8], [126 x i8]* @gv_1, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @gv_2, i64 0, i64 0))\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_postdec_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 32, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %11 = icmp eq i32 %.reload, 5\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = trunc i32 %sv_0.0.reload to i8\n %14 = icmp eq i8 %13, -128\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n %15 = mul i32 %sv_0.0.reload, 16777216\n %sext2 = add i32 %15, -16777216\n %16 = ashr exact i32 %sext2, 24\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %19 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32 %3, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %4 = zext i32 %.reload to i64\n %5 = icmp eq i32 %.reload, 5\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_8, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %sv_0.0.off = add i32 %sv_0.0.reload, -6\n %7 = icmp ult i32 %sv_0.0.off, 94\n br i1 %7, label LBL_4, label LBL_7\n LBL_4:\n %8 = call i64* @malloc(i32 %sv_0.0.reload)\n %9 = icmp eq i64* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = ptrtoint i64* %8 to i64\n %12 = bitcast i64* %8 to i32*\n store i32 1819043176, i32* %12, align 4\n %13 = add i64 %11, 4\n %14 = inttoptr i64 %13 to i16*\n store i16 111, i16* %14, align 2\n %15 = call i64 @FUNC(i64 %11)\n call void @free(i64* %8)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_7:\n %16 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_1 to i64))\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %8, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_18-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %2 = add i64 %1, 8\n %3 = inttoptr i64 %2 to i64*\n store i64 32777976880262761, i64* %3, align 8\n store i64 0, i64* %sv_0, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %4, i32 99, i8* nonnull %5)\n %7 = call i64 @FUNC(i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 99, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_printf_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = sext i32 %2 to i64\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n %11 = call i32 @puts(i8* nonnull %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i8* (i8*)* @getenv, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 25, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -48\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @strtoul(i8* nonnull %20, i8** null, i32 0)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_11\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.0.off = add i32 %sv_0.0.ph.reload, -6\n %25 = icmp ult i32 %sv_0.0.off, 94\n br i1 %25, label LBL_8, label LBL_11\n LBL_8:\n %26 = call i64* @malloc(i32 %sv_0.0.ph.reload)\n %27 = icmp eq i64* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %29 = ptrtoint i64* %26 to i64\n %30 = bitcast i64* %26 to i32*\n store i32 1819043176, i32* %30, align 4\n %31 = add i64 %29, 4\n %32 = inttoptr i64 %31 to i16*\n store i16 111, i16* %32, align 2\n %33 = call i64 @FUNC(i64 %29)\n call void @free(i64* %26)\n br label LBL_12\n LBL_11:\n %34 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_0 to i64))\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %26, { 0, 1, 3, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*, i8**, i32)* @strtoul, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_max_postinc_07-bad", "fun_name": "CWE190_Integer_Overflow__char_max_postinc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 4294967168)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32*\n %sv_1 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 5, i32* %sv_1, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32* %sv_1, i32** %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %4 = load i32, i32* @gv_2, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32*, i32** %sv_0.0.reg2mem\n %6 = load i32, i32* %sv_0.0.reload, align 4\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_4\n LBL_4:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_calloc_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 20, i32 1)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i16*\n store i16 25978, i16* %7, align 2\n %8 = add i64 %5, 10\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_multiply_13-bad", "fun_name": "CWE191_Integer_Underflow__int_connect_socket_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8348 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_7, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_1 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_0, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n br i1 %14, label LBL_4, label LBL_5\n LBL_4:\n %15 = call i32 @close(i32 %4)\n br label LBL_7\n LBL_5:\n %16 = ptrtoint i64* %sv_2 to i64\n %17 = sext i32 %12 to i64\n %18 = add i64 %16, -22\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = bitcast i64* %sv_0 to i8*\n %22 = call i32 @atoi(i8* nonnull %21)\n %23 = call i32 @close(i32 %4)\n %24 = icmp slt i32 %22, 0\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n %26 = mul i32 %22, 2\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_7\n LBL_7:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder label LBL_7, { 3, 4, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_add_34-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = sext i1 %2 to i32\n %storemerge2.in = xor i32 %5, %6\n %storemerge2 = trunc i32 %storemerge2.in to i8\n %7 = icmp eq i8 %storemerge2, 127\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %sext3 = mul i32 %storemerge2.in, 16777216\n %sext = add i32 %sext3, 16777216\n %8 = ashr exact i32 %sext, 24\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %11 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %11, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_popen_13-bad", "fun_name": "CWE78_OS_Command_Injection__char_connect_socket_popen_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* inttoptr (i64 8348 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %30 = icmp eq %_IO_FILE* %29, null\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %31 = call i32 @pclose(%_IO_FILE* nonnull %29)\n br label LBL_11\n LBL_11:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_loop_12-bad", "fun_name": "CWE127_Buffer_Underread__char_declare_loop_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %sv_2.stack_var_-240 = select i1 %4, i64* %sv_2, i64* %sv_1\n %storemerge1 = ptrtoint i64* %sv_2.stack_var_-240 to i64\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n store i64 0, i64* %sv_1, align 8\n %6 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %7 = add i64 %storemerge2.reload, %storemerge1\n %8 = inttoptr i64 %7 to i8*\n %9 = load i8, i8* %8, align 1\n %10 = add i64 %storemerge2.reload, %6\n %11 = inttoptr i64 %10 to i8*\n store i8 %9, i8* %11, align 1\n %12 = load i64, i64* %sv_1, align 8\n %13 = add i64 %12, 1\n store i64 %13, i64* %sv_1, align 8\n %14 = icmp ult i64 %13, 100\n store i64 %13, i64* %storemerge2.reg2mem\n br i1 %14, label LBL_1, label LBL_2\n LBL_2:\n %15 = call i64 @FUNC(i64* nonnull %sv_0)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 0, 2, 1 }\n uselistorder i64 %storemerge2.reload, { 1, 0 }\n uselistorder i64* %sv_1, { 2, 3, 0, 1 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_preinc_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = zext i32 %4 to i64\n %6 = mul i64 %5, 1152921504606846976\n %7 = call i32 @rand()\n %8 = zext i32 %7 to i64\n %9 = mul i64 %8, 35184372088832\n %10 = call i32 @rand()\n %11 = sext i32 %10 to i64\n %12 = mul i64 %11, 1073741824\n %13 = call i32 @rand()\n %14 = sext i32 %13 to i64\n %15 = mul i64 %14, 32768\n %16 = call i32 @rand()\n %17 = sext i32 %16 to i64\n %18 = sext i1 %3 to i64\n %19 = xor i64 %6, %18\n %20 = xor i64 %19, %9\n %21 = xor i64 %20, %12\n %22 = xor i64 %21, %15\n %storemerge2 = xor i64 %22, %17\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n %26 = icmp eq i64 %storemerge2, 9223372036854775807\n br i1 %25, label LBL_4, label LBL_1\n LBL_1:\n br i1 %26, label LBL_3, label LBL_2\n LBL_2:\n %27 = add i64 %storemerge2, 1\n %28 = call i64 @FUNC(i64 %27)\n store i64 %28, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_3:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %29, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %26, label LBL_6, label LBL_5\n LBL_5:\n %30 = add i64 %storemerge2, 1\n %31 = call i64 @FUNC(i64 %30)\n store i64 %31, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %32 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %32, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %26, { 1, 0 }\n uselistorder i64 %storemerge2, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncat_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncat(i8* %4, i8* nonnull %6, i32 100)\n %8 = ptrtoint i64* %1 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_char_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 122)\n ret i64 %0\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_divide_17-bad", "fun_name": "CWE369_Divide_by_Zero__int_listen_socket_divide_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.047.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.047.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %3, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = add i64 %15, -22\n %17 = bitcast i64* %sv_1 to i8*\n %18 = sext i32 %12 to i64\n %19 = add i64 %16, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i32 @atoi(i8* nonnull %17)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.047.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.047.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.047.reload = load i32, i32* %sv_0.047.reg2mem\n %25 = udiv i32 100, %sv_0.047.reload\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.047.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_14, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_2\n LBL_2:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %sv_2 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_7, label LBL_4\n LBL_4:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %20, align 1\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_7\n LBL_7:\n %.pr = load i32, i32* @gv_0, align 4\n %25 = icmp eq i32 %.pr, 0\n br i1 %25, label LBL_14, label LBL_8\n LBL_8:\n %26 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %27 = icmp eq i32 %26, 1\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_14, label LBL_9\n LBL_9:\n %29 = load i64, i64* %sv_1, align 8\n %30 = trunc i64 %29 to i32\n %31 = icmp sgt i32 %30, ptrtoint (i1* @gv_4 to i32)\n br i1 %31, label LBL_14, label LBL_10\n LBL_10:\n %32 = and i64 %29, 4294967295\n %33 = icmp eq i64 %32, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %33, label LBL_13, label LBL_11\n LBL_11:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %34 = add i32 %storemerge4.reload, 1\n %35 = sext i32 %34 to i64\n %36 = icmp sgt i64 %32, %35\n store i32 %34, i32* %storemerge4.reg2mem\n br i1 %36, label LBL_11, label LBL_12\n LBL_12:\n %phitmp = zext i32 %34 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_13\n LBL_13:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %37 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_14\n LBL_14:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %34, { 1, 0, 2 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 ptrtoint (i1* @gv_4 to i32), { 1, 0 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 2, 0, 1, 3, 4 }\n uselistorder label LBL_14, { 1, 2, 3, 4, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_postinc_07-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_fscanf_postinc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = load i64, i64* %sv_0, align 8\n %9 = add i64 %8, 1\n store i64 %9, i64* %sv_0, align 8\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memcpy_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, -49\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_1, align 8\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n br label LBL_2\n LBL_2:\n store i64 4702111234474983745, i64* %sv_0, align 8\n %8 = bitcast i64* %sv_0 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = load i64, i64* %sv_1, align 8\n %12 = inttoptr i64 %11 to i64*\n %13 = call i64* @memcpy(i64* %12, i64* nonnull %sv_0, i32 %10)\n %14 = load i64, i64* %sv_1, align 8\n %15 = call i64 @FUNC(i64 %14)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_sub_01-bad", "fun_name": "CWE191_Integer_Underflow__char_min_sub_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 127)\n ret i64 %0\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_multiply_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8428 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i64, i64* %sv_0, align 8\n %6 = icmp slt i64 %.pr, 0\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = icmp slt i64 %.pr, -4611686018427387903\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = mul i64 %.pr, 2\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %.pr, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_postinc_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i32 %6, 1\n store i32 %8, i32* %sv_0, align 4\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %7 = add i64 %1, 28\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %9 = mul i64 %indvars.iv.reload, 4\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %1, { 0, 2, 1 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 0, 1, 4 }\n uselistorder i32 -1, { 2, 3, 4, 0, 5, 1 }\n uselistorder i64* (i32)* @malloc, { 1, 3, 2, 0, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_05-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.17.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.17.reg2mem\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.17.reg2mem\n br i1 %4, label LBL_9, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 13, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n store i32 -1, i32* %sv_0.17.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n %27 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.17.reg2mem\n br i1 %27, label LBL_12, label LBL_9\n LBL_9:\n %sv_0.17.reload = load i32, i32* %sv_0.17.reg2mem\n %28 = call i64* @malloc(i32 %sv_0.17.reload)\n %29 = icmp eq i64* %28, null\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n call void @exit(i32 -1)\n unreachable\n LBL_11:\n %31 = ptrtoint i64* %28 to i64\n %32 = add i32 %sv_0.17.reload, -1\n %33 = call i64* @memset(i64* %28, i32 65, i32 %32)\n %34 = sext i32 %sv_0.17.reload to i64\n %35 = add nsw i64 %34, -1\n %36 = add i64 %35, %31\n %37 = inttoptr i64 %36 to i8*\n store i8 0, i8* %37, align 1\n %38 = call i64 @FUNC(i64 %31)\n call void @free(i64* %28)\n br label LBL_12\n LBL_12:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %31, { 1, 0 }\n uselistorder i64* %28, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.17.reload, { 1, 2, 0 }\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.17.reg2mem, { 0, 4, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 4, 9, 1, 3, 5, 6, 7, 0, 8, 2 }\n uselistorder label LBL_9, { 3, 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %2 = call i32 @close(i32 %1)\n %3 = call i64 @FUNC(i64 40)\n %4 = icmp eq i64 %0, %3\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_malloc_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 20)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i64* %0, null\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i16*\n store i16 25978, i16* %7, align 2\n %8 = add i64 %5, 10\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 32777976880262761, i64* %6, align 8\n br label LBL_2\n LBL_2:\n %7 = call i64 @FUNC()\n %8 = trunc i64 %7 to i32\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n %10 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %11, i32 99, i8* nonnull %10)\n %13 = ptrtoint i64* %sv_0 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_4\n LBL_4:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 2, 1, 3, 0, 4 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_src_char_cat_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 49)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strcat(i8* nonnull %12, i8* %11)\n %14 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 5, 2, 3, 0, 4 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*)* @strcat, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_multiply_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n %13 = icmp slt i32 %sv_0.0.reload, 0\n %14 = icmp eq i1 %13, false\n %or.cond = or i1 %14, %12\n br i1 %or.cond, label LBL_8, label LBL_5\n LBL_5:\n %15 = icmp slt i32 %sv_0.0.reload, -1073741823\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n %16 = mul i32 %sv_0.0.reload, 2\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n br label LBL_8\n LBL_7:\n %19 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_int64_t_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %3 = call i64 @FUNC(i64 5)\n br label LBL_3\n LBL_3:\n %4 = load i32, i32* @gv_0, align 4\n %5 = zext i32 %4 to i64\n %6 = icmp eq i32 %4, 5\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %7, label LBL_5, label LBL_4\n LBL_4:\n %8 = call i64 @FUNC(i64 10)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_square_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 1)\n ret i64 %2\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fgets_strncpy_17-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__fgets_strncpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i8* @fgets(i8* nonnull %1, i32 14, %_IO_FILE* %2)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_2, align 8\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.03.reg2mem\n br label LBL_3\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %1)\n store i64 0, i64* %sv_2, align 8\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %9 = icmp sgt i32 %7, 99\n store i32 %7, i32* %sv_0.03.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.03.reload = load i32, i32* %sv_0.03.reg2mem\n %10 = ptrtoint i64* %sv_3 to i64\n %11 = bitcast i64* %sv_1 to i8*\n %12 = call i8* @strncpy(i8* nonnull %1, i8* nonnull %11, i32 %sv_0.03.reload)\n %13 = sext i32 %sv_0.03.reload to i64\n %14 = add i64 %10, -112\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n br label LBL_4\n LBL_4:\n %17 = ptrtoint i64* %sv_2 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.03.reload, { 1, 0 }\n uselistorder i64* %sv_2, { 3, 4, 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_sub_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 4294967293)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 4294967293, { 1, 0 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 8\n %9 = add i64 %8, %5\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n %11 = add i64 %9, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 2, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_10-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__CWE135_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_7, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 200)\n %3 = bitcast i64* %2 to i32*\n store i32* %3, i32** %sv_0, align 8\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = call i32* @wmemset(i32* %3, i32 65, i32 49)\n %7 = ptrtoint i64* %2 to i64\n %8 = add i64 %7, 196\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 4\n %.pr = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_7, label LBL_4\n LBL_4:\n %11 = load i32*, i32** %sv_0, align 8\n %12 = bitcast i32* %11 to i8*\n %13 = call i32 @strlen(i8* %12)\n %14 = add i32 %13, 1\n %15 = call i64* @calloc(i32 %14, i32 4)\n %16 = icmp eq i64* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %18 = bitcast i64* %15 to i32*\n %19 = call i32* @wcscpy(i32* %18, i32* %11)\n %20 = ptrtoint i64* %15 to i64\n %21 = call i64 @FUNC(i64 %20)\n call void @free(i64* %15)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %15, { 1, 0, 3, 2 }\n uselistorder i32* %11, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_loop_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -49\n %5 = and i64 %4, -16\n %6 = add i64 %2, -161\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %5 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %5, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = inttoptr i64 %7 to i64*\n %13 = call i64* @memset(i64* %12, i32 65, i32 99)\n %14 = add i64 %7, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC()\n %17 = trunc i64 %16 to i32\n %18 = icmp eq i32 %17, 0\n %spec.select = select i1 %18, i64 %1, i64 %7\n %19 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %20 = bitcast i64* %sv_0 to i8*\n %21 = call i32 @strlen(i8* nonnull %20)\n %22 = sext i32 %21 to i64\n %23 = icmp eq i32 %21, 0\n %.pre = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %23, label LBL_2, label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %24 = add i64 %storemerge1.reload, %spec.select\n %25 = inttoptr i64 %24 to i8*\n %26 = load i8, i8* %25, align 1\n %27 = add i64 %storemerge1.reload, %.pre\n %28 = inttoptr i64 %27 to i8*\n store i8 %26, i8* %28, align 1\n %29 = add nuw i64 %storemerge1.reload, 1\n %30 = icmp ult i64 %29, %22\n store i64 %29, i64* %storemerge1.reg2mem\n br i1 %30, label LBL_1, label LBL_2\n LBL_2:\n %31 = call i64 @FUNC(i64 %.pre)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %3, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %.pre, { 1, 0 }\n uselistorder i64 %7, { 0, 2, 1 }\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 5, 1, 0, 3, 4, 6 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fgets_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.1.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([127 x i8], [127 x i8]* @gv_3, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_4, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_2\n LBL_2:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %rax.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__open_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @close(i32 %1)\n br label LBL_2\n LBL_2:\n %4 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gv_1, i64 0, i64 0), i32 66)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i32 @close(i32 %4)\n br label LBL_4\n LBL_4:\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_ncpy_17-bad", "fun_name": "CWE124_Buffer_Underwrite__char_alloca_ncpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %3, -8\n %9 = inttoptr i64 %8 to i8*\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strncpy(i8* nonnull %9, i8* nonnull %11, i32 99)\n %13 = add i64 %3, 91\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n %15 = call i64 @FUNC(i64 %8)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 1, 3, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_large_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -20\n %6 = inttoptr i64 %5 to i32*\n store i32 1, i32* %6, align 4\n %7 = add i64 %4, -48\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 -20, { 1, 0 }\n uselistorder i32 5, { 1, 0, 2, 3, 4, 5 }\n uselistorder i32* @gv_0, { 4, 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_9, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %13, label LBL_8, label LBL_6\n LBL_6:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %14, -64\n %18 = add i64 %16, %17\n %19 = inttoptr i64 %18 to i32*\n store i32 1, i32* %19, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %20 = mul i64 %indvars.iv.reload, 4\n %21 = add i64 %20, %17\n %22 = inttoptr i64 %21 to i32*\n %23 = load i32, i32* %22, align 4\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %26 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_9\n LBL_9:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_square_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 4)\n ret i64 %2\n\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__zero_07-bad", "fun_name": "CWE617_Reachable_Assertion__zero_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([126 x i8], [126 x i8]* @gv_2, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @gv_3, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = load i32, i32* @gv_3, align 4\n %20 = zext i32 %19 to i64\n %21 = icmp eq i32 %19, 5\n %22 = icmp eq i1 %21, false\n store i64 %20, i64* %rax.0.reg2mem\n br i1 %22, label LBL_14, label LBL_8\n LBL_8:\n %23 = call i32 @strlen(i8* nonnull %3)\n %24 = icmp eq i32 %23, 0\n br i1 %24, label LBL_13, label LBL_9\n LBL_9:\n %25 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_10\n LBL_10:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %26 = add i64 %storemerge4.reload, %25\n %27 = inttoptr i64 %26 to i8*\n %28 = load i8, i8* %27, align 1\n %29 = icmp eq i8 %28, 83\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_12, label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_4 to i64))\n br label LBL_13\n LBL_12:\n %32 = add nuw i64 %storemerge4.reload, 1\n %33 = call i32 @strlen(i8* %3)\n %34 = sext i32 %33 to i64\n %35 = icmp ult i64 %32, %34\n store i64 %32, i64* %storemerge4.reg2mem\n br i1 %35, label LBL_10, label LBL_13\n LBL_13:\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %3, { 1, 0, 3, 2 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32* @gv_3, { 1, 0 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 5, 0, 4, 3, 1, 2, 6 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_13, { 0, 2, 1 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_add_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = icmp eq i8 %3, 127\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i8 %3, 1\n %6 = sext i8 %5 to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_10\n LBL_10:\n %29 = call i32 @strlen(i8* nonnull %4)\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_15, label LBL_11\n LBL_11:\n %31 = ptrtoint i64* %1 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_12\n LBL_12:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %32 = add i64 %storemerge4.reload, %31\n %33 = inttoptr i64 %32 to i8*\n %34 = load i8, i8* %33, align 1\n %35 = icmp eq i8 %34, 83\n %36 = icmp eq i1 %35, false\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n %37 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n br label LBL_15\n LBL_14:\n %38 = add nuw i64 %storemerge4.reload, 1\n %39 = call i32 @strlen(i8* %4)\n %40 = sext i32 %39 to i64\n %41 = icmp ult i64 %38, %40\n store i64 %38, i64* %storemerge4.reg2mem\n br i1 %41, label LBL_12, label LBL_15\n LBL_15:\n call void @free(i64* %1)\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 3, 0, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 5, 0, 4, 2, 1, 3, 6 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 4, 1, 5 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_15, { 0, 2, 1 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_loop_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = add i64 %0, -161\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = inttoptr i64 %5 to i64*\n %11 = call i64* @memset(i64* %10, i32 65, i32 99)\n %12 = add i64 %5, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i32 @strlen(i8* nonnull %15)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_3, label LBL_1\n LBL_1:\n %18 = sext i32 %16 to i64\n %19 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %20 = add i64 %storemerge1.reload, %5\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = add i64 %storemerge1.reload, %19\n %24 = inttoptr i64 %23 to i8*\n store i8 %22, i8* %24, align 1\n %25 = add nuw i64 %storemerge1.reload, 1\n %26 = icmp ult i64 %25, %18\n store i64 %25, i64* %storemerge1.reg2mem\n br i1 %26, label LBL_2, label LBL_3\n LBL_3:\n %27 = call i64 @FUNC(i64* nonnull %sv_0)\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %1, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %16, { 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE123_Write_What_Where_Condition__connect_socket_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n store i64 %1, i64* %sv_1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 %2, i64* %sv_0, align 8\n %3 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %4 = icmp eq i32 %3, 5\n store i64 %1, i64* %.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = load i64, i64* %sv_1, align 8\n store i64 %.pre, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n store i64 %1, i64* @gv_1, align 8\n store i64 %.reload, i64* @gv_2, align 8\n store i64 %.reload, i64* %sv_0, align 8\n %6 = add i64 %.reload, 8\n %7 = inttoptr i64 %6 to i64*\n store i64 %1, i64* %7, align 8\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %1, { 1, 2, 0, 3 }\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_loop_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = sext i32 %7 to i64\n %9 = add nsw i64 %8, 1\n %10 = icmp eq i64 %9, 0\n br i1 %10, label LBL_6, label LBL_4\n LBL_4:\n %11 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %12 = add i64 %storemerge1.reload, %sv_0.0.reload\n %13 = add i64 %storemerge1.reload, %11\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = inttoptr i64 %12 to i8*\n store i8 %15, i8* %16, align 1\n %17 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, %9\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %18 = call i64 @FUNC(i64 %sv_0.0.reload)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_strncpy_17-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_strncpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.03610.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -112\n %3 = bitcast i64* %sv_2 to i8*\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_7, label LBL_1\n LBL_1:\n %6 = bitcast i64* %sv_3 to %sockaddr*\n %7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %6, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_6, label LBL_2\n LBL_2:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_3\n LBL_3:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_6, label LBL_4\n LBL_4:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_2, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_5\n LBL_5:\n %18 = sext i32 %15 to i64\n %19 = add i64 %2, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i32 @atoi(i8* nonnull %3)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %4)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n %23 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.03610.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %24 = call i32 @close(i32 %4)\n %25 = call i32 @close(i32 %13)\n store i64 0, i64* %sv_2, align 8\n %26 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %27 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.03610.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %sv_0.03610.reload = load i32, i32* %sv_0.03610.reg2mem\n %28 = bitcast i64* %sv_1 to i8*\n %29 = call i8* @strncpy(i8* nonnull %3, i8* nonnull %28, i32 %sv_0.03610.reload)\n %30 = sext i32 %sv_0.03610.reload to i64\n %31 = add i64 %2, %30\n %32 = inttoptr i64 %31 to i8*\n store i8 0, i8* %32, align 1\n br label LBL_10\n LBL_10:\n %33 = call i64 @FUNC(i64* nonnull %sv_2)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %1, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.03610.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_3, { 2, 1, 0 }\n uselistorder i64* %sv_2, { 1, 4, 0, 3, 2 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8 0, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2, 3 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__char_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i8*\n %rax.0.reg2mem = alloca i64\n %1 = load i8*, i8** %0\n %2 = call i64 @FUNC()\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %7 = trunc i64 %2 to i32\n %8 = icmp eq i32 %7, 0\n %spec.select = select i1 %8, i8* %1, i8* null\n %9 = icmp eq i8* %spec.select, null\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n %10 = load i8, i8* %spec.select, align 1\n %11 = sext i8 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_1 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_square_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i128, align 8\n %0 = call i64 @FUNC(i64 40)\n store i128 0, i128* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i128* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i128, i128* %sv_0, align 8\n %10 = trunc i128 %9 to i64\n %.off = add i64 %10, 3037000499\n %11 = icmp ugt i64 %.off, 6074000998\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 0)\n br label LBL_6\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128* %sv_0, { 2, 0, 1 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__char_type_overrun_memcpy_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__char_type_overrun_memcpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n %5 = call i64* @memcpy(i64* nonnull %sv_0, i64* bitcast ([32 x i8]* @gv_0 to i64*), i32 32)\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder [32 x i8]* @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__sizeof_double_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n unreachable\n LBL_2:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %6 = call i128 @FUNC(i64 9098483789791991595)\n %7 = call i64 @__asm_movsd.1(i128 %6)\n store i64 %7, i64* %3, align 8\n %8 = call i128 @FUNC(i64 %7)\n %9 = call i64 @FUNC()\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_snprintf_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_snprintf_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %sv_0.0.reload, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %7 = ptrtoint i8* %sv_0.0.reload to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %4 = mul i64 %indvars.iv6.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %7 = add i64 %1, 28\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %9 = mul i64 %indvars.iv.reload, 4\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %1, { 0, 2, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 7, 8, 11, 2, 1, 9, 0, 10, 14, 6, 5, 12, 3, 13, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_34-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_34_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -17\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n store i64 %3, i64* %sv_1, align 8\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = inttoptr i64 %3 to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_0, i32 %7)\n %10 = call i64 @FUNC(i64 %3)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 3, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_realloc_32-bad", "fun_name": "CWE401_Memory_Leak__int_realloc_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @realloc(i64* null, i32 400)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i32*\n store i32 5, i32* %4, align 4\n %5 = call i64 @FUNC(i64 5)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %0 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n store i64 %13, i64* %rax.0.reg2mem\n br i1 %15, label LBL_11, label LBL_5\n LBL_5:\n %16 = call i32 @strlen(i8* nonnull %3)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_10, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %19 = add i64 %storemerge3.reload, %18\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 83\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_9:\n %25 = add nuw i64 %storemerge3.reload, 1\n %26 = call i32 @strlen(i8* %3)\n %27 = sext i32 %26 to i64\n %28 = icmp ult i64 %25, %27\n store i64 %25, i64* %storemerge3.reg2mem\n br i1 %28, label LBL_7, label LBL_10\n LBL_10:\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %3, { 1, 0, 3, 2 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i8* (i8*)* @getenv, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 5, 0, 4, 3, 1, 2, 6 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_10, { 0, 2, 1 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n %spec.select = select i1 %1, i32 -1, i32 99\n %2 = call i64* @malloc(i32 %spec.select)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %5 = ptrtoint i64* %2 to i64\n %6 = add nsw i32 %spec.select, -1\n %7 = call i64* @memset(i64* %2, i32 65, i32 %6)\n %8 = sext i32 %6 to i64\n %9 = add i64 %8, %5\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %5)\n call void @free(i64* %2)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %2, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n uselistorder i32 -1, { 2, 3, 1, 4, 5, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_02-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_console_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %24 = icmp eq i32 %23, 1\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_11, label LBL_7\n LBL_7:\n %26 = load i64, i64* %sv_1, align 8\n %27 = and i64 %26, 4294967295\n %28 = icmp eq i64 %27, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %29 = add i32 %storemerge4.reload, 1\n %30 = sext i32 %29 to i64\n %31 = icmp sgt i64 %27, %30\n store i32 %29, i32* %storemerge4.reg2mem\n br i1 %31, label LBL_8, label LBL_9\n LBL_9:\n %phitmp = zext i32 %29 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %32 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_11\n LBL_11:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %29, { 1, 0, 2 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_malloc_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 100)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = ptrtoint i64* %2 to i64\n store i64 7453010373643542593, i64* %2, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC(i64 %5)\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @free(i64* nonnull %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 1, 2, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv8.reg2mem = alloca i64\n %indvars.iv11.reg2mem = alloca i64\n %indvars.iv14.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 40)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n store i64 0, i64* %indvars.iv14.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv14.reload = load i64, i64* %indvars.iv14.reg2mem\n %8 = mul i64 %indvars.iv14.reload, 4\n %9 = add i64 %8, %5\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %indvars.iv.next15 = add nuw nsw i64 %indvars.iv14.reload, 1\n %exitcond16 = icmp eq i64 %indvars.iv.next15, 10\n store i64 %indvars.iv.next15, i64* %indvars.iv14.reg2mem\n br i1 %exitcond16, label LBL_4, label LBL_3\n LBL_4:\n %11 = add i64 %5, 28\n %12 = inttoptr i64 %11 to i32*\n store i32 1, i32* %12, align 4\n store i64 0, i64* %indvars.iv11.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv11.reload = load i64, i64* %indvars.iv11.reg2mem\n %13 = mul i64 %indvars.iv11.reload, 4\n %14 = add i64 %13, %5\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next12 = add nuw nsw i64 %indvars.iv11.reload, 1\n %exitcond13 = icmp eq i64 %indvars.iv.next12, 10\n store i64 %indvars.iv.next12, i64* %indvars.iv11.reg2mem\n br i1 %exitcond13, label LBL_6, label LBL_5\n LBL_6:\n call void @free(i64* %4)\n br label LBL_13\n LBL_7:\n store i64 0, i64* %indvars.iv8.reg2mem\n br i1 %7, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 -1)\n unreachable\n LBL_9:\n %indvars.iv8.reload = load i64, i64* %indvars.iv8.reg2mem\n %19 = mul i64 %indvars.iv8.reload, 4\n %20 = add i64 %19, %5\n %21 = inttoptr i64 %20 to i32*\n store i32 0, i32* %21, align 4\n %indvars.iv.next9 = add nuw nsw i64 %indvars.iv8.reload, 1\n %exitcond10 = icmp eq i64 %indvars.iv.next9, 10\n store i64 %indvars.iv.next9, i64* %indvars.iv8.reg2mem\n br i1 %exitcond10, label LBL_10, label LBL_9\n LBL_10:\n %22 = add i64 %5, 28\n %23 = inttoptr i64 %22 to i32*\n store i32 1, i32* %23, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_11\n LBL_11:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %24 = mul i64 %indvars.iv.reload, 4\n %25 = add i64 %24, %5\n %26 = inttoptr i64 %25 to i32*\n %27 = load i32, i32* %26, align 4\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_11\n LBL_12:\n call void @free(i64* %4)\n br label LBL_13\n LBL_13:\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %7, { 1, 0 }\n uselistorder i64 %5, { 0, 5, 1, 2, 4, 3 }\n uselistorder i64* %indvars.iv14.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv11.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv8.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 3, 2, 1, 0, 7, 6, 5, 4 }\n uselistorder void (i32)* @exit, { 2, 0, 1, 3, 4 }\n uselistorder i32 -1, { 6, 7, 11, 12, 3, 2, 8, 0, 5, 4, 10, 1, 9 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_multiply_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = zext i32 %3 to i64\n %5 = mul i64 %4, 1152921504606846976\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 35184372088832\n %9 = call i32 @rand()\n %10 = sext i32 %9 to i64\n %11 = mul i64 %10, 1073741824\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 32768\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = sext i1 %2 to i64\n %18 = xor i64 %5, %17\n %19 = xor i64 %18, %8\n %20 = xor i64 %19, %11\n %21 = xor i64 %20, %14\n %storemerge = xor i64 %21, %16\n %22 = icmp slt i64 %storemerge, 0\n %23 = icmp eq i1 %22, false\n store i64 1, i64* %rax.0.reg2mem\n br i1 %23, label LBL_4, label LBL_1\n LBL_1:\n %24 = icmp slt i64 %storemerge, -4611686018427387903\n br i1 %24, label LBL_3, label LBL_2\n LBL_2:\n %25 = mul i64 %storemerge, 2\n %26 = call i64 @FUNC(i64 %25)\n store i64 %26, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %27 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %27, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_char_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %spec.select = select i1 %2, i64 4294967295, i64 122\n %3 = call i64 @FUNC(i64 %spec.select)\n ret i64 %3\n\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n uselistorder i64 122, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_sub_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 8416 to i32*), align 32\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 32, i32* %sv_0.03.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n %11 = trunc i32 %10 to i8\n %12 = icmp eq i8 %11, -128\n store i32 %10, i32* %sv_0.03.reg2mem\n br i1 %12, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.03.reload = load i32, i32* %sv_0.03.reg2mem\n %13 = mul i32 %sv_0.03.reload, 16777216\n %sext2 = add i32 %13, -16777216\n %14 = ashr exact i32 %sext2, 24\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.03.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_ncpy_06-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_ncpy_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -17\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n %5 = bitcast i8** %sv_1 to i64*\n store i64 %3, i64* %5, align 8\n store i8 0, i8* %4, align 16\n store i64 4702111234474983745, i64* %sv_0, align 8\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = add i32 %7, 1\n %9 = load i8*, i8** %sv_1, align 8\n %10 = call i8* @strncpy(i8* %9, i8* nonnull %6, i32 %8)\n %11 = load i8*, i8** %sv_1, align 8\n %12 = ptrtoint i8* %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 3, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_loop_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC()\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %11 = add i64 %storemerge2.reload, %3\n %12 = add i64 %storemerge2.reload, %10\n %13 = inttoptr i64 %12 to i8*\n %14 = load i8, i8* %13, align 1\n %15 = inttoptr i64 %11 to i8*\n store i8 %14, i8* %15, align 1\n %16 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n store i8 0, i8* %7, align 1\n %17 = call i64 @FUNC(i64 %3)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i64 %3, { 1, 0, 3, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_memmove_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, -33\n %6 = and i64 %5, -16\n %sv_2.0 = select i1 %3, i64 0, i64 %6\n store i64 0, i64* %sv_0, align 8\n %7 = inttoptr i64 %sv_2.0 to i64*\n %8 = call i64* @memmove(i64* %7, i64* nonnull %sv_0, i32 40)\n %9 = inttoptr i64 %sv_2.0 to i32*\n %10 = load i32, i32* %9, align 16\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_snprintf_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_1 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_3\n LBL_3:\n %13 = load i32, i32* @gv_2, align 4\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_5:\n store i64 0, i64* %sv_0, align 8\n %16 = bitcast i64* %sv_0 to i8*\n %17 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %16, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n %18 = ptrtoint i64* %sv_0 to i64\n %19 = call i64 @FUNC(i64 %18)\n br label LBL_6\n LBL_6:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_14-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = load i32, i32* @gv_1, align 4\n %30 = icmp eq i32 %29, 5\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n store i64 0, i64* %sv_0, align 8\n %32 = bitcast i64* %sv_0 to i8*\n %33 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %32, i32 99, i8* nonnull %1)\n %34 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_11\n LBL_11:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fprintf_14-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fprintf_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_2, i64 0, i64 0))\n %6 = sext i32 %5 to i64\n %7 = icmp eq i32 %5, 0\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_3 to i64))\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_13-bad", "fun_name": "CWE126_Buffer_Overread__malloc_char_loop_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 49)\n %9 = add i64 %7, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = bitcast i64* %sv_1 to i8*\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = sext i32 %13 to i64\n %16 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_6\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %17 = add i64 %storemerge1.reload, %sv_0.0.reload\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = add i64 %storemerge1.reload, %16\n %21 = inttoptr i64 %20 to i8*\n store i8 %19, i8* %21, align 1\n %22 = add nuw i64 %storemerge1.reload, 1\n %23 = icmp ult i64 %22, %15\n store i64 %22, i64* %storemerge1.reg2mem\n br i1 %23, label LBL_6, label LBL_7\n LBL_7:\n %24 = call i64 @FUNC(i64* nonnull %sv_1)\n %25 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %25)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__sizeof_double_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* inttoptr (i64 8372 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n unreachable\n LBL_2:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %6 = call i128 @FUNC(i64 9098483789791991595)\n %7 = call i64 @__asm_movsd.1(i128 %6)\n store i64 %7, i64* %3, align 8\n %8 = call i128 @FUNC(i64 %7)\n %9 = call i64 @FUNC()\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncat_34-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 49)\n %6 = add i64 %3, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = inttoptr i64 %3 to i8*\n store i8* %8, i8** %sv_1, align 8\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strncat(i8* nonnull %10, i8* %8, i32 %9)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %8, { 1, 0, 2 }\n uselistorder i64 %3, { 0, 3, 2, 1 }\n uselistorder i8** %sv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memcpy_02-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memcpy_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = load i64, i64* %sv_0, align 8\n %7 = inttoptr i64 %3 to i64*\n store i64 %6, i64* %7, align 16\n %8 = or i64 %3, 8\n %9 = inttoptr i64 %8 to i64*\n %10 = add i64 %3, 16\n %11 = inttoptr i64 %10 to i64*\n %12 = add i64 %3, 24\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %3, 32\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %3, 40\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %3, 48\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %3, 56\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %3, 64\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %3, 72\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %3, 80\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %3, 88\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %3, 96\n %31 = inttoptr i64 %30 to i32*\n %32 = add i64 %3, 99\n %33 = inttoptr i64 %32 to i8*\n store i8 0, i8* %33, align 1\n %34 = call i64 @FUNC(i64 %3)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %1, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 14, 13, 2, 10, 3, 12, 4, 5, 6, 7, 8, 9, 11, 0, 1, 15 }\n uselistorder i64* %sv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_ncpy_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strncpy(i8* nonnull %10, i8* nonnull %8, i32 %9)\n %12 = call i64 @FUNC(i64 %.pre-phi.reload)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %8, { 1, 0 }\n uselistorder i64* %sv_1, { 3, 1, 2, 0 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_square_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i128, align 8\n %0 = call i64 @FUNC(i64 40)\n store i128 0, i128* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i128* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i128, i128* %sv_0, align 8\n %7 = trunc i128 %6 to i64\n %.off = add i64 %7, 3037000499\n %8 = icmp ugt i64 %.off, 6074000998\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 0)\n br label LBL_5\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128* %sv_0, { 2, 0, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_multiply_06-bad", "fun_name": "CWE190_Integer_Overflow__short_rand_multiply_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = mul i32 %4, 32768\n %6 = call i32 @rand()\n %7 = xor i32 %6, %5\n %8 = sext i1 %2 to i32\n %storemerge.in = xor i32 %7, %8\n %9 = trunc i32 %storemerge.in to i16\n %10 = icmp slt i16 %9, 1\n store i64 5, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %sext2 = mul i32 %storemerge.in, 131072\n %11 = ashr exact i32 %sext2, 16\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_struct_alloca_13-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_struct_alloca_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %6 = and i64 %5, -16\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %6\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 8\n %10 = or i64 %8, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 1, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n store i64 %6, i64* %sv_0, align 8\n store i64 %6, i64* %.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i64, i64* %.reg2mem\n %13 = call i64 @FUNC(i64 %.reload)\n %14 = load i64, i64* %sv_0, align 8\n %15 = inttoptr i64 %14 to i64*\n call void @free(i64* %15)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_14-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 10)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_1 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = add i64 %8, -48\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = mul i64 %storemerge1.reload, 4\n %11 = add i64 %10, %sv_0.0.reload\n %12 = add i64 %9, %10\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = inttoptr i64 %11 to i32*\n store i32 %14, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %16, 10\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %17 = inttoptr i64 %sv_0.0.reload to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %21)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_static_32-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_int_static_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %1 = mul i64 %storemerge1.reload, 4\n %2 = add i64 %1, ptrtoint (i64* @gv_0 to i64)\n %3 = inttoptr i64 %2 to i32*\n store i32 5, i32* %3, align 4\n %4 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %4, 100\n store i64 %4, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %5 = load i32, i32* bitcast (i64* @gv_0 to i32*), align 8\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n call void @free(i64* nonnull @gv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_multiply_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = load i32, i32* @gv_0, align 4\n %15 = icmp eq i32 %14, 5\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n %16 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %17 = icmp slt i32 %sv_0.0.reload, 0\n %18 = icmp eq i1 %17, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %18, label LBL_8, label LBL_5\n LBL_5:\n %19 = icmp slt i32 %sv_0.0.reload, -1073741823\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n %20 = mul i32 %sv_0.0.reload, 2\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_7:\n %23 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE571_Expression_Always_True__global_return_01-bad", "fun_name": "CWE571_Expression_Always_True__global_return_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_0 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_cpy_02-bad", "fun_name": "CWE124_Buffer_Underwrite__char_alloca_cpy_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = load i64, i64* %sv_1, align 8\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i64, i64* %sv_1, align 8\n %10 = add i64 %9, -8\n %11 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %12 = inttoptr i64 %10 to i8*\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i8* @strcpy(i8* %12, i8* nonnull %13)\n %15 = call i64 @FUNC(i64 %10)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %10, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n store i64 0, i64* %sv_0, align 8\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %23, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %25 = ptrtoint i64* %sv_0 to i64\n %26 = call i64 @FUNC(i64 %25)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_struct_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n store i64 0, i64* %sv_0, align 8\n %5 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_for_loop_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %0 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n %1 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %1, 20\n store i64 %1, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n ret i64 20\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 20, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_loop_17-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_loop_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %11 = add i64 %8, %storemerge3.reload\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = add i64 %storemerge3.reload, %10\n %15 = inttoptr i64 %14 to i8*\n store i8 %13, i8* %15, align 1\n %16 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %17 = call i64 @FUNC(i64* nonnull %sv_0)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memmove_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %5, 5\n %7 = icmp eq i1 %6, false\n %8 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %7, i64 %1, i64 %8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 @strlen(i8* nonnull %10)\n %12 = inttoptr i64 %spec.select to i64*\n %13 = call i64* @memmove(i64* nonnull %sv_0, i64* %12, i32 %11)\n %14 = ptrtoint i64* %sv_0 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %2, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 5, 4, 3, 2, 1, 0, 6 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE506_Embedded_Malicious_Code__file_transfer_listen_socket_14-bad", "fun_name": "CWE506_Embedded_Malicious_Code__file_transfer_listen_socket_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %rsp.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 %0, i64* %rsp.0.reg2mem\n br label LBL_1\n LBL_1:\n %rsp.0.reload = load i64, i64* %rsp.0.reg2mem\n %2 = add i64 %rsp.0.reload, -4096\n %3 = icmp eq i64 %2, %1\n %4 = icmp eq i1 %3, false\n store i64 %2, i64* %rsp.0.reg2mem\n br i1 %4, label LBL_1, label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_13, label LBL_3\n LBL_3:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_7, label LBL_4\n LBL_4:\n %11 = bitcast i64* %sv_1 to i8*\n %12 = call i8* @fgets(i8* nonnull %11, i32 65535, %_IO_FILE* nonnull %9)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i64 0, i64* %sv_1, align 8\n br label LBL_6\n LBL_6:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_7\n LBL_7:\n %17 = call i32 @socket(i32 2, i32 1, i32 6)\n %18 = icmp eq i32 %17, -1\n br i1 %18, label LBL_13, label LBL_8\n LBL_8:\n %19 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %20 = call i16 @htons(i16 27015)\n %21 = bitcast i64* %sv_0 to %sockaddr*\n %22 = call i32 @bind(i32 %17, %sockaddr* nonnull %21, i32 16)\n %23 = icmp eq i32 %22, -1\n br i1 %23, label LBL_11, label LBL_9\n LBL_9:\n %24 = call i32 @listen(i32 %17, i32 5)\n %25 = icmp eq i32 %24, -1\n br i1 %25, label LBL_11, label LBL_10\n LBL_10:\n %26 = call i32 @accept(i32 %17, %sockaddr* null, i32* null)\n %27 = icmp eq i32 %26, -1\n br i1 %27, label LBL_11, label LBL_12\n LBL_11:\n %28 = call i32 @close(i32 %17)\n br label LBL_13\n LBL_12:\n %29 = bitcast i64* %sv_1 to i8*\n %30 = call i32 @strlen(i8* nonnull %29)\n %31 = call i32 @send(i32 %26, i64* nonnull %sv_1, i32 %30, i32 0)\n %32 = call i32 @strlen(i8* nonnull %29)\n %33 = call i32 @close(i32 %17)\n %34 = call i32 @close(i32 %26)\n br label LBL_13\n LBL_13:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %5, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %rsp.0.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_13, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_multiply_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = mul i32 %4, 1073741824\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = xor i32 %7, %5\n %9 = call i32 @rand()\n %10 = xor i32 %8, %9\n %11 = sext i1 %3 to i32\n %storemerge.in = xor i32 %10, %11\n %12 = icmp eq i32 %storemerge.in, 0\n br i1 %12, label LBL_4, label LBL_1\n LBL_1:\n %13 = icmp ult i32 %storemerge.in, 2147483647\n br i1 %13, label LBL_2, label LBL_3\n LBL_2:\n %14 = mul i32 %storemerge.in, 2\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_4\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 0, 2, 1 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_fprintf_08-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_fprintf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_2, i64 0, i64 0))\n %5 = sext i32 %4 to i64\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_1, align 8\n br label LBL_3\n LBL_3:\n %7 = ptrtoint i64* %sv_2 to i64\n %8 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = add i64 %7, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = mul i64 %storemerge1.reload, 8\n %11 = load i64, i64* %sv_1, align 8\n %12 = add i64 %11, %10\n %13 = add i64 %9, %10\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = inttoptr i64 %12 to i64*\n store i64 %15, i64* %16, align 8\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %18 = load i64, i64* %sv_1, align 8\n %19 = inttoptr i64 %18 to i64*\n %20 = load i64, i64* %19, align 8\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_04-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -17\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n %5 = bitcast i8** %sv_1 to i64*\n store i64 %3, i64* %5, align 8\n store i8 0, i8* %4, align 16\n store i64 4702111234474983745, i64* %sv_0, align 8\n %6 = load i8*, i8** %sv_1, align 8\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i8* @strcpy(i8* %6, i8* nonnull %7)\n %9 = load i8*, i8** %sv_1, align 8\n %10 = ptrtoint i8* %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 3, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_rand_14-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_rand_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n %14 = sext i1 %6 to i32\n %storemerge.in = xor i32 %13, %14\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %15 = load i32, i32* @gv_0, align 4\n %16 = icmp eq i32 %15, 5\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %18 = icmp sgt i32 %sv_0.0.reload, 9\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n %19 = ptrtoint i64* %sv_1 to i64\n %20 = sext i32 %sv_0.0.reload to i64\n %21 = mul i64 %20, 4\n %22 = add i64 %19, -64\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i32*\n %25 = load i32, i32* %24, align 4\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n br label LBL_6\n LBL_5:\n %28 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_6:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %8, 5\n store i64 %3, i64* %sv_0.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n %10 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %sv_0.0.reload\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge1.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %19 = call i64 @FUNC(i64 %12)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %1, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n store i8* null, i8** %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @gv_2, i64 0, i64 0), i8** %sv_0, align 8\n br label LBL_3\n LBL_3:\n %4 = load i32, i32* @gv_3, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_5, label LBL_4\n LBL_4:\n %6 = ptrtoint i8** %sv_0 to i64\n %7 = load i8*, i8** %sv_0, align 8\n %8 = call i32 @strlen(i8* %7)\n %9 = sext i32 %8 to i64\n %10 = add nsw i64 %9, 24\n %11 = udiv i64 %10, 16\n %12 = mul i64 %11, 16\n %13 = and i64 %12, -4096\n %14 = and i64 %12, 4080\n %15 = add i64 %6, 15\n %16 = sub i64 %15, %14\n %17 = sub i64 %16, %13\n %18 = and i64 %17, -16\n %19 = load i8*, i8** %sv_0, align 8\n %20 = inttoptr i64 %18 to i8*\n %21 = call i8* @strcpy(i8* %20, i8* %19)\n %22 = call i64 @FUNC(i64 %18)\n br label LBL_5\n LBL_5:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %18, { 1, 0 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i8** %sv_0, { 4, 3, 0, 2, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_printf_11-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_environment_printf_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_3\n LBL_3:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n %17 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n br label LBL_5\n LBL_5:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %1, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_add_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp eq i32 %3, 2147483647\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i32 %3, 1\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_sub_17-bad", "fun_name": "CWE191_Integer_Underflow__int_fgets_sub_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_1, align 8\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i8* @fgets(i8* nonnull %1, i32 14, %_IO_FILE* %2)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %1)\n %phitmp = add i32 %5, -1\n %phitmp5 = zext i32 %phitmp to i64\n store i64 %phitmp5, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64 @FUNC(i64 %sv_0.0.reload)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_calloc_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @calloc(i32 100, i32 1)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n store i64 7453010373643542593, i64* %3, align 8\n %7 = add i64 %6, 8\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC(i64 %6)\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %13, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -161\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_0, i32 100)\n %8 = add i64 %3, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %3)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_12-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_3\n LBL_2:\n store i64 20, i64* %sv_0, align 8\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = load i64, i64* %sv_0, align 8\n %10 = icmp ult i64 %9, 6\n br i1 %8, label LBL_9, label LBL_4\n LBL_4:\n br i1 %10, label LBL_8, label LBL_5\n LBL_5:\n %11 = trunc i64 %9 to i32\n %12 = call i64* @malloc(i32 %11)\n %13 = icmp eq i64* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %15 = ptrtoint i64* %12 to i64\n %16 = bitcast i64* %12 to i32*\n store i32 1819043176, i32* %16, align 4\n %17 = add i64 %15, 4\n %18 = inttoptr i64 %17 to i16*\n store i16 111, i16* %18, align 2\n %19 = call i64 @FUNC(i64 %15)\n call void @free(i64* %12)\n br label LBL_14\n LBL_8:\n %20 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_14\n LBL_9:\n %21 = icmp ult i64 %9, 100\n %or.cond = icmp eq i1 %10, %21\n br i1 %or.cond, label LBL_13, label LBL_10\n LBL_10:\n %22 = trunc i64 %9 to i32\n %23 = call i64* @malloc(i32 %22)\n %24 = icmp eq i64* %23, null\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_12, label LBL_11\n LBL_11:\n call void @exit(i32 -1)\n unreachable\n LBL_12:\n %26 = ptrtoint i64* %23 to i64\n %27 = bitcast i64* %23 to i32*\n store i32 1819043176, i32* %27, align 4\n %28 = add i64 %26, 4\n %29 = inttoptr i64 %28 to i16*\n store i16 111, i16* %29, align 2\n %30 = call i64 @FUNC(i64 %26)\n call void @free(i64* %23)\n br label LBL_14\n LBL_13:\n %31 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_3 to i64))\n br label LBL_14\n LBL_14:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %23, { 0, 1, 3, 2 }\n uselistorder i64* %12, { 0, 1, 3, 2 }\n uselistorder i64 %9, { 1, 2, 0, 3 }\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %.pre = inttoptr i64 %3 to i64*\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i64* @memset(i64* %.pre, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n br label LBL_2\n LBL_2:\n %10 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = call i32 @strlen(i8* %10)\n %12 = call i64* @memcpy(i64* nonnull %sv_0, i64* %.pre, i32 %11)\n %13 = call i64 @FUNC(i64 %3)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 3, 2, 0, 4 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_17-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -401\n %3 = and i64 %2, -16\n store i32 0, i32* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i32, i32* %storemerge1.reg2mem\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %4 = add nuw nsw i32 %storemerge1.reload, 1\n %exitcond3 = icmp eq i32 %4, 2\n store i64 %3, i64* %sv_0.0.reg2mem\n store i32 %4, i32* %storemerge1.reg2mem\n br i1 %exitcond3, label LBL_2, label LBL_1\n LBL_2:\n %5 = ptrtoint i64* %sv_3 to i64\n %6 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 100)\n %7 = add i64 %5, -816\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %8 = mul i64 %storemerge2.reload, 8\n %9 = add i64 %8, %sv_0.0.reload\n %10 = add i64 %7, %8\n %11 = inttoptr i64 %10 to i64*\n %12 = load i64, i64* %11, align 8\n %13 = inttoptr i64 %9 to i64*\n store i64 %12, i64* %13, align 8\n %14 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %14, 100\n store i64 %14, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %15 = inttoptr i64 %sv_0.0.reload to i64*\n %16 = load i64, i64* %15, align 8\n %17 = call i64 @FUNC(i64 %16)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 1, 0 }\n uselistorder i32* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE404_Improper_Resource_Shutdown__open_fclose_01-bad", "fun_name": "CWE404_Improper_Resource_Shutdown__open_fclose_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.in.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = icmp eq i32 %0, -1\n store i64 -1, i64* %rax.0.in.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = zext i32 %0 to i64\n %3 = inttoptr i64 %2 to %_IO_FILE*\n %4 = call i32 @fclose(%_IO_FILE* %3)\n %phitmp = sext i32 %4 to i64\n store i64 %phitmp, i64* %rax.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.in.reload = load i64, i64* %rax.0.in.reg2mem\n ret i64 %rax.0.in.reload\n\n uselistorder i32 %0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE391_Unchecked_Error_Condition__sqrt_14-bad", "fun_name": "CWE391_Unchecked_Error_Condition__sqrt_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i128 @FUNC(i64 -4616189618054758400)\n %5 = trunc i128 %4 to i64\n %6 = bitcast i64 %5 to double\n %7 = call double @sqrt(double %6)\n %8 = fptrunc double %7 to float\n %9 = bitcast float %8 to i32\n %10 = sext i32 %9 to i128\n %11 = call i64 @__asm_movq.1(i128 %10)\n %12 = call i128 @FUNC(i64 %11)\n %13 = call i64 @FUNC()\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 26, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @strtoul(i8* nonnull %5, i8** null, i32 0)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_10, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %sv_0.0.off = add i32 %sv_0.0.reload, -6\n %13 = icmp ult i32 %sv_0.0.off, 94\n br i1 %13, label LBL_6, label LBL_9\n LBL_6:\n %14 = call i64* @malloc(i32 %sv_0.0.reload)\n %15 = icmp eq i64* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %17 = ptrtoint i64* %14 to i64\n %18 = bitcast i64* %14 to i32*\n store i32 1819043176, i32* %18, align 4\n %19 = add i64 %17, 4\n %20 = inttoptr i64 %19 to i16*\n store i16 111, i16* %20, align 2\n %21 = call i64 @FUNC(i64 %17)\n call void @free(i64* %14)\n br label LBL_10\n LBL_9:\n %22 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_3 to i64))\n br label LBL_10\n LBL_10:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %14, { 0, 1, 3, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i8*, i8**, i32)* @strtoul, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_loop_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_loop_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.lcssa.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i8** %sv_1 to i64\n %5 = add i64 %4, -17\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n %8 = bitcast i8** %sv_1 to i64*\n store i64 %6, i64* %8, align 8\n store i8 0, i8* %7, align 16\n br label LBL_2\n LBL_2:\n store i64 4702111234474983745, i64* %sv_0, align 8\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = sext i32 %10 to i64\n %12 = add nsw i64 %11, 1\n %13 = icmp eq i64 %12, 0\n %14 = load i8*, i8** %sv_1, align 8\n %15 = ptrtoint i8* %14 to i64\n store i64 %15, i64* %.lcssa.reg2mem\n br i1 %13, label LBL_5, label LBL_3\n LBL_3:\n %16 = ptrtoint i64* %sv_0 to i64\n store i64 %15, i64* %.reg2mem\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %.reload = load i64, i64* %.reg2mem\n %17 = add i64 %storemerge3.reload, %.reload\n %18 = add i64 %storemerge3.reload, %16\n %19 = inttoptr i64 %18 to i8*\n %20 = load i8, i8* %19, align 1\n %21 = inttoptr i64 %17 to i8*\n store i8 %20, i8* %21, align 1\n %22 = add nuw i64 %storemerge3.reload, 1\n %23 = load i8*, i8** %sv_1, align 8\n %24 = ptrtoint i8* %23 to i64\n %exitcond = icmp eq i64 %22, %12\n store i64 %24, i64* %.reg2mem\n store i64 %22, i64* %storemerge3.reg2mem\n store i64 %24, i64* %.lcssa.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %.lcssa.reload = load i64, i64* %.lcssa.reg2mem\n %25 = call i64 @FUNC(i64 %.lcssa.reload)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i64 %15, { 1, 0 }\n uselistorder i8** %sv_1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64* %.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_file_05-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_file_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_1, align 8\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_6, label LBL_1\n LBL_1:\n %11 = call i32 @strlen(i8* nonnull %8)\n %12 = sext i32 %11 to i64\n %13 = sub nsw i64 250, %12\n %14 = icmp ult i64 %13, 2\n br i1 %14, label LBL_6, label LBL_2\n LBL_2:\n %15 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %16 = icmp eq %_IO_FILE* %15, null\n br i1 %16, label LBL_6, label LBL_3\n LBL_3:\n %17 = sub i32 250, %11\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n %21 = call i8* @fgets(i8* %20, i32 %17, %_IO_FILE* nonnull %15)\n %22 = icmp eq i8* %21, null\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i8 0, i8* %20, align 1\n br label LBL_5\n LBL_5:\n %25 = call i32 @fclose(%_IO_FILE* nonnull %15)\n br label LBL_6\n LBL_6:\n %26 = call i32 @putenv(i8* nonnull %8)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %2, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_square_10-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_fscanf_square_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i128, align 8\n %0 = call i64 @FUNC(i64 40)\n store i128 0, i128* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i128* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 0)\n br label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_multiply_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = call i64 @FUNC(i64 4)\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__addition_13-bad", "fun_name": "CWE398_Poor_Code_Quality__addition_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 0)\n %5 = call i64 @FUNC(i64 0)\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 1)\n %1 = call i64 @FUNC(i64 2)\n ret i64 %1\n\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_popen_02-bad", "fun_name": "CWE426_Untrusted_Search_Path__char_popen_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 757101420, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = ptrtoint i64* %sv_0 to i64\n %3 = or i64 %2, 4\n %4 = inttoptr i64 %3 to i16*\n store i16 24940, i16* %4, align 4\n %5 = or i64 %2, 6\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 2\n %7 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0))\n %8 = icmp eq %_IO_FILE* %7, null\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %9 = call i32 @pclose(%_IO_FILE* nonnull %7)\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_add_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 3)\n ret i64 %0\n\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 25, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_8\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -48\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @strtoul(i8* nonnull %18, i8** null, i32 0)\n %20 = call i32 @close(i32 %1)\n %sv_3.0.off = add i32 %19, -6\n %21 = icmp ult i32 %sv_3.0.off, 94\n br i1 %21, label LBL_5, label LBL_8\n LBL_5:\n %22 = call i64* @malloc(i32 %19)\n %23 = icmp eq i64* %22, null\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %25 = ptrtoint i64* %22 to i64\n %26 = bitcast i64* %22 to i32*\n store i32 1819043176, i32* %26, align 4\n %27 = add i64 %25, 4\n %28 = inttoptr i64 %27 to i16*\n store i16 111, i16* %28, align 2\n %29 = call i64 @FUNC(i64 %25)\n call void @free(i64* %22)\n br label LBL_9\n LBL_8:\n %30 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %22, { 0, 1, 3, 2 }\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i8*, i8**, i32)* @strtoul, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE605_Multiple_Binds_Same_Port__basic_12-bad", "fun_name": "CWE605_Multiple_Binds_Same_Port__basic_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %sv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n br i1 %4, label LBL_14, label LBL_1\n LBL_1:\n store i64 1, i64* %sv_2, align 8\n %7 = call i32 @socket(i32 2, i32 1, i32 6)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_13, label LBL_2\n LBL_2:\n %9 = call i32 @setsockopt(i32 %7, i32 1, i32 2, i64* nonnull %sv_2, i32 4)\n %10 = icmp eq i32 %9, 0\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_11, label LBL_3\n LBL_3:\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %13 = call i16 @htons(i16 27015)\n %14 = bitcast i64* %sv_0 to %sockaddr*\n %15 = call i32 @bind(i32 %7, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_4\n LBL_4:\n %17 = call i32 @listen(i32 %7, i32 5)\n %18 = icmp eq i32 %17, -1\n br i1 %18, label LBL_11, label LBL_5\n LBL_5:\n %19 = call i32 @accept(i32 %7, %sockaddr* null, i32* null)\n %20 = icmp eq i32 %19, -1\n br i1 %20, label LBL_11, label LBL_6\n LBL_6:\n %21 = sub i32 99, %6\n %22 = ptrtoint i64* %sv_1 to i64\n %23 = sext i32 %6 to i64\n %24 = add i64 %23, %22\n %25 = inttoptr i64 %24 to i64*\n %26 = call i32 @recv(i32 %19, i64* %25, i32 %21, i32 0)\n %27 = add i32 %26, 1\n %28 = icmp ult i32 %27, 2\n br i1 %28, label LBL_12, label LBL_7\n LBL_7:\n %29 = sext i32 %26 to i64\n %30 = add i64 %0, -112\n %31 = add i64 %30, %29\n %32 = inttoptr i64 %31 to i8*\n store i8 0, i8* %32, align 1\n %33 = call i8* @strchr(i8* nonnull %5, i32 13)\n %34 = icmp eq i8* %33, null\n br i1 %34, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %33, align 1\n br label LBL_9\n LBL_9:\n %35 = call i8* @strchr(i8* nonnull %5, i32 10)\n %36 = icmp eq i8* %35, null\n br i1 %36, label LBL_12, label LBL_10\n LBL_10:\n store i8 0, i8* %35, align 1\n br label LBL_12\n LBL_11:\n %37 = call i32 @close(i32 %7)\n br label LBL_13\n LBL_12:\n %38 = call i32 @close(i32 %7)\n %39 = call i32 @close(i32 %19)\n br label LBL_13\n LBL_13:\n %40 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_26\n LBL_14:\n %41 = call i32 @socket(i32 2, i32 1, i32 6)\n %42 = icmp eq i32 %41, -1\n br i1 %42, label LBL_25, label LBL_15\n LBL_15:\n %43 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %44 = call i16 @htons(i16 27015)\n %45 = bitcast i64* %sv_0 to %sockaddr*\n %46 = call i32 @bind(i32 %41, %sockaddr* nonnull %45, i32 16)\n %47 = icmp eq i32 %46, -1\n br i1 %47, label LBL_23, label LBL_16\n LBL_16:\n %48 = call i32 @listen(i32 %41, i32 5)\n %49 = icmp eq i32 %48, -1\n br i1 %49, label LBL_23, label LBL_17\n LBL_17:\n %50 = call i32 @accept(i32 %41, %sockaddr* null, i32* null)\n %51 = icmp eq i32 %50, -1\n br i1 %51, label LBL_23, label LBL_18\n LBL_18:\n %52 = sub i32 99, %6\n %53 = ptrtoint i64* %sv_1 to i64\n %54 = sext i32 %6 to i64\n %55 = add i64 %54, %53\n %56 = inttoptr i64 %55 to i64*\n %57 = call i32 @recv(i32 %50, i64* %56, i32 %52, i32 0)\n %58 = add i32 %57, 1\n %59 = icmp ult i32 %58, 2\n br i1 %59, label LBL_24, label LBL_19\n LBL_19:\n %60 = sext i32 %57 to i64\n %61 = add i64 %0, -112\n %62 = add i64 %61, %60\n %63 = inttoptr i64 %62 to i8*\n store i8 0, i8* %63, align 1\n %64 = call i8* @strchr(i8* nonnull %5, i32 13)\n %65 = icmp eq i8* %64, null\n br i1 %65, label LBL_21, label LBL_20\n LBL_20:\n store i8 0, i8* %64, align 1\n br label LBL_21\n LBL_21:\n %66 = call i8* @strchr(i8* nonnull %5, i32 10)\n %67 = icmp eq i8* %66, null\n br i1 %67, label LBL_24, label LBL_22\n LBL_22:\n store i8 0, i8* %66, align 1\n br label LBL_24\n LBL_23:\n %68 = call i32 @close(i32 %41)\n br label LBL_25\n LBL_24:\n %69 = call i32 @close(i32 %41)\n %70 = call i32 @close(i32 %50)\n br label LBL_25\n LBL_25:\n %71 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_26\n LBL_26:\n %72 = call i64 @FUNC(i64 40)\n %73 = icmp eq i64 %1, %72\n store i64 0, i64* %rax.0.reg2mem\n br i1 %73, label LBL_28, label LBL_27\n LBL_27:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_28\n LBL_28:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %57, { 1, 0 }\n uselistorder i32 %41, { 4, 0, 1, 2, 3, 5 }\n uselistorder i32 %26, { 1, 0 }\n uselistorder i32 %7, { 4, 0, 1, 2, 3, 5, 6 }\n uselistorder i32 %6, { 3, 2, 0, 1 }\n uselistorder i8* %5, { 2, 3, 1, 0, 4 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 3, 2, 5, 1, 4 }\n uselistorder i64* %sv_0, { 0, 4, 1, 2, 5, 3 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_25, { 2, 1, 0 }\n uselistorder label LBL_13, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_popen_17-bad", "fun_name": "CWE78_OS_Command_Injection__char_file_popen_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = sub i32 100, %2\n %10 = add i64 %3, %8\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %9, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n %17 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_3, i64 0, i64 0))\n %18 = icmp eq %_IO_FILE* %17, null\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n %19 = call i32 @pclose(%_IO_FILE* nonnull %17)\n br label LBL_7\n LBL_7:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %1, { 1, 0 }\n uselistorder %_IO_FILE* null, { 1, 0 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_partial_init_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv11.reg2mem = alloca i64\n %indvars.iv14.reg2mem = alloca i64\n %storemerge310.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = ptrtoint i32* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -33\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv14.reg2mem\n br i1 %6, label LBL_3, label LBL_1\n LBL_1:\n store i32 0, i32* %sv_0, align 4\n store i32 0, i32* %storemerge310.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge310.reload = load i32, i32* %storemerge310.reg2mem\n %7 = sext i32 %storemerge310.reload to i64\n %8 = mul i64 %7, 4\n %9 = add i64 %8, %3\n %10 = inttoptr i64 %9 to i32*\n store i32 %storemerge310.reload, i32* %10, align 4\n %11 = load i32, i32* %sv_0, align 4\n %12 = add i32 %11, 1\n store i32 %12, i32* %sv_0, align 4\n %13 = icmp slt i32 %12, 10\n store i32 %12, i32* %storemerge310.reg2mem\n br i1 %13, label LBL_2, label LBL_4\n LBL_3:\n %indvars.iv14.reload = load i64, i64* %indvars.iv14.reg2mem\n %14 = mul i64 %indvars.iv14.reload, 4\n %15 = add i64 %14, %3\n %16 = inttoptr i64 %15 to i32*\n %17 = trunc i64 %indvars.iv14.reload to i32\n store i32 %17, i32* %16, align 4\n %indvars.iv.next15 = add nuw nsw i64 %indvars.iv14.reload, 1\n %exitcond16 = icmp eq i64 %indvars.iv.next15, 10\n store i64 %indvars.iv.next15, i64* %indvars.iv14.reg2mem\n br i1 %exitcond16, label LBL_4, label LBL_3\n LBL_4:\n %18 = call i64 @FUNC()\n %19 = trunc i64 %18 to i32\n %20 = icmp eq i32 %19, 0\n store i64 0, i64* %indvars.iv11.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n %indvars.iv11.reload = load i64, i64* %indvars.iv11.reg2mem\n %21 = mul i64 %indvars.iv11.reload, 4\n %22 = add i64 %21, %3\n %23 = inttoptr i64 %22 to i32*\n %24 = load i32, i32* %23, align 4\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n %indvars.iv.next12 = add nuw nsw i64 %indvars.iv11.reload, 1\n %exitcond13 = icmp eq i64 %indvars.iv.next12, 10\n store i64 %indvars.iv.next12, i64* %indvars.iv11.reg2mem\n br i1 %exitcond13, label LBL_7, label LBL_5\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %27 = mul i64 %indvars.iv.reload, 4\n %28 = add i64 %27, %3\n %29 = inttoptr i64 %28 to i32*\n %30 = load i32, i32* %29, align 4\n %31 = zext i32 %30 to i64\n %32 = call i64 @FUNC(i64 %31)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %1, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 0, 2, 1 }\n uselistorder i32 %storemerge310.reload, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 3, 0, 2 }\n uselistorder i32* %storemerge310.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv14.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv11.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 2, 1, 0, 6, 5, 4, 3 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.034.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.034.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.034.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, 0\n store i32 %19, i32* %sv_0.034.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.034.reload = load i32, i32* %sv_0.034.reg2mem\n %22 = urem i32 100, %sv_0.034.reload\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.034.reg2mem, { 0, 3, 2, 1 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp ult i32 %3, 2147483647\n br i1 %5, label LBL_2, label LBL_3\n LBL_2:\n %6 = mul i32 %3, 2\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_13-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_connect_socket_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = load i32, i32* inttoptr (i64 8352 to i32*), align 32\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %30 = icmp eq i32 %29, 1\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_14, label LBL_10\n LBL_10:\n %32 = load i64, i64* %sv_1, align 8\n %33 = and i64 %32, 4294967295\n %34 = icmp eq i64 %33, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %34, label LBL_13, label LBL_11\n LBL_11:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %35 = add i32 %storemerge5.reload, 1\n %36 = sext i32 %35 to i64\n %37 = icmp sgt i64 %33, %36\n store i32 %35, i32* %storemerge5.reg2mem\n br i1 %37, label LBL_11, label LBL_12\n LBL_12:\n %phitmp = zext i32 %35 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_13\n LBL_13:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %38 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_14\n LBL_14:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %35, { 1, 0, 2 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_9, { 2, 0, 1 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int64_t_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %5 = load i32, i32* @gv_2, align 4\n %6 = icmp eq i32 %5, 0\n %spec.select = select i1 %6, i64 %1, i64 0\n %7 = icmp eq i64 %spec.select, 0\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = inttoptr i64 %spec.select to i64*\n %9 = load i64, i64* %8, align 8\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_3 to i64))\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_add_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 3)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 3, { 1, 0 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_sub_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i8, i8* %sv_0, align 1\n %10 = icmp eq i8 %9, -128\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = add i8 %9, -1\n %12 = sext i8 %11 to i64\n %13 = and i64 %12, 4294967295\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_6\n LBL_5:\n %15 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i8*\n %sv_0 = alloca i8*, align 8\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i8* null, i8** %.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 50)\n %4 = bitcast i64* %3 to i8*\n store i8* %4, i8** %sv_0, align 8\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i64* @memset(i64* %3, i32 65, i32 49)\n %8 = ptrtoint i64* %3 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = load i8*, i8** %sv_0, align 8\n store i8* %11, i8** %.reg2mem\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC()\n %13 = trunc i64 %12 to i32\n %14 = icmp eq i32 %13, 0\n store i64 %12, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_5\n LBL_5:\n %.reload = load i8*, i8** %.reg2mem\n %15 = call i32 @strlen(i8* %.reload)\n %16 = add i32 %15, 1\n %17 = call i64* @calloc(i32 %16, i32 1)\n %18 = icmp eq i64* %17, null\n %19 = icmp eq i1 %18, false\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %20 = bitcast i64* %17 to i8*\n %21 = call i8* @strcpy(i8* %20, i8* %.reload)\n %22 = ptrtoint i64* %17 to i64\n %23 = call i64 @FUNC(i64 %22)\n call void @free(i64* %17)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %17, { 1, 0, 3, 2 }\n uselistorder i8** %.reg2mem, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i32, i32)* @calloc, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 0, 7, 6, 5, 4, 3, 2, 1, 8 }\n uselistorder i32 -1, { 0, 1, 3, 2, 4, 5, 6, 7 }\n uselistorder i64* null, { 0, 1, 3, 2, 4, 5, 6, 7 }\n uselistorder i64* (i32)* @malloc, { 2, 1, 3, 0, 4 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_cpy_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %5 = bitcast i64* %sv_2 to i8*\n store i8* %5, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 199)\n %7 = bitcast i64* %sv_1 to i8*\n %8 = call i8* @strcpy(i8* nonnull %7, i8* %sv_0.0.reload)\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_predec_10-bad", "fun_name": "CWE191_Integer_Underflow__char_fscanf_predec_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i8, i8* %sv_0, align 1\n %7 = add i8 %6, -1\n store i8 %7, i8* %sv_0, align 1\n %8 = sext i8 %7 to i64\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 2, 0, 3 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__connect_socket_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @gv_2, i64 0, i64 0), i32 151, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_3, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i8*, i8*, i32, i8*)* @__assert_fail, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_fprintf_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = load %_IO_FILE*, %_IO_FILE** @gv_2, align 8\n %24 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_0)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fprintf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_2, { 1, 0 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memmove_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = add i32 %7, 1\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_1, i32 %8)\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_printf_04-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_file_printf_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = sub i32 100, %2\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %3, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %8, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n %17 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_declare_cpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = add i64 %6, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 %6, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %9 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strcpy(i8* nonnull %10, i8* nonnull %9)\n %12 = call i64 @FUNC(i64 %.pre-phi.reload)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 3, 1, 2, 0 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memmove_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 0, i64* %sv_1, align 8\n %2 = add i64 %1, -816\n %3 = add i64 %1, -812\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %2, %4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 8\n %7 = load i64, i64* %sv_1, align 8\n %8 = mul i64 %7, 8\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = load i64, i64* %sv_1, align 8\n %12 = add i64 %11, 1\n store i64 %12, i64* %sv_1, align 8\n %13 = icmp ult i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %13, label LBL_1, label LBL_2\n LBL_2:\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %14, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %16 = and i64 %15, -16\n %17 = inttoptr i64 %16 to i64*\n %18 = call i64* @memmove(i64* %17, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %19 = call i64 @FUNC(i64 %16)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 1, 0 }\n uselistorder i64 %12, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 4, 1, 2, 3, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_10, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %sv_0.1.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_10\n LBL_10:\n %.reload = load i32, i32* %.reg2mem\n %28 = icmp eq i32 %.reload, 5\n br i1 %28, label LBL_12, label LBL_11\n LBL_11:\n %29 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_15\n LBL_12:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %30 = icmp eq i32 %sv_0.1.reload, 0\n br i1 %30, label LBL_14, label LBL_13\n LBL_13:\n %31 = urem i32 100, %sv_0.1.reload\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_15\n LBL_14:\n %34 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n br label LBL_15\n LBL_15:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__strdup_char_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = add i64 %3, -97\n %5 = and i64 %4, -16\n store i64 %5, i64* %sv_0, align 8\n %6 = inttoptr i64 %5 to i64*\n store i64 7453010373645639777, i64* %6, align 16\n %7 = or i64 %5, 8\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 8\n %9 = load i64, i64* %sv_0, align 8\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_2:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 0, 1, 3, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_printf_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %sv_0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_5\n LBL_5:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_6\n LBL_6:\n %19 = load i32, i32* @gv_4, align 4\n %20 = icmp eq i32 %19, 0\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n %21 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_5 to i64))\n br label LBL_9\n LBL_8:\n %22 = call i32 @puts(i8* nonnull %1)\n br label LBL_9\n LBL_9:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_cpy_14-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_cpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %7, -8\n %12 = inttoptr i64 %11 to i8*\n store i8* %12, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %13 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 199)\n %14 = bitcast i64* %sv_1 to i8*\n %15 = call i8* @strcpy(i8* nonnull %14, i8* %sv_0.0.reload)\n %16 = call i64 @FUNC(i64* nonnull %sv_1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %storemerge34.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %0 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_4\n LBL_4:\n %13 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %14 = icmp eq i32 %13, 5\n br i1 %14, label LBL_5, label LBL_7\n LBL_5:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_11, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge34.reg2mem\n br label LBL_8\n LBL_7:\n %18 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %18, i64* %storemerge.reg2mem\n br label LBL_12\n LBL_8:\n %storemerge34.reload = load i64, i64* %storemerge34.reg2mem\n %19 = add i64 %storemerge34.reload, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 83\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_10, label LBL_9\n LBL_9:\n %24 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_10:\n %25 = add nuw i64 %storemerge34.reload, 1\n %26 = call i32 @strlen(i8* %3)\n %27 = sext i32 %26 to i64\n %28 = icmp ult i64 %25, %27\n store i64 %25, i64* %storemerge34.reg2mem\n br i1 %28, label LBL_8, label LBL_11\n LBL_11:\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_12\n LBL_12:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i8* %3, { 1, 0, 3, 2 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge34.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_11, { 0, 2, 1 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_square_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i128, align 8\n %0 = call i64 @FUNC(i64 40)\n store i128 0, i128* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i128* nonnull %sv_0)\n %3 = load i128, i128* %sv_0, align 8\n %4 = trunc i128 %3 to i64\n %.off = add i64 %4, 3037000499\n %5 = icmp ugt i64 %.off, 6074000998\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 0)\n br label LBL_3\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128* %sv_0, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_calloc_06-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 8)\n %1 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %2 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_multiply_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %5 = icmp slt i32 %4, 0\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_1\n LBL_1:\n %7 = icmp slt i32 %4, -1073741823\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = mul i64 %3, 2\n %9 = and i64 %8, 4294967294\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_4\n LBL_3:\n %11 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_min_sub_10-bad", "fun_name": "CWE191_Integer_Underflow__unsigned_int_min_sub_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 4294967295)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_cpy_08-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_cpy_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC()\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = add i64 %3, -8\n %12 = inttoptr i64 %11 to i8*\n store i8* %12, i8** %sv_1, align 8\n br label LBL_2\n LBL_2:\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %14 = load i8*, i8** %sv_1, align 8\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i8* @strcpy(i8* nonnull %15, i8* %14)\n %17 = call i64 @FUNC(i64* nonnull %sv_0)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i8** %sv_1, { 2, 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_sleep_10-bad", "fun_name": "CWE400_Resource_Exhaustion__fgets_sleep_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = call i32 @usleep(i32 %sv_0.0.ph.reload)\n %11 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_6, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_multiply_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = sub i32 0, %3\n %7 = sub i32 %6, 1\n %8 = zext i32 %7 to i64\n %9 = sext i32 %3 to i64\n %storemerge4.le = select i1 %5, i64 %8, i64 %9\n %10 = trunc i64 %storemerge4.le to i8\n %11 = icmp slt i8 %10, 1\n store i64 %storemerge4.le, i64* %rax.1.reg2mem\n br i1 %11, label LBL_4, label LBL_1\n LBL_1:\n %12 = icmp sgt i8 %10, 62\n br i1 %12, label LBL_3, label LBL_2\n LBL_2:\n %13 = trunc i64 %storemerge4.le to i32\n %sext = mul i32 %13, 33554432\n %14 = ashr exact i32 %sext, 24\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n store i64 %16, i64* %rax.1.reg2mem\n br label LBL_4\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %17, i64* %rax.1.reg2mem\n br label LBL_4\n LBL_4:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i8 %10, { 1, 0 }\n uselistorder i64 %storemerge4.le, { 2, 0, 1 }\n uselistorder i32 %3, { 1, 0 }\n uselistorder i64* %rax.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_4, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE170_char_loop_14-bad", "fun_name": "CWE126_Buffer_Overread__CWE170_char_loop_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 149)\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %6 = add i64 %indvars.iv.reload, %4\n %7 = add i64 %6, -160\n %8 = inttoptr i64 %7 to i8*\n %9 = load i8, i8* %8, align 1\n %10 = add i64 %6, -272\n %11 = inttoptr i64 %10 to i8*\n store i8 %9, i8* %11, align 1\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 99\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_rand_add_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge2.in = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge2.in, 2147483647\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = add i32 %storemerge2.in, 1\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %15, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i32 %storemerge2.in, { 1, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_int64_t_18-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i64*\n store i64 5, i64* %6, align 8\n %7 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %7, 100\n store i64 %7, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %8 = load i64, i64* %0, align 8\n %9 = call i64 @FUNC(i64 %8)\n ret i64 %9\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_ncpy_13-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_ncpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %9 = icmp eq i32 %8, 5\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = add i64 %3, -8\n %12 = inttoptr i64 %11 to i8*\n store i8* %12, i8** %sv_1, align 8\n br label LBL_2\n LBL_2:\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = bitcast i64* %sv_0 to i8*\n %15 = call i32 @strlen(i8* nonnull %14)\n %16 = load i8*, i8** %sv_1, align 8\n %17 = call i8* @strncpy(i8* nonnull %14, i8* %16, i32 %15)\n %18 = call i64 @FUNC(i64* nonnull %sv_0)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i8** %sv_1, { 2, 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_postdec_12-bad", "fun_name": "CWE191_Integer_Underflow__short_fscanf_postdec_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_3\n LBL_2:\n store i16 -2, i16* %sv_0, align 2\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = load i16, i16* %sv_0, align 2\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %10 = add i16 %9, -1\n store i16 %10, i16* %sv_0, align 2\n %11 = sext i16 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_8\n LBL_5:\n %14 = icmp eq i16 %9, -32768\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n %15 = add i16 %9, -1\n store i16 %15, i16* %sv_0, align 2\n %16 = sext i16 %15 to i64\n %17 = and i64 %16, 4294967295\n %18 = call i64 @FUNC(i64 %17)\n br label LBL_8\n LBL_7:\n %19 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %9, { 0, 2, 1 }\n uselistorder i16* %sv_0, { 1, 3, 2, 4, 0, 5 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_multiply_06-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = mul i32 %4, 32768\n %6 = call i32 @rand()\n %7 = xor i32 %6, %5\n %8 = sext i1 %2 to i32\n %storemerge.in = xor i32 %7, %8\n %9 = trunc i32 %storemerge.in to i16\n %10 = icmp slt i16 %9, 1\n store i64 5, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_1\n LBL_1:\n %11 = icmp sgt i16 %9, 16382\n br i1 %11, label LBL_3, label LBL_2\n LBL_2:\n %sext2 = mul i32 %storemerge.in, 131072\n %12 = ashr exact i32 %sext2, 16\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memmove_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = call i64* @memmove(i64* nonnull %sv_0, i64* %1, i32 %10)\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 1, 3, 2, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %3)\n br label LBL_4\n LBL_4:\n %6 = load i32, i32* @gv_1, align 4\n %7 = icmp eq i32 %6, 5\n store i64 5, i64* %rax.0.reg2mem\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memmove_12-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memmove_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n store i64* %4, i64** %sv_0.0.in.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %8 = icmp eq i64* %7, null\n %9 = icmp eq i1 %8, false\n store i64* %7, i64** %sv_0.0.in.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %sv_0.0.in.reload = load i64*, i64** %sv_0.0.in.reg2mem\n %10 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %10, i64 0, i64 100)\n %11 = call i64* @memmove(i64* %sv_0.0.in.reload, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_0 to i32))\n %12 = load i64, i64* %sv_0.0.in.reload, align 8\n %13 = call i64 @FUNC(i64 %12)\n call void @free(i64* %sv_0.0.in.reload)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.in.reload, { 2, 1, 0 }\n uselistorder i64** %sv_0.0.in.reg2mem, { 0, 2, 1 }\n uselistorder i32 ptrtoint (i32* @gv_0 to i32), { 1, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_no_init_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %6, i64* %rax.2.reg2mem\n br label LBL_6\n LBL_4:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %7 = mul i64 %indvars.iv5.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv5.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_5, label LBL_4\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %16, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_declare_cpy_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, 49\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n store i64 0, i64* %sv_0, align 8\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strcpy(i8* nonnull %6, i8* nonnull %1)\n %8 = call i64 @FUNC(i64 %3)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i8*\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 49)\n %7 = add i64 %3, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strcat(i8* nonnull %9, i8* %4)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1, 3, 4 }\n uselistorder i8* (i8*, i8*)* @strcat, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_07-bad", "fun_name": "CWE416_Use_After_Free__malloc_free_struct_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 2, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %3)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i32, i32* %.reg2mem\n %13 = zext i32 %.reload to i64\n %14 = icmp eq i32 %.reload, 5\n %15 = icmp eq i1 %14, false\n store i64 %13, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %16 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_10-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv4.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_13, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_13, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = call i64* @malloc(i32 40)\n %11 = ptrtoint i64* %10 to i64\n %12 = icmp eq i64* %10, null\n %13 = icmp eq i1 %12, false\n store i64 0, i64* %indvars.iv4.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %14 = mul i64 %indvars.iv4.reload, 4\n %15 = add i64 %14, %11\n %16 = inttoptr i64 %15 to i32*\n store i32 0, i32* %16, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 10\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n br i1 %exitcond6, label LBL_8, label LBL_7\n LBL_8:\n %17 = icmp slt i32 %sv_0.0.ph.reload, 0\n br i1 %17, label LBL_11, label LBL_9\n LBL_9:\n %18 = sext i32 %sv_0.0.ph.reload to i64\n %19 = mul i64 %18, 4\n %20 = add i64 %19, %11\n %21 = inttoptr i64 %20 to i32*\n store i32 1, i32* %21, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %22 = mul i64 %indvars.iv.reload, 4\n %23 = add i64 %22, %11\n %24 = inttoptr i64 %23 to i32*\n %25 = load i32, i32* %24, align 4\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_10\n LBL_11:\n %28 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_12:\n call void @free(i64* %10)\n br label LBL_13\n LBL_13:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 1, 0, 2 }\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_13, { 1, 2, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_fprintf_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 32777976880262761, i64* %6, align 8\n br label LBL_2\n LBL_2:\n %7 = call i64 @FUNC()\n %8 = trunc i64 %7 to i32\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n %10 = bitcast i64* %sv_0 to i8*\n %11 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %12 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %11, i8* nonnull %10)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1, 3 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fprintf, { 3, 2, 1, 0, 4 }\n uselistorder %_IO_FILE** @gv_0, { 3, 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fscanf_malloc_01-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__fscanf_malloc_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp sgt i16 %3, 99\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = sext i16 %3 to i32\n %6 = call i64* @malloc(i32 %5)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %9 = ptrtoint i64* %6 to i64\n %10 = load i16, i16* %sv_0, align 2\n %11 = sext i16 %10 to i32\n %12 = add nsw i32 %11, -1\n %13 = call i64* @memset(i64* %6, i32 65, i32 %12)\n %14 = load i16, i16* %sv_0, align 2\n %15 = sext i16 %14 to i64\n %16 = add i64 %9, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = call i64 @FUNC(i64 %9)\n call void @free(i64* %6)\n br label LBL_4\n LBL_4:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %9, { 1, 0 }\n uselistorder i64* %6, { 0, 1, 3, 2 }\n uselistorder i16* %sv_0, { 1, 2, 3, 0, 4 }\n uselistorder i8 0, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memmove_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 100)\n %5 = call i64* @memmove(i64* %1, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %6 = load i64, i64* %1, align 8\n %7 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_square_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = sub i8 0, %3\n %5 = icmp slt i8 %4, 0\n %6 = icmp eq i1 %5, false\n %.v = select i1 %6, i8 %4, i8 %3\n %7 = icmp ult i8 %.v, 12\n br i1 %7, label LBL_1, label LBL_2\n LBL_1:\n %8 = mul i8 %3, %3\n %9 = sext i8 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_2:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8 %3, { 1, 0, 2, 3 }\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 0 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE404_Improper_Resource_Shutdown__open_fclose_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = load i32, i32* inttoptr (i64 8380 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i32 %0, -1\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = call i32 @close(i32 %0)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_listen_socket_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv13.reg2mem = alloca i64\n %sv_0.069.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.069.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.069.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.069.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.069.reload = load i32, i32* %sv_0.069.reg2mem\n %25 = call i64* @malloc(i32 40)\n %26 = ptrtoint i64* %25 to i64\n %27 = icmp eq i64* %25, null\n %28 = icmp eq i1 %27, false\n store i64 0, i64* %indvars.iv13.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %indvars.iv13.reload = load i64, i64* %indvars.iv13.reg2mem\n %29 = mul i64 %indvars.iv13.reload, 4\n %30 = add i64 %29, %26\n %31 = inttoptr i64 %30 to i32*\n store i32 0, i32* %31, align 4\n %indvars.iv.next14 = add nuw nsw i64 %indvars.iv13.reload, 1\n %exitcond15 = icmp eq i64 %indvars.iv.next14, 10\n store i64 %indvars.iv.next14, i64* %indvars.iv13.reg2mem\n br i1 %exitcond15, label LBL_11, label LBL_10\n LBL_11:\n %32 = icmp ugt i32 %sv_0.069.reload, 9\n br i1 %32, label LBL_14, label LBL_12\n LBL_12:\n %33 = sext i32 %sv_0.069.reload to i64\n %34 = mul i64 %33, 4\n %35 = add i64 %34, %26\n %36 = inttoptr i64 %35 to i32*\n store i32 1, i32* %36, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_13\n LBL_13:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %37 = mul i64 %indvars.iv.reload, 4\n %38 = add i64 %37, %26\n %39 = inttoptr i64 %38 to i32*\n %40 = load i32, i32* %39, align 4\n %41 = zext i32 %40 to i64\n %42 = call i64 @FUNC(i64 %41)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_15, label LBL_13\n LBL_14:\n %43 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_15\n LBL_15:\n call void @free(i64* %25)\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %26, { 0, 2, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.069.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %indvars.iv13.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC()\n %36 = trunc i64 %35 to i32\n %37 = icmp eq i32 %36, 0\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n store i64 0, i64* %sv_0, align 8\n %38 = bitcast i64* %sv_0 to i8*\n %39 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %38, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_2)\n %40 = ptrtoint i64* %sv_0 to i64\n %41 = call i64 @FUNC(i64 %40)\n br label LBL_14\n LBL_14:\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 2, 0, 4, 5, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_loop_13-bad", "fun_name": "CWE126_Buffer_Overread__char_alloca_loop_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -49\n %5 = and i64 %4, -16\n %6 = add i64 %2, -161\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %5 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %5, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = inttoptr i64 %7 to i64*\n %13 = call i64* @memset(i64* %12, i32 65, i32 99)\n %14 = add i64 %7, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %17 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @strlen(i8* nonnull %18)\n %20 = icmp eq i32 %19, 0\n br i1 %20, label LBL_3, label LBL_1\n LBL_1:\n %21 = icmp eq i32 %16, 5\n %22 = icmp eq i1 %21, false\n %spec.select = select i1 %22, i64 %1, i64 %5\n %23 = sext i32 %19 to i64\n %24 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %25 = add i64 %storemerge1.reload, %spec.select\n %26 = inttoptr i64 %25 to i8*\n %27 = load i8, i8* %26, align 1\n %28 = add i64 %storemerge1.reload, %24\n %29 = inttoptr i64 %28 to i8*\n store i8 %27, i8* %29, align 1\n %30 = add nuw i64 %storemerge1.reload, 1\n %31 = icmp ult i64 %30, %23\n store i64 %30, i64* %storemerge1.reg2mem\n br i1 %31, label LBL_2, label LBL_3\n LBL_3:\n %32 = call i64 @FUNC(i64* nonnull %sv_0)\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %3, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %19, { 1, 0 }\n uselistorder i64 %7, { 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 2, 1, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_postdec_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n %10 = load i8, i8* %sv_0, align 1\n %11 = icmp eq i8 %10, -128\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = add i8 %10, -1\n store i8 %12, i8* %sv_0, align 1\n %13 = sext i8 %12 to i64\n %14 = and i64 %13, 4294967295\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_7\n LBL_6:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 2, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_multiply_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_11\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp slt i32 %sv_0.0.ph.reload, 0\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_11, label LBL_8\n LBL_8:\n %27 = icmp slt i32 %sv_0.0.ph.reload, -1073741823\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %28 = mul i32 %sv_0.0.ph.reload, 2\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n br label LBL_11\n LBL_10:\n %31 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 2, 0, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 3, 4, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_multiply_12-bad", "fun_name": "CWE191_Integer_Underflow__int_rand_multiply_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 -2, i32* %storemerge1.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i32, i32* %storemerge1.reg2mem\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n %17 = icmp slt i32 %storemerge1.reload, 0\n %18 = icmp eq i1 %17, false\n br i1 %16, label LBL_5, label LBL_3\n LBL_3:\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %18, label LBL_9, label LBL_4\n LBL_4:\n %19 = mul i32 %storemerge1.reload, 2\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_5:\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %18, label LBL_9, label LBL_6\n LBL_6:\n %22 = icmp slt i32 %storemerge1.reload, -1073741823\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n %23 = mul i32 %storemerge1.reload, 2\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n store i64 %25, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_8:\n %26 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %26, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %18, { 1, 0 }\n uselistorder i64 %14, { 1, 0, 2 }\n uselistorder i32 %storemerge1.reload, { 3, 0, 2, 1 }\n uselistorder i32* %storemerge1.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 4, 3, 5, 1, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_postdec_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, -2147483648\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i64 %3, 4294967296\n %sext = add i64 %6, -4294967296\n %7 = ashr exact i64 %sext, 32\n store i64 %7, i64* %sv_0, align 8\n %8 = and i64 %7, 4294967295\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_multiply_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n %or.cond = or i1 %2, %5\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 4294967292)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cat_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cat_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strcat(i8* %sv_0.0.reload, i8* nonnull %6)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64* @memset(i64* %0, i32 65, i32 99)\n %5 = add i64 %3, 99\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %3)\n ret i64 %7\n\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_9\n LBL_4:\n %9 = load i64, i64* %sv_0, align 8\n %.off = add i64 %9, -6\n %10 = icmp ult i64 %.off, 94\n br i1 %10, label LBL_5, label LBL_8\n LBL_5:\n %11 = trunc i64 %9 to i32\n %12 = call i64* @malloc(i32 %11)\n %13 = icmp eq i64* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %15 = ptrtoint i64* %12 to i64\n %16 = bitcast i64* %12 to i32*\n store i32 1819043176, i32* %16, align 4\n %17 = add i64 %15, 4\n %18 = inttoptr i64 %17 to i16*\n store i16 111, i16* %18, align 2\n %19 = call i64 @FUNC(i64 %15)\n call void @free(i64* %12)\n br label LBL_9\n LBL_8:\n %20 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_4 to i64))\n br label LBL_9\n LBL_9:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %12, { 0, 1, 3, 2 }\n uselistorder i64 %9, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_01-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %4 = mul i64 %indvars.iv.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i64*\n %7 = load i64, i64* %6, align 8\n %8 = call i128 @FUNC(i64 %7)\n %9 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n ret i64 %9\n\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n store i64 4702111234474983745, i64* %sv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @strcpy(i8* nonnull %1, i8* nonnull %2)\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = call i64 @FUNC(i64 %4)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_sub_11-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_min_sub_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 -1, i64 9223372036854775807\n %6 = call i64 @FUNC(i64 %spec.select)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 25, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_8\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -48\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @strtoul(i8* nonnull %18, i8** null, i32 0)\n %20 = call i32 @close(i32 %1)\n %sv_3.0.off = add i32 %19, -6\n %21 = icmp ult i32 %sv_3.0.off, 94\n br i1 %21, label LBL_5, label LBL_8\n LBL_5:\n %22 = call i64* @malloc(i32 %19)\n %23 = icmp eq i64* %22, null\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %25 = ptrtoint i64* %22 to i64\n %26 = bitcast i64* %22 to i32*\n store i32 1819043176, i32* %26, align 4\n %27 = add i64 %25, 4\n %28 = inttoptr i64 %27 to i16*\n store i16 111, i16* %28, align 2\n %29 = call i64 @FUNC(i64 %25)\n call void @free(i64* %22)\n br label LBL_9\n LBL_8:\n %30 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %22, { 0, 1, 3, 2 }\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_04-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i8*\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memcpy(i64* nonnull %sv_0, i64* %5, i32 %9)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1, 3, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_sub_10-bad", "fun_name": "CWE191_Integer_Underflow__int_min_sub_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 2147483647)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -20\n %6 = inttoptr i64 %5 to i32*\n store i32 1, i32* %6, align 4\n %7 = add i64 %4, -48\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 -20, { 1, 0 }\n uselistorder i32 5, { 1, 0, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_ncpy_01-bad", "fun_name": "CWE124_Buffer_Underwrite__char_declare_ncpy_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = bitcast i8** %sv_1 to i8*\n store i8* %2, i8** %sv_1, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = load i8*, i8** %sv_1, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @strncpy(i8* %4, i8* nonnull %5, i32 99)\n %7 = load i8*, i8** %sv_1, align 8\n %8 = ptrtoint i8* %7 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = load i8*, i8** %sv_1, align 8\n %12 = ptrtoint i8* %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = bitcast i64* %0 to i32*\n store i32 1, i32* %4, align 4\n %5 = add i64 %3, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 2, i32* %6, align 4\n %7 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_memmove_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %5 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 50)\n %6 = inttoptr i64 %sv_0.0.reload to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_1, i32 400)\n %8 = inttoptr i64 %sv_0.0.reload to i32*\n %9 = load i32, i32* %8, align 4\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_zero_modulo_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 7\n %6 = urem i32 100, %spec.select\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 7, { 1, 0 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_fwrite_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_11, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %.off = add i32 %9, -1\n %10 = icmp ugt i32 %.off, 19\n br i1 %10, label LBL_11, label LBL_4\n LBL_4:\n %11 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %12 = icmp eq %_IO_FILE* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_5, label LBL_6\n LBL_5:\n %14 = load i32, i32* %sv_0, align 4\n %15 = icmp eq i32 %14, 0\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %15, label LBL_10, label LBL_7\n LBL_6:\n call void @exit(i32 1)\n unreachable\n LBL_7:\n %16 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_4 to i64*), i32 1, i32 50, %_IO_FILE* %11)\n %17 = icmp eq i32 %16, 50\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 1)\n unreachable\n LBL_9:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %18 = add nuw i64 %storemerge4.reload, 1\n %19 = load i32, i32* %sv_0, align 4\n %20 = sext i32 %19 to i64\n %21 = icmp ult i64 %18, %20\n store i64 %18, i64* %storemerge4.reg2mem\n br i1 %21, label LBL_7, label LBL_10\n LBL_10:\n %22 = call i32 @fclose(%_IO_FILE* nonnull %11)\n br label LBL_11\n LBL_11:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %11, { 1, 0, 2 }\n uselistorder i32* %sv_0, { 2, 0, 3, 1, 4 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder i32 -1, { 0, 2, 1, 3 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_11-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 25, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -48\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @strtoul(i8* nonnull %23, i8** null, i32 0)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_15, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = icmp ult i32 %sv_0.1.reload, 6\n br i1 %31, label LBL_14, label LBL_11\n LBL_11:\n %32 = call i64* @malloc(i32 %sv_0.1.reload)\n %33 = icmp eq i64* %32, null\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @exit(i32 -1)\n unreachable\n LBL_13:\n %35 = ptrtoint i64* %32 to i64\n %36 = bitcast i64* %32 to i32*\n store i32 1819043176, i32* %36, align 4\n %37 = add i64 %35, 4\n %38 = inttoptr i64 %37 to i16*\n store i16 111, i16* %38, align 2\n %39 = call i64 @FUNC(i64 %35)\n call void @free(i64* %32)\n br label LBL_15\n LBL_14:\n %40 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n br label LBL_15\n LBL_15:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %32, { 0, 1, 3, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 4, 0, 1, 2, 3 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE467_Use_of_sizeof_on_Pointer_Type__short_05-bad", "fun_name": "CWE467_Use_of_sizeof_on_Pointer_Type__short_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 8)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = bitcast i64* %2 to i16*\n store i16 5, i16* %5, align 2\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = sext i32 %2 to i64\n %11 = ptrtoint i64* %sv_3 to i64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %27 = icmp eq i32 %26, 1\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_14, label LBL_9\n LBL_9:\n %29 = load i64, i64* %sv_1, align 8\n %30 = trunc i64 %29 to i32\n %31 = icmp sgt i32 %30, 9999\n br i1 %31, label LBL_14, label LBL_10\n LBL_10:\n %32 = and i64 %29, 4294967295\n %33 = icmp eq i64 %32, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %33, label LBL_13, label LBL_11\n LBL_11:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %34 = add i32 %storemerge5.reload, 1\n %35 = sext i32 %34 to i64\n %36 = icmp sgt i64 %32, %35\n store i32 %34, i32* %storemerge5.reg2mem\n br i1 %36, label LBL_11, label LBL_12\n LBL_12:\n %phitmp = zext i32 %34 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_13\n LBL_13:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %37 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_14\n LBL_14:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %34, { 1, 0, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 3, 2, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 1 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_17-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.04.reg2mem = alloca i8*\n %sv_0.05.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_11, label LBL_3\n LBL_3:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_7, label LBL_4\n LBL_4:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_11, label LBL_5\n LBL_5:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_11, label LBL_6\n LBL_6:\n store i8 0, i8* %20, align 1\n br label LBL_11\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_11\n LBL_8:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %25 = icmp eq i8 %.reload, 83\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n %27 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n store i8* %sv_0.05.reload, i8** %sv_0.04.reg2mem\n br label LBL_12\n LBL_10:\n %28 = ptrtoint i8* %sv_0.05.reload to i64\n %29 = add i64 %28, 1\n %30 = inttoptr i64 %29 to i8*\n %31 = load i8, i8* %30, align 1\n %32 = icmp eq i8 %31, 0\n %33 = icmp eq i1 %32, false\n store i8 %31, i8* %.reg2mem\n store i8* %30, i8** %sv_0.05.reg2mem\n store i8* %30, i8** %sv_0.04.reg2mem\n br i1 %33, label LBL_8, label LBL_12\n LBL_11:\n %34 = load i8, i8* %3, align 1\n %35 = icmp eq i8 %34, 0\n %36 = icmp eq i1 %35, false\n store i8 %34, i8* %.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n store i8* %3, i8** %sv_0.04.reg2mem\n br i1 %36, label LBL_8, label LBL_12\n LBL_12:\n %sv_0.04.reload = load i8*, i8** %sv_0.04.reg2mem\n %37 = bitcast i8* %sv_0.04.reload to i64*\n call void @free(i64* %37)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %sv_0.05.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 0, 1, 2, 3, 5, 4 }\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 1, 2, 0 }\n uselistorder i8** %sv_0.05.reg2mem, { 1, 2, 0 }\n uselistorder i8** %sv_0.04.reg2mem, { 0, 2, 1, 3 }\n uselistorder i8 0, { 0, 2, 3, 4, 5, 6, 1 }\n uselistorder label LBL_12, { 2, 0, 1 }\n uselistorder label LBL_11, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_preinc_13-bad", "fun_name": "CWE190_Integer_Overflow__int_connect_socket_preinc_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8348 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %23 = add i32 %sv_0.1.reload, 1\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memcpy_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = load i64, i64* %sv_1, align 8\n store i64 %3, i64* %sv_0, align 8\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = call i64 @FUNC(i64 %4)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 3, 2, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memmove_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %sv_3 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %5\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %13 = inttoptr i64 %sv_0.0.reload to i64*\n %14 = call i64* @memmove(i64* %13, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %15 = call i64 @FUNC(i64 %sv_0.0.reload)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_fscanf_11-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_fscanf_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = icmp sgt i32 %9, 9\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = sext i32 %9 to i64\n %13 = mul i64 %12, 4\n %14 = add i64 %11, -48\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n br label LBL_6\n LBL_5:\n %20 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_uninit_variable_struct_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %3 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64*)* @printStructLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %7 = mul i64 %indvars.iv9.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv9.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_4, label LBL_3\n LBL_4:\n store i64 0, i64* %indvars.iv6.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %11 = mul i64 %indvars.iv6.reload, 4\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i32*\n %14 = trunc i64 %indvars.iv6.reload to i32\n store i32 %14, i32* %13, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_6, label LBL_5\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %15 = mul i64 %indvars.iv.reload, 4\n %16 = add i64 %15, %3\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n ret i64 %20\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 4702111234474983745, i64* %sv_0, align 8\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = add i32 %4, 1\n %6 = call i8* @strncpy(i8* nonnull %1, i8* nonnull %3, i32 %5)\n %7 = call i64 @FUNC(i64 %2)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_remove_08-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_remove_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @remove(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_0, i64 0, i64 0))\n %4 = sext i32 %3 to i64\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_multiply_05-bad", "fun_name": "CWE190_Integer_Overflow__int_connect_socket_multiply_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_7, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n %22 = load i32, i32* @gv_0, align 4\n %23 = icmp eq i32 %22, 0\n %24 = icmp slt i32 %sv_0.0.ph.reload, 1\n %or.cond4 = or i1 %24, %23\n br i1 %or.cond4, label LBL_7, label LBL_6\n LBL_6:\n %25 = mul i32 %sv_0.0.ph.reload, 2\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n br label LBL_7\n LBL_7:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_7, { 2, 3, 0, 1 }\n uselistorder label LBL_5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_13, label LBL_3\n LBL_3:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_11, label LBL_4\n LBL_4:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_11, label LBL_5\n LBL_5:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_6\n LBL_6:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_12, label LBL_7\n LBL_7:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %28, align 1\n br label LBL_9\n LBL_9:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_12, label LBL_10\n LBL_10:\n store i8 0, i8* %30, align 1\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %6)\n br label LBL_13\n LBL_12:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_13\n LBL_13:\n %35 = load i32, i32* @gv_0, align 4\n %36 = icmp eq i32 %35, 5\n %37 = icmp eq i1 %36, false\n br i1 %37, label LBL_20, label LBL_14\n LBL_14:\n %38 = call i32 @strlen(i8* nonnull %4)\n %39 = icmp eq i32 %38, 0\n br i1 %39, label LBL_19, label LBL_15\n LBL_15:\n %40 = ptrtoint i64* %1 to i64\n store i64 0, i64* %storemerge7.reg2mem\n br label LBL_16\n LBL_16:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %41 = add i64 %storemerge7.reload, %40\n %42 = inttoptr i64 %41 to i8*\n %43 = load i8, i8* %42, align 1\n %44 = icmp eq i8 %43, 83\n %45 = icmp eq i1 %44, false\n br i1 %45, label LBL_18, label LBL_17\n LBL_17:\n %46 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n br label LBL_19\n LBL_18:\n %47 = add nuw i64 %storemerge7.reload, 1\n %48 = call i32 @strlen(i8* %4)\n %49 = sext i32 %48 to i64\n %50 = icmp ult i64 %47, %49\n store i64 %47, i64* %storemerge7.reg2mem\n br i1 %50, label LBL_16, label LBL_19\n LBL_19:\n call void @free(i64* %1)\n br label LBL_20\n LBL_20:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %0, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_22, label LBL_21\n LBL_21:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_22\n LBL_22:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %4, { 3, 0, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge7.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 5, 0, 2, 4, 1, 3, 6 }\n uselistorder label LBL_19, { 0, 2, 1 }\n uselistorder label LBL_16, { 1, 0 }\n uselistorder label LBL_13, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_strncpy_05-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_strncpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.18.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_8, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_3 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_2, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_9, label LBL_6\n LBL_6:\n %18 = sext i32 %15 to i64\n %19 = add i64 %0, -112\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_2 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_9\n LBL_7:\n %24 = call i32 @close(i32 %4)\n br label LBL_8\n LBL_8:\n store i64 0, i64* %sv_2, align 8\n %25 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.18.reg2mem\n br label LBL_10\n LBL_9:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i64 0, i64* %sv_2, align 8\n %28 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %29 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.18.reg2mem\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %sv_0.18.reload = load i32, i32* %sv_0.18.reg2mem\n %30 = bitcast i64* %sv_2 to i8*\n %31 = bitcast i64* %sv_1 to i8*\n %32 = call i8* @strncpy(i8* nonnull %30, i8* nonnull %31, i32 %sv_0.18.reload)\n %33 = sext i32 %sv_0.18.reload to i64\n %34 = add i64 %0, -112\n %35 = add i64 %34, %33\n %36 = inttoptr i64 %35 to i8*\n store i8 0, i8* %36, align 1\n br label LBL_11\n LBL_11:\n %37 = call i64 @FUNC(i64* nonnull %sv_2)\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %1, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.18.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 1, 2, 5, 0, 3, 4 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 0, 1, 3 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, -33\n %5 = and i64 %4, -16\n %sv_2.0 = select i1 %2, i64 0, i64 %5\n store i64 0, i64* %sv_0, align 8\n %6 = inttoptr i64 %sv_2.0 to i64*\n %7 = call i64* @memcpy(i64* %6, i64* nonnull %sv_0, i32 40)\n %8 = inttoptr i64 %sv_2.0 to i32*\n %9 = load i32, i32* %8, align 16\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_postinc_17-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_postinc_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = add i32 %3, 1\n store i32 %4, i32* %sv_0, align 4\n %5 = zext i32 %4 to i64\n %6 = call i64 @FUNC(i64 %5)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_malloc_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n store i64 7453010373643542593, i64* %3, align 8\n %7 = add i64 %6, 8\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC(i64 %6)\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %12, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_sub_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = urem i32 %0, 2\n %7 = icmp eq i32 %6, 0\n %8 = zext i32 %1 to i64\n %9 = mul i64 %8, 1152921504606846976\n %10 = zext i32 %2 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = sext i32 %3 to i64\n %13 = mul i64 %12, 1073741824\n %14 = sext i32 %4 to i64\n %15 = mul i64 %14, 32768\n %16 = sext i32 %5 to i64\n %17 = sext i1 %7 to i64\n %18 = xor i64 %9, %17\n %19 = xor i64 %18, %11\n %20 = xor i64 %19, %13\n %21 = xor i64 %20, %15\n %storemerge3.le = xor i64 %21, %16\n %22 = icmp eq i64 %storemerge3.le, -9223372036854775808\n br i1 %22, label LBL_2, label LBL_1\n LBL_1:\n %23 = add i64 %storemerge3.le, -1\n %24 = call i64 @FUNC(i64 %23)\n store i64 %24, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n %25 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %25, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n ret i64 %storemerge1.reload\n\n uselistorder i64 %storemerge3.le, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_loop_16-bad", "fun_name": "CWE126_Buffer_Overread__char_declare_loop_16_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_3, label LBL_1\n LBL_1:\n %7 = ptrtoint i64* %sv_2 to i64\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %7\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge1.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = add nuw i64 %storemerge1.reload, 1\n %16 = icmp ult i64 %15, %8\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %16, label LBL_2, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64* nonnull %sv_0)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 2, 0, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n br label LBL_2\n LBL_2:\n %10 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strcpy(i8* nonnull %11, i8* %10)\n %13 = call i64 @FUNC(i64 %3)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1, 4 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_popen_05-bad", "fun_name": "CWE78_OS_Command_Injection__char_file_popen_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %sv_0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_5\n LBL_5:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_6\n LBL_6:\n %19 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_4, i64 0, i64 0))\n %20 = icmp eq %_IO_FILE* %19, null\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n %21 = call i32 @pclose(%_IO_FILE* nonnull %19)\n br label LBL_8\n LBL_8:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_declare_cat_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_0.LBL_3_crit_edge, label LBL_2\n LBL_1:\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strcat(i8* nonnull %9, i8* nonnull %8)\n %11 = call i64 @FUNC(i64 %.pre-phi.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 3, 1, 2, 0 }\n uselistorder i8* (i8*, i8*)* @strcat, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_loop_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %4\n %11 = add i64 %storemerge1.reload, %9\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = inttoptr i64 %10 to i8*\n store i8 %13, i8* %14, align 1\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n store i8 0, i8* %7, align 1\n %16 = call i64 @FUNC(i64 %4)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %4, { 1, 0, 2 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 0, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_sub_14-bad", "fun_name": "CWE191_Integer_Underflow__char_fscanf_sub_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i8, i8* %sv_0, align 1\n %10 = add i8 %9, -1\n %11 = sext i8 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 25, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_8\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -48\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @strtoul(i8* nonnull %18, i8** null, i32 0)\n %20 = call i32 @close(i32 %1)\n %21 = icmp ult i32 %19, 6\n br i1 %21, label LBL_8, label LBL_5\n LBL_5:\n %22 = call i64* @malloc(i32 %19)\n %23 = icmp eq i64* %22, null\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %25 = ptrtoint i64* %22 to i64\n %26 = bitcast i64* %22 to i32*\n store i32 1819043176, i32* %26, align 4\n %27 = add i64 %25, 4\n %28 = inttoptr i64 %27 to i16*\n store i16 111, i16* %28, align 2\n %29 = call i64 @FUNC(i64 %25)\n call void @free(i64* %22)\n br label LBL_9\n LBL_8:\n %30 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %22, { 0, 1, 3, 2 }\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 1 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %4 = and i64 %3, -16\n %5 = call i64 @FUNC()\n store i64 %4, i64* %sv_1, align 8\n %6 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 100)\n %7 = add i64 %2, -816\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %8 = mul i64 %storemerge2.reload, 8\n %9 = load i64, i64* %sv_1, align 8\n %10 = add i64 %9, %8\n %11 = add i64 %7, %8\n %12 = inttoptr i64 %11 to i64*\n %13 = load i64, i64* %12, align 8\n %14 = inttoptr i64 %10 to i64*\n store i64 %13, i64* %14, align 8\n %15 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %16 = load i64, i64* %sv_1, align 8\n %17 = inttoptr i64 %16 to i64*\n %18 = load i64, i64* %17, align 8\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %1, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = load i32, i32* @gv_0, align 4\n %30 = icmp eq i32 %29, 5\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n store i64 0, i64* %sv_0, align 8\n %32 = bitcast i64* %sv_0 to i8*\n %33 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %32, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_2)\n %34 = ptrtoint i64* %sv_0 to i64\n %35 = call i64 @FUNC(i64 %34)\n br label LBL_11\n LBL_11:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 1 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fgets_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = load i32, i32* inttoptr (i64 8464 to i32*), align 16\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n store i32 %5, i32* %sv_0.0.reg2mem\n br i1 %8, label LBL_4, label LBL_1\n LBL_1:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = bitcast i64* %sv_1 to i8*\n %11 = call i8* @fgets(i8* nonnull %10, i32 20, %_IO_FILE* %9)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_3, label LBL_2\n LBL_2:\n %13 = call double @atof(i8* nonnull %10)\n %14 = fptrunc double %13 to float\n %15 = bitcast float %14 to i32\n %16 = sext i32 %15 to i128\n %17 = call i128 @FUNC(i128 %16)\n %18 = call i64 @FUNC(i128 %17)\n %19 = trunc i64 %18 to i32\n store i32 %19, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %20 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 %5, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %21 = call i128 @__asm_movss.1(i32 %sv_0.0.reload)\n %22 = call i128 @__asm_movss.1(i32 2147483647)\n %23 = call i128 @FUNC(i128 %21, i128 %22)\n %24 = call i128 @FUNC(i128 %23)\n %25 = load i128, i128* @gv_2, align 8\n call void @FUNC(i128 %24, i128 %25)\n %26 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %2, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_listen_socket_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -20\n %6 = inttoptr i64 %5 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 -20, { 1, 0 }\n uselistorder i32 5, { 1, 0, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_snprintf_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = ptrtoint i64* %1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n %8 = call i64* @memset(i64* %1, i32 65, i32 49)\n store i8 0, i8* %7, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %10, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* %1)\n %12 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 2, 3, 1, 0, 5, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_01-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 400)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 100)\n %7 = add i64 %5, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 8\n %9 = add i64 %8, %4\n %10 = add i64 %7, %8\n %11 = inttoptr i64 %10 to i64*\n %12 = load i64, i64* %11, align 8\n %13 = inttoptr i64 %9 to i64*\n store i64 %12, i64* %13, align 8\n %14 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %14, 100\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %15 = load i64, i64* %1, align 8\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %.pre = inttoptr i64 %3 to i64*\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i64* @memset(i64* %.pre, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n br label LBL_2\n LBL_2:\n %10 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = call i32 @strlen(i8* %10)\n %12 = call i64* @memcpy(i64* nonnull %sv_0, i64* %.pre, i32 %11)\n %13 = call i64 @FUNC(i64 %3)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 3, 2, 0, 4 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fscanf_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 28, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 -4, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_5, label LBL_3\n LBL_3:\n %8 = ptrtoint i64* %sv_1 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = add i64 %8, -48\n %10 = add i64 %sv_0.0.reload, %9\n %11 = inttoptr i64 %10 to i32*\n store i32 1, i32* %11, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %12 = mul i64 %indvars.iv.reload, 4\n %13 = add i64 %12, %9\n %14 = inttoptr i64 %13 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_10\n LBL_10:\n %29 = call i64 @FUNC()\n %30 = trunc i64 %29 to i32\n %31 = icmp eq i32 %30, 0\n br i1 %31, label LBL_17, label LBL_11\n LBL_11:\n %32 = call i32 @strlen(i8* nonnull %4)\n %33 = icmp eq i32 %32, 0\n br i1 %33, label LBL_16, label LBL_12\n LBL_12:\n %34 = ptrtoint i64* %1 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_13\n LBL_13:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %35 = add i64 %storemerge4.reload, %34\n %36 = inttoptr i64 %35 to i8*\n %37 = load i8, i8* %36, align 1\n %38 = icmp eq i8 %37, 83\n %39 = icmp eq i1 %38, false\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n %40 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n br label LBL_16\n LBL_15:\n %41 = add nuw i64 %storemerge4.reload, 1\n %42 = call i32 @strlen(i8* %4)\n %43 = sext i32 %42 to i64\n %44 = icmp ult i64 %41, %43\n store i64 %41, i64* %storemerge4.reg2mem\n br i1 %44, label LBL_13, label LBL_16\n LBL_16:\n call void @free(i64* %1)\n br label LBL_17\n LBL_17:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_19, label LBL_18\n LBL_18:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_19\n LBL_19:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 3, 0, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 4, 0, 5, 2, 1, 3, 6 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 4, 1, 5 }\n uselistorder label LBL_16, { 0, 2, 1 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__short_rand_12-bad", "fun_name": "CWE197_Numeric_Truncation_Error__short_rand_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge3.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 122, i64* %storemerge3.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge.in = xor i32 %8, %9\n %phitmp = mul i32 %storemerge.in, 16777216\n %phitmp4 = ashr exact i32 %phitmp, 24\n %phitmp5 = zext i32 %phitmp4 to i64\n store i64 %phitmp5, i64* %storemerge3.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %10 = call i64 @FUNC(i64 %storemerge3.reload)\n ret i64 %10\n\n uselistorder i64* %storemerge3.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_sleep_08-bad", "fun_name": "CWE400_Resource_Exhaustion__fscanf_sleep_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = call i32 @usleep(i32 %9)\n %11 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_predec_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i8, i8* %sv_0, align 1\n %7 = icmp eq i8 %6, -128\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i8 %6, -1\n store i8 %8, i8* %sv_0, align 1\n %9 = sext i8 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_5\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memcpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = ptrtoint i64* %1 to i64\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = load i64, i64* %sv_0, align 8\n store i64 %7, i64* %1, align 8\n %8 = add i64 %5, 8\n %9 = inttoptr i64 %8 to i64*\n %10 = add i64 %5, 16\n %11 = inttoptr i64 %10 to i64*\n %12 = add i64 %5, 24\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %5, 32\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %5, 40\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %5, 48\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %5, 56\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %5, 64\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %5, 72\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %5, 80\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %5, 88\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %5, 96\n %31 = inttoptr i64 %30 to i32*\n %32 = add i64 %5, 99\n %33 = inttoptr i64 %32 to i8*\n store i8 0, i8* %33, align 1\n %34 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 0, 1, 2, 10, 3, 13, 4, 5, 6, 7, 8, 9, 11, 12 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i8 0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_fwrite_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_15, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_15\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.0.off = add i32 %sv_0.0.ph.reload, -1\n %25 = icmp ugt i32 %sv_0.0.off, 19\n br i1 %25, label LBL_15, label LBL_8\n LBL_8:\n %26 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %27 = icmp eq %_IO_FILE* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_9, label LBL_10\n LBL_9:\n %29 = sext i32 %sv_0.0.ph.reload to i64\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_11\n LBL_10:\n call void @exit(i32 1)\n unreachable\n LBL_11:\n %30 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %26)\n %31 = icmp eq i32 %30, 50\n br i1 %31, label LBL_13, label LBL_12\n LBL_12:\n call void @exit(i32 1)\n unreachable\n LBL_13:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %32 = add nuw i64 %storemerge13.reload, 1\n %33 = icmp ult i64 %32, %29\n store i64 %32, i64* %storemerge13.reg2mem\n br i1 %33, label LBL_11, label LBL_14\n LBL_14:\n %34 = call i32 @fclose(%_IO_FILE* nonnull %26)\n br label LBL_15\n LBL_15:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %26, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 0, 2, 3, 4, 5 }\n uselistorder label LBL_15, { 2, 3, 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fputc_12-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fputc_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %4 = call i32 @fputc(i32 65, %_IO_FILE* %3)\n %5 = sext i32 %4 to i64\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %6 = icmp eq i32 %4, 0\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_3:\n %9 = icmp eq i32 %4, -1\n %10 = icmp eq i1 %9, false\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 1, 0 }\n uselistorder i32 %4, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 4, 1, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memmove_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 4702111234474983745, i64* %sv_0, align 8\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = add i32 %4, 1\n %6 = call i64* @memmove(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %5)\n %7 = call i64 @FUNC(i64 %2)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_loop_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_3, label LBL_1\n LBL_1:\n %7 = ptrtoint i64* %sv_1 to i64\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %10 = add i64 %storemerge2.reload, %7\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge2.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = add nuw i64 %storemerge2.reload, 1\n %16 = icmp ult i64 %15, %8\n store i64 %15, i64* %storemerge2.reg2mem\n br i1 %16, label LBL_2, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64* nonnull %sv_0)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_alloca_cpy_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -161\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strcpy(i8* %4, i8* nonnull %6)\n %8 = call i64 @FUNC(i64 %3)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_multiply_12-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_min_multiply_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %. = select i1 %2, i64 -2, i64 -9223372036854775808\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i64 %., 2\n %7 = call i64 @FUNC(i64 %6)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n br i1 %2, label LBL_3, label LBL_4\n LBL_3:\n %8 = mul i64 %., 2\n %9 = call i64 @FUNC(i64 %8)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_fscanf_to_char_07-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_fscanf_to_char_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 4294967295, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %phitmp = mul i32 %.pre, 16777216\n %phitmp1 = ashr exact i32 %phitmp, 24\n %phitmp2 = zext i32 %phitmp1 to i64\n store i64 %phitmp2, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %6 = call i64 @FUNC(i64 %.reload)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE605_Multiple_Binds_Same_Port__basic_08-bad", "fun_name": "CWE605_Multiple_Binds_Same_Port__basic_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i32, align 4\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_14, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_2, align 8\n %4 = bitcast i64* %sv_2 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n store i32 1, i32* %sv_1, align 4\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_13, label LBL_2\n LBL_2:\n %8 = bitcast i32* %sv_1 to i64*\n %9 = call i32 @setsockopt(i32 %6, i32 1, i32 2, i64* nonnull %8, i32 4)\n %10 = icmp eq i32 %9, 0\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_11, label LBL_3\n LBL_3:\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %13 = call i16 @htons(i16 27015)\n %14 = bitcast i64* %sv_0 to %sockaddr*\n %15 = call i32 @bind(i32 %6, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_4\n LBL_4:\n %17 = call i32 @listen(i32 %6, i32 5)\n %18 = icmp eq i32 %17, -1\n br i1 %18, label LBL_11, label LBL_5\n LBL_5:\n %19 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %20 = icmp eq i32 %19, -1\n br i1 %20, label LBL_11, label LBL_6\n LBL_6:\n %21 = sub i32 99, %5\n %22 = ptrtoint i64* %sv_2 to i64\n %23 = sext i32 %5 to i64\n %24 = add i64 %23, %22\n %25 = inttoptr i64 %24 to i64*\n %26 = call i32 @recv(i32 %19, i64* %25, i32 %21, i32 0)\n %27 = add i32 %26, 1\n %28 = icmp ult i32 %27, 2\n br i1 %28, label LBL_12, label LBL_7\n LBL_7:\n %29 = ptrtoint i64* %sv_3 to i64\n %30 = sext i32 %26 to i64\n %31 = add i64 %29, -112\n %32 = add i64 %31, %30\n %33 = inttoptr i64 %32 to i8*\n store i8 0, i8* %33, align 1\n %34 = call i8* @strchr(i8* nonnull %4, i32 13)\n %35 = icmp eq i8* %34, null\n br i1 %35, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %34, align 1\n br label LBL_9\n LBL_9:\n %36 = call i8* @strchr(i8* nonnull %4, i32 10)\n %37 = icmp eq i8* %36, null\n br i1 %37, label LBL_12, label LBL_10\n LBL_10:\n store i8 0, i8* %36, align 1\n br label LBL_12\n LBL_11:\n %38 = call i32 @close(i32 %6)\n br label LBL_13\n LBL_12:\n %39 = call i32 @close(i32 %6)\n %40 = call i32 @close(i32 %19)\n br label LBL_13\n LBL_13:\n %41 = call i64 @FUNC(i64* nonnull %sv_2)\n br label LBL_14\n LBL_14:\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %26, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5, 6 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_2, { 0, 2, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_13, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_cpy_17-bad", "fun_name": "CWE124_Buffer_Underwrite__char_declare_cpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = bitcast i8** %sv_1 to i8*\n store i8* %2, i8** %sv_1, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = load i8*, i8** %sv_1, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @strcpy(i8* %4, i8* nonnull %5)\n %7 = load i8*, i8** %sv_1, align 8\n %8 = ptrtoint i8* %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 3, 2, 0, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_long_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %3 = ptrtoint i64* %2 to i64\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i64*\n store i64 5, i64* %8, align 8\n %9 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %9, 100\n store i64 %9, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_divide_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 14)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_for_loop_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge9.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_7\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %sv_3.0.off = add i32 %19, -1\n %21 = icmp ugt i32 %sv_3.0.off, 19\n br i1 %21, label LBL_7, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n store i64 0, i64* %storemerge9.reg2mem\n br label LBL_6\n LBL_6:\n %storemerge9.reload = load i64, i64* %storemerge9.reg2mem\n %23 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n %24 = add nuw i64 %storemerge9.reload, 1\n %25 = icmp ult i64 %24, %22\n store i64 %24, i64* %storemerge9.reg2mem\n br i1 %25, label LBL_6, label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %storemerge9.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 2, 3, 1, 4, 5 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_7, { 0, 3, 2, 1 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_preinc_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i16, i16* %sv_0, align 2\n %9 = icmp eq i16 %8, 32767\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = add i16 %8, 1\n store i16 %10, i16* %sv_0, align 2\n %11 = sext i16 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_popen_08-bad", "fun_name": "CWE78_OS_Command_Injection__char_connect_socket_popen_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %30 = icmp eq %_IO_FILE* %29, null\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %31 = call i32 @pclose(%_IO_FILE* nonnull %29)\n br label LBL_11\n LBL_11:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_square_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 4)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_loop_08-bad", "fun_name": "CWE127_Buffer_Underread__char_declare_loop_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %1 = load i64, i64* %0\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %6, i64 %1, i64 %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n store i64 0, i64* %sv_1, align 8\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %spec.select\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge1.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = load i64, i64* %sv_1, align 8\n %16 = add i64 %15, 1\n store i64 %16, i64* %sv_1, align 8\n %17 = icmp ult i64 %16, 100\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %17, label LBL_1, label LBL_2\n LBL_2:\n %18 = call i64 @FUNC(i64* nonnull %sv_0)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %2, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 0, 2, 1 }\n uselistorder i64 %storemerge1.reload, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fscanf_14-bad", "fun_name": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fscanf_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -4, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %phitmp = mul i32 %.pre, 4\n store i32 %phitmp, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = call i64* @malloc(i32 %.reload)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_3, label LBL_4\n LBL_3:\n %9 = ptrtoint i64* %6 to i64\n %10 = load i32, i32* %sv_0, align 4\n %11 = icmp eq i32 %10, 0\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %12 = mul i64 %storemerge1.reload, 4\n %13 = add i64 %12, %9\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 4\n %15 = add nuw i64 %storemerge1.reload, 1\n %16 = load i32, i32* %sv_0, align 4\n %17 = sext i32 %16 to i64\n %18 = icmp ult i64 %15, %17\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %18, label LBL_5, label LBL_6\n LBL_6:\n %19 = bitcast i64* %6 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n call void @free(i64* %6)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %6, { 0, 1, 3, 2 }\n uselistorder i32* %sv_0, { 3, 1, 0, 2, 4 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_square_07-bad", "fun_name": "CWE190_Integer_Overflow__int_connect_socket_square_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = mul i32 %sv_0.1.reload, %sv_0.1.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_8\n LBL_8:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_07-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 25, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -48\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @strtoul(i8* nonnull %23, i8** null, i32 0)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_15, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = icmp ult i32 %sv_0.1.reload, 6\n br i1 %31, label LBL_14, label LBL_11\n LBL_11:\n %32 = call i64* @malloc(i32 %sv_0.1.reload)\n %33 = icmp eq i64* %32, null\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @exit(i32 -1)\n unreachable\n LBL_13:\n %35 = ptrtoint i64* %32 to i64\n %36 = bitcast i64* %32 to i32*\n store i32 1819043176, i32* %36, align 4\n %37 = add i64 %35, 4\n %38 = inttoptr i64 %37 to i16*\n store i16 111, i16* %38, align 2\n %39 = call i64 @FUNC(i64 %35)\n call void @free(i64* %32)\n br label LBL_15\n LBL_14:\n %40 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n br label LBL_15\n LBL_15:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %32, { 0, 1, 3, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 4, 0, 1, 2, 3 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, 49\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n store i64 0, i64* %sv_0, align 8\n %6 = call i32 @strlen(i8* nonnull %1)\n %7 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %6)\n %8 = call i64 @FUNC(i64 %3)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_sub_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %spec.store.select = select i1 %1, i32 32, i32 -128\n %2 = trunc i32 %spec.store.select to i8\n %3 = icmp eq i8 %2, -128\n br i1 %3, label LBL_3, label LBL_2\n LBL_2:\n %4 = mul i32 %spec.store.select, 16777216\n %sext = add i32 %4, -16777216\n %5 = ashr exact i32 %sext, 24\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_1 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %1, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_fprintf_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = sext i32 %2 to i64\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = add i64 %14, %15\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n %32 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %33 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fprintf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 2, 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 4, 0 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncat_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strncat(i8* %sv_0.0.reload, i8* nonnull %6, i32 100)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_32-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 10)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = bitcast i64* %1 to i8*\n %9 = call i8* @strncpy(i8* %8, i8* nonnull %5, i32 %7)\n %10 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_partial_init_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.24.reg2mem = alloca i128\n %indvars.iv9.reg2mem = alloca i64\n %xmm0.1.reg2mem = alloca i128\n %xmm0.06.reg2mem = alloca i128\n %indvars.iv12.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv12.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %xmm0.06.reload = load i128, i128* %xmm0.06.reg2mem\n %indvars.iv12.reload = load i64, i64* %indvars.iv12.reg2mem\n %7 = mul i64 %indvars.iv12.reload, 8\n %8 = add i64 %7, %3\n %9 = call i128 @FUNC(i128 %xmm0.06.reload, i128 %xmm0.06.reload)\n %10 = trunc i64 %indvars.iv12.reload to i32\n %11 = call i128 @FUNC(i32 %10)\n %12 = call i64 @FUNC(i128 %11)\n %13 = inttoptr i64 %8 to i64*\n store i64 %12, i64* %13, align 8\n %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12.reload, 1\n %exitcond14 = icmp eq i64 %indvars.iv.next13, 5\n store i64 %indvars.iv.next13, i64* %indvars.iv12.reg2mem\n store i128 %11, i128* %xmm0.06.reg2mem\n store i128 %11, i128* %xmm0.1.reg2mem\n br i1 %exitcond14, label LBL_4, label LBL_3\n LBL_4:\n %xmm0.1.reload = load i128, i128* %xmm0.1.reg2mem\n %14 = load i32, i32* @gv_0, align 4\n %15 = icmp eq i32 %14, 5\n store i64 0, i64* %indvars.iv9.reg2mem\n store i128 %xmm0.1.reload, i128* %xmm0.24.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %16, i64* %rax.2.reg2mem\n br label LBL_8\n LBL_6:\n %xmm0.24.reload = load i128, i128* %xmm0.24.reg2mem\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %17 = mul i64 %indvars.iv9.reload, 8\n %18 = add i64 %17, %3\n %19 = call i128 @FUNC(i128 %xmm0.24.reload, i128 %xmm0.24.reload)\n %20 = trunc i64 %indvars.iv9.reload to i32\n %21 = call i128 @FUNC(i32 %20)\n %22 = call i64 @FUNC(i128 %21)\n %23 = inttoptr i64 %18 to i64*\n store i64 %22, i64* %23, align 8\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 10\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n store i128 %21, i128* %xmm0.24.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond11, label LBL_7, label LBL_6\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %24 = mul i64 %indvars.iv.reload, 8\n %25 = add i64 %24, %3\n %26 = inttoptr i64 %25 to i64*\n %27 = load i64, i64* %26, align 8\n %28 = call i128 @FUNC(i64 %27)\n %29 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %29, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_7\n LBL_8:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i128 %xmm0.24.reload, { 1, 0 }\n uselistorder i128 %xmm0.06.reload, { 1, 0 }\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv12.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.06.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.24.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_multiply_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_2:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = zext i32 %7 to i64\n %9 = mul i64 %8, 1152921504606846976\n %10 = call i32 @rand()\n %11 = zext i32 %10 to i64\n %12 = mul i64 %11, 35184372088832\n %13 = call i32 @rand()\n %14 = sext i32 %13 to i64\n %15 = mul i64 %14, 1073741824\n %16 = call i32 @rand()\n %17 = sext i32 %16 to i64\n %18 = mul i64 %17, 32768\n %19 = call i32 @rand()\n %20 = sext i32 %19 to i64\n %21 = sext i1 %6 to i64\n %22 = xor i64 %9, %21\n %23 = xor i64 %22, %12\n %24 = xor i64 %23, %15\n %25 = xor i64 %24, %18\n %storemerge = xor i64 %25, %20\n %26 = load i32, i32* @gv_0, align 4\n %27 = zext i32 %26 to i64\n %28 = icmp eq i32 %26, 5\n %29 = icmp eq i1 %28, false\n %30 = icmp slt i64 %storemerge, 1\n %or.cond = or i1 %29, %30\n store i64 %27, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_6, label LBL_3\n LBL_3:\n %31 = icmp sgt i64 %storemerge, 4611686018427387902\n br i1 %31, label LBL_5, label LBL_4\n LBL_4:\n %32 = mul i64 %storemerge, 2\n %33 = call i64 @FUNC(i64 %32)\n store i64 %33, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %34 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %34, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n uselistorder label LBL_6, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_06-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv4.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %2)\n store i32 %5, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = call i64* @malloc(i32 40)\n %8 = ptrtoint i64* %7 to i64\n %9 = icmp eq i64* %7, null\n %10 = icmp eq i1 %9, false\n store i64 0, i64* %indvars.iv4.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %11 = mul i64 %indvars.iv4.reload, 4\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 10\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n br i1 %exitcond6, label LBL_6, label LBL_5\n LBL_6:\n %14 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %14, label LBL_9, label LBL_7\n LBL_7:\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %16, %8\n %18 = inttoptr i64 %17 to i32*\n store i32 1, i32* %18, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_8\n LBL_8:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %19 = mul i64 %indvars.iv.reload, 4\n %20 = add i64 %19, %8\n %21 = inttoptr i64 %20 to i32*\n %22 = load i32, i32* %21, align 4\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_10, label LBL_8\n LBL_9:\n %25 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n call void @free(i64* %7)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %7 = load i64, i64* %sv_1, align 8\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n store i64 %7, i64* %8, align 8\n %9 = add i64 %sv_0.0.reload, 8\n %10 = inttoptr i64 %9 to i64*\n %11 = add i64 %sv_0.0.reload, 16\n %12 = inttoptr i64 %11 to i64*\n %13 = add i64 %sv_0.0.reload, 24\n %14 = inttoptr i64 %13 to i64*\n %15 = add i64 %sv_0.0.reload, 32\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %sv_0.0.reload, 40\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %sv_0.0.reload, 48\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %sv_0.0.reload, 56\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %sv_0.0.reload, 64\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %sv_0.0.reload, 72\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %sv_0.0.reload, 80\n %28 = inttoptr i64 %27 to i64*\n %29 = add i64 %sv_0.0.reload, 88\n %30 = inttoptr i64 %29 to i64*\n %31 = add i64 %sv_0.0.reload, 96\n %32 = inttoptr i64 %31 to i32*\n %33 = add i64 %sv_0.0.reload, 99\n %34 = inttoptr i64 %33 to i8*\n store i8 0, i8* %34, align 1\n %35 = call i64 @FUNC(i64 %sv_0.0.reload)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 14, 13, 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_snprintf_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, 49\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n store i64 0, i64* %sv_0, align 8\n %6 = call i32 @strlen(i8* nonnull %1)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %7, i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %9 = call i64 @FUNC(i64 %3)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_sub_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.03.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp eq i32 %6, -2147483648\n store i32 %6, i32* %sv_0.03.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.03.reload = load i32, i32* %sv_0.03.reg2mem\n %8 = add i32 %sv_0.03.reload, -1\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_malloc_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64*\n %0 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 400)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = call i64 @FUNC(i64 5)\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = call i32 @fclose(%_IO_FILE* %0)\n %2 = sext i32 %1 to i64\n ret i64 %2\n\n uselistorder i32 (%_IO_FILE*)* @fclose, { 3, 2, 1, 0, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 2, 0, 1, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_loop_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %sv_0.0.reload\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge1.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %19 = call i64 @FUNC(i64 %12)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_fprintf_17-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_environment_fprintf_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %sv_0 to i64\n %6 = sext i32 %2 to i64\n %7 = add i64 %6, %5\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n %11 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %12 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %11, i8* nonnull %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_08-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_square_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i16, i16* %sv_0, align 2\n %10 = mul i16 %9, %9\n %11 = sext i16 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %.in.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i8** %sv_1 to i64\n %5 = add i64 %4, -161\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n %8 = bitcast i8** %sv_1 to i64*\n store i64 %6, i64* %8, align 8\n store i8 0, i8* %7, align 16\n br label LBL_3\n LBL_3:\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = load i8*, i8** %sv_1, align 8\n %11 = ptrtoint i64* %sv_0 to i64\n store i8* %10, i8** %.in.reg2mem\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %.in.reload = load i8*, i8** %.in.reg2mem\n %12 = ptrtoint i8* %.in.reload to i64\n %13 = add i64 %storemerge3.reload, %12\n %14 = add i64 %storemerge3.reload, %11\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = inttoptr i64 %13 to i8*\n store i8 %16, i8* %17, align 1\n %18 = add nuw nsw i64 %storemerge3.reload, 1\n %19 = load i8*, i8** %sv_1, align 8\n %exitcond = icmp eq i64 %18, 100\n store i8* %19, i8** %.in.reg2mem\n store i64 %18, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %20 = ptrtoint i8* %19 to i64\n %21 = add i64 %20, 99\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = load i8*, i8** %sv_1, align 8\n %24 = ptrtoint i8* %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %19, { 1, 0 }\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i8** %sv_1, { 4, 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i8** %.in.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_17-bad", "fun_name": "CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i32* %sv_0 to i64\n %2 = or i64 %1, 2\n %3 = inttoptr i64 %2 to i8*\n store i32 1, i32* %sv_0, align 4\n %4 = load i8, i8* %3, align 2\n %5 = sext i8 %4 to i64\n %6 = and i64 %5, 4294967295\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_for_loop_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_2, label LBL_3\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_3:\n %8 = call i32 @atoi(i8* nonnull %4)\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 0\n %sv_1.0.off = add i32 %8, -1\n %11 = icmp ugt i32 %sv_1.0.off, 19\n %12 = or i1 %11, %10\n br i1 %12, label LBL_6, label LBL_4\n LBL_4:\n %13 = sext i32 %8 to i64\n store i64 0, i64* %storemerge5.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %14 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_3 to i64))\n %15 = add nuw i64 %storemerge5.reload, 1\n %16 = icmp ult i64 %15, %13\n store i64 %15, i64* %storemerge5.reg2mem\n br i1 %16, label LBL_5, label LBL_6\n LBL_6:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %8, { 1, 0 }\n uselistorder i64* %storemerge5.reg2mem, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 3, 0, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_6, { 0, 3, 1, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memmove_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %7, i64 0, i64 100)\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_2 to i32))\n %10 = load i64, i64* %8, align 8\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_divide_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i32, i32* %sv_0, align 4\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = udiv i32 100, %8\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_6\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_sub_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = sext i1 %2 to i32\n %storemerge2.in = xor i32 %5, %6\n %storemerge2 = trunc i32 %storemerge2.in to i8\n %7 = icmp eq i8 %storemerge2, -128\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %sext3 = mul i32 %storemerge2.in, 16777216\n %sext = add i32 %sext3, -16777216\n %8 = ashr exact i32 %sext, 24\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %11 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %11, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_partial_init_14-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_partial_init_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %5 = mul i64 %indvars.iv6.reload, 8\n %6 = add i64 %5, %1\n %7 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %8 = trunc i64 %indvars.iv6.reload to i32\n %9 = call i128 @FUNC(i32 %8)\n %10 = call i64 @FUNC(i128 %9)\n %11 = inttoptr i64 %6 to i64*\n store i64 %10, i64* %11, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 5\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %9, i128* %xmm0.04.reg2mem\n br i1 %exitcond8, label LBL_2, label LBL_1\n LBL_2:\n %12 = load i32, i32* @gv_0, align 4\n %13 = icmp eq i32 %12, 5\n %14 = icmp eq i1 %13, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %15 = mul i64 %indvars.iv.reload, 8\n %16 = add i64 %15, %1\n %17 = inttoptr i64 %16 to i64*\n %18 = load i64, i64* %17, align 8\n %19 = call i128 @FUNC(i64 %18)\n %20 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_05-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.06.reg2mem = alloca i8*\n %sv_0.07.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_10\n LBL_10:\n %29 = load i32, i32* @gv_1, align 4\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_16, label LBL_11\n LBL_11:\n %31 = load i8, i8* %4, align 1\n %32 = icmp eq i8 %31, 0\n %33 = icmp eq i1 %32, false\n store i8 %31, i8* %.reg2mem\n store i8* %4, i8** %sv_0.07.reg2mem\n store i8* %4, i8** %sv_0.06.reg2mem\n br i1 %33, label LBL_12, label LBL_15\n LBL_12:\n %sv_0.07.reload = load i8*, i8** %sv_0.07.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %34 = icmp eq i8 %.reload, 83\n %35 = icmp eq i1 %34, false\n br i1 %35, label LBL_14, label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n store i8* %sv_0.07.reload, i8** %sv_0.06.reg2mem\n br label LBL_15\n LBL_14:\n %37 = ptrtoint i8* %sv_0.07.reload to i64\n %38 = add i64 %37, 1\n %39 = inttoptr i64 %38 to i8*\n %40 = load i8, i8* %39, align 1\n %41 = icmp eq i8 %40, 0\n %42 = icmp eq i1 %41, false\n store i8 %40, i8* %.reg2mem\n store i8* %39, i8** %sv_0.07.reg2mem\n store i8* %39, i8** %sv_0.06.reg2mem\n br i1 %42, label LBL_12, label LBL_15\n LBL_15:\n %sv_0.06.reload = load i8*, i8** %sv_0.06.reg2mem\n %43 = bitcast i8* %sv_0.06.reload to i64*\n call void @free(i64* %43)\n br label LBL_16\n LBL_16:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.07.reload, { 1, 0 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 0, 1, 2, 3, 4, 6, 5 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.07.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.06.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4, 5, 6 }\n uselistorder i32 -1, { 1, 0, 2 }\n uselistorder label LBL_15, { 0, 2, 1 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE123_Write_What_Where_Condition__connect_socket_13-bad", "fun_name": "CWE123_Write_What_Where_Condition__connect_socket_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 %1, i64* %sv_1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 %2, i64* %sv_2, align 8\n %3 = load i32, i32* inttoptr (i64 8348 to i32*), align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_5, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %6, i64* nonnull %sv_1, i32 16, i32 0)\n br label LBL_4\n LBL_4:\n %14 = call i32 @close(i32 %6)\n br label LBL_5\n LBL_5:\n store i64 %1, i64* @gv_1, align 8\n %15 = load i64, i64* %sv_1, align 8\n store i64 %15, i64* @gv_2, align 8\n store i64 %15, i64* %sv_2, align 8\n %16 = add i64 %15, 8\n %17 = inttoptr i64 %16 to i64*\n store i64 %1, i64* %17, align 8\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i64* %sv_1, { 1, 0, 2, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE377_Insecure_Temporary_File__char_mktemp_14-bad", "fun_name": "CWE377_Insecure_Temporary_File__char_mktemp_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n store i64 6365935209750752870, i64* %sv_0, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @mktemp(i8* nonnull %4)\n %6 = icmp eq i8* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %8 = ptrtoint i8* %5 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i32 (i8*, i32, ...) @open(i8* %5, i32 66)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([45 x i8]* @gv_0 to i64))\n %13 = call i32 @close(i32 %10)\n br label LBL_5\n LBL_5:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_loop_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = add i64 %2, -816\n %7 = add i64 %2, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %8 = mul i64 %storemerge13.reload, 8\n %9 = add i64 %8, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 8\n %11 = add i64 %7, %8\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge13.reg2mem\n br i1 %exitcond4, label LBL_2, label LBL_1\n LBL_2:\n %14 = ptrtoint i64* %sv_0 to i64\n %15 = icmp eq i1 %5, false\n %spec.select = select i1 %15, i64 %1, i64 %14\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = mul i64 %storemerge2.reload, 8\n %17 = add i64 %16, %spec.select\n %18 = add i64 %16, %6\n %19 = inttoptr i64 %18 to i64*\n %20 = load i64, i64* %19, align 8\n %21 = inttoptr i64 %17 to i64*\n store i64 %20, i64* %21, align 8\n %22 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %22, 100\n store i64 %22, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %23 = call i64 @FUNC(i64 %spec.select)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %3, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 1, 0 }\n uselistorder i64 %spec.select, { 1, 0 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64 100, { 1, 0, 3, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_loop_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n %4 = ptrtoint i32** %sv_0 to i64\n %5 = add i64 %4, -33\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i32*\n store i32* %7, i32** %sv_0, align 8\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = add i64 %9, -48\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %11 = mul i64 %storemerge2.reload, 4\n %12 = load i32*, i32** %sv_0, align 8\n %13 = ptrtoint i32* %12 to i64\n %14 = add i64 %11, %13\n %15 = add i64 %10, %11\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = inttoptr i64 %14 to i32*\n store i32 %17, i32* %18, align 4\n %19 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %19, 10\n store i64 %19, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %20 = load i32*, i32** %sv_0, align 8\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_0, { 4, 3, 2, 0, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__null_check_after_deref_07-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__null_check_after_deref_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 4)\n %5 = bitcast i64* %4 to i32*\n store i32 5, i32* %5, align 4\n %6 = call i64 @FUNC(i64 5)\n %7 = icmp eq i64* %4, null\n br i1 %7, label LBL_1.LBL_4_crit_edge, label LBL_3\n LBL_2:\n %.pre = load i32, i32* %5, align 4\n %phitmp = zext i32 %.pre to i64\n store i64 %phitmp, i64* %.reg2mem\n br label LBL_4\n LBL_3:\n store i32 10, i32* %5, align 4\n store i64 10, i64* %.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i64, i64* %.reg2mem\n %8 = call i64 @FUNC(i64 %.reload)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %5, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 5, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_square_09-bad", "fun_name": "CWE190_Integer_Overflow__int_connect_socket_square_09_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.04.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.04.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -22\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.04.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.04.reload = load i32, i32* %sv_0.04.reg2mem\n %20 = mul i32 %sv_0.04.reload, %sv_0.04.reload\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.04.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_07-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = load i32, i32* %sv_0, align 4\n %9 = add i32 %8, 1\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_cpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = load i8*, i8** %sv_1, align 8\n %12 = ptrtoint i8* %11 to i64\n %13 = bitcast i8** %sv_2 to i64*\n store i64 %12, i64* %13, align 8\n br label LBL_2\n LBL_2:\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %15 = load i8*, i8** %sv_2, align 8\n %16 = bitcast i64* %sv_0 to i8*\n %17 = call i8* @strcpy(i8* %15, i8* nonnull %16)\n %18 = load i8*, i8** %sv_2, align 8\n %19 = ptrtoint i8* %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 3, 2, 0, 1 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_execl_02-bad", "fun_name": "CWE78_OS_Command_Injection__char_console_execl_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_2, i64 0, i64 0))\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_fscanf_12-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_fscanf_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp ne i32 %2, 0\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %6 = icmp eq i32 %5, -1\n %7 = icmp eq i1 %6, false\n %or.cond = or i1 %3, %7\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_ncpy_14-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_ncpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %9 = icmp eq i32 %8, 5\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = add i64 %3, -8\n %12 = inttoptr i64 %11 to i8*\n store i8* %12, i8** %sv_1, align 8\n br label LBL_2\n LBL_2:\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = bitcast i64* %sv_0 to i8*\n %15 = call i32 @strlen(i8* nonnull %14)\n %16 = load i8*, i8** %sv_1, align 8\n %17 = call i8* @strncpy(i8* nonnull %14, i8* %16, i32 %15)\n %18 = call i64 @FUNC(i64* nonnull %sv_0)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i8** %sv_1, { 2, 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_multiply_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %3 = load i32, i32* @gv_2, align 4\n %4 = zext i32 %3 to i64\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %5 = load i32, i32* @gv_2, align 4\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 4294967292)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_ncpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %5 = ptrtoint i8** %sv_1 to i64\n %6 = add i64 %5, -49\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %7 to i8*\n %9 = bitcast i8** %sv_1 to i64*\n store i64 %7, i64* %9, align 8\n store i8 0, i8* %8, align 16\n br label LBL_3\n LBL_3:\n store i64 4702111234474983745, i64* %sv_0, align 8\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 @strlen(i8* nonnull %10)\n %12 = add i32 %11, 1\n %13 = load i8*, i8** %sv_1, align 8\n %14 = call i8* @strncpy(i8* %13, i8* nonnull %10, i32 %12)\n %15 = load i8*, i8** %sv_1, align 8\n %16 = ptrtoint i8* %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 3, 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_zero_divide_12-bad", "fun_name": "CWE369_Divide_by_Zero__int_zero_divide_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 14)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %5 = trunc i64 %0 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_3, label LBL_4\n LBL_3:\n %7 = call i64 @FUNC(i64 14)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %8 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__connect_socket_07-bad", "fun_name": "CWE617_Reachable_Assertion__connect_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_1 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_0, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n br i1 %14, label LBL_4, label LBL_5\n LBL_4:\n %15 = call i32 @close(i32 %4)\n br label LBL_6\n LBL_5:\n %16 = ptrtoint i64* %sv_2 to i64\n %17 = sext i32 %12 to i64\n %18 = add i64 %16, -22\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = bitcast i64* %sv_0 to i8*\n %22 = call i32 @atoi(i8* nonnull %21)\n %23 = call i32 @close(i32 %4)\n %24 = icmp sgt i32 %22, 5\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @gv_3, i64 0, i64 0), i32 118, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @gv_4, i64 0, i64 0))\n br label LBL_7\n LBL_7:\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 5, { 2, 0, 1 }\n uselistorder label LBL_6, { 3, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_03-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64* @malloc(i32 400)\n %3 = ptrtoint i64* %2 to i64\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %0\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %13 = call i64* @memcpy(i64* %2, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %14 = call i64 @FUNC(i64 %3)\n call void @free(i64* %2)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_snprintf_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -161\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %sv_0.0.reload, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_malloc_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %1 = icmp eq i32 %0, 5\n store i32 99, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %3 = call i64* @malloc(i32 %sv_0.0.reload)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %sv_0.0.reload, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = zext i32 %sv_0.0.reload to i64\n %10 = add nsw i64 %9, -1\n %11 = add i64 %10, %6\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.0.reload, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_16-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 0, i64* %sv_1, align 8\n %2 = add i64 %1, -816\n %3 = add i64 %1, -812\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %2, %4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 8\n %7 = load i64, i64* %sv_1, align 8\n %8 = mul i64 %7, 8\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = load i64, i64* %sv_1, align 8\n %12 = add i64 %11, 1\n store i64 %12, i64* %sv_1, align 8\n %13 = icmp ult i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %13, label LBL_1, label LBL_2\n LBL_2:\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %14, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %16 = and i64 %15, -16\n %17 = inttoptr i64 %16 to i64*\n %18 = call i64* @memcpy(i64* %17, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %19 = call i64 @FUNC(i64 %16)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 1, 0 }\n uselistorder i64 %12, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 4, 1, 2, 3, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_negative_01-bad", "fun_name": "CWE124_Buffer_Underwrite__CWE839_negative_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -68\n %3 = inttoptr i64 %2 to i32*\n store i32 1, i32* %3, align 4\n %4 = add i64 %0, -48\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_1\n LBL_1:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %5 = mul i64 %indvars.iv.reload, 4\n %6 = add i64 %4, %5\n %7 = inttoptr i64 %6 to i32*\n %8 = load i32, i32* %7, align 4\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_multiply_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_12, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n br label LBL_12\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n %31 = icmp slt i32 %sv_0.0.ph.reload, 1\n %or.cond3 = or i1 %31, %30\n br i1 %or.cond3, label LBL_12, label LBL_9\n LBL_9:\n %32 = icmp sgt i32 %sv_0.0.ph.reload, 1073741822\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n %33 = mul i32 %sv_0.0.ph.reload, 2\n %34 = zext i32 %33 to i64\n %35 = call i64 @FUNC(i64 %34)\n br label LBL_12\n LBL_11:\n %36 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_12\n LBL_12:\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 2, 0, 1 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder label LBL_12, { 3, 4, 5, 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_add_01-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_add_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = add i16 %3, 1\n %5 = sext i16 %4 to i64\n %6 = and i64 %5, 4294967295\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.034.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.034.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.034.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, 0\n store i32 %19, i32* %sv_0.034.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.034.reload = load i32, i32* %sv_0.034.reg2mem\n %22 = udiv i32 100, %sv_0.034.reload\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.034.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 4, 0, 5, 3, 6, 2, 7 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_modulo_11-bad", "fun_name": "CWE369_Divide_by_Zero__int_rand_modulo_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %17 = urem i32 100, %sv_0.0.reload\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memmove_03-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memmove_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 10)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = call i64* @memmove(i64* %1, i64* nonnull %sv_0, i32 %7)\n %9 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_multiply_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = load i16, i16* %sv_0, align 2\n %10 = icmp slt i16 %9, 1\n %or.cond = or i1 %8, %10\n br i1 %or.cond, label LBL_6, label LBL_3\n LBL_3:\n %11 = icmp sgt i16 %9, ptrtoint (i1* @gv_2 to i16)\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = mul i16 %9, 2\n %13 = sext i16 %12 to i64\n %14 = and i64 %13, 4294967294\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_6\n LBL_5:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE484_Omitted_Break_Statement_in_Switch__basic_17-bad", "fun_name": "CWE484_Omitted_Break_Statement_in_Switch__basic_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = srem i32 %0, 3\n %2 = icmp eq i32 %1, 2\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n br i1 false, label LBL_6, label LBL_2\n LBL_2:\n switch i32 %1, label LBL_6 [\n i32 0, label LBL_3\n i32 1, label LBL_4\n ]\n LBL_3:\n %3 = call i64 @FUNC(i64 ptrtoint (i64* @gv_0 to i64))\n br label LBL_4\n LBL_4:\n %4 = call i64 @FUNC(i64 ptrtoint (i64* @gv_1 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_5:\n %5 = call i64 @FUNC(i64 ptrtoint (i64* @gv_2 to i64))\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %6 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %1, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder label LBL_7, { 2, 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_predec_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.056.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.056.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.056.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, -2147483648\n store i32 %19, i32* %sv_0.056.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.056.reload = load i32, i32* %sv_0.056.reg2mem\n %22 = add i32 %sv_0.056.reload, -1\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.056.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fgets_14-bad", "fun_name": "CWE617_Reachable_Assertion__fgets_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n %phitmp = icmp sgt i32 %8, 5\n br i1 %phitmp, label LBL_5, label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_4\n LBL_4:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([127 x i8], [127 x i8]* @gv_3, i64 0, i64 0), i32 49, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @gv_4, i64 0, i64 0))\n br label LBL_5\n LBL_5:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memmove_32-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_memmove_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = inttoptr i64 %8 to i64*\n %11 = call i64* @memmove(i64* %10, i64* nonnull %sv_0, i32 100)\n %12 = add i64 %4, 91\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %8)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %.reg2mem = alloca i32*\n %sv_0 = alloca i32*, align 8\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32* null, i32** %.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 200)\n %4 = bitcast i64* %3 to i32*\n store i32* %4, i32** %sv_0, align 8\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i32* @wmemset(i32* %4, i32 65, i32 49)\n %8 = ptrtoint i64* %3 to i64\n %9 = add i64 %8, 196\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = load i32*, i32** %sv_0, align 8\n store i32* %11, i32** %.reg2mem\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC()\n %13 = trunc i64 %12 to i32\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %15, i64* %storemerge.reg2mem\n br label LBL_9\n LBL_6:\n %.reload = load i32*, i32** %.reg2mem\n %16 = call i32 @wcslen(i32* %.reload)\n %17 = add i32 %16, 1\n %18 = call i64* @calloc(i32 %17, i32 4)\n %19 = icmp eq i64* %18, null\n %20 = icmp eq i1 %19, false\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %21 = bitcast i64* %18 to i32*\n %22 = call i32* @wcscpy(i32* %21, i32* %.reload)\n %23 = ptrtoint i64* %18 to i64\n %24 = call i64 @FUNC(i64 %23)\n call void @free(i64* %18)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %18, { 1, 0, 3, 2 }\n uselistorder i32** %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memcpy_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = load i64, i64* %sv_1, align 8\n store i64 %3, i64* %sv_0, align 8\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = call i64 @FUNC(i64 %4)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 1, 2, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_no_init_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_4\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %5 = mul i64 %indvars.iv5.reload, 4\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = trunc i64 %indvars.iv5.reload to i32\n store i32 %8, i32* %7, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %9 = mul i64 %indvars.iv.reload, 4\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_fprintf_17-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_fprintf_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %8 = sub i32 100, %2\n %9 = add i64 %3, %6\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %8, %_IO_FILE* %7)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = add i64 %6, -1\n %16 = sext i32 %13 to i64\n %17 = add i64 %15, %16\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = load %_IO_FILE*, %_IO_FILE** @gv_2, align 8\n %24 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %23, i8* nonnull %1)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__empty_case_13-bad", "fun_name": "CWE398_Poor_Code_Quality__empty_case_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8356 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_postinc_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 3)\n ret i64 %0\n\n uselistorder i64 (i64)* @printUnsignedLine, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %7 = load i64, i64* %sv_1, align 8\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n store i64 %7, i64* %8, align 8\n %9 = add i64 %sv_0.0.reload, 8\n %10 = inttoptr i64 %9 to i64*\n %11 = add i64 %sv_0.0.reload, 16\n %12 = inttoptr i64 %11 to i64*\n %13 = add i64 %sv_0.0.reload, 24\n %14 = inttoptr i64 %13 to i64*\n %15 = add i64 %sv_0.0.reload, 32\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %sv_0.0.reload, 40\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %sv_0.0.reload, 48\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %sv_0.0.reload, 56\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %sv_0.0.reload, 64\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %sv_0.0.reload, 72\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %sv_0.0.reload, 80\n %28 = inttoptr i64 %27 to i64*\n %29 = add i64 %sv_0.0.reload, 88\n %30 = inttoptr i64 %29 to i64*\n %31 = add i64 %sv_0.0.reload, 96\n %32 = inttoptr i64 %31 to i32*\n %33 = add i64 %sv_0.0.reload, 99\n %34 = inttoptr i64 %33 to i8*\n store i8 0, i8* %34, align 1\n %35 = call i64 @FUNC(i64 %sv_0.0.reload)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 14, 13, 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_memcpy_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = load i64, i64* %sv_0, align 8\n store i64 %4, i64* %sv_1, align 8\n %5 = add i64 %2, 8\n %6 = inttoptr i64 %5 to i64*\n %7 = add i64 %2, 16\n %8 = inttoptr i64 %7 to i64*\n %9 = add i64 %2, 24\n %10 = inttoptr i64 %9 to i64*\n %11 = add i64 %2, 32\n %12 = inttoptr i64 %11 to i64*\n %13 = add i64 %2, 40\n %14 = inttoptr i64 %13 to i64*\n %15 = add i64 %2, 48\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %2, 56\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %2, 64\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %2, 72\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %2, 80\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %2, 88\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %2, 96\n %28 = inttoptr i64 %27 to i32*\n %29 = add i64 %2, 99\n %30 = inttoptr i64 %29 to i8*\n store i8 0, i8* %30, align 1\n %31 = call i64 @FUNC(i64 %2)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %2, { 13, 12, 0, 8, 1, 11, 2, 3, 4, 5, 6, 7, 9, 10 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_fwrite_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8448 to i32*), align 256\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 ptrtoint ([16 x i8]* @gv_0 to i64), i64* %rax.0.reg2mem\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge3.in = xor i32 %12, %13\n %sv_0.0.off = add i32 %storemerge3.in, -1\n %14 = icmp ugt i32 %sv_0.0.off, 19\n store i64 ptrtoint ([16 x i8]* @gv_0 to i64), i64* %rax.0.reg2mem\n br i1 %14, label LBL_9, label LBL_2\n LBL_2:\n %15 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %16 = icmp eq %_IO_FILE* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_3, label LBL_4\n LBL_3:\n %18 = sext i32 %storemerge3.in to i64\n store i64 0, i64* %storemerge7.reg2mem\n br label LBL_5\n LBL_4:\n call void @exit(i32 1)\n unreachable\n LBL_5:\n %19 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %15)\n %20 = icmp eq i32 %19, 50\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 1)\n unreachable\n LBL_7:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %21 = add nuw i64 %storemerge7.reload, 1\n %22 = icmp ult i64 %21, %18\n store i64 %21, i64* %storemerge7.reg2mem\n br i1 %22, label LBL_5, label LBL_8\n LBL_8:\n %23 = call i32 @fclose(%_IO_FILE* nonnull %15)\n %24 = sext i32 %23 to i64\n store i64 %24, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %15, { 1, 0, 2 }\n uselistorder i32 %storemerge3.in, { 1, 0 }\n uselistorder i64* %storemerge7.reg2mem, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder label LBL_9, { 1, 2, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_32-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_connect_socket_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge6.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = sext i32 %2 to i64\n %11 = ptrtoint i64* %sv_3 to i64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %27 = icmp eq i32 %26, 1\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_13, label LBL_9\n LBL_9:\n %29 = load i64, i64* %sv_1, align 8\n %30 = and i64 %29, 4294967295\n %31 = icmp eq i64 %30, 0\n store i32 0, i32* %storemerge6.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %31, label LBL_12, label LBL_10\n LBL_10:\n %storemerge6.reload = load i32, i32* %storemerge6.reg2mem\n %32 = add i32 %storemerge6.reload, 1\n %33 = sext i32 %32 to i64\n %34 = icmp sgt i64 %30, %33\n store i32 %32, i32* %storemerge6.reg2mem\n br i1 %34, label LBL_10, label LBL_11\n LBL_11:\n %phitmp = zext i32 %32 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_12\n LBL_12:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %35 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %32, { 1, 0, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %storemerge6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %phitmp = icmp eq i32 %.pre, 5\n %phitmp1 = icmp eq i1 %phitmp, false\n br i1 %phitmp1, label LBL_4, label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -20\n %6 = inttoptr i64 %5 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_4\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_no_init_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_4:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %7 = mul i64 %indvars.iv5.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv5.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_5, label LBL_4\n LBL_5:\n %11 = load i32, i32* @gv_0, align 4\n %12 = zext i32 %11 to i64\n %13 = icmp eq i32 %11, 5\n %14 = icmp eq i1 %13, false\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 %12, i64* %rax.1.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %15 = mul i64 %indvars.iv.reload, 4\n %16 = add i64 %15, %3\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %20, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_snprintf_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 49)\n %9 = add i64 %3, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_3\n LBL_3:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %13, i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* %11)\n %15 = call i64 @FUNC(i64 %3)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %11, { 1, 0 }\n uselistorder i64 %3, { 1, 3, 2, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_05-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.18.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_8, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_3 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_2, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_9, label LBL_6\n LBL_6:\n %18 = sext i32 %15 to i64\n %19 = add i64 %0, -112\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_2 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_9\n LBL_7:\n %24 = call i32 @close(i32 %4)\n br label LBL_8\n LBL_8:\n store i64 0, i64* %sv_2, align 8\n %25 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.18.reg2mem\n br label LBL_10\n LBL_9:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i64 0, i64* %sv_2, align 8\n %28 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %29 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.18.reg2mem\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %sv_0.18.reload = load i32, i32* %sv_0.18.reg2mem\n %30 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.18.reload)\n %31 = sext i32 %sv_0.18.reload to i64\n %32 = add i64 %0, -112\n %33 = add i64 %32, %31\n %34 = inttoptr i64 %33 to i8*\n store i8 0, i8* %34, align 1\n br label LBL_11\n LBL_11:\n %35 = call i64 @FUNC(i64* nonnull %sv_2)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %1, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.18.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 1, 2, 5, 0, 3, 4 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 0, 1, 3 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_divide_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge.in = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge.in, 0\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = udiv i32 100, %storemerge.in\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 3)\n ret i64 %0\n\n uselistorder i64 (i64)* @printUnsignedLine, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_listenSocket_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.036.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n store i32 %5, i32* %sv_0.036.reg2mem\n br i1 %7, label LBL_8, label LBL_1\n LBL_1:\n %8 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_2\n LBL_2:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_6, label LBL_4\n LBL_4:\n %17 = call i32 @recv(i32 %15, i64* nonnull %sv_1, i32 19, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %19, label LBL_7, label LBL_5\n LBL_5:\n %20 = ptrtoint i64* %sv_3 to i64\n %21 = sext i32 %17 to i64\n %22 = add i64 %20, -32\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = bitcast i64* %sv_1 to i8*\n %26 = call double @atof(i8* nonnull %25)\n %27 = fptrunc double %26 to float\n %28 = bitcast float %27 to i32\n %29 = sext i32 %28 to i128\n %30 = call i128 @FUNC(i128 %29)\n %31 = call i64 @FUNC(i128 %30)\n %32 = trunc i64 %31 to i32\n store i32 %32, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %33 = call i32 @close(i32 %6)\n store i32 %5, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %34 = call i32 @close(i32 %6)\n %35 = call i32 @close(i32 %15)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.036.reload = load i32, i32* %sv_0.036.reg2mem\n %36 = call i128 @__asm_movss.1(i32 %sv_0.036.reload)\n %37 = call i128 @__asm_movss.1(i32 2147483647)\n %38 = call i128 @FUNC(i128 %36, i128 %37)\n %39 = call i128 @FUNC(i128 %38)\n %40 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %39, i128 %40)\n %41 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %2, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i32 %5, { 1, 2, 0 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.036.reg2mem, { 0, 3, 2, 1 }\n uselistorder i128* @gv_0, { 1, 0 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder double (i8*)* @atof, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %spec.select = select i1 %5, i32 0, i32 20\n %6 = call i64* @malloc(i32 %spec.select)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %9 = ptrtoint i64* %6 to i64\n %10 = bitcast i64* %6 to i32*\n store i32 1819043176, i32* %10, align 4\n %11 = add i64 %9, 4\n %12 = inttoptr i64 %11 to i16*\n store i16 111, i16* %12, align 2\n %13 = call i64 @FUNC(i64 %9)\n call void @free(i64* %6)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %6, { 0, 1, 3, 2 }\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n %7 = trunc i64 %indvars.iv5.reload to i32\n store i32 %7, i32* %6, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %8, %1\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %13\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 1, 3, 2, 0, 4 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_preinc_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i32 %6, 1\n store i32 %8, i32* %sv_0, align 4\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_multiply_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8420 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i64, i64* %sv_0, align 8\n %6 = trunc i64 %.pre to i32\n %7 = icmp slt i32 %6, 0\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_5, label LBL_2\n LBL_2:\n %9 = icmp slt i32 %6, -1073741823\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n %10 = mul i64 %.pre, 2\n %11 = and i64 %10, 4294967294\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_5\n LBL_4:\n %13 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, -49\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_1, align 8\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n br label LBL_2\n LBL_2:\n store i64 4702111234474983745, i64* %sv_0, align 8\n %8 = bitcast i64* %sv_0 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = load i64, i64* %sv_1, align 8\n %12 = inttoptr i64 %11 to i64*\n %13 = call i64* @memmove(i64* %12, i64* nonnull %sv_0, i32 %10)\n %14 = load i64, i64* %sv_1, align 8\n %15 = call i64 @FUNC(i64 %14)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_int_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32*\n %storemerge2.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i32* null, i32** %sv_0.0.reg2mem\n br label LBL_6\n LBL_2:\n %3 = call i64* @malloc(i32 400)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_4\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n %7 = ptrtoint i64* %3 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_5\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %8 = mul i64 %storemerge2.reload, 4\n %9 = add i64 %8, %7\n %10 = inttoptr i64 %9 to i32*\n store i32 5, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge2.reg2mem\n store i32* %6, i32** %sv_0.0.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %12 = load i32, i32* @gv_2, align 4\n %13 = icmp eq i32 %12, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.0.reload = load i32*, i32** %sv_0.0.reg2mem\n %14 = load i32, i32* %sv_0.0.reload, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_multiply_05-bad", "fun_name": "CWE191_Integer_Underflow__short_fscanf_multiply_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_4, label LBL_2\n LBL_2:\n %6 = load i16, i16* %sv_0, align 2\n %7 = icmp slt i16 %6, 0\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = mul i16 %6, 2\n %10 = sext i16 %9 to i64\n %11 = and i64 %10, 4294967294\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 3, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv8.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_15, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = call i64* @malloc(i32 40)\n %27 = ptrtoint i64* %26 to i64\n %28 = icmp eq i64* %26, null\n %29 = icmp eq i1 %28, false\n store i64 0, i64* %indvars.iv8.reg2mem\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 -1)\n unreachable\n LBL_9:\n %indvars.iv8.reload = load i64, i64* %indvars.iv8.reg2mem\n %30 = mul i64 %indvars.iv8.reload, 4\n %31 = add i64 %30, %27\n %32 = inttoptr i64 %31 to i32*\n store i32 0, i32* %32, align 4\n %indvars.iv.next9 = add nuw nsw i64 %indvars.iv8.reload, 1\n %exitcond10 = icmp eq i64 %indvars.iv.next9, 10\n store i64 %indvars.iv.next9, i64* %indvars.iv8.reg2mem\n br i1 %exitcond10, label LBL_10, label LBL_9\n LBL_10:\n %33 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %33, label LBL_13, label LBL_11\n LBL_11:\n %34 = sext i32 %sv_0.1.reload to i64\n %35 = mul i64 %34, 4\n %36 = add i64 %35, %27\n %37 = inttoptr i64 %36 to i32*\n store i32 1, i32* %37, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_12\n LBL_12:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %38 = mul i64 %indvars.iv.reload, 4\n %39 = add i64 %38, %27\n %40 = inttoptr i64 %39 to i32*\n %41 = load i32, i32* %40, align 4\n %42 = zext i32 %41 to i64\n %43 = call i64 @FUNC(i64 %42)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_14, label LBL_12\n LBL_13:\n %44 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_14\n LBL_14:\n call void @free(i64* %26)\n br label LBL_15\n LBL_15:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %27, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv8.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_snprintf_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* inttoptr (i64 20500 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_3\n LBL_3:\n %14 = load i32, i32* @gv_1, align 4\n %15 = icmp eq i32 %14, 5\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_5:\n store i64 0, i64* %sv_0, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %17, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %19 = ptrtoint i64* %sv_0 to i64\n %20 = call i64 @FUNC(i64 %19)\n br label LBL_6\n LBL_6:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_file_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge68.reg2mem = alloca i32\n %sv_1.0.lcssa.reg2mem = alloca i64\n %storemerge10.reg2mem = alloca i32\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n br i1 %8, label LBL_11, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_11, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_11\n LBL_6:\n br i1 %8, label LBL_11, label LBL_7\n LBL_7:\n %20 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %21 = icmp eq %_IO_FILE* %20, null\n br i1 %21, label LBL_11, label LBL_8\n LBL_8:\n %22 = sub i32 100, %5\n %23 = ptrtoint i64* %sv_3 to i64\n %24 = add i64 %6, %23\n %25 = inttoptr i64 %24 to i8*\n %26 = call i8* @fgets(i8* %25, i32 %22, %_IO_FILE* nonnull %20)\n %27 = icmp eq i8* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %25, align 1\n br label LBL_10\n LBL_10:\n %30 = call i32 @fclose(%_IO_FILE* nonnull %20)\n br label LBL_11\n LBL_11:\n %31 = call i64 @FUNC()\n %32 = trunc i64 %31 to i32\n %33 = icmp eq i32 %32, 0\n %34 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_2)\n %35 = icmp eq i32 %34, 1\n %36 = icmp eq i1 %35, false\n br i1 %33, label LBL_18, label LBL_12\n LBL_12:\n br i1 %36, label LBL_24, label LBL_13\n LBL_13:\n %37 = load i64, i64* %sv_2, align 8\n %38 = trunc i64 %37 to i32\n %39 = icmp sgt i32 %38, ptrtoint (i1* @gv_4 to i32)\n br i1 %39, label LBL_24, label LBL_14\n LBL_14:\n %40 = and i64 %37, 4294967295\n %41 = icmp eq i64 %40, 0\n store i32 0, i32* %storemerge10.reg2mem\n store i64 0, i64* %sv_1.0.lcssa.reg2mem\n br i1 %41, label LBL_17, label LBL_15\n LBL_15:\n %storemerge10.reload = load i32, i32* %storemerge10.reg2mem\n %42 = add i32 %storemerge10.reload, 1\n %43 = sext i32 %42 to i64\n %44 = icmp sgt i64 %40, %43\n store i32 %42, i32* %storemerge10.reg2mem\n br i1 %44, label LBL_15, label LBL_16\n LBL_16:\n %phitmp = zext i32 %42 to i64\n store i64 %phitmp, i64* %sv_1.0.lcssa.reg2mem\n br label LBL_17\n LBL_17:\n %sv_1.0.lcssa.reload = load i64, i64* %sv_1.0.lcssa.reg2mem\n %45 = call i64 @FUNC(i64 %sv_1.0.lcssa.reload)\n br label LBL_24\n LBL_18:\n br i1 %36, label LBL_24, label LBL_19\n LBL_19:\n %46 = load i64, i64* %sv_2, align 8\n %47 = trunc i64 %46 to i32\n %48 = icmp sgt i32 %47, ptrtoint (i1* @gv_4 to i32)\n br i1 %48, label LBL_24, label LBL_20\n LBL_20:\n %49 = and i64 %46, 4294967295\n %50 = icmp eq i64 %49, 0\n store i32 0, i32* %storemerge68.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %50, label LBL_23, label LBL_21\n LBL_21:\n %storemerge68.reload = load i32, i32* %storemerge68.reg2mem\n %51 = add i32 %storemerge68.reload, 1\n %52 = sext i32 %51 to i64\n %53 = icmp sgt i64 %49, %52\n store i32 %51, i32* %storemerge68.reg2mem\n br i1 %53, label LBL_21, label LBL_22\n LBL_22:\n %phitmp12 = zext i32 %51 to i64\n store i64 %phitmp12, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_23\n LBL_23:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %54 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_24\n LBL_24:\n %55 = call i64 @FUNC(i64 40)\n %56 = icmp eq i64 %0, %55\n store i64 0, i64* %rax.0.reg2mem\n br i1 %56, label LBL_26, label LBL_25\n LBL_25:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_26\n LBL_26:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %51, { 1, 0, 2 }\n uselistorder i32 %42, { 1, 0, 2 }\n uselistorder i1 %36, { 1, 0 }\n uselistorder i1 %8, { 1, 0 }\n uselistorder i32 %5, { 1, 0, 2 }\n uselistorder i64* %sv_2, { 1, 2, 0 }\n uselistorder i32* %storemerge10.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_1.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32* %storemerge68.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 ptrtoint (i1* @gv_4 to i32), { 1, 0 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder label LBL_23, { 1, 0 }\n uselistorder label LBL_21, { 1, 0 }\n uselistorder label LBL_17, { 1, 0 }\n uselistorder label LBL_15, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_add_05-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_add_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i16, i16* %sv_0, align 2\n %7 = add i16 %6, 1\n %8 = sext i16 %7 to i64\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__char_pointer_alloca_use_12-bad", "fun_name": "CWE758_Undefined_Behavior__char_pointer_alloca_use_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = add i64 %0, -1\n %6 = and i64 %5, -16\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %7 = inttoptr i64 %6 to i64*\n %8 = load i64, i64* %7, align 16\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n store i64 %6, i64* %sv_0, align 8\n %10 = inttoptr i64 %6 to i64*\n store i64 ptrtoint ([7 x i8]* @gv_0 to i64), i64* %10, align 16\n %11 = load i64, i64* %sv_0, align 8\n %12 = inttoptr i64 %11 to i64*\n %13 = load i64, i64* %12, align 8\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_connect_socket_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n br label LBL_7\n LBL_2:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_16, label LBL_3\n LBL_3:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_16, label LBL_5\n LBL_4:\n %12 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n br label LBL_7\n LBL_5:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n %21 = icmp ugt i32 %19, 9\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n %22 = sext i32 %19 to i64\n %23 = mul i64 %22, 4\n %24 = add i64 %13, -64\n %25 = add i64 %24, %23\n %26 = inttoptr i64 %25 to i32*\n %27 = load i32, i32* %26, align 4\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_8\n LBL_7:\n %30 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_8\n LBL_8:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i64 %13, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 4, 0, 2, 5, 3, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder label LBL_7, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__rand_memcpy_07-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__rand_memcpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = call i32 @rand()\n %11 = xor i32 %10, %9\n %12 = sext i1 %6 to i32\n %storemerge.in = xor i32 %11, %12\n %sext = mul i32 %storemerge.in, 65536\n %13 = ashr exact i32 %sext, 16\n store i32 %13, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n store i64 0, i64* %sv_2, align 8\n %14 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %15 = trunc i32 %sv_0.0.reload to i16\n %16 = icmp sgt i16 %15, 99\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.0.reload)\n %19 = sext i32 %sv_0.0.reload to i64\n %20 = add i64 %17, -128\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n br label LBL_4\n LBL_4:\n %23 = call i64 @FUNC(i64* nonnull %sv_2)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memcpy_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 100)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %5, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_7\n LBL_4:\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = call i64* @memset(i64* %4, i32 65, i32 99)\n %12 = add i64 %5, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %15 = load i64, i64* %4, align 8\n store i64 %15, i64* %sv_0, align 8\n %16 = call i64 @FUNC(i64* nonnull %sv_0)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %7, { 1, 0 }\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %4, { 0, 2, 1, 3, 4 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 2, 0, 3 }\n uselistorder i32 99, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_3, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 5\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %6 = ptrtoint i64* %sv_2 to i64\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = sext i32 %9 to i64\n %11 = icmp eq i32 %9, 0\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %12 = add i64 %storemerge1.reload, %sv_0.0.reload\n %13 = inttoptr i64 %12 to i8*\n %14 = load i8, i8* %13, align 1\n %15 = add i64 %storemerge1.reload, %.pre\n %16 = inttoptr i64 %15 to i8*\n store i8 %14, i8* %16, align 1\n %17 = add nuw i64 %storemerge1.reload, 1\n %18 = icmp ult i64 %17, %10\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %18, label LBL_4, label LBL_5\n LBL_5:\n %19 = call i64 @FUNC(i64 %.pre)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %.pre, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int_17-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__int_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge3.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i32*\n store i32 0, i32* %storemerge3.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge3.reload = load i32, i32* %storemerge3.reg2mem\n %sv_0.0.reload = load i32*, i32** %sv_0.0.reg2mem\n %0 = add nuw nsw i32 %storemerge3.reload, 1\n %exitcond = icmp eq i32 %0, 2\n store i32* null, i32** %sv_0.0.reg2mem\n store i32 %0, i32* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %1 = load i32, i32* %sv_0.0.reload, align 4\n %2 = zext i32 %1 to i64\n %3 = call i64 @FUNC(i64 %2)\n ret i64 %3\n\n uselistorder i32** %sv_0.0.reg2mem, { 1, 0 }\n uselistorder i32* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_ncpy_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC()\n %10 = load i8*, i8** %sv_1, align 8\n %11 = ptrtoint i8* %10 to i64\n %12 = bitcast i8** %sv_2 to i64*\n store i64 %11, i64* %12, align 8\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = load i8*, i8** %sv_2, align 8\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i8* @strncpy(i8* %14, i8* nonnull %15, i32 99)\n %17 = load i8*, i8** %sv_2, align 8\n %18 = ptrtoint i8* %17 to i64\n %19 = add i64 %18, 99\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = load i8*, i8** %sv_2, align 8\n %22 = ptrtoint i8* %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %1, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 4, 3, 2, 0, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_08-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = add i32 %9, 1\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__open_11-bad", "fun_name": "CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__open_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @gv_1, i64 0, i64 0), i32 66)\n %5 = icmp eq i32 %4, -1\n store i64 -1, i64* %rax.0.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = call i32 @close(i32 %4)\n %7 = sext i32 %6 to i64\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_14, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %31 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %31, label LBL_13, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %33, %34\n %36 = inttoptr i64 %35 to i32*\n store i32 1, i32* %36, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_12\n LBL_12:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %37 = mul i64 %indvars.iv.reload, 4\n %38 = add i64 %37, %34\n %39 = inttoptr i64 %38 to i32*\n %40 = load i32, i32* %39, align 4\n %41 = zext i32 %40 to i64\n %42 = call i64 @FUNC(i64 %41)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_14, label LBL_12\n LBL_13:\n %43 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_14\n LBL_14:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %1, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder label LBL_14, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_printf_08-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_environment_printf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_3\n LBL_3:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n %17 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n br label LBL_5\n LBL_5:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %1, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_partial_init_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %4 = mul i64 %indvars.iv6.reload, 8\n %5 = add i64 %4, %1\n %6 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %7 = trunc i64 %indvars.iv6.reload to i32\n %8 = call i128 @FUNC(i32 %7)\n %9 = call i64 @FUNC(i128 %8)\n %10 = inttoptr i64 %5 to i64*\n store i64 %9, i64* %10, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %8, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 8\n %12 = add i64 %11, %1\n %13 = inttoptr i64 %12 to i64*\n %14 = load i64, i64* %13, align 8\n %15 = call i128 @FUNC(i64 %14)\n %16 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %16\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @printDoubleLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 2, 3, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 1, 2, 0, 4 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE468_Incorrect_Pointer_Scaling__int_12-bad", "fun_name": "CWE468_Incorrect_Pointer_Scaling__int_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 1, i32* %sv_0, align 4\n %4 = ptrtoint i32* %sv_0 to i64\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i64 %4, 32\n %6 = inttoptr i64 %5 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n %10 = add i64 %4, 8\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_13-bad", "fun_name": "CWE191_Integer_Underflow__char_fscanf_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %.pre = load i8, i8* %sv_0, align 1\n %6 = icmp slt i8 %.pre, 0\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = mul i8 %.pre, 2\n %9 = sext i8 %8 to i64\n %10 = and i64 %9, 4294967294\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__struct_malloc_use_07-bad", "fun_name": "CWE758_Undefined_Behavior__struct_malloc_use_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %2 = load i32, i32* @gv_0, align 4\n %3 = zext i32 %2 to i64\n %4 = icmp eq i32 %2, 5\n %5 = icmp eq i1 %4, false\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %6 = call i64* @malloc(i32 8)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %9 = load i64, i64* %6, align 8\n call void @free(i64* %6)\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n %12 = zext i32 %1 to i64\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_32-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__CWE135_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 200)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i32*\n %5 = call i32* @wmemset(i32* %4, i32 65, i32 49)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 196\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %9 = bitcast i64* %1 to i8*\n %10 = call i32 @strlen(i8* %9)\n %11 = add i32 %10, 1\n %12 = call i64* @calloc(i32 %11, i32 4)\n %13 = icmp eq i64* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %15 = bitcast i64* %12 to i32*\n %16 = call i32* @wcscpy(i32* %15, i32* %4)\n %17 = ptrtoint i64* %12 to i64\n %18 = call i64 @FUNC(i64 %17)\n call void @free(i64* %12)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %12, { 1, 0, 3, 2 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_postdec_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i64, i64* %sv_0, align 8\n %9 = icmp eq i64 %8, -9223372036854775808\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = add i64 %8, -1\n store i64 %10, i64* %sv_0, align 8\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_6\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memcpy_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = add i64 %0, -161\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = inttoptr i64 %5 to i64*\n %11 = call i64* @memset(i64* %10, i32 65, i32 99)\n %12 = add i64 %5, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i32 @strlen(i8* nonnull %15)\n %17 = call i64* @memcpy(i64* nonnull %sv_0, i64* %10, i32 %16)\n %18 = ptrtoint i64* %sv_0 to i64\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %1, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_fwrite_32-bad", "fun_name": "CWE400_Resource_Exhaustion__listen_socket_fwrite_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge11.reg2mem = alloca i64\n %sv_0.069.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.069.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.069.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.069.reg2mem\n br label LBL_8\n LBL_8:\n %25 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %26 = icmp eq %_IO_FILE* %25, null\n %27 = icmp eq i1 %26, false\n br i1 %27, label LBL_9, label LBL_10\n LBL_9:\n %sv_0.069.reload = load i32, i32* %sv_0.069.reg2mem\n %28 = sext i32 %sv_0.069.reload to i64\n %29 = icmp eq i32 %sv_0.069.reload, 0\n store i64 0, i64* %storemerge11.reg2mem\n br i1 %29, label LBL_14, label LBL_11\n LBL_10:\n call void @exit(i32 1)\n unreachable\n LBL_11:\n %30 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %25)\n %31 = icmp eq i32 %30, 50\n br i1 %31, label LBL_13, label LBL_12\n LBL_12:\n call void @exit(i32 1)\n unreachable\n LBL_13:\n %storemerge11.reload = load i64, i64* %storemerge11.reg2mem\n %32 = add nuw i64 %storemerge11.reload, 1\n %33 = icmp ult i64 %32, %28\n store i64 %32, i64* %storemerge11.reg2mem\n br i1 %33, label LBL_11, label LBL_14\n LBL_14:\n %34 = call i32 @fclose(%_IO_FILE* nonnull %25)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.069.reload, { 1, 0 }\n uselistorder %_IO_FILE* %25, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.069.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %storemerge11.reg2mem, { 2, 0, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = load i32, i32* inttoptr (i64 8384 to i32*), align 64\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq %_IO_FILE* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %0, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_loop_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %1 = load i64, i64* %0\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %7 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %6, i64 %1, i64 %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %spec.select\n %11 = add i64 %storemerge1.reload, %9\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = inttoptr i64 %10 to i8*\n store i8 %13, i8* %14, align 1\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %16 = add i64 %spec.select, 99\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i64 @FUNC(i64 %spec.select)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %2, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %spec.select, { 2, 1, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE510_Trapdoor__hostname_based_logic_05-bad", "fun_name": "CWE510_Trapdoor__hostname_based_logic_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_13, label LBL_1\n LBL_1:\n store i32 16, i32* %sv_4, align 4\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_13, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %6 = call i16 @htons(i16 20000)\n %7 = bitcast i64* %sv_3 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_11, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_11, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_11, label LBL_5\n LBL_5:\n %14 = bitcast i64* %sv_2 to %sockaddr*\n %15 = call i32 @getsockname(i32 %12, %sockaddr* nonnull %14, i32* nonnull %sv_4)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_12, label LBL_6\n LBL_6:\n %17 = bitcast i64* %sv_0 to i8*\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @getnameinfo(%sockaddr* nonnull %14, i32 16, i8* nonnull %17, i32 ptrtoint (i32* @gv_1 to i32), i8* nonnull %18, i32 32, i32 2)\n %20 = icmp eq i32 %19, 0\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_12, label LBL_7\n LBL_7:\n %22 = call i32 @strcmp(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %17)\n %23 = icmp eq i32 %22, 0\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_9, label LBL_8\n LBL_8:\n %25 = call i32 @send(i32 %12, i64* bitcast ([16 x i8]* @gv_3 to i64*), i32 15, i32 0)\n br label LBL_12\n LBL_9:\n %26 = call i32 @send(i32 %12, i64* bitcast ([9 x i8]* @gv_4 to i64*), i32 8, i32 0)\n %27 = icmp eq i32 %26, -1\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_12, label LBL_10\n LBL_10:\n %29 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_5 to i64))\n br label LBL_12\n LBL_11:\n %30 = call i32 @close(i32 %3)\n br label LBL_13\n LBL_12:\n %31 = call i32 @close(i32 %3)\n %32 = call i32 @close(i32 %12)\n br label LBL_13\n LBL_13:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 0, 4, 1, 2, 3, 5 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 0, 1, 3 }\n uselistorder i32 (i32, i64*, i32, i32)* @send, { 1, 0, 2 }\n uselistorder label LBL_13, { 2, 1, 0, 3 }\n uselistorder label LBL_12, { 1, 2, 0, 3, 4 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_32-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, -193\n %4 = and i64 %3, -16\n store i64 %4, i64* %sv_1, align 8\n %5 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 50)\n %6 = add i64 %2, -416\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %7 = mul i64 %storemerge2.reload, 4\n %8 = add i64 %7, %4\n %9 = add i64 %6, %7\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = inttoptr i64 %8 to i32*\n store i32 %11, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %14 = inttoptr i64 %4 to i32*\n %15 = load i32, i32* %14, align 16\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_sub_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 8416 to i32*), align 32\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.01.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n %14 = icmp eq i32 %storemerge.in, -2147483648\n store i32 %storemerge.in, i32* %sv_0.01.reg2mem\n br i1 %14, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %15 = add i32 %sv_0.01.reload, -1\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %18 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.01.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_fputc_12-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_fputc_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp ne i32 %1, 0\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %4 = call i32 @fputc(i32 65, %_IO_FILE* %3)\n %5 = sext i32 %4 to i64\n %6 = icmp eq i32 %4, -1\n %7 = icmp eq i1 %6, false\n %or.cond = or i1 %2, %7\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_add_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = icmp eq i32 %sv_0.1.reload, 2147483647\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n %32 = add i32 %sv_0.1.reload, 1\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_13\n LBL_12:\n %35 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_01-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_square_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = mul i16 %3, %3\n %5 = sext i16 %4 to i64\n %6 = and i64 %5, 4294967295\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC()\n %36 = trunc i64 %35 to i32\n %37 = icmp eq i32 %36, 0\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n %38 = call i32 @puts(i8* nonnull %1)\n br label LBL_14\n LBL_14:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_13-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8392 to i32*), align 8\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = icmp ult i32 %3, 6\n br i1 %4, label LBL_5, label LBL_2\n LBL_2:\n %5 = call i64* @malloc(i32 %3)\n %6 = icmp eq i64* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = ptrtoint i64* %5 to i64\n %9 = bitcast i64* %5 to i32*\n store i32 1819043176, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i16*\n store i16 111, i16* %11, align 2\n %12 = call i64 @FUNC(i64 %8)\n call void @free(i64* %5)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %5, { 0, 1, 3, 2 }\n uselistorder i32 %3, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_ncpy_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i8*\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i8*, i8** %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %7 = bitcast i64* %sv_1 to i8*\n %spec.select = select i1 %6, i8* %1, i8* %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = call i8* @strncpy(i8* nonnull %9, i8* %spec.select, i32 %10)\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %2, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fgets_strncpy_13-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__fgets_strncpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %.pre-phi.reg2mem = alloca i8*\n %.pre.pre-phi.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8352 to i32*), align 32\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_0.LBL_4_crit_edge, label LBL_2\n LBL_1:\n %.pre2 = bitcast i64* %sv_2 to i8*\n store i8* %.pre2, i8** %.pre.pre-phi.reg2mem\n br label LBL_4\n LBL_2:\n store i64 0, i64* %sv_2, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_2 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_5\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i8* %5, i8** %.pre.pre-phi.reg2mem\n br label LBL_4\n LBL_4:\n %.pre.pre-phi.reload = load i8*, i8** %.pre.pre-phi.reg2mem\n store i64 0, i64* %sv_2, align 8\n %9 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i8* %.pre.pre-phi.reload, i8** %.pre-phi.reg2mem\n store i32 -1, i32* %sv_0.01.reg2mem\n br label LBL_6\n LBL_5:\n %10 = call i32 @atoi(i8* nonnull %5)\n store i64 0, i64* %sv_2, align 8\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %12 = icmp sgt i32 %10, 99\n store i8* %5, i8** %.pre-phi.reg2mem\n store i32 %10, i32* %sv_0.01.reg2mem\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n %13 = ptrtoint i64* %sv_3 to i64\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %.pre-phi.reload = load i8*, i8** %.pre-phi.reg2mem\n %14 = bitcast i64* %sv_1 to i8*\n %15 = call i8* @strncpy(i8* nonnull %.pre-phi.reload, i8* nonnull %14, i32 %sv_0.01.reload)\n %16 = sext i32 %sv_0.01.reload to i64\n %17 = add i64 %13, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n br label LBL_7\n LBL_7:\n %20 = ptrtoint i64* %sv_2 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.01.reload, { 1, 0 }\n uselistorder i8* %5, { 0, 2, 1, 3 }\n uselistorder i64* %sv_2, { 3, 4, 1, 2, 5, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_system_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %3, %4\n %6 = inttoptr i64 %5 to i32*\n store i32 2764330, i32* %6, align 4\n %7 = call i32 @system(i8* nonnull %1)\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %9 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int64_t_alloca_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge24.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %storemerge5.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %8 = mul i64 %storemerge5.reload, 8\n %9 = add i64 %8, %4\n %10 = inttoptr i64 %9 to i64*\n store i64 5, i64* %10, align 8\n %11 = add nuw nsw i64 %storemerge5.reload, 1\n %exitcond6 = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge5.reg2mem\n br i1 %exitcond6, label LBL_7, label LBL_3\n LBL_4:\n store i64 0, i64* %storemerge24.reg2mem\n br i1 %6, label LBL_6, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_6:\n %storemerge24.reload = load i64, i64* %storemerge24.reg2mem\n %13 = mul i64 %storemerge24.reload, 8\n %14 = add i64 %13, %4\n %15 = inttoptr i64 %14 to i64*\n store i64 5, i64* %15, align 8\n %16 = add nuw nsw i64 %storemerge24.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge24.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %17 = load i64, i64* %3, align 8\n %18 = call i64 @FUNC(i64 %17)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge24.reg2mem, { 2, 0, 1 }\n uselistorder i64 100, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memcpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = add i64 %1, 49\n %3 = inttoptr i64 %2 to i8*\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n store i8 0, i8* %3, align 1\n %5 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_0, align 8\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %6)\n %8 = call i64 @FUNC(i64 %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 3, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem4 = alloca i32\n %.reg2mem = alloca i8*\n %sv_0 = alloca i8*, align 8\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i8* null, i8** %.reg2mem\n store i32 %0, i32* %.reg2mem4\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 50)\n %4 = bitcast i64* %3 to i8*\n store i8* %4, i8** %sv_0, align 8\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i64* @memset(i64* %3, i32 65, i32 49)\n %8 = ptrtoint i64* %3 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = load i8*, i8** %sv_0, align 8\n %.pre = load i32, i32* @gv_0, align 4\n store i8* %11, i8** %.reg2mem\n store i32 %.pre, i32* %.reg2mem4\n br label LBL_4\n LBL_4:\n %.reload5 = load i32, i32* %.reg2mem4\n %12 = zext i32 %.reload5 to i64\n %13 = icmp eq i32 %.reload5, 5\n %14 = icmp eq i1 %13, false\n store i64 %12, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_5\n LBL_5:\n %.reload = load i8*, i8** %.reg2mem\n %15 = call i32 @strlen(i8* %.reload)\n %16 = add i32 %15, 1\n %17 = call i64* @calloc(i32 %16, i32 1)\n %18 = icmp eq i64* %17, null\n %19 = icmp eq i1 %18, false\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %20 = bitcast i64* %17 to i8*\n %21 = call i8* @strcpy(i8* %20, i8* %.reload)\n %22 = ptrtoint i64* %17 to i64\n %23 = call i64 @FUNC(i64 %22)\n call void @free(i64* %17)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %17, { 1, 0, 3, 2 }\n uselistorder i8** %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %.reg2mem4, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32, i32)* @calloc, { 0, 3, 2, 1, 4 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 7, 6, 5, 4, 3, 2, 1, 0, 8 }\n uselistorder i32 -1, { 0, 1, 3, 2, 4, 5, 6, 7 }\n uselistorder i64* null, { 0, 1, 3, 2, 4, 5, 6, 7 }\n uselistorder i64* (i32)* @malloc, { 0, 3, 2, 1, 4 }\n uselistorder i32* @gv_0, { 0, 6, 5, 4, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_14, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_2\n LBL_2:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %sv_2 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_7, label LBL_4\n LBL_4:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %20, align 1\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_7\n LBL_7:\n %.pr = load i32, i32* @gv_0, align 4\n %25 = icmp eq i32 %.pr, 0\n br i1 %25, label LBL_14, label LBL_8\n LBL_8:\n %26 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %27 = icmp eq i32 %26, 1\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_14, label LBL_9\n LBL_9:\n %29 = load i64, i64* %sv_1, align 8\n %30 = trunc i64 %29 to i32\n %31 = icmp sgt i32 %30, ptrtoint (i1* @gv_4 to i32)\n br i1 %31, label LBL_14, label LBL_10\n LBL_10:\n %32 = and i64 %29, 4294967295\n %33 = icmp eq i64 %32, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %33, label LBL_13, label LBL_11\n LBL_11:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %34 = add i32 %storemerge4.reload, 1\n %35 = sext i32 %34 to i64\n %36 = icmp sgt i64 %32, %35\n store i32 %34, i32* %storemerge4.reg2mem\n br i1 %36, label LBL_11, label LBL_12\n LBL_12:\n %phitmp = zext i32 %34 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_13\n LBL_13:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %37 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_14\n LBL_14:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %34, { 1, 0, 2 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 ptrtoint (i1* @gv_4 to i32), { 1, 0 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 2, 1, 3, 0, 4 }\n uselistorder label LBL_14, { 1, 2, 3, 4, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int64_t_13-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__int64_t_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %1 = load i64, i64* %0\n %2 = inttoptr i64 %1 to i64*\n %3 = load i64, i64* %2, align 8\n %4 = call i64 @FUNC(i64 %3)\n ret i64 %4\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_char_08-bad", "fun_name": "CWE415_Double_Free__malloc_free_char_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %3)\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* null, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_partial_init_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %4 = mul i64 %indvars.iv6.reload, 8\n %5 = add i64 %4, %1\n %6 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %7 = trunc i64 %indvars.iv6.reload to i32\n %8 = call i128 @FUNC(i32 %7)\n %9 = call i64 @FUNC(i128 %8)\n %10 = inttoptr i64 %5 to i64*\n store i64 %9, i64* %10, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %8, i128* %xmm0.04.reg2mem\n br i1 %exitcond8, label LBL_2, label LBL_1\n LBL_2:\n %.pr = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %.pr, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %12 = mul i64 %indvars.iv.reload, 8\n %13 = add i64 %12, %1\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = call i128 @FUNC(i64 %15)\n %17 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @printDoubleLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder i32* @gv_0, { 0, 5, 4, 1, 3, 2 }\n uselistorder label LBL_4, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_postinc_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8428 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i64, i64* %sv_0, align 8\n %6 = icmp eq i64 %.pr, 9223372036854775807\n store i64 %.pr, i64* %.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %7 = add i64 %.reload, 1\n store i64 %7, i64* %sv_0, align 8\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1, 3 }\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fixed_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.1.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([127 x i8], [127 x i8]* @gv_2, i64 0, i64 0), i32 74, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_3, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_2\n LBL_2:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %rax.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_memmove_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 0\n %5 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %4, i64 %1, i64 %5\n %6 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 100)\n %7 = inttoptr i64 %spec.select to i64*\n %8 = call i64* @memmove(i64* %7, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %9 = load i64, i64* %7, align 8\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %2, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fread_12-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fread_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 @fread(i64* nonnull %sv_0, i32 1, i32 99, %_IO_FILE* %4)\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %6 = icmp eq i32 %5, 0\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_3:\n %9 = icmp eq i32 %5, 99\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_fgets_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_4\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp ugt i32 %6, 9\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = sext i32 %6 to i64\n %10 = mul i64 %9, 4\n %11 = add i64 %8, -64\n %12 = add i64 %11, %10\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_5\n LBL_4:\n %17 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 1, 0 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_fprintf_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = load i32, i32* @gv_0, align 4\n %21 = icmp eq i32 %20, 5\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n %23 = load %_IO_FILE*, %_IO_FILE** @gv_4, align 8\n %24 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_5, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_8\n LBL_8:\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memcpy_07-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memcpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = bitcast i64* %4 to i8*\n store i8 0, i8* %8, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %10 = load i64, i64* %sv_1, align 8\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n store i64 %10, i64* %11, align 8\n %12 = add i64 %sv_0.0.reload, 8\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %sv_0.0.reload, 16\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %sv_0.0.reload, 24\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %sv_0.0.reload, 32\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %sv_0.0.reload, 40\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %sv_0.0.reload, 48\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %sv_0.0.reload, 56\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %sv_0.0.reload, 64\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %sv_0.0.reload, 72\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %sv_0.0.reload, 80\n %31 = inttoptr i64 %30 to i64*\n %32 = add i64 %sv_0.0.reload, 88\n %33 = inttoptr i64 %32 to i64*\n %34 = add i64 %sv_0.0.reload, 96\n %35 = inttoptr i64 %34 to i32*\n %36 = add i64 %sv_0.0.reload, 99\n %37 = inttoptr i64 %36 to i8*\n store i8 0, i8* %37, align 1\n %38 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %11)\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 14, 13, 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_multiply_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_4:\n %10 = load i64, i64* %sv_0, align 8\n %11 = trunc i64 %10 to i32\n %12 = icmp slt i32 %11, 0\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_8, label LBL_5\n LBL_5:\n %14 = icmp slt i32 %11, -1073741823\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n %15 = mul i64 %10, 2\n %16 = and i64 %15, 4294967294\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_8\n LBL_7:\n %18 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0479.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.0479.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.0479.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp eq i32 %sv_0.0.ph.reload, 0\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0479.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.0479.reload = load i32, i32* %sv_0.0479.reg2mem\n %26 = urem i32 100, %sv_0.0479.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0479.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 2, 6, 7, 8, 0, 9, 4, 5, 10, 11, 12, 3, 13 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* %1, i32 %9)\n %11 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 3, 5, 4 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_malloc_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 8)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i64* %0, null\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %4, label LBL_5, label LBL_2\n LBL_2:\n store i64 5, i64* %0, align 8\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_3:\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %4, label LBL_5, label LBL_4\n LBL_4:\n store i64 5, i64* %0, align 8\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %1, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 4, 1, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_putc_07-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_putc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 @putc(i32 65, %_IO_FILE* %4)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fscanf_05-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fscanf_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = icmp slt i32 %6, 0\n br i1 %7, label LBL_5, label LBL_3\n LBL_3:\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = sext i32 %6 to i64\n %10 = mul i64 %9, 4\n %11 = add i64 %8, -48\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i32*\n store i32 1, i32* %13, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 4\n %15 = add i64 %14, %11\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_4\n LBL_5:\n %20 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_6, { 2, 0, 3, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_execlp_12-bad", "fun_name": "CWE78_OS_Command_Injection__char_connect_socket_execlp_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %7 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %7, -1\n br i1 %cond, label LBL_10, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %10 = call i16 @htons(i16 27015)\n %11 = bitcast i64* %sv_0 to %sockaddr*\n %12 = call i32 @connect(i32 %7, %sockaddr* nonnull %11, i32 16)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_8, label LBL_3\n LBL_3:\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %6, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %7, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %7)\n br label LBL_10\n LBL_9:\n %29 = ptrtoint i64* %sv_1 to i64\n %30 = add i64 %6, %29\n %31 = inttoptr i64 %30 to i32*\n store i32 2764330, i32* %31, align 4\n br label LBL_10\n LBL_10:\n %32 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %7, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_10, { 1, 2, 0 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_max_multiply_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 4)\n ret i64 %2\n\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncat_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 49)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i8* @strncat(i8* nonnull %13, i8* %11, i32 %12)\n %15 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %11, { 1, 0 }\n uselistorder i64* %1, { 1, 5, 2, 3, 0, 4 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_square_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.071013.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.071013.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.071013.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.0.off = add i32 %sv_0.0.ph.reload, 46339\n %25 = icmp ugt i32 %sv_0.0.off, 92678\n store i32 %sv_0.0.ph.reload, i32* %sv_0.071013.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.071013.reload = load i32, i32* %sv_0.071013.reg2mem\n %26 = mul i32 %sv_0.071013.reload, %sv_0.071013.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.071013.reload, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.071013.reg2mem, { 0, 3, 2, 1 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32*\n %rax.0.reg2mem = alloca i64\n %1 = load i32*, i32** %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n store i32 5, i32* %sv_0, align 4\n %3 = call i64 @FUNC()\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = trunc i64 %3 to i32\n %8 = icmp eq i32 %7, 0\n %spec.select = select i1 %8, i32* %1, i32* %sv_0\n %9 = load i32, i32* %spec.select, align 4\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_2\n LBL_2:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %2, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_multiply_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = load i16, i16* %sv_0, align 2\n %9 = icmp slt i16 %8, 0\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_7, label LBL_4\n LBL_4:\n %11 = icmp slt i16 %8, -16383\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = mul i16 %8, 2\n %13 = sext i16 %12 to i64\n %14 = and i64 %13, 4294967294\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_7\n LBL_6:\n %16 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__long_12-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__long_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %storemerge.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = call i64 @FUNC()\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = trunc i64 %2 to i32\n %7 = icmp eq i32 %6, 0\n %8 = icmp eq i1 %7, false\n %spec.select = select i1 %8, i64 %1, i64 5\n %9 = call i64 @FUNC(i64 %spec.select)\n store i64 %9, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %10 = call i64 @FUNC(i64 5)\n store i64 %10, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_14-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.13.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.13.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.13.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n br i1 %14, label LBL_4, label LBL_5\n LBL_4:\n %15 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.13.reg2mem\n br label LBL_6\n LBL_5:\n %16 = ptrtoint i64* %sv_3 to i64\n %17 = sext i32 %12 to i64\n %18 = add i64 %16, -22\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = bitcast i64* %sv_1 to i8*\n %22 = call i32 @atoi(i8* nonnull %21)\n %23 = call i32 @close(i32 %4)\n %24 = icmp sgt i32 %22, 99\n store i32 %22, i32* %sv_0.13.reg2mem\n br i1 %24, label LBL_9, label LBL_6\n LBL_6:\n %sv_0.13.reload = load i32, i32* %sv_0.13.reg2mem\n %25 = call i64* @malloc(i32 %sv_0.13.reload)\n %26 = icmp eq i64* %25, null\n %27 = icmp eq i1 %26, false\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %28 = ptrtoint i64* %25 to i64\n %29 = add i32 %sv_0.13.reload, -1\n %30 = call i64* @memset(i64* %25, i32 65, i32 %29)\n %31 = sext i32 %sv_0.13.reload to i64\n %32 = add nsw i64 %31, -1\n %33 = add i64 %32, %28\n %34 = inttoptr i64 %33 to i8*\n store i8 0, i8* %34, align 1\n %35 = call i64 @FUNC(i64 %28)\n call void @free(i64* %25)\n br label LBL_9\n LBL_9:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %28, { 1, 0 }\n uselistorder i64* %25, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.13.reload, { 1, 2, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.13.reg2mem, { 0, 4, 3, 1, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 6, 2, 4, 0, 5, 1 }\n uselistorder label LBL_6, { 3, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %9)\n %11 = call i64 @FUNC(i64 %.pre-phi.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 4, 1, 3, 0 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @calloc(i32 100, i32 4)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE196_Unsigned_to_Signed_Conversion_Error__basic_13-bad", "fun_name": "CWE196_Unsigned_to_Signed_Conversion_Error__basic_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = urem i32 %5, 2\n %7 = icmp eq i32 %6, 0\n %8 = sext i1 %7 to i32\n %spec.select = xor i32 %4, %8\n %9 = zext i32 %spec.select to i64\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_multiply_08-bad", "fun_name": "CWE190_Integer_Overflow__char_rand_multiply_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 32, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n %14 = trunc i32 %sv_0.0.reload to i8\n %15 = icmp slt i8 %14, 1\n %or.cond = or i1 %15, %13\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %sext2 = mul i32 %sv_0.0.reload, 33554432\n %16 = ashr exact i32 %sext2, 24\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_alloca_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %5 = ptrtoint i64* %1 to i64\n %6 = call i64* @memset(i64* %1, i32 65, i32 99)\n %7 = add i64 %5, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__long_malloc_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %2 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 2, 4, 0, 3, 5, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_divide_02-bad", "fun_name": "CWE369_Divide_by_Zero__int_fgets_divide_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %2)\n store i32 %5, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = udiv i32 100, %sv_0.0.reload\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %4 = mul i64 %indvars.iv6.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %7 = add i64 %1, 28\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %9 = mul i64 %indvars.iv.reload, 4\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %1, { 0, 2, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 0, 3, 1, 2, 4 }\n uselistorder i32 -1, { 0, 1, 2, 4, 3, 5 }\n uselistorder i64* (i32)* @malloc, { 0, 2, 1, 3, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_for_loop_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge18.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %3, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = add i64 %12, -22\n %14 = bitcast i64* %sv_1 to i8*\n %15 = sext i32 %9 to i64\n %16 = add i64 %13, %15\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i32 @atoi(i8* nonnull %14)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n %sv_0.1.off = add i32 %sv_0.0.ph.reload, -1\n %20 = icmp ugt i32 %sv_0.1.off, 19\n %21 = sext i32 %sv_0.0.ph.reload to i64\n store i64 0, i64* %storemerge18.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n %storemerge18.reload = load i64, i64* %storemerge18.reg2mem\n %22 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n %23 = add nuw i64 %storemerge18.reload, 1\n %24 = icmp ult i64 %23, %21\n store i64 %23, i64* %storemerge18.reg2mem\n br i1 %24, label LBL_5, label LBL_6\n LBL_6:\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %storemerge18.reg2mem, { 2, 0, 1 }\n uselistorder i32 -1, { 2, 1, 0, 3, 4 }\n uselistorder label LBL_6, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_memcpy_01-bad", "fun_name": "CWE124_Buffer_Underwrite__char_declare_memcpy_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 %2, i64* %sv_1, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = load i64, i64* %sv_1, align 8\n %5 = load i64, i64* %sv_0, align 8\n %6 = inttoptr i64 %4 to i64*\n store i64 %5, i64* %6, align 8\n %7 = add i64 %4, 8\n %8 = inttoptr i64 %7 to i64*\n %9 = add i64 %4, 16\n %10 = inttoptr i64 %9 to i64*\n %11 = add i64 %4, 24\n %12 = inttoptr i64 %11 to i64*\n %13 = add i64 %4, 32\n %14 = inttoptr i64 %13 to i64*\n %15 = add i64 %4, 40\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %4, 48\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %4, 56\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %4, 64\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %4, 72\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %4, 80\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %4, 88\n %28 = inttoptr i64 %27 to i64*\n %29 = add i64 %4, 96\n %30 = inttoptr i64 %29 to i32*\n %31 = load i64, i64* %sv_1, align 8\n %32 = add i64 %31, 99\n %33 = inttoptr i64 %32 to i8*\n store i8 0, i8* %33, align 1\n %34 = load i64, i64* %sv_1, align 8\n %35 = call i64 @FUNC(i64 %34)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64* %sv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_modulo_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 7\n %6 = urem i32 100, %spec.select\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 7, { 1, 0 }\n uselistorder i32 -1, { 1, 0, 2, 3 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_add_34-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = mul i32 %4, 32768\n %6 = call i32 @rand()\n %7 = xor i32 %6, %5\n %8 = sext i1 %2 to i32\n %storemerge2.in = xor i32 %7, %8\n %9 = trunc i32 %storemerge2.in to i16\n %10 = icmp eq i16 %9, 32767\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %sext3 = mul i32 %storemerge2.in, 65536\n %sext = add i32 %sext3, 65536\n %11 = ashr exact i32 %sext, 16\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %14, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 65536, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_max_square_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_3, label LBL_4\n LBL_3:\n %5 = call i64 @FUNC(i64 0)\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %6 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_malloc_11-bad", "fun_name": "CWE401_Memory_Leak__int_malloc_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 400)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = call i64 @FUNC(i64 5)\n br label LBL_4\n LBL_4:\n %8 = call i64 @FUNC()\n ret i64 %8\n\n uselistorder i64* %3, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_snprintf_01-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_snprintf_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = add i64 %1, 99\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 1\n store i64 0, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %7, i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %9 = call i64 @FUNC(i64 %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_13-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 10)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = sext i32 %9 to i64\n %11 = add nsw i64 %10, 1\n %12 = icmp eq i64 %11, 0\n br i1 %12, label LBL_6, label LBL_4\n LBL_4:\n %13 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %sv_0.0.reload\n %15 = add i64 %storemerge1.reload, %13\n %16 = inttoptr i64 %15 to i8*\n %17 = load i8, i8* %16, align 1\n %18 = inttoptr i64 %14 to i8*\n store i8 %17, i8* %18, align 1\n %19 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %19, %11\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %20 = call i64 @FUNC(i64 %sv_0.0.reload)\n %21 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %21)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_10\n LBL_10:\n %29 = load i32, i32* @gv_1, align 4\n %30 = icmp eq i32 %29, 5\n br i1 %30, label LBL_11, label LBL_13\n LBL_11:\n %31 = call i32 @strlen(i8* nonnull %4)\n %32 = icmp eq i32 %31, 0\n br i1 %32, label LBL_17, label LBL_12\n LBL_12:\n %33 = ptrtoint i64* %1 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_14\n LBL_13:\n %34 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_18\n LBL_14:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %35 = add i64 %storemerge4.reload, %33\n %36 = inttoptr i64 %35 to i8*\n %37 = load i8, i8* %36, align 1\n %38 = icmp eq i8 %37, 83\n %39 = icmp eq i1 %38, false\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n %40 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n br label LBL_17\n LBL_16:\n %41 = add nuw i64 %storemerge4.reload, 1\n %42 = call i32 @strlen(i8* %4)\n %43 = sext i32 %42 to i64\n %44 = icmp ult i64 %41, %43\n store i64 %41, i64* %storemerge4.reg2mem\n br i1 %44, label LBL_14, label LBL_17\n LBL_17:\n call void @free(i64* %1)\n br label LBL_18\n LBL_18:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_20, label LBL_19\n LBL_19:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_20\n LBL_20:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 3, 0, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_17, { 0, 2, 1 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_10\n LBL_10:\n %29 = call i32 @strlen(i8* nonnull %4)\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_15, label LBL_11\n LBL_11:\n %31 = ptrtoint i64* %1 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_12\n LBL_12:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %32 = add i64 %storemerge4.reload, %31\n %33 = inttoptr i64 %32 to i8*\n %34 = load i8, i8* %33, align 1\n %35 = icmp eq i8 %34, 83\n %36 = icmp eq i1 %35, false\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n %37 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n br label LBL_15\n LBL_14:\n %38 = add nuw i64 %storemerge4.reload, 1\n %39 = call i32 @strlen(i8* %4)\n %40 = sext i32 %39 to i64\n %41 = icmp ult i64 %38, %40\n store i64 %38, i64* %storemerge4.reg2mem\n br i1 %41, label LBL_12, label LBL_15\n LBL_15:\n call void @free(i64* %1)\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 3, 0, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 2, 0, 4, 3, 1, 5, 6 }\n uselistorder i32 -1, { 2, 0, 3, 4, 1, 5 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_15, { 0, 2, 1 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_postdec_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.02.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i64 4294967293, i64* %sv_0.02.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %3 = zext i32 %.pre to i64\n %4 = icmp eq i32 %.pre, 5\n %5 = icmp eq i1 %4, false\n store i64 31, i64* %sv_0.02.reg2mem\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.02.reload = load i64, i64* %sv_0.02.reg2mem\n %6 = call i64 @FUNC(i64 %sv_0.02.reload)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.02.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_sub_08-bad", "fun_name": "CWE191_Integer_Underflow__unsigned_int_fscanf_sub_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = add i32 %9, -1\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_connect_socket_05-bad", "fun_name": "CWE369_Divide_by_Zero__float_connect_socket_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %3 = call i64 @FUNC(i64 40)\n %4 = call i128 @FUNC(i128 %2, i128 %2)\n %5 = call i64 @FUNC(i128 %4)\n %6 = load i32, i32* @gv_0, align 4\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_8, label LBL_1\n LBL_1:\n %8 = trunc i64 %5 to i32\n %9 = call i32 @socket(i32 2, i32 1, i32 6)\n %10 = icmp eq i32 %9, -1\n store i32 %8, i32* %sv_0.1.ph.reg2mem\n br i1 %10, label LBL_6, label LBL_2\n LBL_2:\n %11 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %12 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %13 = call i16 @htons(i16 27015)\n %14 = bitcast i64* %sv_2 to %sockaddr*\n %15 = call i32 @connect(i32 %9, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n store i32 %8, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_5, label LBL_3\n LBL_3:\n %17 = call i32 @recv(i32 %9, i64* nonnull %sv_1, i32 19, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n store i32 %8, i32* %sv_0.0.ph.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n %20 = ptrtoint i64* %sv_3 to i64\n %21 = sext i32 %17 to i64\n %22 = add i64 %20, -32\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = bitcast i64* %sv_1 to i8*\n %26 = call double @atof(i8* nonnull %25)\n %27 = fptrunc double %26 to float\n %28 = bitcast float %27 to i32\n %29 = sext i32 %28 to i128\n %30 = call i128 @FUNC(i128 %29)\n %31 = call i64 @FUNC(i128 %30)\n %32 = trunc i64 %31 to i32\n store i32 %32, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %33 = call i32 @close(i32 %9)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %.pr = load i32, i32* @gv_0, align 4\n %34 = icmp eq i32 %.pr, 0\n br i1 %34, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %35 = call i128 @FUNC(i128 %1, i128 %1)\n %36 = call i128 @FUNC(i32 %sv_0.1.ph.reload)\n %37 = call i128 @FUNC(i64 4636737291354636288)\n %38 = call i128 @FUNC(i128 %37, i128 %36)\n %39 = call i32 @FUNC(i128 %38)\n %40 = zext i32 %39 to i64\n %41 = call i64 @FUNC(i64 %40)\n br label LBL_8\n LBL_8:\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %3, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %9, { 2, 0, 1, 3 }\n uselistorder i32 %8, { 2, 1, 0 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder label LBL_8, { 1, 2, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = zext i32 %4 to i64\n %6 = icmp eq i32 %4, 5\n %7 = icmp eq i1 %6, false\n store i64 0, i64* %indvars.iv6.reg2mem\n store i64 %5, i64* %rax.2.reg2mem\n br i1 %7, label LBL_5, label LBL_3\n LBL_3:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %8 = mul i64 %indvars.iv6.reload, 8\n %9 = add i64 %8, %3\n %10 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %11 = trunc i64 %indvars.iv6.reload to i32\n %12 = call i128 @FUNC(i32 %11)\n %13 = call i64 @FUNC(i128 %12)\n %14 = inttoptr i64 %9 to i64*\n store i64 %13, i64* %14, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %12, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_4, label LBL_3\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %15 = mul i64 %indvars.iv.reload, 8\n %16 = add i64 %15, %3\n %17 = inttoptr i64 %16 to i64*\n %18 = load i64, i64* %17, align 8\n %19 = call i128 @FUNC(i64 %18)\n %20 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %20, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0), i32** %sv_0, align 8\n %2 = call i32 @wcslen(i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0))\n %3 = sext i32 %2 to i64\n %4 = mul i64 %3, 4\n %5 = add nsw i64 %4, 27\n %6 = udiv i64 %5, 16\n %7 = mul i64 %6, 16\n %8 = and i64 %7, -4096\n %9 = and i64 %7, 4080\n %10 = add i64 %0, 15\n %11 = sub i64 %10, %9\n %12 = sub i64 %11, %8\n %13 = and i64 %12, -16\n %14 = load i32*, i32** %sv_0, align 8\n %15 = inttoptr i64 %13 to i32*\n %16 = call i32* @wcscpy(i32* %15, i32* %14)\n %17 = call i64 @FUNC(i64 %13)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64 %7, { 1, 0 }\n uselistorder i32** %sv_0, { 2, 0, 1 }\n uselistorder i64 (i64)* @printWLine, { 1, 0 }\n uselistorder i32* (i32*, i32*)* @wcscpy, { 1, 0, 2 }\n uselistorder i32 (i32*)* @wcslen, { 1, 0, 2 }\n uselistorder i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0), { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memcpy_04-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_memcpy_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = inttoptr i64 %8 to i64*\n %11 = load i64, i64* %10, align 8\n store i64 %11, i64* %sv_0, align 8\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_fwrite_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 20, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 -1, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_9, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %8 = icmp eq %_IO_FILE* %7, null\n %9 = icmp eq i1 %8, false\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 1)\n unreachable\n LBL_5:\n %10 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_3 to i64*), i32 1, i32 50, %_IO_FILE* %7)\n %11 = icmp eq i32 %10, 50\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 1)\n unreachable\n LBL_7:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %12 = add nuw i64 %storemerge2.reload, 1\n %13 = icmp ult i64 %12, %sv_0.0.reload\n store i64 %12, i64* %storemerge2.reg2mem\n br i1 %13, label LBL_5, label LBL_8\n LBL_8:\n %14 = call i32 @fclose(%_IO_FILE* nonnull %7)\n %15 = sext i32 %14 to i64\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %7, { 1, 0, 2 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncpy_01-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncpy_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strncpy(i8* nonnull %10, i8* %4, i32 %9)\n %12 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_sleep_17-bad", "fun_name": "CWE400_Resource_Exhaustion__fgets_sleep_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_1, align 8\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i8* @fgets(i8* nonnull %1, i32 14, %_IO_FILE* %2)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %1)\n store i32 %5, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = call i32 @usleep(i32 %sv_0.0.reload)\n %8 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_2 to i64))\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_rand_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %7 = icmp eq i32 %.pr, 0\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = urem i32 %3, 2\n %9 = icmp eq i32 %8, 0\n %10 = mul i32 %4, 1073741824\n %11 = mul i32 %5, 32768\n %12 = xor i32 %11, %10\n %13 = xor i32 %12, %6\n %14 = sext i1 %9 to i32\n %storemerge1.in = xor i32 %13, %14\n %15 = icmp ugt i32 %storemerge1.in, 9\n br i1 %15, label LBL_5, label LBL_3\n LBL_3:\n %16 = ptrtoint i64* %sv_0 to i64\n %17 = sext i32 %storemerge1.in to i64\n %18 = mul i64 %17, 4\n %19 = add i64 %16, -64\n %20 = add i64 %18, %19\n %21 = inttoptr i64 %20 to i32*\n store i32 1, i32* %21, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %22 = mul i64 %indvars.iv.reload, 4\n %23 = add i64 %22, %19\n %24 = inttoptr i64 %23 to i32*\n %25 = load i32, i32* %24, align 4\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_4\n LBL_5:\n %28 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_6:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_6, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_max_add_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 1)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_sleep_13-bad", "fun_name": "CWE400_Resource_Exhaustion__listen_socket_sleep_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8368 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %28 = call i32 @usleep(i32 %sv_0.1.reload)\n %29 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_0 to i64))\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i32 5, { 1, 0, 2 }\n uselistorder label LBL_9, { 3, 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge45.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_9.preheader, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_9.preheader, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_9.preheader\n LBL_7:\n %storemerge45.reload = load i64, i64* %storemerge45.reg2mem\n %19 = add i64 %storemerge45.reload, %29\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 83\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n br label LBL_11\n LBL_9:\n %25 = add nuw i64 %storemerge45.reload, 1\n %26 = call i32 @strlen(i8* %3)\n %27 = sext i32 %26 to i64\n %28 = icmp ult i64 %25, %27\n store i64 %25, i64* %storemerge45.reg2mem\n br i1 %28, label LBL_7, label LBL_11\n LBL_10:\n %29 = ptrtoint i64* %0 to i64\n %30 = call i32 @strlen(i8* nonnull %3)\n %31 = icmp eq i32 %30, 0\n store i64 0, i64* %storemerge45.reg2mem\n br i1 %31, label LBL_11, label LBL_7\n LBL_11:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %3, { 0, 1, 3, 2 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge45.reg2mem, { 1, 2, 0 }\n uselistorder i32 (i8*)* @strlen, { 0, 2, 1, 3 }\n uselistorder label LBL_11, { 2, 0, 1 }\n uselistorder label LBL_9.preheader, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_listen_socket_system_01-bad", "fun_name": "CWE78_OS_Command_Injection__char_listen_socket_system_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = sext i32 %2 to i64\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = add i64 %14, %15\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n %32 = call i32 @system(i8* nonnull %1)\n %33 = icmp eq i32 %32, 0\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n %34 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_13:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = sext i32 %10 to i64\n %13 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %4\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = add i64 %storemerge1.reload, %13\n %18 = inttoptr i64 %17 to i8*\n store i8 %16, i8* %18, align 1\n %19 = add nuw i64 %storemerge1.reload, 1\n %20 = icmp ult i64 %19, %12\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %20, label LBL_4, label LBL_5\n LBL_5:\n %21 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %1)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %10, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_connect_socket_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_3 to i64\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = sext i32 %12 to i64\n %16 = add i64 %3, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %.pr = load i32, i32* @gv_0, align 4\n %22 = icmp eq i32 %.pr, 0\n br i1 %22, label LBL_11, label LBL_7\n LBL_7:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n store i64 0, i64* %sv_2, align 8\n %23 = icmp ugt i32 %sv_0.1.ph.reload, 9\n br i1 %23, label LBL_10, label LBL_8\n LBL_8:\n %24 = sext i32 %sv_0.1.ph.reload to i64\n %25 = mul i64 %24, 4\n %26 = add i64 %3, -64\n %27 = add i64 %25, %26\n %28 = inttoptr i64 %27 to i32*\n store i32 1, i32* %28, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_9\n LBL_9:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %29 = mul i64 %indvars.iv.reload, 4\n %30 = add i64 %29, %26\n %31 = inttoptr i64 %30 to i32*\n %32 = load i32, i32* %31, align 4\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_11, label LBL_9\n LBL_10:\n %35 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_11:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 1, 7, 0, 8, 6, 5, 9, 3, 10, 4 }\n uselistorder label LBL_11, { 2, 0, 3, 1 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_square_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i32, i32* %.reg2mem\n %10 = icmp eq i32 %.reload, 5\n br i1 %10, label LBL_7, label LBL_6\n LBL_6:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_10\n LBL_7:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %sv_0.0.off = add i32 %sv_0.0.reload, 46339\n %12 = icmp ugt i32 %sv_0.0.off, 92678\n br i1 %12, label LBL_9, label LBL_8\n LBL_8:\n %13 = mul i32 %sv_0.0.reload, %sv_0.0.reload\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_10\n LBL_9:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_10\n LBL_10:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv5.reg2mem\n store i32 %4, i32* %.reg2mem\n br i1 %6, label LBL_5, label LBL_3\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %7 = mul i64 %indvars.iv5.reload, 4\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv5.reload to i32\n store i32 %10, i32* %9, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i32, i32* %.reg2mem\n %11 = zext i32 %.reload to i64\n %12 = icmp eq i32 %.reload, 5\n %13 = icmp eq i1 %12, false\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 %11, i64* %rax.1.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 4\n %15 = add i64 %14, %3\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %19, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder i32* @gv_0, { 0, 7, 6, 5, 1, 4, 2, 3 }\n uselistorder void (i32)* @exit, { 3, 2, 0, 1, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 2, 0, 3, 4 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fscanf_memcpy_14-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__fscanf_memcpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i16, align 2\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_2, align 2\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_2)\n br label LBL_2\n LBL_2:\n store i64 0, i64* %sv_1, align 8\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %7 = load i16, i16* %sv_2, align 2\n %8 = icmp sgt i16 %7, 99\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = ptrtoint i64* %sv_3 to i64\n %10 = sext i16 %7 to i32\n %11 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %10)\n %12 = load i16, i16* %sv_2, align 2\n %13 = sext i16 %12 to i64\n %14 = add i64 %9, -112\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n br label LBL_4\n LBL_4:\n %17 = call i64 @FUNC(i64* nonnull %sv_1)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_2, { 1, 2, 0, 3 }\n uselistorder i8 0, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n store i64 5, i64* %sv_0.01.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %phitmp = zext i32 %1 to i64\n %.pre = load i32, i32* @gv_0, align 4\n %5 = zext i32 %.pre to i64\n %6 = icmp eq i32 %.pre, 5\n %7 = icmp eq i1 %6, false\n store i64 %phitmp, i64* %sv_0.01.reg2mem\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.01.reload = load i64, i64* %sv_0.01.reg2mem\n %8 = call i64 @FUNC(i64 %sv_0.01.reload)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.01.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_postinc_07-bad", "fun_name": "CWE190_Integer_Overflow__int_fgets_postinc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 1, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n %phitmp = add i32 %8, 1\n %phitmp2 = zext i32 %phitmp to i64\n store i64 %phitmp2, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i64 1, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n br label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_multiply_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 -4)\n ret i64 %2\n\n uselistorder i64 (i64)* @printLongLongLine, { 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp ult i32 %3, 2147483647\n br i1 %5, label LBL_2, label LBL_3\n LBL_2:\n %6 = mul i32 %3, 2\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_13-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.18.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_8, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %6, label LBL_8, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_3 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_2, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_9, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -112\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_2 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_9\n LBL_7:\n %25 = call i32 @close(i32 %5)\n br label LBL_8\n LBL_8:\n store i64 0, i64* %sv_2, align 8\n %26 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.18.reg2mem\n br label LBL_10\n LBL_9:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %27 = call i32 @close(i32 %5)\n %28 = call i32 @close(i32 %14)\n store i64 0, i64* %sv_2, align 8\n %29 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %30 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.18.reg2mem\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %sv_0.18.reload = load i32, i32* %sv_0.18.reg2mem\n %31 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.18.reload)\n %32 = sext i32 %sv_0.18.reload to i64\n %33 = add i64 %0, -112\n %34 = add i64 %33, %32\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n br label LBL_11\n LBL_11:\n %36 = call i64 @FUNC(i64* nonnull %sv_2)\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %1, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.18.reload, { 1, 0 }\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 1, 2, 5, 0, 3, 4 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 0, 1, 3 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_1.LBL_4_crit_edge, label LBL_3\n LBL_2:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %6 = zext i32 %.reload to i64\n %7 = icmp eq i32 %.reload, 5\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i64* null, { 1, 0, 2, 3, 4 }\n uselistorder i32* @gv_0, { 0, 5, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_predec_11-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n %10 = load i32, i32* %sv_0, align 4\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = add i32 %10, -1\n store i32 %12, i32* %sv_0, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_7\n LBL_6:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__malloc_realloc_int_13-bad", "fun_name": "CWE401_Memory_Leak__malloc_realloc_int_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i32*\n store i32 5, i32* %7, align 4\n %8 = call i64 @FUNC(i64 5)\n %9 = call i64* @realloc(i64* %4, i32 520000)\n %10 = ptrtoint i64* %9 to i64\n %11 = icmp eq i64* %9, null\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = bitcast i64* %9 to i32*\n store i32 10, i32* %12, align 4\n %13 = call i64 @FUNC(i64 10)\n call void @free(i64* nonnull %9)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__rand_malloc_14-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__rand_malloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %sv_0.06.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.06.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %12 = ashr exact i32 %sext, 16\n %rax.0 = zext i32 %storemerge.in to i64\n %13 = trunc i32 %12 to i16\n %14 = icmp sgt i16 %13, 99\n store i32 %12, i32* %sv_0.06.reg2mem\n store i64 %rax.0, i64* %rax.1.reg2mem\n br i1 %14, label LBL_5, label LBL_2\n LBL_2:\n %sv_0.06.reload = load i32, i32* %sv_0.06.reg2mem\n %15 = call i64* @malloc(i32 %sv_0.06.reload)\n %16 = icmp eq i64* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %18 = ptrtoint i64* %15 to i64\n %19 = add nsw i32 %sv_0.06.reload, -1\n %20 = call i64* @memset(i64* %15, i32 65, i32 %19)\n %21 = zext i32 %sv_0.06.reload to i64\n %sext4 = mul i64 %21, 281474976710656\n %22 = ashr exact i64 %sext4, 48\n %23 = add i64 %18, -1\n %24 = add i64 %23, %22\n %25 = inttoptr i64 %24 to i8*\n store i8 0, i8* %25, align 1\n %26 = call i64 @FUNC(i64 %18)\n call void @free(i64* %15)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_5\n LBL_5:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64 %18, { 1, 0 }\n uselistorder i64* %15, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.06.reload, { 0, 2, 1 }\n uselistorder i32 %storemerge.in, { 1, 0 }\n uselistorder i32* %sv_0.06.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_no_init_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n %7 = trunc i64 %indvars.iv5.reload to i32\n store i32 %7, i32* %6, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %8, %1\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %13\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 0, 3, 2, 1, 4 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_square_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = zext i32 %3 to i64\n %5 = mul i64 %4, 1152921504606846976\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 35184372088832\n %9 = call i32 @rand()\n %10 = sext i32 %9 to i64\n %11 = mul i64 %10, 1073741824\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 32768\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = sext i1 %2 to i64\n %18 = xor i64 %5, %17\n %19 = xor i64 %18, %8\n %20 = xor i64 %19, %11\n %21 = xor i64 %20, %14\n %storemerge2 = xor i64 %21, %16\n %storemerge2.off = add i64 %storemerge2, 3037000499\n %22 = icmp ugt i64 %storemerge2.off, 6074000998\n br i1 %22, label LBL_2, label LBL_1\n LBL_1:\n %23 = mul i64 %storemerge2, %storemerge2\n %24 = call i64 @FUNC(i64 %23)\n store i64 %24, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %25, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64 %storemerge2, { 1, 2, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE570_Expression_Always_False__string_equals_01-bad", "fun_name": "CWE570_Expression_Always_False__string_equals_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 435728179558, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strcmp(i8* nonnull %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_0, i64 0, i64 0))\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_multiply_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = load i64, i64* %sv_0, align 8\n %9 = trunc i64 %8 to i32\n %10 = icmp slt i32 %9, 1\n br i1 %10, label LBL_7, label LBL_4\n LBL_4:\n %11 = icmp sgt i32 %9, 1073741822\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = mul i64 %8, 2\n %13 = and i64 %12, 4294967294\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_7\n LBL_6:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_postinc_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = icmp eq i64 %9, 9223372036854775807\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = add i64 %9, 1\n store i64 %11, i64* %sv_0, align 8\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_6\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_execlp_17-bad", "fun_name": "CWE78_OS_Command_Injection__char_file_execlp_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = sub i32 100, %2\n %10 = add i64 %3, %8\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %9, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n %17 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_pointer_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = ptrtoint i64* %3 to i64\n %8 = add i64 %7, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 6, i32* %9, align 4\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32* %6, i32** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %10 = zext i32 %.reload to i64\n %11 = icmp eq i32 %.reload, 5\n %12 = icmp eq i1 %11, false\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32*, i32** %sv_0.0.reg2mem\n %13 = load i32, i32* %sv_0.0.reload, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = ptrtoint i32* %sv_0.0.reload to i64\n %17 = add i64 %16, 4\n %18 = inttoptr i64 %17 to i32*\n %19 = load i32, i32* %18, align 4\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 2, 1, 0, 3, 4 }\n uselistorder i64* (i32)* @malloc, { 2, 0, 3, 1, 4 }\n uselistorder i32 5, { 0, 7, 1, 2, 8, 3, 9, 4, 10, 5, 6 }\n uselistorder i32* @gv_0, { 0, 5, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n %spec.store.select = select i1 %1, i32 -1, i32 20\n %2 = mul i32 %spec.store.select, 4\n %3 = call i64* @malloc(i32 %2)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_1, label LBL_2\n LBL_1:\n %6 = ptrtoint i64* %3 to i64\n %7 = sext i32 %spec.store.select to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 4\n %9 = add i64 %8, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = add nuw i64 %storemerge1.reload, 1\n %12 = icmp ult i64 %11, %7\n store i64 %11, i64* %storemerge1.reg2mem\n br i1 %12, label LBL_3, label LBL_4\n LBL_4:\n %13 = bitcast i64* %3 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.store.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %.in.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i8** %sv_1 to i64\n %5 = add i64 %4, -161\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n %8 = bitcast i8** %sv_1 to i64*\n store i64 %6, i64* %8, align 8\n store i8 0, i8* %7, align 16\n br label LBL_2\n LBL_2:\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = load i8*, i8** %sv_1, align 8\n %11 = ptrtoint i64* %sv_0 to i64\n store i8* %10, i8** %.in.reg2mem\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %.in.reload = load i8*, i8** %.in.reg2mem\n %12 = ptrtoint i8* %.in.reload to i64\n %13 = add i64 %storemerge3.reload, %12\n %14 = add i64 %storemerge3.reload, %11\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = inttoptr i64 %13 to i8*\n store i8 %16, i8* %17, align 1\n %18 = add nuw nsw i64 %storemerge3.reload, 1\n %19 = load i8*, i8** %sv_1, align 8\n %exitcond = icmp eq i64 %18, 100\n store i8* %19, i8** %.in.reg2mem\n store i64 %18, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %20 = ptrtoint i8* %19 to i64\n %21 = add i64 %20, 99\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = load i8*, i8** %sv_1, align 8\n %24 = ptrtoint i8* %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %19, { 1, 0 }\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i8** %sv_1, { 4, 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i8** %.in.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_sub_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = icmp eq i64 %6, -9223372036854775808\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i64 %6, -1\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_5\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_no_init_12-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_no_init_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv10.reg2mem = alloca i64\n %indvars.iv13.reg2mem = alloca i64\n %storemerge49.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = ptrtoint i32* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_1\n LBL_1:\n store i32 0, i32* %sv_0, align 4\n store i32 0, i32* %storemerge49.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge49.reload = load i32, i32* %storemerge49.reg2mem\n %8 = sext i32 %storemerge49.reload to i64\n %9 = mul i64 %8, 8\n %10 = add i64 %9, %3\n %11 = inttoptr i64 %10 to i32*\n store i32 %storemerge49.reload, i32* %11, align 8\n %12 = load i32, i32* %sv_0, align 4\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 8\n %15 = add i64 %14, %3\n %16 = or i64 %15, 4\n %17 = inttoptr i64 %16 to i32*\n store i32 %12, i32* %17, align 4\n %18 = load i32, i32* %sv_0, align 4\n %19 = add i32 %18, 1\n store i32 %19, i32* %sv_0, align 4\n %20 = icmp slt i32 %19, 10\n store i32 %19, i32* %storemerge49.reg2mem\n br i1 %20, label LBL_2, label LBL_3\n LBL_3:\n %21 = call i64 @FUNC()\n %22 = trunc i64 %21 to i32\n %23 = icmp eq i32 %22, 0\n store i64 0, i64* %indvars.iv13.reg2mem\n store i64 0, i64* %indvars.iv10.reg2mem\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n %indvars.iv13.reload = load i64, i64* %indvars.iv13.reg2mem\n %24 = mul i64 %indvars.iv13.reload, 8\n %25 = add i64 %24, %3\n %26 = inttoptr i64 %25 to i32*\n %27 = load i32, i32* %26, align 8\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n %30 = or i64 %25, 4\n %31 = inttoptr i64 %30 to i32*\n %32 = load i32, i32* %31, align 4\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n %indvars.iv.next14 = add nuw nsw i64 %indvars.iv13.reload, 1\n %exitcond15 = icmp eq i64 %indvars.iv.next14, 10\n store i64 %indvars.iv.next14, i64* %indvars.iv13.reg2mem\n br i1 %exitcond15, label LBL_7, label LBL_4\n LBL_5:\n %indvars.iv10.reload = load i64, i64* %indvars.iv10.reg2mem\n %35 = mul i64 %indvars.iv10.reload, 8\n %36 = add i64 %35, %3\n %37 = inttoptr i64 %36 to i32*\n %38 = trunc i64 %indvars.iv10.reload to i32\n store i32 %38, i32* %37, align 8\n %39 = or i64 %36, 4\n %40 = inttoptr i64 %39 to i32*\n store i32 %38, i32* %40, align 4\n %indvars.iv.next11 = add nuw nsw i64 %indvars.iv10.reload, 1\n %exitcond12 = icmp eq i64 %indvars.iv.next11, 10\n store i64 %indvars.iv.next11, i64* %indvars.iv10.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond12, label LBL_6, label LBL_5\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %41 = mul i64 %indvars.iv.reload, 8\n %42 = add i64 %41, %3\n %43 = inttoptr i64 %42 to i32*\n %44 = load i32, i32* %43, align 8\n %45 = zext i32 %44 to i64\n %46 = call i64 @FUNC(i64 %45)\n %47 = or i64 %42, 4\n %48 = inttoptr i64 %47 to i32*\n %49 = load i32, i32* %48, align 4\n %50 = zext i32 %49 to i64\n %51 = call i64 @FUNC(i64 %50)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %52 = call i64 @FUNC(i64 40)\n %53 = icmp eq i64 %1, %52\n store i64 0, i64* %rax.0.reg2mem\n br i1 %53, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 0, 2, 1 }\n uselistorder i32 %storemerge49.reload, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 4, 3, 0, 2 }\n uselistorder i32* %storemerge49.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv13.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv10.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 10, { 2, 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_sleep_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i32 20, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %5 = call i32 @usleep(i32 %sv_0.0.reload)\n %6 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_3 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 0, 2, 3, 8, 9, 10, 1, 11, 5, 7, 12, 13, 14, 4, 15, 6 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_environment_popen_12-bad", "fun_name": "CWE78_OS_Command_Injection__char_environment_popen_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %7 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %8 = icmp eq i8* %7, null\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %6, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %7, i32 %12)\n br label LBL_4\n LBL_3:\n %14 = ptrtoint i64* %sv_0 to i64\n %15 = add i64 %6, %14\n %16 = inttoptr i64 %15 to i32*\n store i32 2764330, i32* %16, align 4\n br label LBL_4\n LBL_4:\n %17 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %18 = icmp eq %_IO_FILE* %17, null\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n %19 = call i32 @pclose(%_IO_FILE* nonnull %17)\n br label LBL_6\n LBL_6:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_05-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv4.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_13, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_13, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = call i64* @malloc(i32 40)\n %11 = ptrtoint i64* %10 to i64\n %12 = icmp eq i64* %10, null\n %13 = icmp eq i1 %12, false\n store i64 0, i64* %indvars.iv4.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %14 = mul i64 %indvars.iv4.reload, 4\n %15 = add i64 %14, %11\n %16 = inttoptr i64 %15 to i32*\n store i32 0, i32* %16, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 10\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n br i1 %exitcond6, label LBL_8, label LBL_7\n LBL_8:\n %17 = icmp slt i32 %sv_0.0.ph.reload, 0\n br i1 %17, label LBL_11, label LBL_9\n LBL_9:\n %18 = sext i32 %sv_0.0.ph.reload to i64\n %19 = mul i64 %18, 4\n %20 = add i64 %19, %11\n %21 = inttoptr i64 %20 to i32*\n store i32 1, i32* %21, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %22 = mul i64 %indvars.iv.reload, 4\n %23 = add i64 %22, %11\n %24 = inttoptr i64 %23 to i32*\n %25 = load i32, i32* %24, align 4\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_10\n LBL_11:\n %28 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_12:\n call void @free(i64* %10)\n br label LBL_13\n LBL_13:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 1, 0, 2 }\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_13, { 1, 2, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__struct_malloc_use_14-bad", "fun_name": "CWE758_Undefined_Behavior__struct_malloc_use_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = zext i32 %2 to i64\n %4 = icmp eq i32 %2, 5\n %5 = icmp eq i1 %4, false\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %6 = call i64* @malloc(i32 8)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %9 = load i64, i64* %6, align 8\n call void @free(i64* %6)\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n %12 = zext i32 %1 to i64\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_fwrite_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge6.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %sv_1.0.off = add i32 %6, -1\n %7 = icmp ugt i32 %sv_1.0.off, 19\n br i1 %7, label LBL_10, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_4, label LBL_5\n LBL_4:\n %11 = sext i32 %6 to i64\n store i64 0, i64* %storemerge6.reg2mem\n br label LBL_6\n LBL_5:\n call void @exit(i32 1)\n unreachable\n LBL_6:\n %12 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_4 to i64*), i32 1, i32 50, %_IO_FILE* %8)\n %13 = icmp eq i32 %12, 50\n br i1 %13, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %storemerge6.reload = load i64, i64* %storemerge6.reg2mem\n %14 = add nuw i64 %storemerge6.reload, 1\n %15 = icmp ult i64 %14, %11\n store i64 %14, i64* %storemerge6.reg2mem\n br i1 %15, label LBL_6, label LBL_9\n LBL_9:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_10\n LBL_10:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %8, { 1, 0, 2 }\n uselistorder i32 %6, { 1, 0 }\n uselistorder i64* %storemerge6.reg2mem, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 2, 0 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_loop_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %2, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %5 = add i64 %storemerge1.reload, %1\n %6 = add i64 %storemerge1.reload, %4\n %7 = inttoptr i64 %6 to i8*\n %8 = load i8, i8* %7, align 1\n %9 = inttoptr i64 %5 to i8*\n store i8 %8, i8* %9, align 1\n %10 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %10, 100\n store i64 %10, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %11 = add i64 %1, 99\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %1, { 1, 2, 0 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_multiply_07-bad", "fun_name": "CWE191_Integer_Underflow__char_rand_multiply_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 32, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %11 = zext i32 %.reload to i64\n %12 = icmp eq i32 %.reload, 5\n %13 = icmp eq i1 %12, false\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %14 = trunc i32 %sv_0.0.reload to i8\n %15 = icmp slt i8 %14, 0\n %16 = icmp eq i1 %15, false\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n %sext2 = mul i32 %sv_0.0.reload, 33554432\n %17 = ashr exact i32 %sext2, 24\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_multiply_31-bad", "fun_name": "CWE191_Integer_Underflow__char_rand_multiply_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = sub i32 0, %5\n %7 = sub i32 %6, 1\n %8 = zext i32 %7 to i64\n %9 = sext i32 %5 to i64\n %storemerge = select i1 %2, i64 %8, i64 %9\n %10 = urem i64 %storemerge, 256\n %11 = trunc i64 %storemerge to i8\n %12 = icmp slt i8 %11, 0\n %13 = icmp eq i1 %12, false\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n %14 = trunc i64 %storemerge to i32\n %sext = mul i32 %14, 33554432\n %15 = ashr exact i32 %sext, 24\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge, { 1, 2, 0 }\n uselistorder i32 %5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memmove_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %3 = and i64 %2, -16\n store i32 0, i32* %storemerge.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge.reload = load i32, i32* %storemerge.reg2mem\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %4 = add nuw nsw i32 %storemerge.reload, 1\n %exitcond = icmp eq i32 %4, 2\n store i64 %3, i64* %sv_0.0.reg2mem\n store i32 %4, i32* %storemerge.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %5 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 100)\n %6 = inttoptr i64 %sv_0.0.reload to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %8 = load i64, i64* %6, align 8\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %1, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 1, 0 }\n uselistorder i32* %storemerge.reg2mem, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_snprintf_32-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_snprintf_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 50)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = ptrtoint i64* %1 to i64\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %.off = add i64 %3, -6\n %4 = icmp ult i64 %.off, 94\n br i1 %4, label LBL_1, label LBL_4\n LBL_1:\n %5 = trunc i64 %3 to i32\n %6 = call i64* @malloc(i32 %5)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %9 = ptrtoint i64* %6 to i64\n %10 = bitcast i64* %6 to i32*\n store i32 1819043176, i32* %10, align 4\n %11 = add i64 %9, 4\n %12 = inttoptr i64 %11 to i16*\n store i16 111, i16* %12, align 2\n %13 = call i64 @FUNC(i64 %9)\n call void @free(i64* %6)\n br label LBL_5\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %6, { 0, 1, 3, 2 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_loop_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -97\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 99)\n %8 = add i64 %5, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n %spec.select = select i1 %12, i64 %1, i64 %5\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %15 = add i64 %storemerge1.reload, %spec.select\n %16 = add i64 %storemerge1.reload, %14\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = inttoptr i64 %15 to i8*\n store i8 %18, i8* %19, align 1\n %20 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %20, 100\n store i64 %20, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %21 = add i64 %spec.select, 99\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = call i64 @FUNC(i64 %spec.select)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %3, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %spec.select, { 2, 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memmove_13-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memmove_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_0 to i32))\n %11 = load i64, i64* %9, align 8\n %12 = call i64 @FUNC(i64 %11)\n call void @free(i64* %9)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_multiply_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = load i64, i64* %sv_0, align 8\n %9 = icmp slt i64 %8, 0\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_7, label LBL_4\n LBL_4:\n %11 = icmp slt i64 %8, -4611686018427387903\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = mul i64 %8, 2\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_7\n LBL_6:\n %14 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memmove_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %7 = inttoptr i64 %sv_0.0.reload to i64*\n %8 = call i64* @memmove(i64* %7, i64* nonnull %sv_1, i32 100)\n %9 = add i64 %sv_0.0.reload, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 20)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = bitcast i64* %4 to i32*\n store i32 1819043176, i32* %8, align 4\n %9 = add i64 %7, 4\n %10 = inttoptr i64 %9 to i16*\n store i16 111, i16* %10, align 2\n %11 = call i64 @FUNC(i64 %7)\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 0, 1, 6, 2, 3, 4, 5, 11, 7, 8, 9, 10 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_max_square_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %3 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_4\n LBL_3:\n %6 = call i64 @FUNC(i64 0)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_34-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -161\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n store i64 %3, i64* %sv_1, align 8\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = add i64 %storemerge1.reload, %3\n %8 = add i64 %storemerge1.reload, %6\n %9 = inttoptr i64 %8 to i8*\n %10 = load i8, i8* %9, align 1\n %11 = inttoptr i64 %7 to i8*\n store i8 %10, i8* %11, align 1\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %13 = add i64 %3, 99\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n %15 = call i64 @FUNC(i64 %3)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %3, { 1, 2, 0, 4, 3 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__struct_malloc_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 8)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i64* %0, null\n %or.cond = or i1 %4, %3\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %0 to i64\n %6 = bitcast i64* %0 to i32*\n store i32 1, i32* %6, align 4\n %7 = add i64 %5, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n %9 = call i64 @FUNC(i64 %5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_remove_12-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_remove_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @remove(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_0, i64 0, i64 0))\n %4 = sext i32 %3 to i64\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %5 = call i32 @remove(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @gv_1, i64 0, i64 0))\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32 (i8*)* @remove, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_divide_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = udiv i32 100, %sv_0.0.reload\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_8\n LBL_7:\n %17 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_loop_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -97\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 99)\n %8 = add i64 %5, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n %spec.select = select i1 %12, i64 %1, i64 %5\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %15 = add i64 %storemerge1.reload, %spec.select\n %16 = inttoptr i64 %15 to i8*\n %17 = load i8, i8* %16, align 1\n %18 = add i64 %storemerge1.reload, %14\n %19 = inttoptr i64 %18 to i8*\n store i8 %17, i8* %19, align 1\n %20 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %20, 100\n store i64 %20, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %21 = call i64 @FUNC(i64 %14)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %3, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %14, { 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memmove_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = bitcast i64* %1 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = call i64* @memmove(i64* %1, i64* nonnull %sv_0, i32 100)\n %8 = add i64 %4, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_sub_34-bad", "fun_name": "CWE191_Integer_Underflow__int_fscanf_sub_34_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = add i32 %3, -1\n %5 = zext i32 %4 to i64\n %6 = call i64 @FUNC(i64 %5)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_fwrite_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge11.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 20500 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_19\n LBL_11:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sv_0.1.off = add i32 %sv_0.1.reload, -1\n %31 = icmp ugt i32 %sv_0.1.off, 19\n br i1 %31, label LBL_19, label LBL_12\n LBL_12:\n %32 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %33 = icmp eq %_IO_FILE* %32, null\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_13, label LBL_14\n LBL_13:\n %35 = sext i32 %sv_0.1.reload to i64\n store i64 0, i64* %storemerge11.reg2mem\n br label LBL_15\n LBL_14:\n call void @exit(i32 1)\n unreachable\n LBL_15:\n %36 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_4 to i64*), i32 1, i32 50, %_IO_FILE* %32)\n %37 = icmp eq i32 %36, 50\n br i1 %37, label LBL_17, label LBL_16\n LBL_16:\n call void @exit(i32 1)\n unreachable\n LBL_17:\n %storemerge11.reload = load i64, i64* %storemerge11.reg2mem\n %38 = add nuw i64 %storemerge11.reload, 1\n %39 = icmp ult i64 %38, %35\n store i64 %38, i64* %storemerge11.reg2mem\n br i1 %39, label LBL_15, label LBL_18\n LBL_18:\n %40 = call i32 @fclose(%_IO_FILE* nonnull %32)\n br label LBL_19\n LBL_19:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_21, label LBL_20\n LBL_20:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_21\n LBL_21:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %32, { 1, 0, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %storemerge11.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_memmove_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %8, 5\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n store i64 %3, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %11 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %12 = load i64, i64* %sv_1, align 8\n %13 = inttoptr i64 %12 to i64*\n %14 = call i64* @memmove(i64* nonnull %sv_0, i64* %13, i32 100)\n %15 = ptrtoint i64* %sv_0 to i64\n %16 = call i64 @FUNC(i64 %15)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_11-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = add i64 %8, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = mul i64 %storemerge1.reload, 8\n %12 = add i64 %11, %sv_0.0.reload\n %13 = add i64 %10, %11\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = inttoptr i64 %12 to i64*\n store i64 %15, i64* %16, align 8\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %18 = inttoptr i64 %sv_0.0.reload to i64*\n %19 = load i64, i64* %18, align 8\n %20 = call i64 @FUNC(i64 %19)\n call void @free(i64* %18)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_loop_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = bitcast i64* %4 to i8*\n store i8 0, i8* %8, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %10 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = add i64 %storemerge1.reload, %sv_0.0.reload\n %12 = add i64 %storemerge1.reload, %10\n %13 = inttoptr i64 %12 to i8*\n %14 = load i8, i8* %13, align 1\n %15 = inttoptr i64 %11 to i8*\n store i8 %14, i8* %15, align 1\n %16 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %17 = add i64 %sv_0.0.reload, 99\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = call i64 @FUNC(i64 %sv_0.0.reload)\n %20 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %20)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %sv_0.0.reload, { 1, 2, 0, 3 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_snprintf_08-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_snprintf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -49\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %sv_0.0.reload, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = load i32, i32* @gv_0, align 4\n %36 = icmp eq i32 %35, 5\n %37 = icmp eq i1 %36, false\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n %38 = call i32 @puts(i8* nonnull %1)\n br label LBL_14\n LBL_14:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_07-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.02.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i64\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n store i64 8382078947037833542, i64* %0, align 8\n %4 = add i64 %3, 8\n %5 = inttoptr i64 %4 to i32*\n store i32 1735289202, i32* %5, align 4\n %6 = add i64 %3, 12\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* @gv_0, align 4\n %9 = zext i32 %8 to i64\n %10 = icmp eq i32 %8, 5\n %11 = icmp eq i1 %10, false\n store i64 %9, i64* %rax.0.reg2mem\n br i1 %11, label LBL_8, label LBL_3\n LBL_3:\n %12 = bitcast i64* %0 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = icmp eq i8 %13, 0\n %15 = icmp eq i1 %14, false\n store i8 %13, i8* %.reg2mem\n store i64 %3, i64* %sv_0.03.reg2mem\n store i64 %3, i64* %sv_0.02.reg2mem\n br i1 %15, label LBL_4, label LBL_7\n LBL_4:\n %sv_0.03.reload = load i64, i64* %sv_0.03.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %16 = icmp eq i8 %.reload, 83\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n %18 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n store i64 %sv_0.03.reload, i64* %sv_0.02.reg2mem\n br label LBL_7\n LBL_6:\n %19 = add i64 %sv_0.03.reload, 1\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 0\n %23 = icmp eq i1 %22, false\n store i8 %21, i8* %.reg2mem\n store i64 %19, i64* %sv_0.03.reg2mem\n store i64 %19, i64* %sv_0.02.reg2mem\n br i1 %23, label LBL_4, label LBL_7\n LBL_7:\n %sv_0.02.reload = load i64, i64* %sv_0.02.reg2mem\n %24 = inttoptr i64 %sv_0.02.reload to i64*\n call void @free(i64* %24)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.03.reload, { 1, 0 }\n uselistorder i64* %0, { 1, 0, 3, 2 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.03.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.02.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8 0, { 1, 0, 2, 3 }\n uselistorder label LBL_7, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_postdec_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.01.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp eq i32 %6, -2147483648\n store i32 %6, i32* %sv_0.01.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %8 = add i32 %sv_0.01.reload, -1\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_postdec_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.06.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_1, align 8\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i8* @fgets(i8* nonnull %1, i32 14, %_IO_FILE* %2)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.06.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %1)\n %7 = icmp eq i32 %6, -2147483648\n store i32 %6, i32* %sv_0.06.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.06.reload = load i32, i32* %sv_0.06.reg2mem\n %8 = add i32 %sv_0.06.reload, -1\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_fwrite_05-bad", "fun_name": "CWE400_Resource_Exhaustion__fgets_fwrite_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_12, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n %phitmp = sext i32 %7 to i64\n store i64 %phitmp, i64* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i64 -1, i64* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_12, label LBL_5\n LBL_5:\n %10 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0))\n %11 = icmp eq %_IO_FILE* %10, null\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_6, label LBL_7\n LBL_6:\n %sv_0.0.ph.reload = load i64, i64* %sv_0.0.ph.reg2mem\n %13 = icmp eq i64 %sv_0.0.ph.reload, 0\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %13, label LBL_11, label LBL_8\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %14 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_5 to i64*), i32 1, i32 50, %_IO_FILE* %10)\n %15 = icmp eq i32 %14, 50\n br i1 %15, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 1)\n unreachable\n LBL_10:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = add nuw i64 %storemerge2.reload, 1\n %17 = icmp ult i64 %16, %sv_0.0.ph.reload\n store i64 %16, i64* %storemerge2.reg2mem\n br i1 %17, label LBL_8, label LBL_11\n LBL_11:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %10)\n br label LBL_12\n LBL_12:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %10, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_12, { 1, 2, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_loop_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64 @FUNC()\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_3, label LBL_1\n LBL_1:\n %storemerge1 = ptrtoint i64* %sv_1 to i64\n %8 = sext i32 %6 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %10 = add i64 %storemerge2.reload, %storemerge1\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge2.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = add nuw i64 %storemerge2.reload, 1\n %16 = icmp ult i64 %15, %8\n store i64 %15, i64* %storemerge2.reg2mem\n br i1 %16, label LBL_2, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64* nonnull %sv_0)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i32 %6, { 1, 0 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 2, 0, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_listen_socket_07-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_listen_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %31 = icmp sgt i32 %sv_0.1.reload, 9\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %34, %33\n %36 = inttoptr i64 %35 to i32*\n %37 = load i32, i32* %36, align 4\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n br label LBL_13\n LBL_12:\n %40 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_13\n LBL_13:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %1, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n %or.cond = or i1 %2, %5\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 4)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printUnsignedLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_sub_02-bad", "fun_name": "CWE191_Integer_Underflow__short_rand_sub_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = mul i32 %4, 32768\n %6 = call i32 @rand()\n %7 = xor i32 %6, %5\n %8 = sext i1 %2 to i32\n %storemerge.in = xor i32 %7, %8\n %9 = mul i32 %storemerge.in, 65536\n %sext = add i32 %9, -65536\n %10 = ashr exact i32 %sext, 16\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n ret i64 %12\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fgets_memcpy_12-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__fgets_memcpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 99, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_2, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_2 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 8, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n %sext = mul i32 %8, 65536\n %9 = ashr exact i32 %sext, 16\n store i32 %9, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n store i64 0, i64* %sv_2, align 8\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %12 = trunc i32 %sv_0.0.reload to i16\n %13 = icmp sgt i16 %12, 99\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.0.reload)\n %16 = sext i32 %sv_0.0.reload to i64\n %17 = add i64 %14, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n br label LBL_6\n LBL_6:\n %20 = ptrtoint i64* %sv_2 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 2, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1, 4 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i32 99, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_sleep_14-bad", "fun_name": "CWE400_Resource_Exhaustion__connect_socket_sleep_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_1, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = call i32 @usleep(i32 %sv_0.1.reload)\n %27 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_accept_bind_12-bad", "fun_name": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_accept_bind_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %sv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = call i32 @socket(i32 2, i32 1, i32 6)\n %8 = icmp eq i32 %7, -1\n br i1 %4, label LBL_13, label LBL_1\n LBL_1:\n br i1 %8, label LBL_12, label LBL_2\n LBL_2:\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %10 = call i16 @htons(i16 27015)\n %11 = call i32 @listen(i32 %7, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @accept(i32 %7, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = bitcast i64* %sv_0 to %sockaddr*\n %16 = call i32 @bind(i32 %7, %sockaddr* nonnull %15, i32 16)\n %17 = icmp eq i32 %16, -1\n br i1 %17, label LBL_11, label LBL_5\n LBL_5:\n %18 = sub i32 99, %6\n %19 = ptrtoint i64* %sv_1 to i64\n %20 = sext i32 %6 to i64\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i64*\n %23 = call i32 @recv(i32 %13, i64* %22, i32 %18, i32 0)\n %24 = add i32 %23, 1\n %25 = icmp ult i32 %24, 2\n br i1 %25, label LBL_11, label LBL_6\n LBL_6:\n %26 = sext i32 %23 to i64\n %27 = add i64 %0, -112\n %28 = add i64 %27, %26\n %29 = inttoptr i64 %28 to i8*\n store i8 0, i8* %29, align 1\n %30 = call i8* @strchr(i8* nonnull %5, i32 13)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %30, align 1\n br label LBL_8\n LBL_8:\n %32 = call i8* @strchr(i8* nonnull %5, i32 10)\n %33 = icmp eq i8* %32, null\n br i1 %33, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %32, align 1\n br label LBL_11\n LBL_10:\n %34 = call i32 @close(i32 %7)\n br label LBL_12\n LBL_11:\n %35 = call i32 @close(i32 %7)\n %36 = call i32 @close(i32 %13)\n br label LBL_12\n LBL_12:\n %37 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_25\n LBL_13:\n br i1 %8, label LBL_24, label LBL_14\n LBL_14:\n %38 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %39 = call i16 @htons(i16 27015)\n %40 = bitcast i64* %sv_0 to %sockaddr*\n %41 = call i32 @bind(i32 %7, %sockaddr* nonnull %40, i32 16)\n %42 = icmp eq i32 %41, -1\n br i1 %42, label LBL_22, label LBL_15\n LBL_15:\n %43 = call i32 @listen(i32 %7, i32 5)\n %44 = icmp eq i32 %43, -1\n br i1 %44, label LBL_22, label LBL_16\n LBL_16:\n %45 = call i32 @accept(i32 %7, %sockaddr* null, i32* null)\n %46 = icmp eq i32 %45, -1\n br i1 %46, label LBL_22, label LBL_17\n LBL_17:\n %47 = sub i32 99, %6\n %48 = ptrtoint i64* %sv_1 to i64\n %49 = sext i32 %6 to i64\n %50 = add i64 %49, %48\n %51 = inttoptr i64 %50 to i64*\n %52 = call i32 @recv(i32 %45, i64* %51, i32 %47, i32 0)\n %53 = add i32 %52, 1\n %54 = icmp ult i32 %53, 2\n br i1 %54, label LBL_23, label LBL_18\n LBL_18:\n %55 = sext i32 %52 to i64\n %56 = add i64 %0, -112\n %57 = add i64 %56, %55\n %58 = inttoptr i64 %57 to i8*\n store i8 0, i8* %58, align 1\n %59 = call i8* @strchr(i8* nonnull %5, i32 13)\n %60 = icmp eq i8* %59, null\n br i1 %60, label LBL_20, label LBL_19\n LBL_19:\n store i8 0, i8* %59, align 1\n br label LBL_20\n LBL_20:\n %61 = call i8* @strchr(i8* nonnull %5, i32 10)\n %62 = icmp eq i8* %61, null\n br i1 %62, label LBL_23, label LBL_21\n LBL_21:\n store i8 0, i8* %61, align 1\n br label LBL_23\n LBL_22:\n %63 = call i32 @close(i32 %7)\n br label LBL_24\n LBL_23:\n %64 = call i32 @close(i32 %7)\n %65 = call i32 @close(i32 %45)\n br label LBL_24\n LBL_24:\n %66 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_25\n LBL_25:\n %67 = call i64 @FUNC(i64 40)\n %68 = icmp eq i64 %1, %67\n store i64 0, i64* %rax.0.reg2mem\n br i1 %68, label LBL_27, label LBL_26\n LBL_26:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_27\n LBL_27:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %52, { 1, 0 }\n uselistorder i32 %23, { 1, 0 }\n uselistorder i1 %8, { 1, 0 }\n uselistorder i32 %7, { 9, 0, 6, 7, 8, 1, 2, 5, 4, 3, 10 }\n uselistorder i32 %6, { 3, 2, 0, 1 }\n uselistorder i8* %5, { 2, 3, 1, 0, 4 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 3, 2, 5, 1, 4 }\n uselistorder i64* %sv_0, { 0, 4, 1, 2, 5, 3 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 1, 2, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 1, 2, 4, 5, 6, 3 }\n uselistorder label LBL_24, { 2, 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = add i64 %3, 49\n %6 = inttoptr i64 %5 to i8*\n %7 = call i64* @memset(i64* %4, i32 65, i32 49)\n store i8 0, i8* %6, align 1\n %8 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strncpy(i8* nonnull %10, i8* %8, i32 %9)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %8, { 1, 0 }\n uselistorder i64 %3, { 2, 3, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncat_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %8 = call i64* @memset(i64* %1, i32 65, i32 49)\n %9 = ptrtoint i64* %1 to i64\n %10 = add i64 %9, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n store i64 %9, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %12 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %13 = call i32 @strlen(i8* %12)\n %14 = bitcast i64* %sv_0 to i8*\n %15 = call i8* @strncat(i8* nonnull %14, i8* %12, i32 %13)\n %16 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %12, { 1, 0 }\n uselistorder i64* %1, { 3, 5, 1, 2, 0, 4 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_pointer_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 4)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n ret i64 %4\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_13-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8388 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %23 = call i64* @malloc(i32 40)\n %24 = ptrtoint i64* %23 to i64\n %25 = icmp eq i64* %23, null\n %26 = icmp eq i1 %25, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %27 = mul i64 %indvars.iv6.reload, 4\n %28 = add i64 %27, %24\n %29 = inttoptr i64 %28 to i32*\n store i32 0, i32* %29, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n br i1 %exitcond8, label LBL_9, label LBL_8\n LBL_9:\n %30 = icmp slt i32 %sv_0.1.reload, 0\n br i1 %30, label LBL_12, label LBL_10\n LBL_10:\n %31 = sext i32 %sv_0.1.reload to i64\n %32 = mul i64 %31, 4\n %33 = add i64 %32, %24\n %34 = inttoptr i64 %33 to i32*\n store i32 1, i32* %34, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_11\n LBL_11:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %35 = mul i64 %indvars.iv.reload, 4\n %36 = add i64 %35, %24\n %37 = inttoptr i64 %36 to i32*\n %38 = load i32, i32* %37, align 4\n %39 = zext i32 %38 to i64\n %40 = call i64 @FUNC(i64 %39)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_13, label LBL_11\n LBL_12:\n %41 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_1 to i64))\n br label LBL_13\n LBL_13:\n call void @free(i64* %23)\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %24, { 0, 2, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i32 -1, { 6, 3, 2, 4, 0, 5, 1 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_6, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_printf_11-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_printf_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_0 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %1)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC()\n %27 = trunc i64 %26 to i32\n %28 = icmp eq i32 %27, 0\n br i1 %28, label LBL_9, label LBL_8\n LBL_8:\n %29 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n br label LBL_9\n LBL_9:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 1, 0 }\n uselistorder i8* %1, { 2, 0, 1 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = inttoptr i64 %3 to i64*\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i64* @memset(i64* %7, i32 65, i32 99)\n %9 = add i64 %3, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_3\n LBL_2:\n %11 = call i64* @memset(i64* %7, i32 65, i32 49)\n %12 = add i64 %3, 49\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n br label LBL_3\n LBL_3:\n %14 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i8* @strcpy(i8* nonnull %15, i8* %14)\n %17 = call i64 @FUNC(i64 %3)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 4, 0, 2, 3, 5 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memcpy_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = add i32 %7, 1\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memcpy(i64* %9, i64* nonnull %sv_1, i32 %8)\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_divide_31-bad", "fun_name": "CWE369_Divide_by_Zero__int_listen_socket_divide_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.036.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.036.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.036.reload = load i32, i32* %sv_0.036.reg2mem\n %25 = udiv i32 100, %sv_0.036.reload\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.036.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_putc_05-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_putc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %3 = call i32 @putc(i32 65, %_IO_FILE* %2)\n %4 = sext i32 %3 to i64\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_listen_socket_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv12.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_18, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = call i64* @malloc(i32 40)\n %32 = ptrtoint i64* %31 to i64\n %33 = icmp eq i64* %31, null\n %34 = icmp eq i1 %33, false\n store i64 0, i64* %indvars.iv12.reg2mem\n br i1 %34, label LBL_12, label LBL_11\n LBL_11:\n call void @exit(i32 -1)\n unreachable\n LBL_12:\n %indvars.iv12.reload = load i64, i64* %indvars.iv12.reg2mem\n %35 = mul i64 %indvars.iv12.reload, 4\n %36 = add i64 %35, %32\n %37 = inttoptr i64 %36 to i32*\n store i32 0, i32* %37, align 4\n %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12.reload, 1\n %exitcond14 = icmp eq i64 %indvars.iv.next13, 10\n store i64 %indvars.iv.next13, i64* %indvars.iv12.reg2mem\n br i1 %exitcond14, label LBL_13, label LBL_12\n LBL_13:\n %38 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %38, label LBL_16, label LBL_14\n LBL_14:\n %39 = sext i32 %sv_0.1.reload to i64\n %40 = mul i64 %39, 4\n %41 = add i64 %40, %32\n %42 = inttoptr i64 %41 to i32*\n store i32 1, i32* %42, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_15\n LBL_15:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %43 = mul i64 %indvars.iv.reload, 4\n %44 = add i64 %43, %32\n %45 = inttoptr i64 %44 to i32*\n %46 = load i32, i32* %45, align 4\n %47 = zext i32 %46 to i64\n %48 = call i64 @FUNC(i64 %47)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_17, label LBL_15\n LBL_16:\n %49 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_17\n LBL_17:\n call void @free(i64* %31)\n br label LBL_18\n LBL_18:\n %50 = call i64 @FUNC(i64 40)\n %51 = icmp eq i64 %0, %50\n store i64 0, i64* %rax.0.reg2mem\n br i1 %51, label LBL_20, label LBL_19\n LBL_19:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_20\n LBL_20:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %32, { 1, 0, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %indvars.iv12.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_17, { 1, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 100)\n %5 = call i64 @FUNC(i64* nonnull %sv_0)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memmove_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %sv_3 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %5\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %13 = inttoptr i64 %sv_0.0.reload to i64*\n %14 = call i64* @memmove(i64* %13, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_2 to i32))\n %15 = call i64 @FUNC(i64 %sv_0.0.reload)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_sub_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.045.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.045.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.045.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, -2147483648\n store i32 %19, i32* %sv_0.045.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.045.reload = load i32, i32* %sv_0.045.reg2mem\n %22 = add i32 %sv_0.045.reload, -1\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.045.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_postinc_17-bad", "fun_name": "CWE190_Integer_Overflow__int_fgets_postinc_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_1, align 8\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i8* @fgets(i8* nonnull %1, i32 14, %_IO_FILE* %2)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %1)\n %phitmp = add i32 %5, 1\n %phitmp6 = zext i32 %phitmp to i64\n store i64 %phitmp6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 1, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64 @FUNC(i64 %sv_0.0.reload)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fgets_07-bad", "fun_name": "CWE124_Buffer_Underwrite__CWE839_fgets_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_9, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp sgt i32 %sv_0.0.reload, 9\n br i1 %13, label LBL_8, label LBL_6\n LBL_6:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %14, -64\n %18 = add i64 %16, %17\n %19 = inttoptr i64 %18 to i32*\n store i32 1, i32* %19, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %20 = mul i64 %indvars.iv.reload, 4\n %21 = add i64 %20, %17\n %22 = inttoptr i64 %21 to i32*\n %23 = load i32, i32* %22, align 4\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %26 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_3 to i64))\n br label LBL_9\n LBL_9:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_0 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %3 to i32*\n store i32 0, i32* %7, align 4\n %8 = add i64 %4, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 4\n %10 = call i64 @FUNC(i64 %4)\n br label LBL_7\n LBL_4:\n br i1 %6, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = bitcast i64* %3 to i32*\n store i32 0, i32* %11, align 4\n %12 = add i64 %4, 4\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 4\n %14 = call i64 @FUNC(i64 %4)\n br label LBL_7\n LBL_7:\n %15 = call i64 @FUNC()\n call void @free(i64* nonnull %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64 %4, { 2, 3, 0, 1 }\n uselistorder i64* %3, { 1, 0, 2, 3, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_cpy_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC()\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = bitcast i8** %sv_2 to i64*\n store i64 %13, i64* %14, align 8\n br label LBL_2\n LBL_2:\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = load i8*, i8** %sv_2, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i8* @strcpy(i8* %16, i8* nonnull %17)\n %19 = load i8*, i8** %sv_2, align 8\n %20 = ptrtoint i8* %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 3, 2, 0, 1 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_divide_12-bad", "fun_name": "CWE369_Divide_by_Zero__int_fgets_divide_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 7, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = udiv i32 100, %sv_0.0.reload\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_9\n LBL_6:\n %16 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n %17 = udiv i32 100, %sv_0.0.reload\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n br label LBL_9\n LBL_8:\n %20 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n br label LBL_9\n LBL_9:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_execlp_12-bad", "fun_name": "CWE78_OS_Command_Injection__char_file_execlp_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_7\n LBL_6:\n %20 = ptrtoint i64* %sv_0 to i64\n %21 = add i64 %6, %20\n %22 = inttoptr i64 %21 to i32*\n store i32 2764330, i32* %22, align 4\n br label LBL_7\n LBL_7:\n %23 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_multiply_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 2, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = icmp eq i32 %sv_0.0.reload, 0\n %or.cond = or i1 %7, %6\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %sext = mul i32 %sv_0.0.reload, 2\n %8 = zext i32 %sext to i64\n %9 = call i64 @FUNC(i64 %8)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_struct_static_05-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_struct_static_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %storemerge1.reg2mem\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %2 = mul i64 %storemerge1.reload, 8\n %3 = add i64 %2, ptrtoint (i64* @gv_1 to i64)\n %4 = inttoptr i64 %3 to i32*\n store i32 1, i32* %4, align 8\n %5 = add i64 %2, ptrtoint (i64* @gv_2 to i64)\n %6 = inttoptr i64 %5 to i32*\n store i32 1, i32* %6, align 8\n %7 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %7, 100\n store i64 %7, i64* %storemerge1.reg2mem\n store i64 ptrtoint (i64* @gv_1 to i64), i64* %sv_0.0.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = call i64 @FUNC(i64 %sv_0.0.reload)\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %9)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %2, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_calloc_06-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_0, align 8\n %4 = inttoptr i64 %3 to i64*\n store i64 7453010373643542593, i64* %4, align 16\n %5 = or i64 %3, 8\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 8\n %7 = load i64, i64* %sv_0, align 8\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_char_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 122, i64* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %3 = call i64 @FUNC(i64 %sv_0.0.reload)\n ret i64 %3\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_malloc_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = ptrtoint i64* %2 to i64\n %6 = bitcast i64* %2 to i32*\n store i32 0, i32* %6, align 4\n %7 = add i64 %5, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %9 = call i64 @FUNC(i64 %5)\n store i64* %2, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_2, align 4\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n store i64 %12, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %2, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_popen_32-bad", "fun_name": "CWE78_OS_Command_Injection__char_connect_socket_popen_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = sext i32 %2 to i64\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %27 = icmp eq %_IO_FILE* %26, null\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %28 = call i32 @pclose(%_IO_FILE* nonnull %26)\n br label LBL_10\n LBL_10:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = ptrtoint i64* %1 to i64\n store i8 0, i8* %4, align 1\n %6 = call i32 @strlen(i8* %4)\n %7 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %8 = icmp eq i8* %7, null\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = sext i32 %6 to i64\n %10 = add i64 %9, %5\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %6\n %13 = call i8* @strncat(i8* %11, i8* nonnull %7, i32 %12)\n br label LBL_4\n LBL_4:\n %14 = call i32 @strlen(i8* nonnull %4)\n %15 = icmp eq i32 %14, 0\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %16 = add i64 %storemerge4.reload, %5\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = icmp eq i8 %18, 83\n %20 = icmp eq i1 %19, false\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n %21 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n br label LBL_8\n LBL_7:\n %22 = add nuw i64 %storemerge4.reload, 1\n %23 = call i32 @strlen(i8* %4)\n %24 = sext i32 %23 to i64\n %25 = icmp ult i64 %22, %24\n store i64 %22, i64* %storemerge4.reg2mem\n br i1 %25, label LBL_5, label LBL_8\n LBL_8:\n call void @free(i64* %1)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 2, 0, 3 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2, 3 }\n uselistorder label LBL_8, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_5, label LBL_1\n LBL_1:\n %5 = trunc i64 %1 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_2\n LBL_2:\n %7 = ptrtoint i64* %sv_0 to i64\n %spec.select = select i1 %6, i64 -4, i64 28\n %8 = add i64 %7, -48\n %9 = add i64 %spec.select, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_3\n LBL_4:\n %17 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_5\n LBL_5:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n uselistorder label LBL_5, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_divide_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 7\n %6 = udiv i32 100, %spec.select\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 7, { 1, 0 }\n uselistorder i32 -1, { 3, 0, 1, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_loop_09-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = add i64 %1, -816\n %3 = add i64 %1, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %4 = mul i64 %storemerge13.reload, 8\n %5 = add i64 %4, %2\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 8\n %7 = add i64 %3, %4\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %9 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %9, 100\n store i64 %9, i64* %storemerge13.reg2mem\n br i1 %exitcond4, label LBL_2, label LBL_1\n LBL_2:\n %10 = ptrtoint i64* %sv_0 to i64\n %11 = add i64 %10, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %12 = and i64 %11, -16\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %13 = mul i64 %storemerge2.reload, 8\n %14 = add i64 %13, %12\n %15 = add i64 %13, %2\n %16 = inttoptr i64 %15 to i64*\n %17 = load i64, i64* %16, align 8\n %18 = inttoptr i64 %14 to i64*\n store i64 %17, i64* %18, align 8\n %19 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %19, 100\n store i64 %19, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %20 = call i64 @FUNC(i64 %12)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_malloc_31-bad", "fun_name": "CWE401_Memory_Leak__int_malloc_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 400)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n %5 = ptrtoint i64* %0 to i64\n ret i64 %5\n\n uselistorder i64* %0, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_square_15-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_rand_square_15_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = zext i32 %3 to i64\n %5 = mul i64 %4, 1152921504606846976\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 35184372088832\n %9 = call i32 @rand()\n %10 = sext i32 %9 to i64\n %11 = mul i64 %10, 1073741824\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 32768\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = sext i1 %2 to i64\n %18 = xor i64 %5, %17\n %19 = xor i64 %18, %8\n %20 = xor i64 %19, %11\n %21 = xor i64 %20, %14\n %storemerge = xor i64 %21, %16\n %22 = mul i64 %storemerge, %storemerge\n %23 = call i64 @FUNC(i64 %22)\n ret i64 %23\n\n uselistorder i64 %storemerge, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fgets_memcpy_13-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__fgets_memcpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8352 to i32*), align 32\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_2, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_2 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 8, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n %sext = mul i32 %8, 65536\n %9 = ashr exact i32 %sext, 16\n store i32 %9, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n store i64 0, i64* %sv_2, align 8\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %12 = trunc i32 %sv_0.0.reload to i16\n %13 = icmp sgt i16 %12, 99\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.0.reload)\n %16 = sext i32 %sv_0.0.reload to i64\n %17 = add i64 %14, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n br label LBL_6\n LBL_6:\n %20 = ptrtoint i64* %sv_2 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 2, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1, 4 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i8 0, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 49)\n %9 = add i64 %3, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_2\n LBL_2:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strcat(i8* nonnull %12, i8* %11)\n %14 = call i64 @FUNC(i64 %3)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1, 4 }\n uselistorder i8* (i8*, i8*)* @strcat, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_file_07-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_file_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_2 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = load i32, i32* @gv_0, align 4\n %21 = icmp eq i32 %20, 5\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_12, label LBL_7\n LBL_7:\n %23 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n %24 = icmp eq i32 %23, 1\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_12, label LBL_8\n LBL_8:\n %26 = load i64, i64* %sv_1, align 8\n %27 = and i64 %26, 4294967295\n %28 = icmp eq i64 %27, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %28, label LBL_11, label LBL_9\n LBL_9:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %29 = add i32 %storemerge5.reload, 1\n %30 = sext i32 %29 to i64\n %31 = icmp sgt i64 %27, %30\n store i32 %29, i32* %storemerge5.reg2mem\n br i1 %31, label LBL_9, label LBL_10\n LBL_10:\n %phitmp = zext i32 %29 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %32 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_12\n LBL_12:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %29, { 1, 0, 2 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int64_t_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 5)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i64 5, { 1, 0, 2, 3 }\n uselistorder i32* @gv_0, { 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_remove_14-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_remove_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @remove(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_0, i64 0, i64 0))\n %5 = sext i32 %4 to i64\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE170_char_loop_07-bad", "fun_name": "CWE126_Buffer_Overread__CWE170_char_loop_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 149)\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %6 = add i64 %indvars.iv.reload, %4\n %7 = add i64 %6, -160\n %8 = inttoptr i64 %7 to i8*\n %9 = load i8, i8* %8, align 1\n %10 = add i64 %6, -272\n %11 = inttoptr i64 %10 to i8*\n store i8 %9, i8* %11, align 1\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 99\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_square_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge2.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = mul i32 %2, 32768\n %7 = xor i32 %3, %6\n %8 = sext i1 %5 to i32\n %storemerge5.in.le = xor i32 %7, %8\n %sext3.le = mul i32 %storemerge5.in.le, 65536\n %9 = ashr exact i32 %sext3.le, 16\n %10 = trunc i32 %9 to i16\n %11 = sub i16 0, %10\n %12 = icmp slt i16 %11, 0\n %13 = icmp eq i1 %12, false\n %14 = zext i16 %11 to i32\n %15 = select i1 %13, i32 %14, i32 %9\n %16 = trunc i32 %15 to i16\n %17 = icmp ult i16 %16, 182\n br i1 %17, label LBL_1, label LBL_2\n LBL_1:\n %18 = urem i32 %9, 65536\n %sext = mul i32 %18, %sext3.le\n %19 = ashr exact i32 %sext, 16\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_2:\n %22 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %22, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n ret i64 %storemerge2.reload\n\n uselistorder i32 %9, { 0, 2, 1 }\n uselistorder i32 %sext3.le, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 0, 2, 1 }\n uselistorder i32 16, { 1, 0 }\n uselistorder i32 65536, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_sub_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.02.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.02.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp eq i32 %6, -2147483648\n store i32 %6, i32* %sv_0.02.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.02.reload = load i32, i32* %sv_0.02.reg2mem\n %8 = add i32 %sv_0.02.reload, -1\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_add_05-bad", "fun_name": "CWE190_Integer_Overflow__char_fscanf_add_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i8, i8* %sv_0, align 1\n %7 = add i8 %6, 1\n %8 = sext i8 %7 to i64\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_large_11-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_large_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_5, label LBL_1\n LBL_1:\n %5 = trunc i64 %1 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_2\n LBL_2:\n %7 = ptrtoint i64* %sv_0 to i64\n %spec.select = select i1 %6, i64 -4, i64 40\n %8 = add i64 %7, -48\n %9 = add i64 %spec.select, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_3\n LBL_4:\n %17 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_5\n LBL_5:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_pointer_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 4)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n ret i64 %4\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 3, 2, 0, 1, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 0, 1, 2, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_listen_socket_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge310.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %5, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %2 to i64\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n %32 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %33 = icmp eq i32 %32, 1\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_17, label LBL_12\n LBL_12:\n %35 = load i64, i64* %sv_1, align 8\n %36 = trunc i64 %35 to i32\n %37 = icmp sgt i32 %36, ptrtoint (i1* @gv_1 to i32)\n br i1 %37, label LBL_17, label LBL_13\n LBL_13:\n %38 = and i64 %35, 4294967295\n %39 = icmp eq i64 %38, 0\n store i32 0, i32* %storemerge310.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %39, label LBL_16, label LBL_14\n LBL_14:\n %storemerge310.reload = load i32, i32* %storemerge310.reg2mem\n %40 = add i32 %storemerge310.reload, 1\n %41 = sext i32 %40 to i64\n %42 = icmp sgt i64 %38, %41\n store i32 %40, i32* %storemerge310.reg2mem\n br i1 %42, label LBL_14, label LBL_15\n LBL_15:\n %phitmp = zext i32 %40 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_16\n LBL_16:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %43 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_17\n LBL_17:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_19, label LBL_18\n LBL_18:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_19\n LBL_19:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %40, { 1, 0, 2 }\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge310.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_17, { 2, 1, 0 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 100)\n %7 = add i64 %5, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 8\n %9 = add i64 %8, %4\n %10 = add i64 %7, %8\n %11 = inttoptr i64 %10 to i64*\n %12 = load i64, i64* %11, align 8\n %13 = inttoptr i64 %9 to i64*\n store i64 %12, i64* %13, align 8\n %14 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %14, 100\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %15 = load i64, i64* %1, align 8\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 100, { 0, 2, 1, 3 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE404_Improper_Resource_Shutdown__open_fclose_06-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = icmp eq i32 %0, -1\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @close(i32 %0)\n %3 = sext i32 %2 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__fopen_12-bad", "fun_name": "CWE690_NULL_Deref_From_Return__fopen_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @fclose(%_IO_FILE* %0)\n %5 = sext i32 %4 to i64\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %6 = icmp eq %_IO_FILE* %0, null\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %8 = sext i32 %7 to i64\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %0, { 2, 0, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_multiply_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %sv_0.1.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_7\n LBL_7:\n %.reload = load i32, i32* %.reg2mem\n %23 = icmp eq i32 %.reload, 5\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_13\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %25 = icmp slt i32 %sv_0.1.reload, 1\n br i1 %25, label LBL_13, label LBL_10\n LBL_10:\n %26 = icmp sgt i32 %sv_0.1.reload, 1073741822\n br i1 %26, label LBL_12, label LBL_11\n LBL_11:\n %27 = mul i32 %sv_0.1.reload, 2\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_13\n LBL_12:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_13\n LBL_13:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 2, 0, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_max_multiply_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = call i64 @FUNC(i64 4)\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 4, 3, 5 }\n uselistorder i32* @gv_0, { 4, 0, 3, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_fprintf_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = sext i32 %2 to i64\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %27 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 6, 7, 0 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 1 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_listen_socket_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %12, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n br label LBL_10\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i64 0, i64* %sv_2, align 8\n %25 = icmp ugt i32 %sv_0.0.ph.reload, 9\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n %26 = sext i32 %sv_0.0.ph.reload to i64\n %27 = mul i64 %26, 4\n %28 = add i64 %12, -64\n %29 = add i64 %28, %27\n %30 = inttoptr i64 %29 to i32*\n %31 = load i32, i32* %30, align 4\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_11\n LBL_10:\n %34 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 3, 0, 1, 4, 2 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 2, 3, 4, 5, 1, 6, 7, 8, 9 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_square_10-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %22 = load i32, i32* @gv_2, align 4\n %23 = icmp eq i32 %22, 0\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_11\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sv_0.1.off = add i32 %sv_0.1.reload, 46339\n %25 = icmp ugt i32 %sv_0.1.off, 92678\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n %26 = mul i32 %sv_0.1.reload, %sv_0.1.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_11\n LBL_10:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_11\n LBL_11:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 0, 2 }\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_fgets_13-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_fgets_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8388 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.01.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_2, label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.01.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i32 @atoi(i8* nonnull %5)\n %10 = icmp sgt i32 %9, 9\n store i32 %9, i32* %sv_0.01.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = ptrtoint i64* %sv_2 to i64\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %12 = sext i32 %sv_0.01.reload to i64\n %13 = mul i64 %12, 4\n %14 = add i64 %11, -64\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n br label LBL_6\n LBL_5:\n %20 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.01.reg2mem, { 0, 3, 1, 2 }\n uselistorder label LBL_4, { 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_multiply_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_2, label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_3:\n %9 = call i32 @atoi(i8* nonnull %5)\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp slt i32 %9, 0\n %13 = icmp eq i1 %12, %11\n br i1 %13, label LBL_4, label LBL_7\n LBL_4:\n %14 = icmp slt i32 %9, -1073741823\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n %15 = mul i32 %9, 2\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_7\n LBL_6:\n %18 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 0, 2, 1 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_7, { 3, 4, 0, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__char_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i8*\n %rax.0.reg2mem = alloca i64\n %1 = load i8*, i8** %0\n %2 = call i64 @FUNC()\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = trunc i64 %2 to i32\n %7 = icmp eq i32 %6, 0\n %spec.select = select i1 %7, i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_0, i64 0, i64 0)\n %8 = load i8, i8* %spec.select, align 1\n %9 = sext i8 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 3, 2, 1, 0 }\n uselistorder i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_0, i64 0, i64 0), { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_postdec_10-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = urem i32 %2, 2\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @rand()\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = call i32 @rand()\n %9 = xor i32 %8, %7\n %10 = sext i1 %4 to i32\n %storemerge.in = xor i32 %9, %10\n %sext = mul i32 %storemerge.in, 65536\n %11 = ashr exact i32 %sext, 16\n store i32 %11, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %12 = load i32, i32* @gv_1, align 4\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n %14 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %15 = trunc i32 %sv_0.0.reload to i16\n %16 = icmp eq i16 %15, -32768\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = mul i32 %sv_0.0.reload, 65536\n %sext2 = add i32 %17, -65536\n %18 = ashr exact i32 %sext2, 16\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %21 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_sub_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i8, i8* %sv_0, align 1\n %9 = icmp eq i8 %8, -128\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = add i8 %8, -1\n %11 = sext i8 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE475_Undefined_Behavior_for_Input_to_API__char_08-bad", "fun_name": "CWE475_Undefined_Behavior_for_Input_to_API__char_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 7523094288207667809, i64* %sv_0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 8101815670912281193, i64* %6, align 8\n %7 = add i64 %4, 16\n %8 = inttoptr i64 %7 to i64*\n store i64 8680537053616894577, i64* %8, align 8\n %9 = add i64 %4, 24\n %10 = inttoptr i64 %9 to i16*\n store i16 31353, i16* %10, align 8\n %11 = add i64 %4, 26\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 2\n %13 = or i64 %4, 4\n %14 = or i64 %4, 6\n %15 = inttoptr i64 %14 to i64*\n %16 = inttoptr i64 %13 to i64*\n %17 = call i64* @memcpy(i64* nonnull %15, i64* nonnull %16, i32 10)\n %18 = call i64 @FUNC(i64 %4)\n br label LBL_2\n LBL_2:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 2, 0, 1, 6, 5, 4, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_ncpy_31-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = bitcast i64* %1 to i8*\n store i8* %2, i8** %sv_1, align 8\n %3 = icmp eq i64* %1, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i8*, i8** %sv_1, align 8\n %10 = ptrtoint i8* %9 to i64\n %11 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strncpy(i8* %9, i8* nonnull %12, i32 99)\n %14 = add i64 %10, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %10)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_no_init_05-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_no_init_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -33\n %3 = and i64 %2, -16\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %6 = mul i64 %indvars.iv.reload, 4\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n %9 = load i32, i32* %8, align 4\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__sizeof_double_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = call i128 @FUNC(i64 9098483789791991595)\n %4 = call i64 @__asm_movsd.1(i128 %3)\n store i64 %4, i64* %0, align 8\n %5 = call i128 @FUNC(i64 %4)\n %6 = call i64 @FUNC()\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 ()* @printDoubleLine, { 1, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_multiply_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_11\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp slt i32 %sv_0.0.ph.reload, 1\n br i1 %25, label LBL_11, label LBL_8\n LBL_8:\n %26 = icmp sgt i32 %sv_0.0.ph.reload, 1073741822\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n %27 = mul i32 %sv_0.0.ph.reload, 2\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_11\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 2, 0, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 3, 4, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_snprintf_07-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_snprintf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %sv_0.0.reload, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %7 = ptrtoint i8* %sv_0.0.reload to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_printf_02-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_printf_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_sleep_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_1, align 4\n %24 = icmp eq i32 %23, 5\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n %25 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp slt i32 %sv_0.1.reload, 1\n %27 = icmp sgt i32 %sv_0.1.reload, ptrtoint (i1* @gv_3 to i32)\n %or.cond3 = or i1 %26, %27\n br i1 %or.cond3, label LBL_10, label LBL_9\n LBL_9:\n %28 = call i32 @usleep(i32 %sv_0.1.reload)\n %29 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_4 to i64))\n br label LBL_11\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_5 to i64))\n br label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_listen_socket_14-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_listen_socket_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %31 = icmp sgt i32 %sv_0.1.reload, 9\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %34, %33\n %36 = inttoptr i64 %35 to i32*\n %37 = load i32, i32* %36, align 4\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n br label LBL_13\n LBL_12:\n %40 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_13\n LBL_13:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %1, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__strdup_char_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 7453010373643565421, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i8* @strdup(i8* nonnull %1)\n %3 = ptrtoint i8* %2 to i64\n %4 = call i64 @FUNC(i64 %3)\n %5 = bitcast i8* %2 to i64*\n call void @free(i64* %5)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_add_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 3)\n ret i64 %0\n\n uselistorder i64 (i64)* @printHexCharLine, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_ncpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i8* @strncpy(i8* nonnull %4, i8* nonnull %2, i32 %5)\n %7 = call i64 @FUNC(i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_rand_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %storemerge.reg2mem = alloca i128\n %1 = load i128, i128* %0\n %2 = call i128 @FUNC(i128 %1, i128 %1)\n %3 = call i64 @FUNC(i128 %2)\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %14 = call i128 @FUNC(i128 %2, i128 %2)\n %15 = call i128 @FUNC(i32 %13)\n store i128 %15, i128* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %16 = sub i32 0, %13\n %17 = sub i32 %16, 1\n %18 = call i128 @FUNC(i128 %2, i128 %2)\n %19 = call i128 @FUNC(i32 %17)\n store i128 %19, i128* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i128, i128* %storemerge.reg2mem\n %20 = call i64 @FUNC(i128 %storemerge.reload)\n %21 = trunc i64 %20 to i32\n %22 = call i128 @__asm_movss.1(i32 %21)\n %23 = call i128 @__asm_movss.1(i32 2147483647)\n %24 = call i128 @FUNC(i128 %22, i128 %23)\n %25 = call i128 @FUNC(i128 %24)\n %26 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %25, i128 %26)\n %27 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n ret i64 %27\n\n uselistorder i128 %2, { 3, 2, 1, 0, 4 }\n uselistorder i128* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i128* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_9, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = icmp ugt i32 %sv_0.0.ph.reload, 9\n br i1 %10, label LBL_8, label LBL_6\n LBL_6:\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = sext i32 %sv_0.0.ph.reload to i64\n %13 = mul i64 %12, 4\n %14 = add i64 %11, -64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i32*\n store i32 1, i32* %16, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %17 = mul i64 %indvars.iv.reload, 4\n %18 = add i64 %17, %14\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %23 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_9\n LBL_9:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_9, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memmove_31-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = bitcast i64* %1 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = call i64* @memmove(i64* %1, i64* nonnull %sv_0, i32 100)\n %8 = add i64 %4, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fscanf_03-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fscanf_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp slt i32 %3, 0\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = sext i32 %3 to i64\n %7 = mul i64 %6, 4\n %8 = add i64 %5, -48\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_2\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memcpy_31-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memcpy_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i32, align 4\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_2, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_2)\n %3 = load i32, i32* %sv_2, align 4\n store i64 0, i64* %sv_1, align 8\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %5 = icmp sgt i32 %3, 99\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %sv_3 to i64\n %7 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %3)\n %8 = sext i32 %3 to i64\n %9 = add i64 %6, -112\n %10 = add i64 %9, %8\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n br label LBL_2\n LBL_2:\n %12 = call i64 @FUNC(i64* nonnull %sv_1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 1, 0, 2 }\n uselistorder i32* %sv_2, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_loop_05-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_loop_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_2 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n %6 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %7, i64 0, i64 100)\n %8 = add i64 %2, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 8\n %10 = add i64 %9, %spec.select\n %11 = add i64 %8, %9\n %12 = inttoptr i64 %11 to i64*\n %13 = load i64, i64* %12, align 8\n %14 = inttoptr i64 %10 to i64*\n store i64 %13, i64* %14, align 8\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %16 = inttoptr i64 %spec.select to i64*\n %17 = load i64, i64* %16, align 8\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %3, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %spec.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_multiply_34-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp slt i32 %3, 1\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp sgt i32 %3, 1073741822\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = mul i32 %3, 2\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_execl_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = add i64 %6, %7\n %9 = inttoptr i64 %8 to i32*\n store i32 2764330, i32* %9, align 4\n br label LBL_2\n LBL_2:\n %10 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_0, i64 0, i64 0))\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i8*, ...)* @execl, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_multiply_32-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_rand_multiply_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = zext i32 %4 to i64\n %6 = mul i64 %5, 1152921504606846976\n %7 = call i32 @rand()\n %8 = zext i32 %7 to i64\n %9 = mul i64 %8, 35184372088832\n %10 = call i32 @rand()\n %11 = sext i32 %10 to i64\n %12 = mul i64 %11, 1073741824\n %13 = call i32 @rand()\n %14 = sext i32 %13 to i64\n %15 = mul i64 %14, 32768\n %16 = call i32 @rand()\n %17 = sext i32 %16 to i64\n %18 = sext i1 %3 to i64\n %19 = xor i64 %6, %18\n %20 = xor i64 %19, %9\n %21 = xor i64 %20, %12\n %22 = xor i64 %21, %15\n %storemerge = xor i64 %22, %17\n %23 = icmp slt i64 %storemerge, 0\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_2, label LBL_1\n LBL_1:\n %25 = mul i64 %storemerge, 2\n %26 = call i64 @FUNC(i64 %25)\n br label LBL_2\n LBL_2:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* %4, i8* nonnull %6, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -609\n %3 = and i64 %2, -16\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 50)\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memcpy(i64* %5, i64* nonnull %sv_0, i32 400)\n %7 = inttoptr i64 %3 to i32*\n %8 = load i32, i32* %7, align 16\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_add_11-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_add_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i16, i16* %sv_0, align 2\n %10 = add i16 %9, 1\n %11 = sext i16 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_loop_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_3, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %7 = ptrtoint i64* %sv_2 to i64\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = sext i32 %10 to i64\n %12 = icmp eq i32 %10, 0\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %sv_0.0.reload\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge1.reload, %.pre\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw i64 %storemerge1.reload, 1\n %19 = icmp ult i64 %18, %11\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %19, label LBL_4, label LBL_5\n LBL_5:\n %20 = call i64 @FUNC(i64 %.pre)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %.pre, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__int_malloc_use_14-bad", "fun_name": "CWE758_Undefined_Behavior__int_malloc_use_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 4)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i32*\n %8 = load i32, i32* %7, align 4\n call void @free(i64* %4)\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cpy_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i8* null, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %9)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %13)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fgets_strncpy_10-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__fgets_strncpy_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_2, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_2 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 8, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n %sext = mul i32 %7, 65536\n %8 = ashr exact i32 %sext, 16\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n store i64 0, i64* %sv_2, align 8\n %10 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %11 = trunc i32 %sv_0.0.reload to i16\n %12 = icmp sgt i16 %11, 99\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = bitcast i64* %sv_2 to i8*\n %15 = bitcast i64* %sv_1 to i8*\n %16 = call i8* @strncpy(i8* nonnull %14, i8* nonnull %15, i32 %sv_0.0.reload)\n %17 = sext i32 %sv_0.0.reload to i64\n %18 = add i64 %13, -112\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n br label LBL_6\n LBL_6:\n %21 = ptrtoint i64* %sv_2 to i64\n %22 = call i64 @FUNC(i64 %21)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 2, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1, 4 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i8 0, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_long_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 5)\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 10)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLine, { 5, 4, 3, 2, 1, 0 }\n uselistorder i64 5, { 2, 3, 0, 1 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i32*, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i32** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, -609\n %4 = and i64 %3, -16\n %5 = bitcast i32** %sv_1 to i64*\n store i64 %4, i64* %5, align 8\n %6 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 50)\n %7 = add i64 %2, -416\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %8 = mul i64 %storemerge3.reload, 4\n %9 = load i32*, i32** %sv_1, align 8\n %10 = ptrtoint i32* %9 to i64\n %11 = add i64 %8, %10\n %12 = add i64 %7, %8\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = inttoptr i64 %11 to i32*\n store i32 %14, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %17 = load i32*, i32** %sv_1, align 8\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_1, { 3, 2, 0, 1 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_char_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %1)\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_12-bad", "fun_name": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_0 to i32))\n %5 = ptrtoint i64* %4 to i64\n store i64 %5, i64* %sv_0, align 8\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = bitcast i64* %4 to i32*\n store i32 0, i32* %8, align 4\n %9 = load i64, i64* %sv_0, align 8\n %10 = add i64 %9, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = load i64, i64* %sv_0, align 8\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_5\n LBL_4:\n %14 = ptrtoint i64* %sv_0 to i64\n %15 = add i64 %14, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %16 = and i64 %15, -16\n store i64 %16, i64* %sv_0, align 8\n %17 = inttoptr i64 %16 to i32*\n store i32 0, i32* %17, align 16\n %18 = load i64, i64* %sv_0, align 8\n %19 = add i64 %18, 4\n %20 = inttoptr i64 %19 to i32*\n store i32 0, i32* %20, align 4\n %21 = load i64, i64* %sv_0, align 8\n %22 = call i64 @FUNC(i64 %21)\n br label LBL_5\n LBL_5:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n %27 = load i64, i64* %sv_0, align 8\n %28 = inttoptr i64 %27 to i64*\n call void @free(i64* %28)\n br label LBL_7\n LBL_7:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 0, 1, 2, 3, 8, 4, 5, 6, 7 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64* null, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__freopen_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %.pr = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_2\n LBL_2:\n %4 = call i32 @fclose(%_IO_FILE* %2)\n %5 = sext i32 %4 to i64\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 0, 2, 3, 1, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 0, 4, 3, 2, 1 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_07-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %.pre = inttoptr i64 %3 to i64*\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i64* @memset(i64* %.pre, i32 65, i32 99)\n %8 = add i64 %3, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n br label LBL_2\n LBL_2:\n %10 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = call i32 @strlen(i8* %10)\n %12 = call i64* @memcpy(i64* nonnull %sv_0, i64* %.pre, i32 %11)\n %13 = call i64 @FUNC(i64 %3)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 3, 2, 0, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__addition_04-bad", "fun_name": "CWE398_Poor_Code_Quality__addition_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 0)\n %1 = call i64 @FUNC(i64 0)\n ret i64 %1\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_32-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %sv_0.06.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.06.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -22\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.06.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.06.reload = load i32, i32* %sv_0.06.reg2mem\n %20 = call i64* @malloc(i32 40)\n %21 = ptrtoint i64* %20 to i64\n %22 = icmp eq i64* %20, null\n %23 = icmp eq i1 %22, false\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %24 = mul i64 %indvars.iv9.reload, 4\n %25 = add i64 %24, %21\n %26 = inttoptr i64 %25 to i32*\n store i32 0, i32* %26, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 10\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_8, label LBL_7\n LBL_8:\n %27 = icmp slt i32 %sv_0.06.reload, 0\n br i1 %27, label LBL_11, label LBL_9\n LBL_9:\n %28 = sext i32 %sv_0.06.reload to i64\n %29 = mul i64 %28, 4\n %30 = add i64 %29, %21\n %31 = inttoptr i64 %30 to i32*\n store i32 1, i32* %31, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %32 = mul i64 %indvars.iv.reload, 4\n %33 = add i64 %32, %21\n %34 = inttoptr i64 %33 to i32*\n %35 = load i32, i32* %34, align 4\n %36 = zext i32 %35 to i64\n %37 = call i64 @FUNC(i64 %36)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_10\n LBL_11:\n %38 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_1 to i64))\n br label LBL_12\n LBL_12:\n call void @free(i64* %20)\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %21, { 0, 2, 1 }\n uselistorder i32 %sv_0.06.reload, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.06.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i32 -1, { 5, 2, 1, 3, 0, 4 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_sub_18-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.045.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.045.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.045.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, -2147483648\n store i32 %19, i32* %sv_0.045.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.045.reload = load i32, i32* %sv_0.045.reg2mem\n %22 = add i32 %sv_0.045.reload, -1\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.045.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_17-bad", "fun_name": "CWE127_Buffer_Underread__char_declare_memmove_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 %2, i64* %sv_1, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = load i64, i64* %sv_1, align 8\n %5 = inttoptr i64 %4 to i64*\n %6 = call i64* @memmove(i64* nonnull %sv_0, i64* %5, i32 100)\n %7 = call i64 @FUNC(i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_loop_31-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_loop_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 50)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = ptrtoint i64* %1 to i64\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %8 = add i64 %storemerge2.reload, %5\n %9 = add i64 %storemerge2.reload, %7\n %10 = inttoptr i64 %9 to i8*\n %11 = load i8, i8* %10, align 1\n %12 = inttoptr i64 %8 to i8*\n store i8 %11, i8* %12, align 1\n %13 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %14 = add i64 %5, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i64 %5, { 2, 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_sleep_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 20\n %6 = call i32 @usleep(i32 %spec.select)\n %7 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_0 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i32)* @usleep, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 9, 0, 4, 3, 10, 1, 11, 2, 8, 7, 12, 5, 13, 6 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -17\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = add i64 %0, -49\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 16\n store i64 4702111234474983745, i64* %sv_0, align 8\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = add i32 %8, 1\n %10 = inttoptr i64 %5 to i64*\n %11 = call i64* @memmove(i64* %10, i64* nonnull %sv_0, i32 %9)\n %12 = call i64 @FUNC(i64 %5)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_system_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 7955998172649846063, i64* %sv_0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 27422013814697007, i64* %6, align 8\n br label LBL_2\n LBL_2:\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 @system(i8* nonnull %7)\n %9 = icmp eq i32 %8, 0\n %10 = icmp slt i32 %8, 0\n %11 = icmp eq i1 %10, false\n %12 = icmp eq i1 %9, false\n %13 = icmp eq i1 %11, %12\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n %14 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %8, { 1, 0 }\n uselistorder i64* %sv_0, { 2, 0, 1, 3 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 (i8*)* @system, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_multiply_12-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_max_multiply_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %. = select i1 %2, i32 2, i32 -1\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i32 %., 2\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n br i1 %2, label LBL_3, label LBL_4\n LBL_3:\n %9 = mul i32 %., 2\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_sleep_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_9\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp slt i32 %sv_0.0.ph.reload, 1\n %26 = icmp sgt i32 %sv_0.0.ph.reload, ptrtoint (i1* @gv_0 to i32)\n %or.cond4 = or i1 %25, %26\n br i1 %or.cond4, label LBL_9, label LBL_8\n LBL_8:\n %27 = call i32 @usleep(i32 %sv_0.0.ph.reload)\n %28 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 0, 2, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_9, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_multiply_07-bad", "fun_name": "CWE191_Integer_Underflow__int_min_multiply_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 0)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_fprintf_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_3\n LBL_3:\n %13 = load i32, i32* @gv_2, align 4\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_5:\n %16 = load %_IO_FILE*, %_IO_FILE** @gv_4, align 8\n %17 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_5, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_6\n LBL_6:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_struct_alloca_05-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_struct_alloca_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = add i64 %3, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %5 = and i64 %4, -16\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %5\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 8\n %9 = or i64 %7, 4\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n store i64 %5, i64* %sv_0, align 8\n store i64 %5, i64* %.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i64, i64* %.reg2mem\n %12 = call i64 @FUNC(i64 %.reload)\n %13 = load i64, i64* %sv_0, align 8\n %14 = inttoptr i64 %13 to i64*\n call void @free(i64* %14)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_06-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %.in.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n %5 = bitcast i8** %sv_1 to i64*\n store i64 %3, i64* %5, align 8\n store i8 0, i8* %4, align 16\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = load i8*, i8** %sv_1, align 8\n %8 = ptrtoint i64* %sv_0 to i64\n store i8* %7, i8** %.in.reg2mem\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %.in.reload = load i8*, i8** %.in.reg2mem\n %9 = ptrtoint i8* %.in.reload to i64\n %10 = add i64 %storemerge3.reload, %9\n %11 = add i64 %storemerge3.reload, %8\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = inttoptr i64 %10 to i8*\n store i8 %13, i8* %14, align 1\n %15 = add nuw nsw i64 %storemerge3.reload, 1\n %16 = load i8*, i8** %sv_1, align 8\n %exitcond = icmp eq i64 %15, 100\n store i8* %16, i8** %.in.reg2mem\n store i64 %15, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %17 = ptrtoint i8* %16 to i64\n %18 = add i64 %17, 99\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = load i8*, i8** %sv_1, align 8\n %21 = ptrtoint i8* %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %1, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %16, { 1, 0 }\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i8** %sv_1, { 4, 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i8** %.in.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_multiply_06-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_rand_multiply_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = zext i32 %3 to i64\n %5 = mul i64 %4, 1152921504606846976\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 35184372088832\n %9 = call i32 @rand()\n %10 = sext i32 %9 to i64\n %11 = mul i64 %10, 1073741824\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 32768\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = sext i1 %2 to i64\n %18 = xor i64 %5, %17\n %19 = xor i64 %18, %8\n %20 = xor i64 %19, %11\n %21 = xor i64 %20, %14\n %storemerge = xor i64 %21, %16\n %22 = icmp slt i64 %storemerge, 0\n %23 = icmp eq i1 %22, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %23, label LBL_2, label LBL_1\n LBL_1:\n %24 = mul i64 %storemerge, 2\n %25 = call i64 @FUNC(i64 %24)\n store i64 %25, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = load i8, i8* %sv_0, align 1\n %9 = icmp slt i8 %8, 0\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_7, label LBL_4\n LBL_4:\n %11 = icmp slt i8 %8, -63\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = mul i8 %8, 2\n %13 = sext i8 %12 to i64\n %14 = and i64 %13, 4294967294\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_7\n LBL_6:\n %16 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_realloc_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @realloc(i64* null, i32 400)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = call i64 @FUNC(i64 5)\n br label LBL_7\n LBL_4:\n br i1 %5, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %8 = bitcast i64* %3 to i32*\n store i32 5, i32* %8, align 4\n %9 = call i64 @FUNC(i64 5)\n br label LBL_7\n LBL_7:\n %10 = call i64 @FUNC()\n call void @free(i64* nonnull %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %3, { 1, 0, 2, 3 }\n uselistorder i64* null, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_execlp_04-bad", "fun_name": "CWE78_OS_Command_Injection__char_console_execlp_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_sub_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 -1, i64 -3\n %6 = call i64 @FUNC(i64 %spec.select)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i64 -3, { 1, 0 }\n uselistorder i64 -1, { 1, 0, 2, 3 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memmove_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64* null, i64** %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64* %4, i64** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = call i64* @memmove(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 100)\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 2, 0, 1 }\n uselistorder i64** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_pointer_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %storemerge.reg2mem\n br label LBL_5\n LBL_2:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %6 = call i128 @FUNC(i64 4617315517961601024)\n %7 = call i64 @__asm_movsd.1(i128 %6)\n store i64 %7, i64* %3, align 8\n %8 = call i128 @FUNC(i64 %7)\n %9 = call i64 @FUNC()\n store i64 %9, i64* %storemerge.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE510_Trapdoor__network_connection_05-bad", "fun_name": "CWE510_Trapdoor__network_connection_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_3, label LBL_2\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_1, i64 0, i64 0))\n %6 = call i16 @htons(i16 80)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = call i32 @close(i32 %3)\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 2, 1, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_malloc_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 8)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memcpy_13-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memcpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i32, align 4\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_2, align 4\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_2)\n br label LBL_2\n LBL_2:\n store i64 0, i64* %sv_1, align 8\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %7 = load i32, i32* %sv_2, align 4\n %8 = icmp sgt i32 %7, 99\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = ptrtoint i64* %sv_3 to i64\n %10 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %7)\n %11 = load i32, i32* %sv_2, align 4\n %12 = sext i32 %11 to i64\n %13 = add i64 %9, -112\n %14 = add i64 %13, %12\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n br label LBL_4\n LBL_4:\n %16 = call i64 @FUNC(i64* nonnull %sv_1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_2, { 1, 2, 0, 3 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__listen_socket_memmove_31-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__listen_socket_memmove_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01013.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n store i32 0, i32* %sv_0.01013.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_3 to %sockaddr*\n %7 = call i32 @bind(i32 %2, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = call i32 @listen(i32 %2, i32 5)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @accept(i32 %2, %sockaddr* null, i32* null)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @recv(i32 %11, i64* nonnull %sv_2, i32 7, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_2 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %.off = add i32 %21, 32768\n %22 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %22, label LBL_6, label LBL_8\n LBL_6:\n %sext5 = mul i32 %21, 65536\n %23 = ashr exact i32 %sext5, 16\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %2)\n store i32 0, i32* %sv_0.01013.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %2)\n %26 = call i32 @close(i32 %11)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.01013.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.01013.reload = load i32, i32* %sv_0.01013.reg2mem\n %27 = trunc i32 %sv_0.01013.reload to i16\n store i64 0, i64* %sv_2, align 8\n %28 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %29 = icmp sgt i16 %27, 99\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %30 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.01013.reload)\n %31 = sext i32 %sv_0.01013.reload to i64\n %32 = add i64 %0, -112\n %33 = add i64 %32, %31\n %34 = inttoptr i64 %33 to i8*\n store i8 0, i8* %34, align 1\n br label LBL_11\n LBL_11:\n %35 = call i64 @FUNC(i64* nonnull %sv_2)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %1, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.01013.reload, { 1, 2, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %2, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %sv_0.01013.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_9, { 2, 1, 0 }\n uselistorder label LBL_8, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_calloc_12-bad", "fun_name": "CWE690_NULL_Deref_From_Return__int64_t_calloc_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 8)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %5 = icmp eq i64* %0, null\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n store i64 5, i64* %0, align 8\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.2.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n store i32 -1, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_11, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_11\n LBL_6:\n store i32 -1, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_11, label LBL_7\n LBL_7:\n %23 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %24 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %25 = call i16 @htons(i16 27015)\n %26 = bitcast i64* %sv_2 to %sockaddr*\n %27 = call i32 @connect(i32 %5, %sockaddr* nonnull %26, i32 16)\n %28 = icmp eq i32 %27, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n %29 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %30 = add i32 %29, 1\n %31 = icmp ult i32 %30, 2\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %31, label LBL_10, label LBL_9\n LBL_9:\n %32 = sext i32 %29 to i64\n %33 = add i64 %0, -22\n %34 = add i64 %33, %32\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n %36 = bitcast i64* %sv_1 to i8*\n %37 = call i32 @atoi(i8* nonnull %36)\n store i32 %37, i32* %sv_0.1.ph.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %38 = call i32 @close(i32 %5)\n store i32 %sv_0.1.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.2.reload = load i32, i32* %sv_0.2.reg2mem\n %39 = call i64 @FUNC()\n %40 = trunc i64 %39 to i32\n %41 = icmp eq i32 %40, 0\n %42 = icmp eq i32 %sv_0.2.reload, 0\n br i1 %41, label LBL_15, label LBL_12\n LBL_12:\n br i1 %42, label LBL_14, label LBL_13\n LBL_13:\n %43 = urem i32 100, %sv_0.2.reload\n %44 = zext i32 %43 to i64\n %45 = call i64 @FUNC(i64 %44)\n br label LBL_18\n LBL_14:\n %46 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_18\n LBL_15:\n br i1 %42, label LBL_17, label LBL_16\n LBL_16:\n %47 = urem i32 100, %sv_0.2.reload\n %48 = zext i32 %47 to i64\n %49 = call i64 @FUNC(i64 %48)\n br label LBL_18\n LBL_17:\n %50 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_18\n LBL_18:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %1, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_20, label LBL_19\n LBL_19:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_20\n LBL_20:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %42, { 1, 0 }\n uselistorder i32 %sv_0.2.reload, { 1, 0, 2 }\n uselistorder i32 %29, { 1, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i1 %6, { 1, 0 }\n uselistorder i32 %5, { 5, 3, 4, 2, 0, 1, 6 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 0, 4, 1, 2, 5, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.2.reg2mem, { 0, 4, 1, 3, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 2, 6, 0, 5, 4, 8, 1, 7 }\n uselistorder label LBL_11, { 2, 0, 3, 1 }\n uselistorder label LBL_10, { 1, 2, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_pointer_05-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_pointer_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = inttoptr i64 %1 to i64*\n %5 = load i64, i64* %4, align 8\n %6 = call i128 @FUNC(i64 %5)\n %7 = call i64 @FUNC()\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_divide_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.18.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.18.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.18.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.18.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n %28 = icmp eq i32 %sv_0.0.ph.reload, 0\n store i32 %sv_0.0.ph.reload, i32* %sv_0.18.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n %sv_0.18.reload = load i32, i32* %sv_0.18.reg2mem\n %29 = udiv i32 100, %sv_0.18.reload\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n br label LBL_11\n LBL_10:\n %32 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.18.reg2mem, { 0, 4, 2, 1, 3 }\n uselistorder label LBL_9, { 3, 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_connect_socket_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n br label LBL_7\n LBL_2:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_16, label LBL_3\n LBL_3:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_16, label LBL_5\n LBL_4:\n %12 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n br label LBL_7\n LBL_5:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n %21 = icmp ugt i32 %19, 9\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n %22 = sext i32 %19 to i64\n %23 = mul i64 %22, 4\n %24 = add i64 %13, -64\n %25 = add i64 %24, %23\n %26 = inttoptr i64 %25 to i32*\n %27 = load i32, i32* %26, align 4\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_8\n LBL_7:\n %30 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_8\n LBL_8:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i64 %13, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 4, 0, 2, 5, 3, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_7, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_square_14-bad", "fun_name": "CWE190_Integer_Overflow__int_listen_socket_square_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = mul i32 %sv_0.1.reload, %sv_0.1.reload\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_negative_11-bad", "fun_name": "CWE124_Buffer_Underwrite__CWE839_negative_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = trunc i64 %1 to i32\n %6 = icmp eq i32 %5, 0\n %spec.select = select i1 %6, i64 -4, i64 -20\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = add i64 %7, -48\n %9 = add i64 %spec.select, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_postinc_10-bad", "fun_name": "CWE190_Integer_Overflow__short_rand_postinc_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = mul i32 %4, 32768\n %8 = xor i32 %5, %7\n %9 = urem i32 %2, 2\n %10 = icmp eq i32 %9, 0\n %11 = sext i1 %10 to i32\n %storemerge.in = xor i32 %8, %11\n %sext = mul i32 %storemerge.in, 65536\n %phitmp = add i32 %sext, 65536\n %phitmp3 = ashr exact i32 %phitmp, 16\n %phitmp4 = zext i32 %phitmp3 to i64\n %12 = call i64 @FUNC(i64 %phitmp4)\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32 65536, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_rand_14-bad", "fun_name": "CWE124_Buffer_Underwrite__CWE839_rand_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n %14 = sext i1 %6 to i32\n %storemerge1.in = xor i32 %13, %14\n store i32 %storemerge1.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %15 = load i32, i32* @gv_0, align 4\n %16 = icmp eq i32 %15, 5\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %18 = icmp sgt i32 %sv_0.0.reload, 9\n br i1 %18, label LBL_6, label LBL_4\n LBL_4:\n %19 = ptrtoint i64* %sv_1 to i64\n %20 = sext i32 %sv_0.0.reload to i64\n %21 = mul i64 %20, 4\n %22 = add i64 %19, -64\n %23 = add i64 %21, %22\n %24 = inttoptr i64 %23 to i32*\n store i32 1, i32* %24, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %25 = mul i64 %indvars.iv.reload, 4\n %26 = add i64 %25, %22\n %27 = inttoptr i64 %26 to i32*\n %28 = load i32, i32* %27, align 4\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_5\n LBL_6:\n %31 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_snprintf_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = sext i32 %2 to i64\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n store i64 0, i64* %sv_0, align 8\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %11, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %13 = ptrtoint i64* %sv_0 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_calloc_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 8)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i64* %0, null\n %or.cond = or i1 %4, %3\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_fprintf_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %8 = sub i32 100, %2\n %9 = add i64 %3, %6\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %8, %_IO_FILE* %7)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = add i64 %6, -1\n %16 = sext i32 %13 to i64\n %17 = add i64 %15, %16\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = load %_IO_FILE*, %_IO_FILE** @gv_2, align 8\n %24 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_0)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2, 3 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_fwrite_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.in.reg2mem = alloca i32\n %storemerge34.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %5 = icmp eq %_IO_FILE* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n store i64 0, i64* %storemerge5.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %7 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %4)\n %8 = icmp eq i32 %7, 50\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 1)\n unreachable\n LBL_5:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %9 = add nuw nsw i64 %storemerge5.reload, 1\n %10 = icmp ult i64 %9, 20\n store i64 %9, i64* %storemerge5.reg2mem\n br i1 %10, label LBL_3, label LBL_6\n LBL_6:\n %11 = call i32 @fclose(%_IO_FILE* nonnull %4)\n store i32 %11, i32* %rax.0.in.reg2mem\n br label LBL_13\n LBL_7:\n store i64 0, i64* %storemerge34.reg2mem\n br i1 %6, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 1)\n unreachable\n LBL_9:\n %12 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %4)\n %13 = icmp eq i32 %12, 50\n br i1 %13, label LBL_11, label LBL_10\n LBL_10:\n call void @exit(i32 1)\n unreachable\n LBL_11:\n %storemerge34.reload = load i64, i64* %storemerge34.reg2mem\n %14 = add nuw nsw i64 %storemerge34.reload, 1\n %15 = icmp ult i64 %14, 20\n store i64 %14, i64* %storemerge34.reg2mem\n br i1 %15, label LBL_9, label LBL_12\n LBL_12:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %4)\n store i32 %16, i32* %rax.0.in.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.in.reload = load i32, i32* %rax.0.in.reg2mem\n %rax.0 = sext i32 %rax.0.in.reload to i64\n ret i64 %rax.0\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder %_IO_FILE* %4, { 3, 2, 1, 0, 4 }\n uselistorder i64* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge34.reg2mem, { 2, 0, 1 }\n uselistorder i32* %rax.0.in.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 3, 2, 1, 0, 4 }\n uselistorder i32 50, { 0, 2, 1, 3, 4, 6, 5, 7 }\n uselistorder void (i32)* @exit, { 7, 6, 5, 4, 3, 2, 1, 0, 8 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 0, 2, 1, 3 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_12-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 20, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 26, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @strtoul(i8* nonnull %5, i8** null, i32 0)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n %13 = icmp ult i32 %sv_0.0.reload, 6\n br i1 %12, label LBL_10, label LBL_5\n LBL_5:\n br i1 %13, label LBL_9, label LBL_6\n LBL_6:\n %14 = call i64* @malloc(i32 %sv_0.0.reload)\n %15 = icmp eq i64* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %17 = ptrtoint i64* %14 to i64\n %18 = bitcast i64* %14 to i32*\n store i32 1819043176, i32* %18, align 4\n %19 = add i64 %17, 4\n %20 = inttoptr i64 %19 to i16*\n store i16 111, i16* %20, align 2\n %21 = call i64 @FUNC(i64 %17)\n call void @free(i64* %14)\n br label LBL_15\n LBL_9:\n %22 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_15\n LBL_10:\n %23 = icmp ult i32 %sv_0.0.reload, 100\n %or.cond = icmp eq i1 %13, %23\n br i1 %or.cond, label LBL_14, label LBL_11\n LBL_11:\n %24 = call i64* @malloc(i32 %sv_0.0.reload)\n %25 = icmp eq i64* %24, null\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_13, label LBL_12\n LBL_12:\n call void @exit(i32 -1)\n unreachable\n LBL_13:\n %27 = ptrtoint i64* %24 to i64\n %28 = bitcast i64* %24 to i32*\n store i32 1819043176, i32* %28, align 4\n %29 = add i64 %27, 4\n %30 = inttoptr i64 %29 to i16*\n store i16 111, i16* %30, align 2\n %31 = call i64 @FUNC(i64 %27)\n call void @free(i64* %24)\n br label LBL_15\n LBL_14:\n %32 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_3 to i64))\n br label LBL_15\n LBL_15:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %24, { 0, 1, 3, 2 }\n uselistorder i64* %14, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.0.reload, { 1, 2, 0, 3 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_calloc_06-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @calloc(i32 100, i32 1)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n store i64 7453010373643542593, i64* %0, align 8\n %4 = add i64 %3, 8\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cat_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strcat(i8* %4, i8* nonnull %6)\n %8 = ptrtoint i64* %1 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %12, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n br label LBL_11\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i64 0, i64* %sv_2, align 8\n %25 = icmp ugt i32 %sv_0.0.ph.reload, 9\n br i1 %25, label LBL_11, label LBL_9\n LBL_9:\n %26 = sext i32 %sv_0.0.ph.reload to i64\n %27 = mul i64 %26, 4\n %28 = add i64 %12, -64\n %29 = add i64 %27, %28\n %30 = inttoptr i64 %29 to i32*\n store i32 1, i32* %30, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %31 = mul i64 %indvars.iv.reload, 4\n %32 = add i64 %31, %28\n %33 = inttoptr i64 %32 to i32*\n %34 = load i32, i32* %33, align 4\n %35 = zext i32 %34 to i64\n %36 = call i64 @FUNC(i64 %35)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_10\n LBL_11:\n %37 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_12\n LBL_12:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 3, 0, 1, 4, 2 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 2, 3, 4, 5, 1, 6, 7, 8, 9 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncat_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncat(i8* %4, i8* nonnull %6, i32 100)\n %8 = ptrtoint i64* %1 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i32 100, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_connect_socket_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv14.reg2mem = alloca i64\n %sv_0.2.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n store i32 -1, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_11, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_11\n LBL_6:\n store i32 -1, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_11, label LBL_7\n LBL_7:\n %23 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %24 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %25 = call i16 @htons(i16 27015)\n %26 = bitcast i64* %sv_2 to %sockaddr*\n %27 = call i32 @connect(i32 %5, %sockaddr* nonnull %26, i32 16)\n %28 = icmp eq i32 %27, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n %29 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %30 = add i32 %29, 1\n %31 = icmp ult i32 %30, 2\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %31, label LBL_10, label LBL_9\n LBL_9:\n %32 = sext i32 %29 to i64\n %33 = add i64 %0, -22\n %34 = add i64 %33, %32\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n %36 = bitcast i64* %sv_1 to i8*\n %37 = call i32 @atoi(i8* nonnull %36)\n store i32 %37, i32* %sv_0.1.ph.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %38 = call i32 @close(i32 %5)\n store i32 %sv_0.1.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.2.reload = load i32, i32* %sv_0.2.reg2mem\n %39 = call i64 @FUNC()\n %40 = trunc i64 %39 to i32\n %41 = icmp eq i32 %40, 0\n store i64 0, i64* %sv_2, align 8\n %42 = icmp ugt i32 %sv_0.2.reload, 9\n br i1 %41, label LBL_16, label LBL_12\n LBL_12:\n br i1 %42, label LBL_15, label LBL_13\n LBL_13:\n %43 = sext i32 %sv_0.2.reload to i64\n %44 = mul i64 %43, 4\n %45 = add i64 %0, -64\n %46 = add i64 %44, %45\n %47 = inttoptr i64 %46 to i32*\n store i32 1, i32* %47, align 4\n store i64 0, i64* %indvars.iv14.reg2mem\n br label LBL_14\n LBL_14:\n %indvars.iv14.reload = load i64, i64* %indvars.iv14.reg2mem\n %48 = mul i64 %indvars.iv14.reload, 4\n %49 = add i64 %48, %45\n %50 = inttoptr i64 %49 to i32*\n %51 = load i32, i32* %50, align 4\n %52 = zext i32 %51 to i64\n %53 = call i64 @FUNC(i64 %52)\n %indvars.iv.next15 = add nuw nsw i64 %indvars.iv14.reload, 1\n %exitcond16 = icmp eq i64 %indvars.iv.next15, 10\n store i64 %indvars.iv.next15, i64* %indvars.iv14.reg2mem\n br i1 %exitcond16, label LBL_20, label LBL_14\n LBL_15:\n %54 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_20\n LBL_16:\n br i1 %42, label LBL_19, label LBL_17\n LBL_17:\n %55 = sext i32 %sv_0.2.reload to i64\n %56 = mul i64 %55, 4\n %57 = add i64 %0, -64\n %58 = add i64 %56, %57\n %59 = inttoptr i64 %58 to i32*\n store i32 1, i32* %59, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_18\n LBL_18:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %60 = mul i64 %indvars.iv.reload, 4\n %61 = add i64 %60, %57\n %62 = inttoptr i64 %61 to i32*\n %63 = load i32, i32* %62, align 4\n %64 = zext i32 %63 to i64\n %65 = call i64 @FUNC(i64 %64)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_20, label LBL_18\n LBL_19:\n %66 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_20\n LBL_20:\n %67 = call i64 @FUNC(i64 40)\n %68 = icmp eq i64 %1, %67\n store i64 0, i64* %rax.0.reg2mem\n br i1 %68, label LBL_22, label LBL_21\n LBL_21:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_22\n LBL_22:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.2.reload, { 1, 0, 2 }\n uselistorder i32 %29, { 1, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i1 %6, { 1, 0 }\n uselistorder i32 %5, { 5, 3, 4, 2, 0, 1, 6 }\n uselistorder i64 %0, { 3, 2, 1, 0 }\n uselistorder i64* %sv_2, { 4, 0, 5, 1, 2, 6, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.2.reg2mem, { 0, 4, 1, 3, 2 }\n uselistorder i64* %indvars.iv14.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 2, 6, 0, 5, 4, 8, 1, 7 }\n uselistorder label LBL_20, { 2, 1, 3, 0 }\n uselistorder label LBL_11, { 2, 0, 3, 1 }\n uselistorder label LBL_10, { 1, 2, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_malloc_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n store i64 7453010373643542593, i64* %3, align 8\n %7 = add i64 %6, 8\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC(i64 %6)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %10 = icmp eq i32 %.reload, 5\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %11, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64** %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_postdec_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 8420 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* %sv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = add i32 %.pr, -1\n store i32 %7, i32* %sv_0, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_4\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %.pr, { 1, 0 }\n uselistorder i32* %sv_0, { 2, 0, 3, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_multiply_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %5 = icmp slt i32 %4, 1\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %6 = icmp sgt i32 %4, 1073741822\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = mul i64 %3, 2\n %8 = and i64 %7, 4294967294\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_4\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncat_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = ptrtoint i64* %1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n %8 = call i64* @memset(i64* %1, i32 65, i32 49)\n store i8 0, i8* %7, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strncat(i8* nonnull %10, i8* %4, i32 %9)\n %12 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 2, 1, 0, 4, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_long_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i64*\n store i64 5, i64* %6, align 8\n %7 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %7, 100\n store i64 %7, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %8 = load i64, i64* %0, align 8\n %9 = call i64 @FUNC(i64 %8)\n ret i64 %9\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 1, 2, 3, 0, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 3, 2, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2, 3, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_loop_05-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_loop_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -97\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 99)\n %8 = add i64 %5, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 0\n %12 = add i64 %5, -8\n %spec.select = select i1 %11, i64 %1, i64 %12\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %15 = add i64 %storemerge1.reload, %spec.select\n %16 = inttoptr i64 %15 to i8*\n %17 = load i8, i8* %16, align 1\n %18 = add i64 %storemerge1.reload, %14\n %19 = inttoptr i64 %18 to i8*\n store i8 %17, i8* %19, align 1\n %20 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %20, 100\n store i64 %20, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %21 = call i64 @FUNC(i64* nonnull %sv_0)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %3, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_11-bad", "fun_name": "CWE191_Integer_Underflow__char_fscanf_multiply_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_5, label LBL_3\n LBL_3:\n %9 = load i8, i8* %sv_0, align 1\n %10 = icmp slt i8 %9, 0\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = mul i8 %9, 2\n %13 = sext i8 %12 to i64\n %14 = and i64 %13, 4294967294\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__empty_if_17-bad", "fun_name": "CWE398_Poor_Code_Quality__empty_if_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = srem i32 %0, 3\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n ret i64 %4\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_predec_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp eq i16 %3, -32768\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i16 %3, -1\n store i16 %5, i16* %sv_0, align 2\n %6 = sext i16 %5 to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0, 3 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0), i32** %sv_0, align 8\n %2 = call i32 @wcslen(i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0))\n %3 = sext i32 %2 to i64\n %4 = mul i64 %3, 4\n %5 = add nsw i64 %4, 27\n %6 = udiv i64 %5, 16\n %7 = mul i64 %6, 16\n %8 = and i64 %7, -4096\n %9 = and i64 %7, 4080\n %10 = add i64 %0, 15\n %11 = sub i64 %10, %9\n %12 = sub i64 %11, %8\n %13 = and i64 %12, -16\n %14 = load i32*, i32** %sv_0, align 8\n %15 = inttoptr i64 %13 to i32*\n %16 = call i32* @wcscpy(i32* %15, i32* %14)\n %17 = call i64 @FUNC(i64 %13)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64 %7, { 1, 0 }\n uselistorder i32** %sv_0, { 2, 0, 1 }\n uselistorder i64 (i64)* @printWLine, { 1, 0 }\n uselistorder i32* (i32*, i32*)* @wcscpy, { 1, 0, 2 }\n uselistorder i32 (i32*)* @wcslen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_postdec_12-bad", "fun_name": "CWE191_Integer_Underflow__short_rand_postdec_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 -2, i32* %storemerge4.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %12 = ashr exact i32 %sext, 16\n store i32 %12, i32* %storemerge4.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n %16 = mul i32 %storemerge4.reload, 65536\n %sext2 = add i32 %16, -65536\n %17 = ashr exact i32 %sext2, 16\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %20 = trunc i32 %storemerge4.reload to i16\n %21 = icmp eq i16 %20, -32768\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %22 = mul i32 %storemerge4.reload, 65536\n %sext3 = add i32 %22, -65536\n %23 = ashr exact i32 %sext3, 16\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n store i64 %25, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %26 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %26, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge4.reload, { 2, 0, 1 }\n uselistorder i32* %storemerge4.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE367_TOC_TOU__stat_13-bad", "fun_name": "CWE367_TOC_TOU__stat_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8, align 1\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8364 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n store i8 0, i8* %sv_1, align 1\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i8* @fgets(i8* nonnull %sv_1, i32 100, %_IO_FILE* %4)\n %6 = icmp eq i8* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %sv_1, align 1\n br label LBL_5\n LBL_3:\n %.pr = load i8, i8* %sv_1, align 1\n %9 = icmp eq i8 %.pr, 0\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = ptrtoint i64* %sv_2 to i64\n %11 = call i32 @strlen(i8* nonnull %sv_1)\n %12 = sext i32 %11 to i64\n %13 = add i64 %10, -113\n %14 = add i64 %13, %12\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n br label LBL_5\n LBL_5:\n %16 = bitcast i64* %sv_0 to %stat*\n %17 = call i32 @stat(i8* nonnull %sv_1, %stat* nonnull %16)\n %18 = icmp eq i32 %17, -1\n %19 = icmp eq i1 %18, false\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 1)\n unreachable\n LBL_7:\n %20 = call i32 (i8*, i32, ...) @open(i8* nonnull %sv_1, i32 2)\n %21 = icmp eq i32 %20, -1\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 1)\n unreachable\n LBL_9:\n %23 = call i32 @write(i32 %20, i64* bitcast ([12 x i8]* @gv_2 to i64*), i32 11)\n %24 = icmp eq i32 %23, -1\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_11, label LBL_10\n LBL_10:\n call void @exit(i32 1)\n unreachable\n LBL_11:\n %26 = call i32 @close(i32 %20)\n br label LBL_12\n LBL_12:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_1, { 6, 5, 4, 0, 2, 3, 1 }\n uselistorder void (i32)* @exit, { 2, 1, 0, 3 }\n uselistorder i8 0, { 3, 4, 0, 1, 5, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_malloc_07-bad", "fun_name": "CWE401_Memory_Leak__int_malloc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i32*\n store i32 5, i32* %7, align 4\n %8 = call i64 @FUNC(i64 5)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n uselistorder i32 5, { 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %3 = ptrtoint i64* %2 to i64\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %0\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %13 = call i64* @memcpy(i64* %2, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %14 = call i64 @FUNC(i64 %3)\n call void @free(i64* %2)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_pointer_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 4)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = bitcast i64* %2 to i32*\n store i32 5, i32* %5, align 4\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n %7 = call i64 @FUNC(i64 5)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 0, 3, 2, 1, 4 }\n uselistorder i64* (i32)* @malloc, { 0, 3, 2, 1, 4 }\n uselistorder i32* @gv_0, { 0, 3, 2, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE123_Write_What_Where_Condition__fgets_01-bad", "fun_name": "CWE123_Write_What_Where_Condition__fgets_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n store i64 %1, i64* %sv_1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 %2, i64* %sv_0, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 16, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_2:\n store i64 %1, i64* @gv_2, align 8\n %9 = load i64, i64* %sv_1, align 8\n store i64 %9, i64* @gv_3, align 8\n store i64 %9, i64* %sv_0, align 8\n %10 = add i64 %9, 8\n %11 = inttoptr i64 %10 to i64*\n store i64 %1, i64* %11, align 8\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0, 2, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_file_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_1, align 8\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 5\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = call i32 @strlen(i8* nonnull %8)\n %13 = sext i32 %12 to i64\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i32*\n store i32 1852400175, i32* %16, align 4\n %17 = add i64 %15, 4\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n br label LBL_2\n LBL_2:\n %19 = call i32 @putenv(i8* nonnull %8)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %2, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %15, { 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_loop_17-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_loop_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = ptrtoint i64* %1 to i64\n %6 = add i64 %5, 99\n %7 = inttoptr i64 %6 to i8*\n %8 = call i64* @memset(i64* %1, i32 65, i32 99)\n store i8 0, i8* %7, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = sext i32 %9 to i64\n %12 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %13 = add i64 %storemerge3.reload, %5\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge3.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw i64 %storemerge3.reload, 1\n %19 = icmp ult i64 %18, %11\n store i64 %18, i64* %storemerge3.reg2mem\n br i1 %19, label LBL_4, label LBL_5\n LBL_5:\n %20 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i64 %5, { 1, 0, 2 }\n uselistorder i64* %1, { 2, 1, 0, 4, 3 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_malloc_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n store i64 7453010373643542593, i64* %1, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE511_Logic_Time_Bomb__time_08-bad", "fun_name": "CWE511_Logic_Time_Bomb__time_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i32*\n %5 = call i32 @time(i32* nonnull %4)\n %6 = load i64, i64* %sv_0, align 8\n %7 = icmp slt i64 %6, 1199163601\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @unlink(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_postdec_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i16, i16* %sv_0, align 2\n %10 = icmp eq i16 %9, -32768\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = add i16 %9, -1\n store i16 %11, i16* %sv_0, align 2\n %12 = sext i16 %11 to i64\n %13 = and i64 %12, 4294967295\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_6\n LBL_5:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__double_pointer_alloca_use_12-bad", "fun_name": "CWE758_Undefined_Behavior__double_pointer_alloca_use_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = add i64 %0, -1\n %6 = and i64 %5, -16\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %7 = inttoptr i64 %6 to i64*\n %8 = load i64, i64* %7, align 16\n %9 = inttoptr i64 %8 to i64*\n %10 = load i64, i64* %9, align 8\n %11 = call i128 @FUNC(i64 %10)\n %12 = call i64 @FUNC()\n br label LBL_5\n LBL_2:\n store i64 %6, i64* %sv_0, align 8\n %13 = call i64* @malloc(i32 8)\n %14 = icmp eq i64* %13, null\n %15 = icmp eq i1 %14, false\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %16 = ptrtoint i64* %13 to i64\n %17 = call i128 @FUNC(i64 4617315517961601024)\n %18 = call i64 @__asm_movsd.1(i128 %17)\n store i64 %18, i64* %13, align 8\n %19 = load i64, i64* %sv_0, align 8\n %20 = inttoptr i64 %19 to i64*\n store i64 %16, i64* %20, align 8\n %21 = load i64, i64* %sv_0, align 8\n %22 = inttoptr i64 %21 to i64*\n %23 = load i64, i64* %22, align 8\n %24 = inttoptr i64 %23 to i64*\n %25 = load i64, i64* %24, align 8\n %26 = call i128 @FUNC(i64 %25)\n %27 = call i64 @FUNC()\n br label LBL_5\n LBL_5:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %1, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %13, { 0, 2, 1 }\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64 ()* @printDoubleLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__rand_06-bad", "fun_name": "CWE617_Reachable_Assertion__rand_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge.in = xor i32 %9, %10\n %storemerge = zext i32 %storemerge.in to i64\n %11 = icmp sgt i32 %storemerge.in, 5\n store i64 %storemerge, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([126 x i8], [126 x i8]* @gv_1, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @gv_2, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cat_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strcat(i8* %sv_0.0.reload, i8* nonnull %9)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %13)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_memcpy_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 0\n %5 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %4, i64 %1, i64 %5\n %6 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 100)\n %7 = inttoptr i64 %spec.select to i64*\n %8 = call i64* @memcpy(i64* %7, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %9 = load i64, i64* %7, align 8\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %2, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memmove_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = add i64 %0, -161\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = inttoptr i64 %5 to i64*\n %11 = call i64* @memset(i64* %10, i32 65, i32 99)\n %12 = add i64 %5, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i32 @strlen(i8* nonnull %15)\n %17 = call i64* @memmove(i64* nonnull %sv_0, i64* %10, i32 %16)\n %18 = call i64 @FUNC(i64* nonnull %sv_0)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64 %3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_memcpy_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n store i32 99, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = ptrtoint i64* %sv_3 to i64\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n store i64 0, i64* %sv_2, align 8\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %6 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.0.reload)\n %7 = sext i32 %sv_0.0.reload to i64\n %8 = add i64 %4, -112\n %9 = add i64 %8, %7\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 0, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_fprintf_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_0 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %4)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %26 = load i32, i32* @gv_0, align 4\n %27 = icmp eq i32 %26, 5\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_9, label LBL_8\n LBL_8:\n %29 = load %_IO_FILE*, %_IO_FILE** @gv_3, align 8\n %30 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_9\n LBL_9:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 1, 0 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 0 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n %6 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %8 = inttoptr i64 %spec.select to i64*\n %9 = call i64* @memmove(i64* nonnull %sv_0, i64* %8, i32 100)\n %10 = ptrtoint i64* %sv_0 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %2, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 0, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_loop_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = add i64 %1, -816\n %3 = add i64 %1, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %4 = mul i64 %storemerge13.reload, 8\n %5 = add i64 %4, %2\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 8\n %7 = add i64 %3, %4\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %9 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %9, 100\n store i64 %9, i64* %storemerge13.reg2mem\n br i1 %exitcond4, label LBL_2, label LBL_1\n LBL_2:\n %10 = ptrtoint i64* %sv_0 to i64\n %11 = add i64 %10, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %12 = and i64 %11, -16\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %13 = mul i64 %storemerge2.reload, 8\n %14 = add i64 %13, %12\n %15 = add i64 %13, %2\n %16 = inttoptr i64 %15 to i64*\n %17 = load i64, i64* %16, align 8\n %18 = inttoptr i64 %14 to i64*\n store i64 %17, i64* %18, align 8\n %19 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %19, 100\n store i64 %19, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %20 = call i64 @FUNC(i64 %12)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n uselistorder i64 100, { 1, 0, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %6 = ptrtoint i64* %sv_2 to i64\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memmove(i64* nonnull %sv_1, i64* %8, i32 100)\n %10 = ptrtoint i64* %sv_1 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* %sv_1, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = load i32, i32* @gv_0, align 4\n %36 = icmp eq i32 %35, 5\n %37 = icmp eq i1 %36, false\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n store i64 0, i64* %sv_0, align 8\n %38 = bitcast i64* %sv_0 to i8*\n %39 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %38, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_2)\n %40 = ptrtoint i64* %sv_0 to i64\n %41 = call i64 @FUNC(i64 %40)\n br label LBL_14\n LBL_14:\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_sleep_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = icmp slt i32 %sv_0.1.reload, 1\n %32 = icmp sgt i32 %sv_0.1.reload, ptrtoint (i1* @gv_1 to i32)\n %or.cond4 = or i1 %31, %32\n br i1 %or.cond4, label LBL_12, label LBL_11\n LBL_11:\n %33 = call i32 @usleep(i32 %sv_0.1.reload)\n %34 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_2 to i64))\n br label LBL_13\n LBL_12:\n %35 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_3 to i64))\n br label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %phitmp = icmp eq i32 %.pre, 5\n %phitmp2 = icmp eq i1 %phitmp, false\n br i1 %phitmp2, label LBL_5, label LBL_4\n LBL_2:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -48\n %6 = add i64 %4, -20\n %7 = inttoptr i64 %6 to i32*\n store i32 1, i32* %7, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %5, %8\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_3\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_2 to i64))\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__connect_socket_05-bad", "fun_name": "CWE617_Reachable_Assertion__connect_socket_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_1 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_0, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n br i1 %13, label LBL_4, label LBL_5\n LBL_4:\n %14 = call i32 @close(i32 %3)\n br label LBL_6\n LBL_5:\n %15 = ptrtoint i64* %sv_2 to i64\n %16 = sext i32 %11 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_0 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %22 = call i32 @close(i32 %3)\n %23 = icmp sgt i32 %21, 5\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @gv_3, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @gv_4, i64 0, i64 0))\n br label LBL_7\n LBL_7:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder label LBL_6, { 3, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = bitcast i64* %0 to i32*\n store i32 0, i32* %4, align 4\n %5 = add i64 %3, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %7 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__listen_socket_malloc_14-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__listen_socket_malloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.113.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.113.reg2mem\n br i1 %3, label LBL_10, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.113.reg2mem\n br i1 %5, label LBL_10, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_8, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_8, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 7, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_9, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -16\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %.off = add i32 %24, 32768\n %25 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %25, label LBL_7, label LBL_9\n LBL_7:\n %sext4 = mul i32 %24, 65536\n %26 = ashr exact i32 %sext4, 16\n store i32 %26, i32* %sv_0.0.ph.reg2mem\n br label LBL_9\n LBL_8:\n %27 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.113.reg2mem\n br label LBL_10\n LBL_9:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %28 = call i32 @close(i32 %4)\n %29 = call i32 @close(i32 %13)\n %30 = trunc i32 %sv_0.0.ph.reload to i16\n %31 = icmp sgt i16 %30, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.113.reg2mem\n br i1 %31, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.113.reload = load i32, i32* %sv_0.113.reg2mem\n %32 = call i64* @malloc(i32 %sv_0.113.reload)\n %33 = icmp eq i64* %32, null\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_12, label LBL_11\n LBL_11:\n call void @exit(i32 -1)\n unreachable\n LBL_12:\n %35 = ptrtoint i64* %32 to i64\n %36 = add nsw i32 %sv_0.113.reload, -1\n %37 = call i64* @memset(i64* %32, i32 65, i32 %36)\n %38 = zext i32 %sv_0.113.reload to i64\n %sext3 = mul i64 %38, 281474976710656\n %39 = ashr exact i64 %sext3, 48\n %40 = add i64 %35, -1\n %41 = add i64 %40, %39\n %42 = inttoptr i64 %41 to i8*\n store i8 0, i8* %42, align 1\n %43 = call i64 @FUNC(i64 %35)\n call void @free(i64* %32)\n br label LBL_13\n LBL_13:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %35, { 1, 0 }\n uselistorder i64* %32, { 0, 1, 3, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %sv_0.113.reg2mem, { 0, 4, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 6, 0, 2, 3, 4, 5 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_10, { 3, 1, 0, 2 }\n uselistorder label LBL_9, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_fscanf_to_short_05-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_fscanf_to_short_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 4294967295, i64* %.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %phitmp = mul i32 %.pre, 65536\n %phitmp1 = ashr exact i32 %phitmp, 16\n %phitmp2 = zext i32 %phitmp1 to i64\n store i64 %phitmp2, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %5 = call i64 @FUNC(i64 %.reload)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -161\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_1, i32 100)\n %11 = add i64 %sv_0.0.reload, 99\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_square_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.071013.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.071013.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.071013.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.0.off = add i32 %sv_0.0.ph.reload, 46339\n %25 = icmp ugt i32 %sv_0.0.off, 92678\n store i32 %sv_0.0.ph.reload, i32* %sv_0.071013.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.071013.reload = load i32, i32* %sv_0.071013.reg2mem\n %26 = mul i32 %sv_0.071013.reload, %sv_0.071013.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.071013.reload, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.071013.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_loop_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n %5 = call i64 @FUNC()\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 0, i64* %sv_0, align 8\n %10 = call i32 @strlen(i8* %4)\n store i64 0, i64* %sv_1, align 8\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_3, label LBL_1\n LBL_1:\n %12 = sext i32 %10 to i64\n %13 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %14 = add i64 %storemerge2.reload, %3\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = add i64 %storemerge2.reload, %13\n %18 = inttoptr i64 %17 to i8*\n store i8 %16, i8* %18, align 1\n %19 = load i64, i64* %sv_1, align 8\n %20 = add i64 %19, 1\n store i64 %20, i64* %sv_1, align 8\n %21 = icmp ult i64 %20, %12\n store i64 %20, i64* %storemerge2.reg2mem\n br i1 %21, label LBL_2, label LBL_3\n LBL_3:\n %22 = call i64 @FUNC(i64 %3)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %1, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %20, { 0, 2, 1 }\n uselistorder i64 %storemerge2.reload, { 1, 0 }\n uselistorder i32 %10, { 1, 0 }\n uselistorder i64 %3, { 1, 0, 2, 3, 4 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_12-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv12.reg2mem = alloca i64\n %indvars.iv15.reg2mem = alloca i64\n %indvars.iv18.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 7, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n %26 = call i64* @malloc(i32 40)\n %27 = ptrtoint i64* %26 to i64\n %28 = icmp eq i64* %26, null\n %29 = icmp eq i1 %28, false\n br i1 %25, label LBL_15, label LBL_7\n LBL_7:\n store i64 0, i64* %indvars.iv18.reg2mem\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 -1)\n unreachable\n LBL_9:\n %indvars.iv18.reload = load i64, i64* %indvars.iv18.reg2mem\n %30 = mul i64 %indvars.iv18.reload, 4\n %31 = add i64 %30, %27\n %32 = inttoptr i64 %31 to i32*\n store i32 0, i32* %32, align 4\n %indvars.iv.next19 = add nuw nsw i64 %indvars.iv18.reload, 1\n %exitcond20 = icmp eq i64 %indvars.iv.next19, 10\n store i64 %indvars.iv.next19, i64* %indvars.iv18.reg2mem\n br i1 %exitcond20, label LBL_10, label LBL_9\n LBL_10:\n %33 = icmp slt i32 %sv_0.1.reload, 0\n br i1 %33, label LBL_13, label LBL_11\n LBL_11:\n %34 = sext i32 %sv_0.1.reload to i64\n %35 = mul i64 %34, 4\n %36 = add i64 %35, %27\n %37 = inttoptr i64 %36 to i32*\n store i32 1, i32* %37, align 4\n store i64 0, i64* %indvars.iv15.reg2mem\n br label LBL_12\n LBL_12:\n %indvars.iv15.reload = load i64, i64* %indvars.iv15.reg2mem\n %38 = mul i64 %indvars.iv15.reload, 4\n %39 = add i64 %38, %27\n %40 = inttoptr i64 %39 to i32*\n %41 = load i32, i32* %40, align 4\n %42 = zext i32 %41 to i64\n %43 = call i64 @FUNC(i64 %42)\n %indvars.iv.next16 = add nuw nsw i64 %indvars.iv15.reload, 1\n %exitcond17 = icmp eq i64 %indvars.iv.next16, 10\n store i64 %indvars.iv.next16, i64* %indvars.iv15.reg2mem\n br i1 %exitcond17, label LBL_14, label LBL_12\n LBL_13:\n %44 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_1 to i64))\n br label LBL_14\n LBL_14:\n call void @free(i64* %26)\n br label LBL_23\n LBL_15:\n store i64 0, i64* %indvars.iv12.reg2mem\n br i1 %29, label LBL_17, label LBL_16\n LBL_16:\n call void @exit(i32 -1)\n unreachable\n LBL_17:\n %indvars.iv12.reload = load i64, i64* %indvars.iv12.reg2mem\n %45 = mul i64 %indvars.iv12.reload, 4\n %46 = add i64 %45, %27\n %47 = inttoptr i64 %46 to i32*\n store i32 0, i32* %47, align 4\n %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12.reload, 1\n %exitcond14 = icmp eq i64 %indvars.iv.next13, 10\n store i64 %indvars.iv.next13, i64* %indvars.iv12.reg2mem\n br i1 %exitcond14, label LBL_18, label LBL_17\n LBL_18:\n %48 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %48, label LBL_21, label LBL_19\n LBL_19:\n %49 = sext i32 %sv_0.1.reload to i64\n %50 = mul i64 %49, 4\n %51 = add i64 %50, %27\n %52 = inttoptr i64 %51 to i32*\n store i32 1, i32* %52, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_20\n LBL_20:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %53 = mul i64 %indvars.iv.reload, 4\n %54 = add i64 %53, %27\n %55 = inttoptr i64 %54 to i32*\n %56 = load i32, i32* %55, align 4\n %57 = zext i32 %56 to i64\n %58 = call i64 @FUNC(i64 %57)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_22, label LBL_20\n LBL_21:\n %59 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_22\n LBL_22:\n call void @free(i64* %26)\n br label LBL_23\n LBL_23:\n %60 = call i64 @FUNC(i64 40)\n %61 = icmp eq i64 %0, %60\n store i64 0, i64* %rax.0.reg2mem\n br i1 %61, label LBL_25, label LBL_24\n LBL_24:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_25\n LBL_25:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %29, { 1, 0 }\n uselistorder i64 %27, { 2, 0, 3, 4, 1, 5 }\n uselistorder i32 %sv_0.1.reload, { 0, 3, 1, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 1, 2 }\n uselistorder i64* %indvars.iv18.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv15.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv12.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 10, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 -1, { 5, 6, 2, 1, 3, 0, 4 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_22, { 1, 0 }\n uselistorder label LBL_17, { 1, 0 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_6, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cat_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = ptrtoint i64* %1 to i64\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i8* @strcat(i8* %4, i8* nonnull %7)\n %9 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_03-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = sext i32 %2 to i64\n %11 = ptrtoint i64* %sv_3 to i64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %27 = icmp eq i32 %26, 1\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_14, label LBL_9\n LBL_9:\n %29 = load i64, i64* %sv_1, align 8\n %30 = trunc i64 %29 to i32\n %31 = icmp sgt i32 %30, 9999\n br i1 %31, label LBL_14, label LBL_10\n LBL_10:\n %32 = and i64 %29, 4294967295\n %33 = icmp eq i64 %32, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %33, label LBL_13, label LBL_11\n LBL_11:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %34 = add i32 %storemerge5.reload, 1\n %35 = sext i32 %34 to i64\n %36 = icmp sgt i64 %32, %35\n store i32 %34, i32* %storemerge5.reg2mem\n br i1 %36, label LBL_11, label LBL_12\n LBL_12:\n %phitmp = zext i32 %34 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_13\n LBL_13:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %37 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_14\n LBL_14:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %34, { 1, 0, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_printf_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i64*\n store i64 32777976880262761, i64* %7, align 8\n %8 = call i32 (i8*, ...) @printf(i8* nonnull %4)\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2, 3 }\n uselistorder i32 5, { 1, 0, 2, 3, 4, 5, 6, 7 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE665_Improper_Initialization__char_cat_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i8* @strcat(i8* nonnull %1, i8* nonnull %3)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = call i64 @FUNC(i64 %5)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE688_Function_Call_With_Incorrect_Variable_or_Reference_as_Argument__basic_07-bad", "fun_name": "CWE688_Function_Call_With_Incorrect_Variable_or_Reference_as_Argument__basic_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* inttoptr (i64 5 to i8*))\n %6 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__freopen_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %1 = call %_IO_FILE* @freopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), %_IO_FILE* %0)\n %2 = call i32 @fclose(%_IO_FILE* %1)\n ret i64 0\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_sub_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = icmp eq i32 %sv_0.0.ph.reload, -2147483648\n br i1 %10, label LBL_7, label LBL_6\n LBL_6:\n %11 = add i32 %sv_0.0.ph.reload, -1\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_8\n LBL_7:\n %14 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_8, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_loop_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %8, 0\n store i64 %3, i64* %sv_0.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n %10 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %sv_0.0.reload\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge1.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %19 = call i64 @FUNC(i64 %12)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %1, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_07-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_loop_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i32*, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i32** %sv_1 to i64\n %5 = add i64 %4, -193\n %6 = and i64 %5, -16\n %7 = bitcast i32** %sv_1 to i64*\n store i64 %6, i64* %7, align 8\n br label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 50)\n %10 = add i64 %8, -416\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %11 = mul i64 %storemerge3.reload, 4\n %12 = load i32*, i32** %sv_1, align 8\n %13 = ptrtoint i32* %12 to i64\n %14 = add i64 %11, %13\n %15 = add i64 %10, %11\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = inttoptr i64 %14 to i32*\n store i32 %17, i32* %18, align 4\n %19 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %19, 100\n store i64 %19, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %20 = load i32*, i32** %sv_1, align 8\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_1, { 3, 2, 0, 1 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_add_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC(i64 3)\n %2 = call i64 @FUNC(i64 40)\n %3 = icmp eq i64 %0, %2\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_add_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.02.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i64 3, i64* %sv_0.02.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %3 = zext i32 %.pre to i64\n %4 = icmp eq i32 %.pre, 5\n %5 = icmp eq i1 %4, false\n store i64 1, i64* %sv_0.02.reg2mem\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.02.reload = load i64, i64* %sv_0.02.reg2mem\n %6 = call i64 @FUNC(i64 %sv_0.02.reload)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.02.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %2 = call i32 @close(i32 %1)\n %3 = call i64 @FUNC(i64 40)\n %4 = icmp eq i64 %0, %3\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_multiply_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %12 = ashr exact i32 %sext, 16\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32 %12, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %13 = zext i32 %.reload to i64\n %14 = icmp eq i32 %.reload, 5\n %15 = icmp eq i1 %14, false\n store i64 %13, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %16 = trunc i32 %sv_0.0.reload to i16\n %17 = icmp slt i16 %16, 1\n store i64 %13, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = icmp sgt i16 %16, ptrtoint (i1* @gv_1 to i16)\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n %sext2 = mul i32 %sv_0.0.reload, 131072\n %19 = ashr exact i32 %sext2, 16\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge23.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_4.preheader, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge23.reload = load i64, i64* %storemerge23.reg2mem\n %3 = add i64 %storemerge23.reload, %14\n %4 = inttoptr i64 %3 to i8*\n %5 = load i8, i8* %4, align 1\n %6 = icmp eq i8 %5, 83\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n br label LBL_6\n LBL_4:\n %9 = add nuw i64 %storemerge23.reload, 1\n %10 = call i32 @strlen(i8* %13)\n %11 = sext i32 %10 to i64\n %12 = icmp ult i64 %9, %11\n store i64 %9, i64* %storemerge23.reg2mem\n br i1 %12, label LBL_2, label LBL_6\n LBL_5:\n %13 = bitcast i64* %0 to i8*\n %14 = ptrtoint i64* %0 to i64\n store i64 8382078947037833542, i64* %0, align 8\n %15 = add i64 %14, 8\n %16 = inttoptr i64 %15 to i32*\n store i32 1735289202, i32* %16, align 4\n %17 = add i64 %14, 12\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = call i32 @strlen(i8* %13)\n %20 = icmp eq i32 %19, 0\n store i64 0, i64* %storemerge23.reg2mem\n br i1 %20, label LBL_6, label LBL_2\n LBL_6:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %14, { 2, 1, 0 }\n uselistorder i64* %0, { 0, 2, 1, 4, 3 }\n uselistorder i64* %storemerge23.reg2mem, { 1, 2, 0 }\n uselistorder label LBL_6, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_alloca_cpy_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -161\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %9)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_realloc_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 400)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_loop_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -49\n %5 = and i64 %4, -16\n %6 = add i64 %2, -161\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %5 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %5, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = inttoptr i64 %7 to i64*\n %13 = call i64* @memset(i64* %12, i32 65, i32 99)\n %14 = add i64 %7, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = load i32, i32* @gv_0, align 4\n %17 = icmp eq i32 %16, 5\n %18 = icmp eq i1 %17, false\n %spec.select = select i1 %18, i64 %1, i64 %7\n %19 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %20 = bitcast i64* %sv_0 to i8*\n %21 = call i32 @strlen(i8* nonnull %20)\n %22 = sext i32 %21 to i64\n %23 = icmp eq i32 %21, 0\n %.pre = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %23, label LBL_2, label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %24 = add i64 %storemerge1.reload, %spec.select\n %25 = inttoptr i64 %24 to i8*\n %26 = load i8, i8* %25, align 1\n %27 = add i64 %storemerge1.reload, %.pre\n %28 = inttoptr i64 %27 to i8*\n store i8 %26, i8* %28, align 1\n %29 = add nuw i64 %storemerge1.reload, 1\n %30 = icmp ult i64 %29, %22\n store i64 %29, i64* %storemerge1.reg2mem\n br i1 %30, label LBL_1, label LBL_2\n LBL_2:\n %31 = call i64 @FUNC(i64 %.pre)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %3, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %.pre, { 1, 0 }\n uselistorder i64 %7, { 0, 2, 1 }\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 5, 4, 3, 2, 1, 0, 6 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_fwrite_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_2, label LBL_3\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_3:\n %8 = call i32 @atoi(i8* nonnull %4)\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 0\n %sv_1.0.off = add i32 %8, -1\n %11 = icmp ugt i32 %sv_1.0.off, 19\n %or.cond = or i1 %10, %11\n br i1 %or.cond, label LBL_11, label LBL_4\n LBL_4:\n %12 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0))\n %13 = icmp eq %_IO_FILE* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_5, label LBL_6\n LBL_5:\n %15 = sext i32 %8 to i64\n store i64 0, i64* %storemerge7.reg2mem\n br label LBL_7\n LBL_6:\n call void @exit(i32 1)\n unreachable\n LBL_7:\n %16 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_5 to i64*), i32 1, i32 50, %_IO_FILE* %12)\n %17 = icmp eq i32 %16, 50\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 1)\n unreachable\n LBL_9:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %18 = add nuw i64 %storemerge7.reload, 1\n %19 = icmp ult i64 %18, %15\n store i64 %18, i64* %storemerge7.reg2mem\n br i1 %19, label LBL_7, label LBL_10\n LBL_10:\n %20 = call i32 @fclose(%_IO_FILE* nonnull %12)\n br label LBL_11\n LBL_11:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %12, { 1, 0, 2 }\n uselistorder i32 %8, { 1, 0 }\n uselistorder i64* %storemerge7.reg2mem, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 3, 0, 1 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_11, { 2, 3, 0, 1 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE667_Improper_Locking__basic_07-bad", "fun_name": "CWE667_Improper_Locking__basic_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n %5 = call i64 @FUNC(i64 ptrtoint (i32* @gv_2 to i64))\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([22 x i8]* @gv_3 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([18 x i8]* @gv_4 to i64))\n %11 = load i32, i32* @gv_2, align 4\n %12 = sext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* @gv_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_fgets_to_char_01-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_fgets_to_char_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %2)\n %phitmp = mul i32 %5, 16777216\n %phitmp1 = ashr exact i32 %phitmp, 24\n %phitmp2 = zext i32 %phitmp1 to i64\n store i64 %phitmp2, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64 @FUNC(i64 %sv_0.0.reload)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__short_listen_socket_08-bad", "fun_name": "CWE197_Numeric_Truncation_Error__short_listen_socket_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 7, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -16\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %sext = mul i32 %24, 65536\n %25 = ashr exact i32 %sext, 16\n store i32 %25, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %26 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %27 = call i32 @close(i32 %4)\n %28 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext2 = mul i32 %sv_0.1.reload, 16777216\n %29 = ashr exact i32 %sext2, 24\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_postdec_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = icmp eq i64 %6, -9223372036854775808\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i64 %6, -1\n store i64 %8, i64* %sv_0, align 8\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_5\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_zero_divide_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_7, label LBL_1\n LBL_1:\n %spec.store.select = select i1 %1, i64 -4, i64 28\n %2 = call i64* @malloc(i32 40)\n %3 = ptrtoint i64* %2 to i64\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %6 = mul i64 %indvars.iv5.reload, 4\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %9 = add i64 %spec.store.select, %3\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i1 %1, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 1, 2, 0, 3, 4 }\n uselistorder i32 -1, { 1, 2, 0, 3, 5, 4, 6 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2, 3, 4 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE665_Improper_Initialization__char_ncat_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i8* @strncat(i8* nonnull %1, i8* nonnull %3, i32 %4)\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge6.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = sext i32 %2 to i64\n %11 = ptrtoint i64* %sv_3 to i64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %27 = icmp eq i32 %26, 1\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_14, label LBL_9\n LBL_9:\n %29 = load i64, i64* %sv_1, align 8\n %30 = trunc i64 %29 to i32\n %31 = icmp sgt i32 %30, ptrtoint (i1* @gv_2 to i32)\n br i1 %31, label LBL_14, label LBL_10\n LBL_10:\n %32 = and i64 %29, 4294967295\n %33 = icmp eq i64 %32, 0\n store i32 0, i32* %storemerge6.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %33, label LBL_13, label LBL_11\n LBL_11:\n %storemerge6.reload = load i32, i32* %storemerge6.reg2mem\n %34 = add i32 %storemerge6.reload, 1\n %35 = sext i32 %34 to i64\n %36 = icmp sgt i64 %32, %35\n store i32 %34, i32* %storemerge6.reg2mem\n br i1 %36, label LBL_11, label LBL_12\n LBL_12:\n %phitmp = zext i32 %34 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_13\n LBL_13:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %37 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_14\n LBL_14:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %34, { 1, 0, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_realloc_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 20)\n %1 = load i32, i32* @gv_0, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n %5 = icmp eq i64* %0, null\n %or.cond = or i1 %5, %4\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %7 = add i64 %6, 8\n %8 = inttoptr i64 %7 to i16*\n store i16 25978, i16* %8, align 2\n %9 = add i64 %6, 10\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %6)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__strdup_char_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n store i64 7453010373645639777, i64* %4, align 16\n %5 = or i64 %3, 8\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 8\n %7 = call i64 @FUNC(i64 %3)\n store i64 %3, i64* %sv_0, align 8\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %1, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 3, 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 26, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @strtoul(i8* nonnull %5, i8** null, i32 0)\n store i32 %8, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i32, i32* %.reg2mem\n %10 = icmp eq i32 %.reload, 5\n br i1 %10, label LBL_7, label LBL_6\n LBL_6:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_7:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %sv_0.0.off = add i32 %sv_0.0.reload, -6\n %12 = icmp ult i32 %sv_0.0.off, 94\n br i1 %12, label LBL_8, label LBL_11\n LBL_8:\n %13 = call i64* @malloc(i32 %sv_0.0.reload)\n %14 = icmp eq i64* %13, null\n %15 = icmp eq i1 %14, false\n br i1 %15, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %16 = ptrtoint i64* %13 to i64\n %17 = bitcast i64* %13 to i32*\n store i32 1819043176, i32* %17, align 4\n %18 = add i64 %16, 4\n %19 = inttoptr i64 %18 to i16*\n store i16 111, i16* %19, align 2\n %20 = call i64 @FUNC(i64 %16)\n call void @free(i64* %13)\n br label LBL_12\n LBL_11:\n %21 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_4 to i64))\n br label LBL_12\n LBL_12:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %13, { 0, 1, 3, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 -4, i64 28\n %6 = call i64* @malloc(i32 40)\n %7 = ptrtoint i64* %6 to i64\n %8 = icmp eq i64* %6, null\n %9 = icmp eq i1 %8, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %9, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %10 = mul i64 %indvars.iv5.reload, 4\n %11 = add i64 %10, %7\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n br i1 %5, label LBL_7, label LBL_5\n LBL_5:\n %13 = add i64 %spec.select, %7\n %14 = inttoptr i64 %13 to i32*\n store i32 1, i32* %14, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_6\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %15 = mul i64 %indvars.iv.reload, 4\n %16 = add i64 %15, %7\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_6\n LBL_7:\n %21 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_8\n LBL_8:\n call void @free(i64* %6)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0, 2 }\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 5, 6, 0, 7, 1, 2, 8, 3, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_cpy_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %storemerge = bitcast i64* %sv_1 to i8*\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strcpy(i8* nonnull %storemerge, i8* nonnull %4)\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 7, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %8 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = sext i32 %sv_0.0.reload to i64\n %11 = mul i64 %10, 4\n %12 = add i64 %9, -48\n %13 = add i64 %12, %11\n %14 = inttoptr i64 %13 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_6\n LBL_5:\n %18 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_6:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 0, 4, 3, 9, 1, 10, 2, 8, 7, 11, 5, 12, 6 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__rand_memcpy_17-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__rand_memcpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = urem i32 %1, 2\n %6 = icmp eq i32 %5, 0\n %7 = mul i32 %3, 32768\n %8 = xor i32 %4, %7\n %9 = sext i1 %6 to i32\n %storemerge4.in.le = xor i32 %8, %9\n %sext3.le = mul i32 %storemerge4.in.le, 65536\n %10 = ashr exact i32 %sext3.le, 16\n store i64 0, i64* %sv_1, align 8\n %11 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %12 = trunc i32 %10 to i16\n %13 = icmp sgt i16 %12, 99\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %10)\n %16 = sext i32 %10 to i64\n %17 = add i64 %14, -128\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n br label LBL_2\n LBL_2:\n %20 = call i64 @FUNC(i64* nonnull %sv_1)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %10, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_multiply_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp slt i16 %3, 1\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp sgt i16 %3, ptrtoint (i1* @gv_2 to i16)\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = mul i16 %3, 2\n %7 = sext i16 %6 to i64\n %8 = and i64 %7, 4294967294\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_4\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_system_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = sext i32 %4 to i64\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i32*\n store i32 2764330, i32* %8, align 4\n br label LBL_2\n LBL_2:\n %9 = call i32 @system(i8* nonnull %1)\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 (i8*)* @system, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_for_loop_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %sv_1.0.off = add i32 %6, -1\n %7 = icmp ugt i32 %sv_1.0.off, 19\n br i1 %7, label LBL_5, label LBL_3\n LBL_3:\n %8 = sext i32 %6 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %9 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %10 = add nuw i64 %storemerge4.reload, 1\n %11 = icmp ult i64 %10, %8\n store i64 %10, i64* %storemerge4.reg2mem\n br i1 %11, label LBL_4, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 1, 0 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_5, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_int_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 400)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 4\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i32*\n store i32 5, i32* %9, align 4\n %10 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %10, 100\n store i64 %10, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %3)\n br label LBL_5\n LBL_5:\n ret i64 5\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE570_Expression_Always_False__global_const_five_01-bad", "fun_name": "CWE570_Expression_Always_False__global_const_five_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8352 to i32*), align 32\n %1 = icmp eq i32 %0, 5\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_0 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 20)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = bitcast i64* %4 to i32*\n store i32 1819043176, i32* %8, align 4\n %9 = add i64 %7, 4\n %10 = inttoptr i64 %9 to i16*\n store i16 111, i16* %10, align 2\n %11 = call i64 @FUNC(i64 %7)\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 0, 1, 6, 2, 3, 4, 5, 11, 7, 8, 9, 10 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = bitcast i64* %sv_1 to i8*\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = sext i32 %13 to i64\n %15 = icmp eq i32 %13, 0\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %16 = add i64 %storemerge1.reload, %sv_0.0.reload\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = add i64 %storemerge1.reload, %.pre\n %20 = inttoptr i64 %19 to i8*\n store i8 %18, i8* %20, align 1\n %21 = add nuw i64 %storemerge1.reload, 1\n %22 = icmp ult i64 %21, %14\n store i64 %21, i64* %storemerge1.reg2mem\n br i1 %22, label LBL_6, label LBL_7\n LBL_7:\n %23 = call i64 @FUNC(i64 %.pre)\n %24 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %24)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %.pre, { 1, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.08.reg2mem = alloca i8*\n %sv_0.09.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_13, label LBL_3\n LBL_3:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_11, label LBL_4\n LBL_4:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_11, label LBL_5\n LBL_5:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_6\n LBL_6:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_12, label LBL_7\n LBL_7:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %28, align 1\n br label LBL_9\n LBL_9:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_12, label LBL_10\n LBL_10:\n store i8 0, i8* %30, align 1\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %6)\n br label LBL_13\n LBL_12:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_13\n LBL_13:\n %35 = load i32, i32* @gv_0, align 4\n %36 = icmp eq i32 %35, 5\n %37 = icmp eq i1 %36, false\n br i1 %37, label LBL_19, label LBL_14\n LBL_14:\n %38 = load i8, i8* %4, align 1\n %39 = icmp eq i8 %38, 0\n %40 = icmp eq i1 %39, false\n store i8 %38, i8* %.reg2mem\n store i8* %4, i8** %sv_0.09.reg2mem\n store i8* %4, i8** %sv_0.08.reg2mem\n br i1 %40, label LBL_15, label LBL_18\n LBL_15:\n %sv_0.09.reload = load i8*, i8** %sv_0.09.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %41 = icmp eq i8 %.reload, 83\n %42 = icmp eq i1 %41, false\n br i1 %42, label LBL_17, label LBL_16\n LBL_16:\n %43 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n store i8* %sv_0.09.reload, i8** %sv_0.08.reg2mem\n br label LBL_18\n LBL_17:\n %44 = ptrtoint i8* %sv_0.09.reload to i64\n %45 = add i64 %44, 1\n %46 = inttoptr i64 %45 to i8*\n %47 = load i8, i8* %46, align 1\n %48 = icmp eq i8 %47, 0\n %49 = icmp eq i1 %48, false\n store i8 %47, i8* %.reg2mem\n store i8* %46, i8** %sv_0.09.reg2mem\n store i8* %46, i8** %sv_0.08.reg2mem\n br i1 %49, label LBL_15, label LBL_18\n LBL_18:\n %sv_0.08.reload = load i8*, i8** %sv_0.08.reg2mem\n %50 = bitcast i8* %sv_0.08.reload to i64*\n call void @free(i64* %50)\n br label LBL_19\n LBL_19:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %0, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_21, label LBL_20\n LBL_20:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_21\n LBL_21:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.09.reload, { 1, 0 }\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %4, { 0, 1, 2, 3, 4, 6, 5 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.09.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.08.reg2mem, { 0, 1, 3, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4, 5, 6 }\n uselistorder label LBL_18, { 0, 2, 1 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_13, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memcpy_14-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memcpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 200)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 50)\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memcpy(i64* %9, i64* nonnull %sv_1, i32 400)\n %11 = inttoptr i64 %sv_0.0.reload to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n call void @free(i64* %9)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_square_14-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_rand_square_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = load i32, i32* @gv_0, align 4\n %15 = zext i32 %14 to i64\n %16 = icmp eq i32 %14, 5\n %17 = icmp eq i1 %16, false\n store i64 %15, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %18 = mul i32 %sv_0.0.reload, %sv_0.0.reload\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_multiply_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_2:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n %14 = sext i1 %6 to i32\n %storemerge.in = xor i32 %13, %14\n %.pre = load i32, i32* @gv_0, align 4\n %15 = zext i32 %.pre to i64\n %16 = icmp eq i32 %.pre, 5\n %17 = icmp slt i32 %storemerge.in, 0\n %18 = icmp eq i1 %16, %17\n store i64 %15, i64* %rax.0.reg2mem\n br i1 %18, label LBL_3, label LBL_6\n LBL_3:\n %19 = icmp slt i32 %storemerge.in, -1073741823\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n %20 = mul i32 %storemerge.in, 2\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %23 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n uselistorder label LBL_6, { 2, 3, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_zero_08-bad", "fun_name": "CWE369_Divide_by_Zero__float_zero_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 %4, i64* %sv_0.0.in.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i128 @FUNC(i128 %3, i128 %3)\n %9 = call i64 @FUNC(i128 %8)\n store i64 %9, i64* %sv_0.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %13 = call i128 @FUNC(i128 %1, i128 %1)\n %14 = call i128 @FUNC(i32 %sv_0.0)\n %15 = call i128 @FUNC(i64 4636737291354636288)\n %16 = call i128 @FUNC(i128 %15, i128 %14)\n %17 = call i32 @FUNC(i128 %16)\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %3, { 1, 0, 2 }\n uselistorder i128 %2, { 1, 0 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_32-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -17\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n store i64 %3, i64* %sv_1, align 8\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @strcpy(i8* %4, i8* nonnull %5)\n %7 = call i64 @FUNC(i64 %3)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %1, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_max_square_12-bad", "fun_name": "CWE190_Integer_Overflow__int_max_square_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = select i1 %2, i64 4, i64 1\n %7 = call i64 @FUNC(i64 %6)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n br i1 %2, label LBL_3, label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 4)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE665_Improper_Initialization__char_ncat_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n store i8 0, i8* %1, align 8\n br label LBL_2\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = call i8* @strncat(i8* nonnull %1, i8* nonnull %5, i32 %6)\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memmove_17-bad", "fun_name": "CWE126_Buffer_Overread__char_alloca_memmove_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = add i64 %0, -161\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = inttoptr i64 %5 to i64*\n %11 = call i64* @memset(i64* %10, i32 65, i32 99)\n %12 = add i64 %5, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n store i32 0, i32* %storemerge.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge.reload = load i32, i32* %storemerge.reg2mem\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %14 = add nuw nsw i32 %storemerge.reload, 1\n %exitcond = icmp eq i32 %14, 2\n store i64 %3, i64* %sv_0.0.reg2mem\n store i32 %14, i32* %storemerge.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %15 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %16 = bitcast i64* %sv_1 to i8*\n %17 = call i32 @strlen(i8* nonnull %16)\n %18 = inttoptr i64 %sv_0.0.reload to i64*\n %19 = call i64* @memmove(i64* nonnull %sv_1, i64* %18, i32 %17)\n %20 = call i64 @FUNC(i64* nonnull %sv_1)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 1, 0 }\n uselistorder i32* %storemerge.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_04-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE135_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i32* bitcast ([2 x i8]* @gv_0 to i32*), i32** %sv_0, align 8\n %2 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_0, i64 0, i64 0))\n %3 = sext i32 %2 to i64\n %4 = mul i64 %3, 4\n %5 = add nsw i64 %4, 27\n %6 = udiv i64 %5, 16\n %7 = mul i64 %6, 16\n %8 = and i64 %7, -4096\n %9 = and i64 %7, 4080\n %10 = add i64 %0, 15\n %11 = sub i64 %10, %9\n %12 = sub i64 %11, %8\n %13 = and i64 %12, -16\n %14 = load i32*, i32** %sv_0, align 8\n %15 = inttoptr i64 %13 to i32*\n %16 = call i32* @wcscpy(i32* %15, i32* %14)\n %17 = call i64 @FUNC(i64 %13)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @2 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64 %7, { 1, 0 }\n uselistorder i32** %sv_0, { 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_ncpy_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i8*\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i8*, i8** %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = bitcast i64* %sv_1 to i8*\n %spec.select = select i1 %6, i8* %1, i8* %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strncpy(i8* %spec.select, i8* nonnull %9, i32 99)\n %11 = ptrtoint i8* %spec.select to i64\n %12 = add i64 %11, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %11)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %2, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 2, 3, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_memmove_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = call i64* @memmove(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 100)\n %5 = add i64 %2, 99\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %2)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %2, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_max_add_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 3)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 2, 1, 0 }\n uselistorder i64 3, { 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 5, 4, 6 }\n uselistorder i32* @gv_0, { 4, 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %.reg2mem = alloca i8*\n %sv_0 = alloca i8*, align 8\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 50)\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 49)\n %8 = add i64 %6, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = bitcast i64* %3 to i8*\n store i8* %10, i8** %.reg2mem\n br label LBL_7\n LBL_4:\n %11 = bitcast i64* %3 to i8*\n store i8* %11, i8** %sv_0, align 8\n %12 = icmp eq i64* %3, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %14 = call i64* @memset(i64* %3, i32 65, i32 49)\n %15 = ptrtoint i64* %3 to i64\n %16 = add i64 %15, 49\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = load i8*, i8** %sv_0, align 8\n store i8* %18, i8** %.reg2mem\n br label LBL_7\n LBL_7:\n %.reload = load i8*, i8** %.reg2mem\n %19 = call i64 @FUNC()\n %20 = trunc i64 %19 to i32\n %21 = icmp eq i32 %20, 0\n %22 = call i32 @strlen(i8* %.reload)\n %23 = add i32 %22, 1\n %24 = call i64* @calloc(i32 %23, i32 1)\n %25 = bitcast i64* %24 to i8*\n %26 = icmp eq i64* %24, null\n %27 = icmp eq i1 %26, false\n br i1 %21, label LBL_11, label LBL_8\n LBL_8:\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %28 = call i8* @strcpy(i8* %25, i8* %.reload)\n %29 = ptrtoint i64* %24 to i64\n %30 = call i64 @FUNC(i64 %29)\n call void @free(i64* %24)\n br label LBL_14\n LBL_11:\n br i1 %27, label LBL_13, label LBL_12\n LBL_12:\n call void @exit(i32 -1)\n unreachable\n LBL_13:\n %31 = call i8* @strcpy(i8* %25, i8* %.reload)\n %32 = ptrtoint i64* %24 to i64\n %33 = call i64 @FUNC(i64 %32)\n call void @free(i64* %24)\n br label LBL_14\n LBL_14:\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %27, { 1, 0 }\n uselistorder i8* %25, { 1, 0 }\n uselistorder i64* %24, { 3, 0, 2, 1, 4, 5 }\n uselistorder i64* %3, { 0, 3, 6, 7, 1, 2, 4, 5 }\n uselistorder i8** %.reg2mem, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 7, 6, 5, 4, 3, 2, 1, 0, 8 }\n uselistorder i32 -1, { 1, 2, 0, 3, 5, 6, 4, 7 }\n uselistorder i64* null, { 1, 0, 2, 4, 3, 5 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_postdec_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, -2147483648\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i64 %3, 4294967296\n %sext = add i64 %6, -4294967296\n %7 = ashr exact i64 %sext, 32\n store i64 %7, i64* %sv_0, align 8\n %8 = and i64 %7, 4294967295\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_postinc_13-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_rand_postinc_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 1, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 1152921504606846976\n %9 = call i32 @rand()\n %10 = zext i32 %9 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 1073741824\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = mul i64 %16, 32768\n %18 = call i32 @rand()\n %19 = sext i32 %18 to i64\n %20 = sext i1 %5 to i64\n %21 = xor i64 %8, %20\n %22 = xor i64 %21, %11\n %23 = xor i64 %22, %14\n %24 = xor i64 %23, %17\n %storemerge = xor i64 %24, %19\n %phitmp = add i64 %storemerge, 1\n store i64 %phitmp, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %25 = call i64 @FUNC(i64 %sv_0.0.reload)\n ret i64 %25\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_no_init_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_1\n LBL_1:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %2 = mul i64 %indvars.iv.reload, 8\n %3 = add i64 %2, %1\n %4 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %5 = trunc i64 %indvars.iv.reload to i32\n %6 = call i128 @FUNC(i32 %5)\n %7 = call i64 @FUNC(i128 %6)\n %8 = inttoptr i64 %3 to i64*\n store i64 %7, i64* %8, align 8\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i128 %6, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %9 = mul i64 %indvars.iv9.reload, 8\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i64*\n %12 = load i64, i64* %11, align 8\n %13 = call i128 @FUNC(i64 %12)\n %14 = call i64 @FUNC()\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 10\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_3, label LBL_2\n LBL_3:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memcpy_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %5)\n %7 = call i64 @FUNC(i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 2, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_10-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* %sv_0, align 4\n %5 = icmp sgt i32 %.pr, 99\n store i32 %.pr, i32* %.reg2mem\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = call i64* @malloc(i32 %.reload)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %9 = ptrtoint i64* %6 to i64\n %10 = load i32, i32* %sv_0, align 4\n %11 = add i32 %10, -1\n %12 = call i64* @memset(i64* %6, i32 65, i32 %11)\n %13 = load i32, i32* %sv_0, align 4\n %14 = sext i32 %13 to i64\n %15 = add i64 %9, -1\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i64 @FUNC(i64 %9)\n call void @free(i64* %6)\n br label LBL_5\n LBL_5:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %9, { 1, 0 }\n uselistorder i64* %6, { 0, 1, 3, 2 }\n uselistorder i32* %sv_0, { 2, 3, 0, 1, 4 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i32 -1, { 1, 2, 0, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_calloc_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @calloc(i32 100, i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %3, align 8\n %6 = call i64 @FUNC(i64 5)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %7 = zext i32 %.reload to i64\n %8 = icmp eq i32 %.reload, 5\n %9 = icmp eq i1 %8, false\n store i64 %7, i64* %rax.0.reg2mem\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_2 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 2, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %13 = load i32, i32* @gv_0, align 4\n %14 = zext i32 %13 to i64\n %15 = icmp eq i32 %13, 5\n %16 = icmp eq i1 %15, false\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %17 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__fopen_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = load i32, i32* inttoptr (i64 8404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_2:\n %4 = icmp eq %_IO_FILE* %0, null\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = call i32 @fclose(%_IO_FILE* nonnull %0)\n br label LBL_4\n LBL_4:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %7 = ptrtoint %_IO_FILE* %6 to i64\n %8 = icmp eq %_IO_FILE* %6, null\n store i64 %7, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %9 = call i32 @fclose(%_IO_FILE* nonnull %6)\n %10 = sext i32 %9 to i64\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_multiply_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %spec.store.select = select i1 %1, i32 32, i32 -2\n %2 = zext i32 %0 to i64\n %3 = trunc i32 %spec.store.select to i8\n %4 = icmp slt i8 %3, 0\n %5 = icmp eq i1 %4, false\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = mul i32 %spec.store.select, 2\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %1, { 1, 0 }\n uselistorder i64 (i64)* @printHexCharLine, { 3, 2, 1, 0 }\n uselistorder i32 -2, { 1, 0 }\n uselistorder i32 32, { 1, 0, 2, 3 }\n uselistorder i32* @gv_0, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_sub_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i64, i64* %sv_0, align 8\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, -2147483648\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = add i64 %8, 4294967295\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_square_17-bad", "fun_name": "CWE190_Integer_Overflow__short_rand_square_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = mul i32 %2, 32768\n %7 = xor i32 %3, %6\n %8 = sext i1 %5 to i32\n %storemerge4.in.le = xor i32 %7, %8\n %9 = urem i32 %storemerge4.in.le, 65536\n %narrow = mul i32 %storemerge4.in.le, 65536\n %sext = mul i32 %narrow, %9\n %10 = ashr exact i32 %sext, 16\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n ret i64 %12\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memmove_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %3 = and i64 %2, -16\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 100)\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memmove(i64* %5, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %7 = load i64, i64* %5, align 16\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -161\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %7 = add i64 %storemerge3.reload, %3\n %8 = add i64 %storemerge3.reload, %6\n %9 = inttoptr i64 %8 to i8*\n %10 = load i8, i8* %9, align 1\n %11 = inttoptr i64 %7 to i8*\n store i8 %10, i8* %11, align 1\n %12 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %13 = add i64 %3, 99\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n %15 = call i64 @FUNC(i64 %3)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i64 %3, { 1, 2, 0, 3 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_memcpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %6, i64 %1, i64 %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = load i64, i64* %sv_0, align 8\n %10 = inttoptr i64 %spec.select to i64*\n store i64 %9, i64* %10, align 8\n %11 = add i64 %spec.select, 8\n %12 = inttoptr i64 %11 to i64*\n %13 = add i64 %spec.select, 16\n %14 = inttoptr i64 %13 to i64*\n %15 = add i64 %spec.select, 24\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %spec.select, 32\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %spec.select, 40\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %spec.select, 48\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %spec.select, 56\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %spec.select, 64\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %spec.select, 72\n %28 = inttoptr i64 %27 to i64*\n %29 = add i64 %spec.select, 80\n %30 = inttoptr i64 %29 to i64*\n %31 = add i64 %spec.select, 88\n %32 = inttoptr i64 %31 to i64*\n %33 = add i64 %spec.select, 96\n %34 = inttoptr i64 %33 to i32*\n %35 = add i64 %spec.select, 99\n %36 = inttoptr i64 %35 to i8*\n store i8 0, i8* %36, align 1\n %37 = call i64 @FUNC(i64 %spec.select)\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %2, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %spec.select, { 14, 13, 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 1, 0, 2, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %9, i32 99)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = add i64 %11, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %11)\n %15 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %15)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %4, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_ncpy_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = load i8*, i8** %sv_1, align 8\n %8 = ptrtoint i8* %7 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = load i8*, i8** %sv_1, align 8\n %12 = ptrtoint i8* %11 to i64\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = bitcast i64* %sv_0 to i8*\n %15 = call i8* @strncpy(i8* %11, i8* nonnull %14, i32 99)\n %16 = add i64 %12, 99\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i64 @FUNC(i64 %12)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %12, { 1, 0 }\n uselistorder i8** %sv_1, { 3, 2, 1, 0 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_max_square_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 4)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 2, 1, 0 }\n uselistorder i32* @gv_0, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__short_listen_socket_14-bad", "fun_name": "CWE197_Numeric_Truncation_Error__short_listen_socket_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 7, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -16\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %sext = mul i32 %24, 65536\n %25 = ashr exact i32 %sext, 16\n store i32 %25, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %26 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %27 = call i32 @close(i32 %4)\n %28 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext2 = mul i32 %sv_0.1.reload, 16777216\n %29 = ashr exact i32 %sext2, 24\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_popen_05-bad", "fun_name": "CWE78_OS_Command_Injection__char_connect_socket_popen_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %5, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_0 to %sockaddr*\n %10 = call i32 @connect(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_8, label LBL_3\n LBL_3:\n %12 = sext i32 %4 to i64\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = add i64 %12, %13\n %15 = inttoptr i64 %14 to i64*\n %16 = sub i32 99, %4\n %17 = call i32 @recv(i32 %5, i64* %15, i32 %16, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n br i1 %19, label LBL_8, label LBL_4\n LBL_4:\n %20 = sext i32 %17 to i64\n %21 = add i64 %14, %20\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = call i8* @strchr(i8* nonnull %1, i32 13)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %23, align 1\n br label LBL_6\n LBL_6:\n %25 = call i8* @strchr(i8* nonnull %1, i32 10)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %25, align 1\n br label LBL_8\n LBL_8:\n %27 = call i32 @close(i32 %5)\n br label LBL_9\n LBL_9:\n %28 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %29 = icmp eq %_IO_FILE* %28, null\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %30 = call i32 @pclose(%_IO_FILE* nonnull %28)\n br label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %5, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE681_Incorrect_Conversion_Between_Numeric_Types__doubleNaN2int_13-bad", "fun_name": "CWE681_Incorrect_Conversion_Between_Numeric_Types__doubleNaN2int_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* inttoptr (i64 8352 to i32*), align 32\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call i128 @FUNC(i128 %1, i128 %1)\n %7 = call i64 @FUNC(i128 %6)\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @fgets(i8* nonnull %9, i32 256, %_IO_FILE* %8)\n %11 = icmp eq i8* %10, null\n br i1 %11, label LBL_3, label LBL_2\n LBL_2:\n %12 = call double @atof(i8* nonnull %9)\n %13 = fptrunc double %12 to float\n %14 = bitcast float %13 to i32\n %15 = sext i32 %14 to i128\n %16 = call i64 @FUNC(i128 %15)\n store i64 %16, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %18 = call i128 @__asm_movq.1(i64 %sv_0.0.reload)\n %19 = trunc i128 %18 to i64\n %20 = bitcast i64 %19 to double\n %21 = call double @sqrt(double %20)\n %22 = fptrunc double %21 to float\n %23 = bitcast float %22 to i32\n %24 = sext i32 %23 to i128\n %25 = call i32 @FUNC(i128 %24)\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n br label LBL_5\n LBL_5:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %2, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i8** %sv_1 to i64\n %5 = add i64 %4, -17\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n %8 = bitcast i8** %sv_1 to i64*\n store i64 %6, i64* %8, align 8\n store i8 0, i8* %7, align 16\n br label LBL_2\n LBL_2:\n store i64 4702111234474983745, i64* %sv_0, align 8\n %9 = load i8*, i8** %sv_1, align 8\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strcpy(i8* %9, i8* nonnull %10)\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 3, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_sleep_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 20\n %6 = call i32 @usleep(i32 %spec.select)\n %7 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_0 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i32)* @usleep, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 5, 0, 1, 2, 3, 4 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_ncpy_07-bad", "fun_name": "CWE124_Buffer_Underwrite__char_declare_ncpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = bitcast i8** %sv_1 to i8*\n store i8* %5, i8** %sv_1, align 8\n br label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = load i8*, i8** %sv_1, align 8\n %8 = bitcast i64* %sv_0 to i8*\n %9 = call i8* @strncpy(i8* %7, i8* nonnull %8, i32 99)\n %10 = load i8*, i8** %sv_1, align 8\n %11 = ptrtoint i8* %10 to i64\n %12 = add i64 %11, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = load i8*, i8** %sv_1, align 8\n %15 = ptrtoint i8* %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 25, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_8\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -48\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @strtoul(i8* nonnull %18, i8** null, i32 0)\n %20 = call i32 @close(i32 %1)\n %sv_3.0.off = add i32 %19, -6\n %21 = icmp ult i32 %sv_3.0.off, 94\n br i1 %21, label LBL_5, label LBL_8\n LBL_5:\n %22 = call i64* @malloc(i32 %19)\n %23 = icmp eq i64* %22, null\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %25 = ptrtoint i64* %22 to i64\n %26 = bitcast i64* %22 to i32*\n store i32 1819043176, i32* %26, align 4\n %27 = add i64 %25, 4\n %28 = inttoptr i64 %27 to i16*\n store i16 111, i16* %28, align 2\n %29 = call i64 @FUNC(i64 %25)\n call void @free(i64* %22)\n br label LBL_9\n LBL_8:\n %30 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %22, { 0, 1, 3, 2 }\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 1, 3 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_calloc_34-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @calloc(i32 100, i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 5, i64* %0, align 8\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int64_t_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.02.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 5, i64* %sv_1, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = ptrtoint i64* %sv_1 to i64\n store i64 %3, i64* %sv_0.02.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %phitmp = icmp eq i32 %.pre, 5\n %phitmp1 = icmp eq i1 %phitmp, false\n br i1 %phitmp1, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.02.reload = load i64, i64* %sv_0.02.reg2mem\n %5 = inttoptr i64 %sv_0.02.reload to i64*\n %6 = load i64, i64* %5, align 8\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_4\n LBL_4:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_32-bad", "fun_name": "CWE675_Duplicate_Operations_on_Resource__open_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %2 = call i32 @close(i32 %1)\n %3 = call i32 @close(i32 %1)\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_sub_11-bad", "fun_name": "CWE191_Integer_Underflow__char_rand_sub_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 31, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %phitmp = add i32 %sext, -16777216\n %phitmp3 = ashr exact i32 %phitmp, 24\n %phitmp4 = zext i32 %phitmp3 to i64\n store i64 %phitmp4, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_sub_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 -1)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__listen_socket_13-bad", "fun_name": "CWE617_Reachable_Assertion__listen_socket_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8576 to i32*), align 128\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_1 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_0, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %phitmp = icmp sgt i32 %24, 5\n %25 = call i32 @close(i32 %4)\n %26 = call i32 @close(i32 %13)\n br i1 %phitmp, label LBL_10, label LBL_9\n LBL_7:\n %27 = call i32 @close(i32 %4)\n br label LBL_9\n LBL_8:\n %28 = call i32 @close(i32 %4)\n %29 = call i32 @close(i32 %13)\n br label LBL_9\n LBL_9:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @gv_1, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @gv_2, i64 0, i64 0))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 0, 1, 5, 2, 3, 4, 6 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 0, 1, 2, 4, 3, 5 }\n uselistorder i32 5, { 0, 2, 1 }\n uselistorder label LBL_9, { 0, 2, 4, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memmove_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = call i64* @memmove(i64* %1, i64* nonnull %sv_0, i32 100)\n store i8 0, i8* %7, align 1\n %10 = call i64 @FUNC(i64 %4)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_loop_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %2, align 8\n store i64 4702111234474983745, i64* %sv_0, align 8\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = sext i32 %4 to i64\n %6 = add nsw i64 %5, 1\n %7 = icmp eq i64 %6, 0\n br i1 %7, label LBL_3, label LBL_1\n LBL_1:\n %8 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = add i64 %storemerge1.reload, %1\n %10 = add i64 %storemerge1.reload, %8\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = inttoptr i64 %9 to i8*\n store i8 %12, i8* %13, align 1\n %14 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %14, %6\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %15 = call i64 @FUNC(i64 %1)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %1, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_fgets_14-bad", "fun_name": "CWE126_Buffer_Overread__CWE129_fgets_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_2, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %14, -64\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n br label LBL_8\n LBL_7:\n %23 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_sub_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %22 = load i32, i32* @gv_2, align 4\n %23 = icmp eq i32 %22, 0\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_11\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %25 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n %26 = add i32 %sv_0.1.reload, -1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_11\n LBL_10:\n %29 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_4 to i64))\n br label LBL_11\n LBL_11:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_for_loop_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge9.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_14\n LBL_11:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sv_0.1.off = add i32 %sv_0.1.reload, -1\n %31 = icmp ugt i32 %sv_0.1.off, 19\n br i1 %31, label LBL_14, label LBL_12\n LBL_12:\n %32 = sext i32 %sv_0.1.reload to i64\n store i64 0, i64* %storemerge9.reg2mem\n br label LBL_13\n LBL_13:\n %storemerge9.reload = load i64, i64* %storemerge9.reg2mem\n %33 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %34 = add nuw i64 %storemerge9.reload, 1\n %35 = icmp ult i64 %34, %32\n store i64 %34, i64* %storemerge9.reg2mem\n br i1 %35, label LBL_13, label LBL_14\n LBL_14:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %storemerge9.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 99)\n %9 = add i64 %3, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_2\n LBL_2:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strcat(i8* nonnull %12, i8* %11)\n %14 = call i64 @FUNC(i64 %3)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_sleep_01-bad", "fun_name": "CWE400_Resource_Exhaustion__fgets_sleep_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %2)\n store i32 %5, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = call i32 @usleep(i32 %sv_0.0.reload)\n %8 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_2 to i64))\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__negative_malloc_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %spec.select = select i1 %2, i32 0, i32 99\n %3 = call i64* @malloc(i32 %spec.select)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %spec.select, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = zext i32 %spec.select to i64\n %10 = add i64 %6, -1\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 14)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE571_Expression_Always_True__n_less_int_max_01-bad", "fun_name": "CWE571_Expression_Always_True__n_less_int_max_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_0 to i64))\n ret i64 %1\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_02-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -17\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n store i8 0, i8* %4, align 16\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @strcpy(i8* %4, i8* nonnull %5)\n %7 = call i64 @FUNC(i64 %3)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %1, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0, 2 }\n uselistorder i8** %sv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memmove_01-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_memmove_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = inttoptr i64 %8 to i64*\n %11 = call i64* @memmove(i64* nonnull %sv_0, i64* %10, i32 100)\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_min_sub_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 4294967295, i64 4294967293\n %6 = call i64 @FUNC(i64 %spec.select)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n uselistorder i64 4294967293, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fscanf_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp ugt i32 %3, 9\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = sext i32 %3 to i64\n %7 = mul i64 %6, 4\n %8 = add i64 %5, -48\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_2\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_ncpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = inttoptr i64 %3 to i8*\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 @strlen(i8* nonnull %10)\n %12 = call i8* @strncpy(i8* nonnull %10, i8* %8, i32 %11)\n %13 = call i64 @FUNC(i64* nonnull %sv_0)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_05-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__struct_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %2 = load i32, i32* %0\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = zext i32 %2 to i64\n %6 = call i64 @FUNC(i64 %5)\n %7 = zext i32 %1 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 49)\n %7 = add i64 %3, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strcat(i8* nonnull %9, i8* %4)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 1, 0, 3 }\n uselistorder i8** %sv_1, { 1, 0 }\n uselistorder i8* (i8*, i8*)* @strcat, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_realloc_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @realloc(i64* null, i32 400)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = call i64 @FUNC(i64 5)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %8 = icmp eq i32 %.reload, 5\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %9, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64** %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_cpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %6 = bitcast i64* %sv_2 to i8*\n store i8* %6, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 199)\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @strcpy(i8* nonnull %8, i8* %sv_0.0.reload)\n %10 = ptrtoint i64* %sv_1 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -609\n %3 = and i64 %2, -16\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 50)\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memcpy(i64* %5, i64* nonnull %sv_0, i32 400)\n %7 = inttoptr i64 %3 to i32*\n %8 = load i32, i32* %7, align 16\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memcpy_04-bad", "fun_name": "CWE126_Buffer_Overread__char_declare_memcpy_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_2, i32 %5)\n %7 = call i64 @FUNC(i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %24 = icmp eq i32 %23, 1\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_12, label LBL_7\n LBL_7:\n %26 = load i64, i64* %sv_1, align 8\n %27 = trunc i64 %26 to i32\n %28 = icmp sgt i32 %27, ptrtoint (i1* @gv_3 to i32)\n br i1 %28, label LBL_12, label LBL_8\n LBL_8:\n %29 = and i64 %26, 4294967295\n %30 = icmp eq i64 %29, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %30, label LBL_11, label LBL_9\n LBL_9:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %31 = add i32 %storemerge4.reload, 1\n %32 = sext i32 %31 to i64\n %33 = icmp sgt i64 %29, %32\n store i32 %31, i32* %storemerge4.reg2mem\n br i1 %33, label LBL_9, label LBL_10\n LBL_10:\n %phitmp = zext i32 %31 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %34 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %31, { 1, 0, 2 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 ptrtoint (i1* @gv_3 to i32), { 1, 0 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 3, 2, 0, 4 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_6, { 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_12-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i128 @FUNC(i64 4617315517961601024)\n %5 = call i64 @__asm_movsd.1(i128 %4)\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i128 @FUNC(i64 %sv_0.0.reload)\n %10 = call i64 @FUNC()\n store i64 %10, i64* %storemerge.reg2mem\n br label LBL_5\n LBL_4:\n %11 = call i128 @FUNC(i64 4617315517961601024)\n %12 = call i64 @__asm_movsd.1(i128 %11)\n %13 = call i128 @FUNC(i64 %12)\n %14 = call i64 @FUNC()\n store i64 %14, i64* %storemerge.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @printDoubleLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_06-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_0, i32 100)\n %8 = add i64 %3, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %3)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE510_Trapdoor__hostname_based_logic_13-bad", "fun_name": "CWE510_Trapdoor__hostname_based_logic_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8392 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_13, label LBL_1\n LBL_1:\n store i32 16, i32* %sv_4, align 4\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_13, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %7 = call i16 @htons(i16 20000)\n %8 = bitcast i64* %sv_3 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_11, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_11, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_11, label LBL_5\n LBL_5:\n %15 = bitcast i64* %sv_2 to %sockaddr*\n %16 = call i32 @getsockname(i32 %13, %sockaddr* nonnull %15, i32* nonnull %sv_4)\n %17 = icmp eq i32 %16, -1\n br i1 %17, label LBL_12, label LBL_6\n LBL_6:\n %18 = bitcast i64* %sv_0 to i8*\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @getnameinfo(%sockaddr* nonnull %15, i32 16, i8* nonnull %18, i32 ptrtoint (i32* @gv_0 to i32), i8* nonnull %19, i32 32, i32 2)\n %21 = icmp eq i32 %20, 0\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_12, label LBL_7\n LBL_7:\n %23 = call i32 @strcmp(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %18)\n %24 = icmp eq i32 %23, 0\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %26 = call i32 @send(i32 %13, i64* bitcast ([16 x i8]* @gv_2 to i64*), i32 15, i32 0)\n br label LBL_12\n LBL_9:\n %27 = call i32 @send(i32 %13, i64* bitcast ([9 x i8]* @gv_3 to i64*), i32 8, i32 0)\n %28 = icmp eq i32 %27, -1\n %29 = icmp eq i1 %28, false\n br i1 %29, label LBL_12, label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_4 to i64))\n br label LBL_12\n LBL_11:\n %31 = call i32 @close(i32 %4)\n br label LBL_13\n LBL_12:\n %32 = call i32 @close(i32 %4)\n %33 = call i32 @close(i32 %13)\n br label LBL_13\n LBL_13:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %4, { 0, 4, 1, 2, 3, 5 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 0, 1, 3 }\n uselistorder i32 (i32, i64*, i32, i32)* @send, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_13, { 2, 1, 0, 3 }\n uselistorder label LBL_12, { 1, 2, 0, 3, 4 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_file_14-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_file_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_2 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = load i32, i32* @gv_3, align 4\n %21 = icmp eq i32 %20, 5\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_12, label LBL_7\n LBL_7:\n %23 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n %24 = icmp eq i32 %23, 1\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_12, label LBL_8\n LBL_8:\n %26 = load i64, i64* %sv_1, align 8\n %27 = and i64 %26, 4294967295\n %28 = icmp eq i64 %27, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %28, label LBL_11, label LBL_9\n LBL_9:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %29 = add i32 %storemerge5.reload, 1\n %30 = sext i32 %29 to i64\n %31 = icmp sgt i64 %27, %30\n store i32 %29, i32* %storemerge5.reg2mem\n br i1 %31, label LBL_9, label LBL_10\n LBL_10:\n %phitmp = zext i32 %29 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %32 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_12\n LBL_12:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %29, { 1, 0, 2 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_memcpy_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %3, i64* %sv_1, align 8\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = load i64, i64* %sv_1, align 8\n %10 = inttoptr i64 %9 to i64*\n %11 = load i64, i64* %10, align 8\n store i64 %11, i64* %sv_0, align 8\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__rand_memcpy_13-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__rand_memcpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_2, align 8\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n store i32 -1, i32* %sv_0.01.reg2mem\n br label LBL_3\n LBL_2:\n %5 = call i32 @rand()\n %6 = urem i32 %5, 2\n %7 = icmp eq i32 %6, 0\n %8 = call i32 @rand()\n %9 = mul i32 %8, 1073741824\n %10 = call i32 @rand()\n %11 = mul i32 %10, 32768\n %12 = xor i32 %11, %9\n %13 = call i32 @rand()\n %14 = xor i32 %12, %13\n %15 = sext i1 %7 to i32\n %storemerge.in = xor i32 %14, %15\n store i64 0, i64* %sv_2, align 8\n %16 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %17 = icmp sgt i32 %storemerge.in, 99\n store i32 %storemerge.in, i32* %sv_0.01.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n %18 = ptrtoint i64* %sv_3 to i64\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %19 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.01.reload)\n %20 = sext i32 %sv_0.01.reload to i64\n %21 = add i64 %18, -128\n %22 = add i64 %21, %20\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n br label LBL_4\n LBL_4:\n %24 = call i64 @FUNC(i64* nonnull %sv_2)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.01.reload, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 2, 3, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 2, 1, 0 }\n uselistorder i32 65, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %10 = zext i32 %.reload to i64\n %11 = icmp eq i32 %.reload, 5\n %12 = icmp eq i1 %11, false\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i32* @gv_0, { 0, 5, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE588_Attempt_to_Access_Child_of_Non_Structure_Pointer__struct_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n %6 = ptrtoint i32* %sv_0 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = call i64 @FUNC(i64 %spec.select)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %2, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_realloc_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 4)\n %1 = icmp eq i64* %0, null\n store i64 1, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = bitcast i64* %0 to i32*\n store i32 5, i32* %2, align 4\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_multiply_13-bad", "fun_name": "CWE190_Integer_Overflow__short_rand_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %12 = trunc i32 %storemerge.in to i16\n %13 = icmp slt i16 %12, 1\n store i64 5, i64* %rax.0.reg2mem\n br i1 %13, label LBL_3, label LBL_2\n LBL_2:\n %sext2 = mul i32 %storemerge.in, 131072\n %14 = ashr exact i32 %sext2, 16\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 5, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_13-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8356 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n %5 = icmp eq i32 %4, 0\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memcpy_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = load i64, i64* %sv_1, align 8\n store i64 %3, i64* %sv_0, align 8\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = call i64 @FUNC(i64 %4)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 2, 3, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_ncpy_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %10 = icmp eq i32 %9, 5\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = bitcast i8** %sv_2 to i64*\n store i64 %13, i64* %14, align 8\n br label LBL_3\n LBL_3:\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = bitcast i64* %sv_0 to i8*\n %17 = call i32 @strlen(i8* nonnull %16)\n %18 = load i8*, i8** %sv_2, align 8\n %19 = call i8* @strncpy(i8* nonnull %16, i8* %18, i32 %17)\n %20 = ptrtoint i64* %sv_0 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 2, 0, 1 }\n uselistorder i64* %sv_0, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_alloca_cat_08-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__dest_char_alloca_cat_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, -49\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strcat(i8* %sv_0.0.reload, i8* nonnull %9)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__listen_socket_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @gv_2, i64 0, i64 0), i32 164, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_3, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i8*, i8*, i32, i8*)* @__assert_fail, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memcpy_34-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memcpy_34_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -17\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n store i64 %3, i64* %sv_1, align 8\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = inttoptr i64 %3 to i64*\n %9 = call i64* @memcpy(i64* %8, i64* nonnull %sv_0, i32 %7)\n %10 = call i64 @FUNC(i64 %3)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 3, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @calloc(i32 100, i32 4)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = bitcast i64* %2 to i32*\n store i32 5, i32* %5, align 4\n %6 = call i64 @FUNC(i64 5)\n store i64* %2, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %7 = load i32, i32* @gv_1, align 4\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %9, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_loop_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -97\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 99)\n %8 = add i64 %5, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n %spec.select = select i1 %12, i64 %1, i64 %5\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %15 = add i64 %storemerge1.reload, %spec.select\n %16 = add i64 %storemerge1.reload, %14\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = inttoptr i64 %15 to i8*\n store i8 %18, i8* %19, align 1\n %20 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %20, 100\n store i64 %20, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %21 = add i64 %spec.select, 99\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = call i64 @FUNC(i64 %spec.select)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %3, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %spec.select, { 2, 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memmove_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memmove_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %storemerge.v.v = select i1 %4, i64 -609, i64 -193\n %storemerge.v = add i64 %storemerge.v.v, %0\n %storemerge = and i64 %storemerge.v, -16\n %5 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 50)\n %6 = inttoptr i64 %storemerge to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_0, i32 400)\n %8 = inttoptr i64 %storemerge to i32*\n %9 = load i32, i32* %8, align 16\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__listen_socket_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8552 to i32*), align 8\n %1 = icmp eq i32 %0, 5\n store i64 5, i64* %rax.1.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @gv_2, i64 0, i64 0), i32 149, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_3, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_2\n LBL_2:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %rax.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_sub_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 -1, i64 -3\n %6 = call i64 @FUNC(i64 %spec.select)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i64 -3, { 1, 0 }\n uselistorder i64 -1, { 3, 0, 1, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_add_11-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_max_add_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = zext i1 %5 to i64\n %6 = call i64 @FUNC(i64 %spec.select)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_add_10-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = load i32, i32* @gv_3, align 4\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i16, i16* %sv_0, align 2\n %9 = icmp eq i16 %8, 32767\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %10 = add i16 %8, 1\n %11 = sext i16 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_7\n LBL_6:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_5 to i64))\n br label LBL_7\n LBL_7:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_multiply_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp slt i16 %3, 1\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp sgt i16 %3, 16382\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = mul i16 %3, 2\n %7 = sext i16 %6 to i64\n %8 = and i64 %7, 4294967294\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_4\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_realloc_12-bad", "fun_name": "CWE690_NULL_Deref_From_Return__char_realloc_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 20)\n %1 = ptrtoint i64* %0 to i64\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n store i64 7596553777019711049, i64* %0, align 8\n %5 = add i64 %1, 8\n %6 = inttoptr i64 %5 to i16*\n store i16 25978, i16* %6, align 2\n %7 = add i64 %1, 10\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC(i64 %1)\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %10 = icmp eq i64* %0, null\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n store i64 7596553777019711049, i64* %0, align 8\n %11 = add i64 %1, 8\n %12 = inttoptr i64 %11 to i16*\n store i16 25978, i16* %12, align 2\n %13 = add i64 %1, 10\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n %15 = call i64 @FUNC(i64 %1)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %1, { 1, 5, 4, 0, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i16*\n store i16 ptrtoint (i64* @gv_2 to i16), i16* %5, align 8\n %6 = or i64 %4, 2\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 2\n br label LBL_3\n LBL_3:\n %8 = load i32, i32* @gv_3, align 4\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_9, label LBL_4\n LBL_4:\n %10 = bitcast i64* %sv_2 to i8*\n %11 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n %12 = icmp eq i32 %11, 1\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_9, label LBL_5\n LBL_5:\n %14 = load i64, i64* %sv_1, align 8\n %15 = and i64 %14, 4294967295\n %16 = icmp eq i64 %15, 0\n store i32 0, i32* %storemerge3.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %storemerge3.reload = load i32, i32* %storemerge3.reg2mem\n %17 = add i32 %storemerge3.reload, 1\n %18 = sext i32 %17 to i64\n %19 = icmp sgt i64 %15, %18\n store i32 %17, i32* %storemerge3.reg2mem\n br i1 %19, label LBL_6, label LBL_7\n LBL_7:\n %phitmp = zext i32 %17 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %20 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_9\n LBL_9:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 1, 0, 2 }\n uselistorder i64* %sv_2, { 2, 0, 1, 3 }\n uselistorder i32* %storemerge3.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i8* null, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 11)\n %5 = bitcast i64* %4 to i8*\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i8* %5, i8** %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %8, i32 %10)\n %12 = ptrtoint i8* %sv_0.0.reload to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %14)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fgets_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n store i32 %5, i32* %sv_0.0.reg2mem\n br i1 %8, label LBL_4, label LBL_1\n LBL_1:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = bitcast i64* %sv_1 to i8*\n %11 = call i8* @fgets(i8* nonnull %10, i32 20, %_IO_FILE* %9)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_3, label LBL_2\n LBL_2:\n %13 = call double @atof(i8* nonnull %10)\n %14 = fptrunc double %13 to float\n %15 = bitcast float %14 to i32\n %16 = sext i32 %15 to i128\n %17 = call i128 @FUNC(i128 %16)\n %18 = call i64 @FUNC(i128 %17)\n %19 = trunc i64 %18 to i32\n store i32 %19, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %20 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 %5, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %21 = call i64 @FUNC()\n %22 = trunc i64 %21 to i32\n %23 = icmp eq i32 %22, 0\n br i1 %23, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %24 = call i128 @__asm_movss.1(i32 %sv_0.0.reload)\n %25 = call i128 @__asm_movss.1(i32 2147483647)\n %26 = call i128 @FUNC(i128 %24, i128 %25)\n %27 = call i128 @FUNC(i128 %26)\n %28 = load i128, i128* @gv_2, align 8\n call void @FUNC(i128 %27, i128 %28)\n %29 = call i128 @FUNC(i128 %25, i128 %25)\n %30 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.0.reload)\n %31 = call i128 @FUNC(i64 4636737291354636288)\n %32 = call i128 @FUNC(i128 %31, i128 %30)\n %33 = call i32 @FUNC(i128 %32)\n %34 = zext i32 %33 to i64\n %35 = call i64 @FUNC(i64 %34)\n br label LBL_6\n LBL_6:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %2, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %25, { 1, 0, 2 }\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i128* @gv_2, { 1, 0 }\n uselistorder double (i8*)* @atof, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_rand_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %storemerge.reg2mem = alloca i128\n %1 = load i128, i128* %0\n %2 = call i128 @FUNC(i128 %1, i128 %1)\n %3 = call i64 @FUNC(i128 %2)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i32 %4, i32* %.reg2mem\n store i64 %3, i64* %sv_0.0.in.reg2mem\n br i1 %6, label LBL_5, label LBL_1\n LBL_1:\n %7 = call i32 @rand()\n %8 = urem i32 %7, 2\n %9 = icmp eq i32 %8, 0\n %10 = call i32 @rand()\n %11 = mul i32 %10, 1073741824\n %12 = call i32 @rand()\n %13 = mul i32 %12, 32768\n %14 = xor i32 %13, %11\n %15 = call i32 @rand()\n %16 = xor i32 %14, %15\n br i1 %9, label LBL_3, label LBL_2\n LBL_2:\n %17 = call i128 @FUNC(i128 %2, i128 %2)\n %18 = call i128 @FUNC(i32 %16)\n store i128 %18, i128* %storemerge.reg2mem\n br label LBL_4\n LBL_3:\n %19 = sub i32 0, %16\n %20 = sub i32 %19, 1\n %21 = call i128 @FUNC(i128 %2, i128 %2)\n %22 = call i128 @FUNC(i32 %20)\n store i128 %22, i128* %storemerge.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge.reload = load i128, i128* %storemerge.reg2mem\n %23 = call i64 @FUNC(i128 %storemerge.reload)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i64 %23, i64* %sv_0.0.in.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i32, i32* %.reg2mem\n %24 = zext i32 %.reload to i64\n %25 = icmp eq i32 %.reload, 5\n %26 = icmp eq i1 %25, false\n store i64 %24, i64* %rax.0.reg2mem\n br i1 %26, label LBL_9, label LBL_6\n LBL_6:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %27 = call i128 @__asm_movss.1(i32 %sv_0.0)\n %28 = call i128 @__asm_movss.1(i32 2147483647)\n %29 = call i128 @FUNC(i128 %27, i128 %28)\n %30 = call i128 @FUNC(i128 %29)\n %31 = load i128, i128* @gv_1, align 8\n call void @FUNC(i128 %30, i128 %31)\n %32 = icmp ult i32 %.reload, 6\n br i1 %32, label LBL_8, label LBL_7\n LBL_7:\n %33 = call i128 @FUNC(i128 %28, i128 %28)\n %34 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.0)\n %35 = call i128 @FUNC(i64 4636737291354636288)\n %36 = call i128 @FUNC(i128 %35, i128 %34)\n %37 = call i32 @FUNC(i128 %36)\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n store i64 %39, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_8:\n %40 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n store i64 %40, i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %28, { 1, 0, 2 }\n uselistorder i32 %sv_0.0, { 1, 0 }\n uselistorder i128 %2, { 3, 2, 1, 0, 4 }\n uselistorder i128* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.in.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i128* @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncat_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = call i64 @FUNC()\n %6 = call i64* @memset(i64* %1, i32 65, i32 49)\n %7 = ptrtoint i64* %1 to i64\n %8 = add i64 %7, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 0, i64* %sv_0, align 8\n %10 = call i32 @strlen(i8* %4)\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strncat(i8* nonnull %11, i8* %4, i32 %10)\n %13 = call i64 @FUNC(i64 %7)\n call void @free(i64* %1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_ncpy_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i8* @strncpy(i8* nonnull %4, i8* nonnull %2, i32 %5)\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_partial_init_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %7 = mul i64 %indvars.iv9.reload, 8\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv9.reload to i32\n store i32 %10, i32* %9, align 4\n %11 = add i64 %8, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 %10, i32* %12, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_4, label LBL_3\n LBL_4:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %16, i64* %rax.2.reg2mem\n br label LBL_8\n LBL_6:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %17 = mul i64 %indvars.iv6.reload, 8\n %18 = add i64 %17, %3\n %19 = inttoptr i64 %18 to i32*\n %20 = trunc i64 %indvars.iv6.reload to i32\n store i32 %20, i32* %19, align 4\n %21 = add i64 %18, 4\n %22 = inttoptr i64 %21 to i32*\n store i32 %20, i32* %22, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_7, label LBL_6\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %23 = mul i64 %indvars.iv.reload, 8\n %24 = add i64 %23, %3\n %25 = inttoptr i64 %24 to i32*\n %26 = load i32, i32* %25, align 4\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n %29 = add i64 %24, 4\n %30 = inttoptr i64 %29 to i32*\n %31 = load i32, i32* %30, align 4\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %33, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_7\n LBL_8:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_listen_socket_08-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_listen_socket_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %31 = icmp sgt i32 %sv_0.1.reload, 9\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %34, %33\n %36 = inttoptr i64 %35 to i32*\n %37 = load i32, i32* %36, align 4\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n br label LBL_13\n LBL_12:\n %40 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_0 to i64))\n br label LBL_13\n LBL_13:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %1, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_loop_03-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_loop_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 200)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 50)\n %7 = add i64 %5, -416\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 4\n %9 = add i64 %8, %4\n %10 = add i64 %7, %8\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = inttoptr i64 %9 to i32*\n store i32 %12, i32* %13, align 4\n %14 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %14, 100\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %15 = bitcast i64* %1 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n call void @free(i64* %1)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i8*\n store i8 0, i8* %6, align 1\n store i8* %6, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %8, i32 99)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = add i64 %10, 99\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %10)\n %14 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %14)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %3, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_multiply_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = icmp slt i64 %6, 0\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = icmp slt i64 %6, -4611686018427387903\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = mul i64 %6, 2\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_6\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_6, { 1, 2, 3, 4, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_environment_execlp_07-bad", "fun_name": "CWE78_OS_Command_Injection__char_environment_execlp_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_3\n LBL_3:\n %14 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_sleep_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = icmp slt i32 %sv_0.0.ph.reload, 1\n %11 = icmp sgt i32 %sv_0.0.ph.reload, ptrtoint (i1* @gv_3 to i32)\n %or.cond = or i1 %10, %11\n br i1 %or.cond, label LBL_7, label LBL_6\n LBL_6:\n %12 = call i32 @usleep(i32 %sv_0.0.ph.reload)\n %13 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_4 to i64))\n br label LBL_8\n LBL_7:\n %14 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_5 to i64))\n br label LBL_8\n LBL_8:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 2, 1, 0 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_8, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_loop_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %10 = add i64 %storemerge3.reload, %4\n %11 = add i64 %storemerge3.reload, %9\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = inttoptr i64 %10 to i8*\n store i8 %13, i8* %14, align 1\n %15 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n store i8 0, i8* %7, align 1\n %16 = call i64 @FUNC(i64 %4)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i64 %4, { 1, 0, 2 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_sub_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n ret i64 %0\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memcpy_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 40)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %sv_1, align 8\n %7 = inttoptr i64 %sv_0.0.reload to i64*\n %8 = call i64* @memcpy(i64* %7, i64* nonnull %sv_1, i32 40)\n %9 = inttoptr i64 %sv_0.0.reload to i32*\n %10 = load i32, i32* %9, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n call void @free(i64* %7)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 40, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fputs_13-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fputs_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_1, i64 0, i64 0), %_IO_FILE* %4)\n %6 = sext i32 %5 to i64\n %7 = icmp eq i32 %5, 0\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_2 to i64))\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_square_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %.off = add i32 %4, 46339\n %5 = icmp ugt i32 %.off, 92678\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %sext = mul i64 %3, 4294967296\n %6 = ashr exact i64 %sext, 32\n %7 = mul nsw i64 %6, %6\n %8 = and i64 %7, 4294967295\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__strdup_char_07-bad", "fun_name": "CWE401_Memory_Leak__strdup_char_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n store i64 7453010373643565421, i64* %sv_0, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strdup(i8* nonnull %4)\n %6 = ptrtoint i8* %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_predec_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i16, i16* %sv_0, align 2\n %9 = icmp eq i16 %8, -32768\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %10 = add i16 %8, -1\n store i16 %10, i16* %sv_0, align 2\n %11 = sext i16 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_7\n LBL_6:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_7:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_rand_to_char_07-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_rand_to_char_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge.in = xor i32 %8, %9\n %phitmp = mul i32 %storemerge.in, 16777216\n %phitmp1 = ashr exact i32 %phitmp, 24\n %phitmp2 = zext i32 %phitmp1 to i64\n store i64 %phitmp2, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %10 = call i64 @FUNC(i64 %sv_0.0.reload)\n ret i64 %10\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = bitcast i64* %sv_2 to i32*\n store i32* %4, i32** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %sv_3 to i64\n %sv_0.0.reload = load i32*, i32** %sv_0.0.reg2mem\n %6 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 50)\n %7 = ptrtoint i32* %sv_0.0.reload to i64\n %8 = add i64 %5, -416\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %9 = mul i64 %storemerge2.reload, 4\n %10 = add i64 %9, %7\n %11 = add i64 %8, %9\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = inttoptr i64 %10 to i32*\n store i32 %13, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %16 = load i32, i32* %sv_0.0.reload, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_sleep_01-bad", "fun_name": "CWE400_Resource_Exhaustion__connect_socket_sleep_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.03.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -22\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.03.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.03.reload = load i32, i32* %sv_0.03.reg2mem\n %20 = call i32 @usleep(i32 %sv_0.03.reload)\n %21 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_1 to i64))\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.03.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 2, 1, 3, 0, 4 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_short_08-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_short_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext = mul i32 %sv_0.1.reload, 65536\n %23 = ashr exact i32 %sext, 16\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_listenSocket_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %5, 5\n %7 = icmp eq i1 %6, false\n store i32 %5, i32* %.reg2mem\n store i64 %4, i64* %sv_0.0.in.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i128 @__asm_movss.1(i32 1073741824)\n %9 = call i64 @FUNC(i128 %8)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64 %9, i64* %sv_0.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %10 = zext i32 %.reload to i64\n %11 = icmp eq i32 %.reload, 5\n %12 = icmp eq i1 %11, false\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %13 = call i128 @FUNC(i128 %1, i128 %1)\n %14 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.0)\n %15 = call i128 @FUNC(i64 4636737291354636288)\n %16 = call i128 @FUNC(i128 %15, i128 %14)\n %17 = call i32 @FUNC(i128 %16)\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %2, { 1, 0 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 4, 6, 5, 7, 9, 8, 10 }\n uselistorder i32* @gv_0, { 0, 6, 5, 4, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_fwrite_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_4:\n %8 = load i32, i32* %sv_0, align 4\n %.off = add i32 %8, -1\n %9 = icmp ugt i32 %.off, 19\n br i1 %9, label LBL_12, label LBL_5\n LBL_5:\n %10 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_5, i64 0, i64 0))\n %11 = icmp eq %_IO_FILE* %10, null\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_6, label LBL_7\n LBL_6:\n %13 = load i32, i32* %sv_0, align 4\n %14 = icmp eq i32 %13, 0\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %14, label LBL_11, label LBL_8\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %15 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_6 to i64*), i32 1, i32 50, %_IO_FILE* %10)\n %16 = icmp eq i32 %15, 50\n br i1 %16, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 1)\n unreachable\n LBL_10:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %17 = add nuw i64 %storemerge4.reload, 1\n %18 = load i32, i32* %sv_0, align 4\n %19 = sext i32 %18 to i64\n %20 = icmp ult i64 %17, %19\n store i64 %17, i64* %storemerge4.reg2mem\n br i1 %20, label LBL_8, label LBL_11\n LBL_11:\n %21 = call i32 @fclose(%_IO_FILE* nonnull %10)\n br label LBL_12\n LBL_12:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %10, { 1, 0, 2 }\n uselistorder i32* %sv_0, { 2, 0, 3, 1, 4 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_file_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_13, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_5\n LBL_5:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_6\n LBL_6:\n %.pr = load i32, i32* @gv_0, align 4\n %19 = icmp eq i32 %.pr, 0\n br i1 %19, label LBL_13, label LBL_7\n LBL_7:\n %20 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n %21 = icmp eq i32 %20, 1\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_13, label LBL_8\n LBL_8:\n %23 = load i64, i64* %sv_1, align 8\n %24 = trunc i64 %23 to i32\n %25 = icmp sgt i32 %24, ptrtoint (i1* @gv_5 to i32)\n br i1 %25, label LBL_13, label LBL_9\n LBL_9:\n %26 = and i64 %23, 4294967295\n %27 = icmp eq i64 %26, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %27, label LBL_12, label LBL_10\n LBL_10:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %28 = add i32 %storemerge5.reload, 1\n %29 = sext i32 %28 to i64\n %30 = icmp sgt i64 %26, %29\n store i32 %28, i32* %storemerge5.reg2mem\n br i1 %30, label LBL_10, label LBL_11\n LBL_11:\n %phitmp = zext i32 %28 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_12\n LBL_12:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %31 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_13\n LBL_13:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %28, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 ptrtoint (i1* @gv_5 to i32), { 1, 0 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_13, { 1, 2, 3, 4, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int64_t_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = load i32, i32* inttoptr (i64 8372 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i64 %1, 0\n %5 = or i1 %4, %3\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = inttoptr i64 %1 to i64*\n %7 = load i64, i64* %6, align 8\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_0 to i64))\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memcpy_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 100)\n %5 = call i64* @memcpy(i64* %1, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %6 = load i64, i64* %1, align 8\n %7 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_strncpy_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n store i32 99, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = ptrtoint i64* %sv_3 to i64\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n store i64 0, i64* %sv_2, align 8\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %6 = bitcast i64* %sv_2 to i8*\n %7 = bitcast i64* %sv_1 to i8*\n %8 = call i8* @strncpy(i8* nonnull %6, i8* nonnull %7, i32 %sv_0.0.reload)\n %9 = zext i32 %sv_0.0.reload to i64\n %10 = add i64 %4, -112\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 0, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 13617, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = or i64 %2, 2\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 2\n %5 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %6 = icmp eq i32 %5, 1\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_5, label LBL_1\n LBL_1:\n %8 = load i64, i64* %sv_1, align 8\n %9 = and i64 %8, 4294967295\n %10 = icmp eq i64 %9, 0\n store i32 0, i32* %storemerge3.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %10, label LBL_4, label LBL_2\n LBL_2:\n %storemerge3.reload = load i32, i32* %storemerge3.reg2mem\n %11 = add i32 %storemerge3.reload, 1\n %12 = sext i32 %11 to i64\n %13 = icmp sgt i64 %9, %12\n store i32 %11, i32* %storemerge3.reg2mem\n br i1 %13, label LBL_2, label LBL_3\n LBL_3:\n %phitmp = zext i32 %11 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %14 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0, 2 }\n uselistorder i64* %sv_2, { 1, 2, 0 }\n uselistorder i32* %storemerge3.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 6, 7, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_char_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC(i64 122)\n %2 = call i64 @FUNC(i64 40)\n %3 = icmp eq i64 %0, %2\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.034.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.034.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.034.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, 0\n store i32 %19, i32* %sv_0.034.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.034.reload = load i32, i32* %sv_0.034.reg2mem\n %22 = udiv i32 100, %sv_0.034.reload\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.034.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 2, 0, 3 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_add_13-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_fscanf_add_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 1, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i64, i64* %sv_0, align 8\n %phitmp = add i64 %.pre, 1\n store i64 %phitmp, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %6 = call i64 @FUNC(i64 %.reload)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_31-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %.reg2mem14 = alloca i8*\n %.reg2mem12 = alloca i8\n %.reg2mem = alloca i8*\n %sv_0 = alloca i8*, align 8\n %0 = call i64* @malloc(i32 100)\n %1 = bitcast i64* %0 to i8*\n store i8* %1, i8** %sv_0, align 8\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i8 0, i8* %1, align 1\n %4 = call i32 @strlen(i8* %1)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_8, label LBL_3\n LBL_3:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_7, label LBL_4\n LBL_4:\n %15 = call i32 @strlen(i8* nonnull %1)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_8, label LBL_5\n LBL_5:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_8, label LBL_6\n LBL_6:\n store i8 0, i8* %20, align 1\n br label LBL_8\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_8\n LBL_8:\n %25 = load i8*, i8** %sv_0, align 8\n %26 = load i8, i8* %25, align 1\n %27 = icmp eq i8 %26, 0\n %28 = icmp eq i1 %27, false\n store i8* %25, i8** %.reg2mem\n store i8 %26, i8* %.reg2mem12\n store i8* %25, i8** %.reg2mem14\n br i1 %28, label LBL_9, label LBL_12\n LBL_9:\n %.reload13 = load i8, i8* %.reg2mem12\n %.reload = load i8*, i8** %.reg2mem\n %29 = icmp eq i8 %.reload13, 83\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n store i8* %.reload, i8** %.reg2mem14\n br label LBL_12\n LBL_11:\n %32 = ptrtoint i8* %.reload to i64\n %33 = add i64 %32, 1\n %34 = inttoptr i64 %33 to i8*\n %35 = load i8, i8* %34, align 1\n %36 = icmp eq i8 %35, 0\n %37 = icmp eq i1 %36, false\n store i8* %34, i8** %.reg2mem\n store i8 %35, i8* %.reg2mem12\n store i8* %34, i8** %.reg2mem14\n br i1 %37, label LBL_9, label LBL_12\n LBL_12:\n %.reload15 = load i8*, i8** %.reg2mem14\n %38 = bitcast i8* %.reload15 to i64*\n call void @free(i64* %38)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %.reload, { 1, 0 }\n uselistorder i8* %1, { 0, 2, 1, 3 }\n uselistorder i8** %.reg2mem, { 2, 0, 1 }\n uselistorder i8* %.reg2mem12, { 2, 0, 1 }\n uselistorder i8** %.reg2mem14, { 0, 1, 3, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i8 0, { 2, 0, 3, 4, 5, 6, 1 }\n uselistorder label LBL_12, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_listen_socket_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 7, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %8 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = sext i32 %sv_0.0.reload to i64\n %11 = mul i64 %10, 4\n %12 = add i64 %9, -48\n %13 = add i64 %12, %11\n %14 = inttoptr i64 %13 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_6\n LBL_5:\n %18 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_6:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 0, 2, 4, 9, 10, 11, 1, 12, 3, 6, 8, 13, 14, 15, 5, 16, 7 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_declare_cat_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %3 = add i64 %1, 49\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 1\n store i64 0, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strcat(i8* nonnull %5, i8* nonnull %6)\n %8 = call i64 @FUNC(i64 %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %spec.select = select i1 %2, i32 -1, i32 20\n %3 = mul i32 %spec.select, 4\n %4 = call i64* @malloc(i32 %3)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_1, label LBL_2\n LBL_1:\n %7 = ptrtoint i64* %4 to i64\n %8 = sext i32 %spec.select to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 4\n %10 = add i64 %9, %7\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw i64 %storemerge1.reload, 1\n %13 = icmp ult i64 %12, %8\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %13, label LBL_3, label LBL_4\n LBL_4:\n %14 = bitcast i64* %4 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %4)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_4:\n %10 = load i8, i8* %sv_0, align 1\n %11 = icmp slt i8 %10, 0\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_8, label LBL_5\n LBL_5:\n %13 = icmp slt i8 %10, -63\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = mul i8 %10, 2\n %15 = sext i8 %14 to i64\n %16 = and i64 %15, 4294967294\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_8\n LBL_7:\n %18 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memcpy_04-bad", "fun_name": "CWE126_Buffer_Overread__malloc_char_memcpy_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 50)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = add i64 %4, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %10)\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64* @memset(i64* %0, i32 65, i32 99)\n %5 = add i64 %3, 99\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %3)\n ret i64 %7\n\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 0, 1, 2, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_predec_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = call i32 @rand()\n %8 = xor i32 %7, %6\n %9 = sext i1 %3 to i32\n %storemerge.in = xor i32 %8, %9\n %10 = trunc i32 %storemerge.in to i16\n %11 = icmp eq i16 %10, -32768\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %sext4 = mul i32 %storemerge.in, 65536\n %sext = add i32 %sext4, -65536\n %12 = ashr exact i32 %sext, 16\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memcpy_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = bitcast i64* %1 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = load i64, i64* %sv_0, align 8\n store i64 %7, i64* %1, align 8\n %8 = add i64 %4, 8\n %9 = inttoptr i64 %8 to i64*\n %10 = add i64 %4, 16\n %11 = inttoptr i64 %10 to i64*\n %12 = add i64 %4, 24\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %4, 32\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %4, 40\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %4, 48\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %4, 56\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %4, 64\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %4, 72\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %4, 80\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %4, 88\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %4, 96\n %31 = inttoptr i64 %30 to i32*\n %32 = add i64 %4, 99\n %33 = inttoptr i64 %32 to i8*\n store i8 0, i8* %33, align 1\n %34 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 0, 1, 2, 10, 3, 13, 4, 5, 6, 7, 8, 9, 11, 12 }\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %6, i64* %rax.2.reg2mem\n br label LBL_6\n LBL_4:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %7 = mul i64 %indvars.iv6.reload, 8\n %8 = add i64 %7, %3\n %9 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %10 = trunc i64 %indvars.iv6.reload to i32\n %11 = call i128 @FUNC(i32 %10)\n %12 = call i64 @FUNC(i128 %11)\n %13 = inttoptr i64 %8 to i64*\n store i64 %12, i64* %13, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %11, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_5, label LBL_4\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 8\n %15 = add i64 %14, %3\n %16 = inttoptr i64 %15 to i64*\n %17 = load i64, i64* %16, align 8\n %18 = call i128 @FUNC(i64 %17)\n %19 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %19, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_cpy_08-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_cpy_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %7, -8\n %12 = inttoptr i64 %11 to i8*\n store i8* %12, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %13 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %14 = bitcast i64* %sv_1 to i8*\n %15 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %14)\n %16 = ptrtoint i8* %sv_0.0.reload to i64\n %17 = call i64 @FUNC(i64 %16)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_multiply_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 0, i32 -2\n %6 = trunc i32 %spec.select to i16\n %7 = icmp slt i16 %6, 0\n %8 = icmp eq i1 %7, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = mul i32 %spec.select, 2\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 -2, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_memmove_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %5 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 100)\n %6 = inttoptr i64 %sv_0.0.reload to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_2 to i32))\n %8 = load i64, i64* %6, align 8\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = call i64 @FUNC()\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, 0\n store i64 %8, i64* %rax.0.reg2mem\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %11)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_multiply_03-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp slt i32 %6, 0\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = icmp slt i32 %6, -1073741823\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = mul i32 %6, 2\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_6\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 0, 2, 1 }\n uselistorder label LBL_6, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_07-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv4.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_13, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = call i64* @malloc(i32 40)\n %14 = ptrtoint i64* %13 to i64\n %15 = icmp eq i64* %13, null\n %16 = icmp eq i1 %15, false\n store i64 0, i64* %indvars.iv4.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %17 = mul i64 %indvars.iv4.reload, 4\n %18 = add i64 %17, %14\n %19 = inttoptr i64 %18 to i32*\n store i32 0, i32* %19, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 10\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n br i1 %exitcond6, label LBL_8, label LBL_7\n LBL_8:\n %20 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %20, label LBL_11, label LBL_9\n LBL_9:\n %21 = sext i32 %sv_0.0.reload to i64\n %22 = mul i64 %21, 4\n %23 = add i64 %22, %14\n %24 = inttoptr i64 %23 to i32*\n store i32 1, i32* %24, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %25 = mul i64 %indvars.iv.reload, 4\n %26 = add i64 %25, %14\n %27 = inttoptr i64 %26 to i32*\n %28 = load i32, i32* %27, align 4\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_10\n LBL_11:\n %31 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_12:\n call void @free(i64* %13)\n br label LBL_13\n LBL_13:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %14, { 1, 0, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32 -1, { 2, 0, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_03-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.04.reg2mem = alloca i8*\n %sv_0.05.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %0 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_4\n LBL_4:\n %13 = load i8, i8* %3, align 1\n %14 = icmp eq i8 %13, 0\n %15 = icmp eq i1 %14, false\n store i8 %13, i8* %.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n store i8* %3, i8** %sv_0.04.reg2mem\n br i1 %15, label LBL_5, label LBL_8\n LBL_5:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %16 = icmp eq i8 %.reload, 83\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n %18 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n store i8* %sv_0.05.reload, i8** %sv_0.04.reg2mem\n br label LBL_8\n LBL_7:\n %19 = ptrtoint i8* %sv_0.05.reload to i64\n %20 = add i64 %19, 1\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 0\n %24 = icmp eq i1 %23, false\n store i8 %22, i8* %.reg2mem\n store i8* %21, i8** %sv_0.05.reg2mem\n store i8* %21, i8** %sv_0.04.reg2mem\n br i1 %24, label LBL_5, label LBL_8\n LBL_8:\n %sv_0.04.reload = load i8*, i8** %sv_0.04.reg2mem\n %25 = bitcast i8* %sv_0.04.reload to i64*\n call void @free(i64* %25)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %sv_0.05.reload, { 1, 0 }\n uselistorder i8* %3, { 0, 1, 2, 4, 3 }\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.05.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.04.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8 0, { 1, 0, 2, 3 }\n uselistorder label LBL_8, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_sub_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = load i64, i64* %sv_0, align 8\n %8 = icmp eq i64 %7, -9223372036854775808\n br i1 %6, label LBL_4, label LBL_1\n LBL_1:\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = add i64 %7, -1\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_7\n LBL_3:\n %11 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_4:\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %12 = add i64 %7, -1\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_7\n LBL_6:\n %14 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_7:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %8, { 1, 0 }\n uselistorder i64 %7, { 1, 0, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_uninit_variable_struct_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64*)* @printStructLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_postdec_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 -3)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 2, 1, 0 }\n uselistorder i64 -3, { 1, 0 }\n uselistorder i32* @gv_0, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i8** %sv_1 to i64\n %5 = add i64 %4, -17\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n %8 = bitcast i8** %sv_1 to i64*\n store i64 %6, i64* %8, align 8\n store i8 0, i8* %7, align 16\n br label LBL_2\n LBL_2:\n store i64 4702111234474983745, i64* %sv_0, align 8\n %9 = load i8*, i8** %sv_1, align 8\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strcpy(i8* %9, i8* nonnull %10)\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 3, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_postdec_10-bad", "fun_name": "CWE191_Integer_Underflow__unsigned_int_fscanf_postdec_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = add i32 %6, -1\n store i32 %7, i32* %sv_0, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_realloc_14-bad", "fun_name": "CWE401_Memory_Leak__int_realloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @realloc(i64* null, i32 400)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i32*\n store i32 5, i32* %7, align 4\n %8 = call i64 @FUNC(i64 5)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* null, { 1, 0 }\n uselistorder i32 5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_square_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %narrow = select i1 %5, i64 0, i64 4\n %6 = call i64 @FUNC(i64 %narrow)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE467_Use_of_sizeof_on_Pointer_Type__int_05-bad", "fun_name": "CWE467_Use_of_sizeof_on_Pointer_Type__int_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 8)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = bitcast i64* %2 to i32*\n store i32 5, i32* %5, align 4\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_alloca_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 400)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 4\n %9 = add i64 %8, %4\n %10 = inttoptr i64 %9 to i32*\n store i32 5, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge1.reg2mem\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = inttoptr i64 %sv_0.0.reload to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %16)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 5, { 3, 0, 4, 1, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_no_init_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %5 = mul i64 %indvars.iv5.reload, 4\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = trunc i64 %indvars.iv5.reload to i32\n store i32 %8, i32* %7, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %9 = load i32, i32* @gv_2, align 4\n %10 = icmp eq i32 %9, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %1\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_multiply_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %12 = ashr exact i32 %sext, 16\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %12, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %13 = icmp eq i32 %.reload, 5\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n %14 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %15 = trunc i32 %sv_0.0.reload to i16\n %16 = icmp slt i16 %15, 0\n %17 = icmp eq i1 %16, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %17, label LBL_8, label LBL_5\n LBL_5:\n %18 = icmp slt i16 %15, -16383\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n %sext2 = mul i32 %sv_0.0.reload, 131072\n %19 = ashr exact i32 %sext2, 16\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_7:\n %22 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_loop_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = sext i32 %7 to i64\n %9 = add nsw i64 %8, 1\n %10 = icmp eq i64 %9, 0\n br i1 %10, label LBL_6, label LBL_4\n LBL_4:\n %11 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %12 = add i64 %storemerge1.reload, %sv_0.0.reload\n %13 = add i64 %storemerge1.reload, %11\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = inttoptr i64 %12 to i8*\n store i8 %15, i8* %16, align 1\n %17 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, %9\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %18 = call i64 @FUNC(i64 %sv_0.0.reload)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_multiply_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp slt i32 %6, 0\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = icmp slt i32 %6, -1073741823\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = mul i32 %6, 2\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_6\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder label LBL_6, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_listen_socket_05-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_listen_socket_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_13, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_3 to i64\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = sext i32 %15 to i64\n %19 = add i64 %3, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %4)\n %26 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_9:\n %.pr = load i32, i32* @gv_0, align 4\n %27 = icmp eq i32 %.pr, 0\n br i1 %27, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n store i64 0, i64* %sv_2, align 8\n %28 = icmp sgt i32 %sv_0.1.ph.reload, 9\n br i1 %28, label LBL_12, label LBL_11\n LBL_11:\n %29 = sext i32 %sv_0.1.ph.reload to i64\n %30 = mul i64 %29, 4\n %31 = add i64 %3, -64\n %32 = add i64 %31, %30\n %33 = inttoptr i64 %32 to i32*\n %34 = load i32, i32* %33, align 4\n %35 = zext i32 %34 to i64\n %36 = call i64 @FUNC(i64 %35)\n br label LBL_13\n LBL_12:\n %37 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_13\n LBL_13:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_13, { 1, 2, 3, 0 }\n uselistorder label LBL_9, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memmove_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_2 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_2 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %7, i64 0, i64 100)\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_3 to i32))\n %10 = load i64, i64* %8, align 8\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = ptrtoint i64* %1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n %8 = call i64* @memset(i64* %1, i32 65, i32 49)\n store i8 0, i8* %7, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* %1, i32 %9)\n %11 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 2, 3, 1, 0, 5, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_loop_17-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_loop_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = add i64 %3, 99\n %6 = inttoptr i64 %5 to i8*\n %7 = call i64* @memset(i64* %4, i32 65, i32 99)\n store i8 0, i8* %6, align 1\n %8 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %8)\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_3, label LBL_1\n LBL_1:\n %11 = sext i32 %9 to i64\n %12 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %13 = add i64 %storemerge3.reload, %3\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge3.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw i64 %storemerge3.reload, 1\n %19 = icmp ult i64 %18, %11\n store i64 %18, i64* %storemerge3.reg2mem\n br i1 %19, label LBL_2, label LBL_3\n LBL_3:\n %20 = call i64 @FUNC(i64 %3)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i64 %3, { 3, 0, 4, 1, 2 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_large_to_char_13-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_large_to_char_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = select i1 %2, i64 4294967295, i64 4\n %4 = call i64 @FUNC(i64 %3)\n ret i64 %4\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memmove_09-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memmove_09_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i8*\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* %5, i32 %9)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1, 3, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_12-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 10)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n store i64* %4, i64** %sv_0.0.in.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i64* @malloc(i32 11)\n %8 = icmp eq i64* %7, null\n %9 = icmp eq i1 %8, false\n store i64* %7, i64** %sv_0.0.in.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %sv_0.0.in.reload = load i64*, i64** %sv_0.0.in.reg2mem\n %sv_0.0 = bitcast i64* %sv_0.0.in.reload to i8*\n store i64 4702111234474983745, i64* %sv_1, align 8\n %10 = bitcast i64* %sv_1 to i8*\n %11 = call i8* @strcpy(i8* %sv_0.0, i8* nonnull %10)\n %12 = ptrtoint i64* %sv_0.0.in.reload to i64\n %13 = call i64 @FUNC(i64 %12)\n call void @free(i64* %sv_0.0.in.reload)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.in.reload, { 2, 1, 0 }\n uselistorder i64** %sv_0.0.in.reg2mem, { 0, 2, 1 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_postinc_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp eq i32 %sv_0.0.reload, 2147483647\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = add i32 %sv_0.0.reload, 1\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_8\n LBL_7:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_connect_socket_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n store i32 %5, i32* %sv_0.03.reg2mem\n br i1 %7, label LBL_5, label LBL_1\n LBL_1:\n %8 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %9 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %10 = call i16 @htons(i16 27015)\n %11 = bitcast i64* %sv_2 to %sockaddr*\n %12 = call i32 @connect(i32 %6, %sockaddr* nonnull %11, i32 16)\n %13 = icmp eq i32 %12, -1\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_4, label LBL_2\n LBL_2:\n %14 = call i32 @recv(i32 %6, i64* nonnull %sv_1, i32 19, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -32\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call double @atof(i8* nonnull %22)\n %24 = fptrunc double %23 to float\n %25 = bitcast float %24 to i32\n %26 = sext i32 %25 to i128\n %27 = call i128 @FUNC(i128 %26)\n %28 = call i64 @FUNC(i128 %27)\n %29 = trunc i64 %28 to i32\n store i32 %29, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %30 = call i32 @close(i32 %6)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.03.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.03.reload = load i32, i32* %sv_0.03.reg2mem\n %31 = call i128 @__asm_movss.1(i32 %sv_0.03.reload)\n %32 = call i64 @FUNC(i128 %31)\n %33 = trunc i64 %32 to i32\n %34 = call i128 @__asm_movss.1(i32 %33)\n %35 = call i64 @FUNC(i128 %34)\n %36 = trunc i64 %35 to i32\n %37 = call i128 @__asm_movss.1(i32 %36)\n %38 = call i128 @__asm_movss.1(i32 2147483647)\n %39 = call i128 @FUNC(i128 %37, i128 %38)\n %40 = call i128 @__asm_cvtss2sd.2(i128 %39)\n %41 = load i128, i128* @gv_1, align 8\n call void @FUNC(i128 %40, i128 %41)\n %42 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n %43 = call i64 @FUNC(i64 40)\n %44 = icmp eq i64 %2, %43\n store i64 0, i64* %rax.0.reg2mem\n br i1 %44, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %6, { 2, 0, 1, 3 }\n uselistorder i32 %5, { 2, 1, 0 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.03.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 11)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = call i8* @strncpy(i8* %4, i8* nonnull %5, i32 %7)\n %9 = ptrtoint i64* %1 to i64\n %10 = call i64 @FUNC(i64 %9)\n call void @free(i64* %1)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fscanf_strncpy_14-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__fscanf_strncpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i16, align 2\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_2, align 2\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_2)\n br label LBL_2\n LBL_2:\n store i64 0, i64* %sv_1, align 8\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %7 = load i16, i16* %sv_2, align 2\n %8 = icmp sgt i16 %7, 99\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = ptrtoint i64* %sv_3 to i64\n %10 = bitcast i64* %sv_1 to i8*\n %11 = bitcast i64* %sv_0 to i8*\n %12 = sext i16 %7 to i32\n %13 = call i8* @strncpy(i8* nonnull %10, i8* nonnull %11, i32 %12)\n %14 = load i16, i16* %sv_2, align 2\n %15 = sext i16 %14 to i64\n %16 = add i64 %9, -112\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n br label LBL_4\n LBL_4:\n %19 = call i64 @FUNC(i64* nonnull %sv_1)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_2, { 1, 2, 0, 3 }\n uselistorder i8 0, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE587_Assignment_of_Fixed_Address_to_Pointer__basic_12-bad", "fun_name": "CWE587_Assignment_of_Fixed_Address_to_Pointer__basic_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load i8, i8* inttoptr (i64 4194304 to i8*), align 4194304\n %5 = sext i8 %4 to i64\n %6 = and i64 %5, 4294967295\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 97)\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %4 = mul i64 %indvars.iv6.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %7 = add i64 %1, 28\n %8 = inttoptr i64 %7 to i32*\n store i32 1, i32* %8, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %9 = mul i64 %indvars.iv.reload, 4\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %1, { 0, 2, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 1, 0, 2, 4 }\n uselistorder i32 -1, { 0, 1, 2, 4, 3, 5 }\n uselistorder i64* (i32)* @malloc, { 2, 0, 3, 1, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memcpy_10-bad", "fun_name": "CWE126_Buffer_Overread__malloc_char_memcpy_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 50)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 49)\n %8 = add i64 %6, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %10 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %11 = bitcast i64* %sv_1 to i8*\n %12 = call i32 @strlen(i8* nonnull %11)\n %13 = call i64* @memcpy(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 %12)\n %14 = call i64 @FUNC(i64* nonnull %sv_1)\n call void @free(i64* %sv_0.0.reload)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_loop_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 400)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 50)\n %10 = add i64 %8, -416\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = mul i64 %storemerge1.reload, 4\n %12 = add i64 %11, %sv_0.0.reload\n %13 = add i64 %10, %11\n %14 = inttoptr i64 %13 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = inttoptr i64 %12 to i32*\n store i32 %15, i32* %16, align 4\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %18 = inttoptr i64 %sv_0.0.reload to i32*\n %19 = load i32, i32* %18, align 4\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %22)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_execlp_07-bad", "fun_name": "CWE78_OS_Command_Injection__char_file_execlp_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0))\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_ncat_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = add i64 %1, 49\n %3 = inttoptr i64 %2 to i8*\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n store i8 0, i8* %3, align 1\n %5 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_0, align 8\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i8* @strncat(i8* nonnull %7, i8* nonnull %5, i32 %6)\n %9 = call i64 @FUNC(i64 %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %5, { 1, 0 }\n uselistorder i64* %sv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_01-bad", "fun_name": "CWE416_Use_After_Free__malloc_free_struct_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n store i32 1, i32* %6, align 4\n %7 = add i64 %5, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 2, i32* %8, align 4\n %9 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %9, 100\n store i64 %9, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n call void @free(i64* %0)\n %10 = call i64 @FUNC(i64 %1)\n ret i64 %10\n\n uselistorder i64 %1, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_08-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_scanf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n %5 = icmp eq i32 %4, 0\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_zero_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = call i128 @FUNC(i128 %1, i128 %1)\n %3 = call i64 @FUNC(i128 %2)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %3, i64* %sv_0.0.in.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i128 @FUNC(i128 %2, i128 %2)\n %8 = call i64 @FUNC(i128 %7)\n store i64 %8, i64* %sv_0.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC()\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 0\n store i64 %9, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %12 = call i128 @__asm_movss.1(i32 %sv_0.0)\n %13 = call i128 @__asm_movss.1(i32 2147483647)\n %14 = call i128 @FUNC(i128 %12, i128 %13)\n %15 = call i128 @FUNC(i128 %14)\n %16 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %15, i128 %16)\n %17 = call i128 @FUNC(i128 %13, i128 %13)\n %18 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.0)\n %19 = call i128 @FUNC(i64 4636737291354636288)\n %20 = call i128 @FUNC(i128 %19, i128 %18)\n %21 = call i32 @FUNC(i128 %20)\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %13, { 1, 0, 2 }\n uselistorder i32 %sv_0.0, { 1, 0 }\n uselistorder i128 %2, { 1, 0, 2 }\n uselistorder i128* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %6, label LBL_12, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_0 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_10, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_10, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_10, label LBL_5\n LBL_5:\n %16 = sext i32 %4 to i64\n %17 = ptrtoint i64* %sv_1 to i64\n %18 = add i64 %16, %17\n %19 = inttoptr i64 %18 to i64*\n %20 = sub i32 99, %4\n %21 = call i32 @recv(i32 %14, i64* %19, i32 %20, i32 0)\n %22 = add i32 %21, 1\n %23 = icmp ult i32 %22, 2\n br i1 %23, label LBL_11, label LBL_6\n LBL_6:\n %24 = sext i32 %21 to i64\n %25 = add i64 %18, %24\n %26 = inttoptr i64 %25 to i8*\n store i8 0, i8* %26, align 1\n %27 = call i8* @strchr(i8* nonnull %1, i32 13)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %27, align 1\n br label LBL_8\n LBL_8:\n %29 = call i8* @strchr(i8* nonnull %1, i32 10)\n %30 = icmp eq i8* %29, null\n br i1 %30, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %29, align 1\n br label LBL_11\n LBL_10:\n %31 = call i32 @close(i32 %5)\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %5)\n %33 = call i32 @close(i32 %14)\n br label LBL_12\n LBL_12:\n %34 = load i32, i32* @gv_1, align 4\n %35 = icmp eq i32 %34, 0\n br i1 %35, label LBL_14, label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_15\n LBL_14:\n %37 = call i32 @puts(i8* nonnull %1)\n br label LBL_15\n LBL_15:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %21, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_08-bad", "fun_name": "CWE415_Double_Free__malloc_free_int64_t_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %3)\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* null, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_multiply_08-bad", "fun_name": "CWE191_Integer_Underflow__int_rand_multiply_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n %17 = icmp slt i32 %sv_0.0.reload, 0\n %18 = icmp eq i1 %17, false\n %or.cond = or i1 %18, %16\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %19 = mul i32 %sv_0.0.reload, 2\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_partial_init_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv10.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv13.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %indvars.iv13.reg2mem\n br label LBL_1\n LBL_1:\n %indvars.iv13.reload = load i64, i64* %indvars.iv13.reg2mem\n %2 = mul i64 %indvars.iv13.reload, 4\n %3 = add i64 %2, %1\n %4 = inttoptr i64 %3 to i32*\n %5 = trunc i64 %indvars.iv13.reload to i32\n store i32 %5, i32* %4, align 4\n %indvars.iv.next14 = add nuw nsw i64 %indvars.iv13.reload, 1\n %exitcond15 = icmp eq i64 %indvars.iv.next14, 5\n store i64 %indvars.iv.next14, i64* %indvars.iv13.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond15, label LBL_2, label LBL_1\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %6 = mul i64 %indvars.iv.reload, 4\n %7 = add i64 %6, %1\n %8 = inttoptr i64 %7 to i32*\n %9 = trunc i64 %indvars.iv.reload to i32\n store i32 %9, i32* %8, align 4\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 0, i64* %indvars.iv10.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv10.reload = load i64, i64* %indvars.iv10.reg2mem\n %10 = mul i64 %indvars.iv10.reload, 4\n %11 = add i64 %10, %1\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %indvars.iv.next11 = add nuw nsw i64 %indvars.iv10.reload, 1\n %exitcond12 = icmp eq i64 %indvars.iv.next11, 10\n store i64 %indvars.iv.next11, i64* %indvars.iv10.reg2mem\n br i1 %exitcond12, label LBL_4, label LBL_3\n LBL_4:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv10.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_for_loop_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 20, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 -1, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %storemerge1.reg2mem\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n %8 = add nuw i64 %storemerge1.reload, 1\n %9 = icmp ult i64 %8, %sv_0.0.reload\n store i64 %8, i64* %storemerge1.reg2mem\n store i64 %sv_0.0.reload, i64* %rax.0.reg2mem\n br i1 %9, label LBL_3, label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_popen_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = add i64 %6, %7\n %9 = inttoptr i64 %8 to i32*\n store i32 2764330, i32* %9, align 4\n br label LBL_2\n LBL_2:\n %10 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %11 = icmp eq %_IO_FILE* %10, null\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i32 @pclose(%_IO_FILE* nonnull %10)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*)* @pclose, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_multiply_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8420 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 1152921504606846976\n %9 = call i32 @rand()\n %10 = zext i32 %9 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 1073741824\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = mul i64 %16, 32768\n %18 = call i32 @rand()\n %19 = sext i32 %18 to i64\n %20 = sext i1 %5 to i64\n %21 = xor i64 %8, %20\n %22 = xor i64 %21, %11\n %23 = xor i64 %22, %14\n %24 = xor i64 %23, %17\n %storemerge = xor i64 %24, %19\n %25 = icmp slt i64 %storemerge, 1\n store i64 5, i64* %rax.0.reg2mem\n br i1 %25, label LBL_5, label LBL_2\n LBL_2:\n %26 = icmp sgt i64 %storemerge, 4611686018427387902\n br i1 %26, label LBL_4, label LBL_3\n LBL_3:\n %27 = mul i64 %storemerge, 2\n %28 = call i64 @FUNC(i64 %27)\n store i64 %28, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %29, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_printf_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_14, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_1 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %6, label LBL_12, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_0 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_10, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_10, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_10, label LBL_5\n LBL_5:\n %16 = sext i32 %4 to i64\n %17 = ptrtoint i64* %sv_1 to i64\n %18 = add i64 %16, %17\n %19 = inttoptr i64 %18 to i64*\n %20 = sub i32 99, %4\n %21 = call i32 @recv(i32 %14, i64* %19, i32 %20, i32 0)\n %22 = add i32 %21, 1\n %23 = icmp ult i32 %22, 2\n br i1 %23, label LBL_11, label LBL_6\n LBL_6:\n %24 = sext i32 %21 to i64\n %25 = add i64 %18, %24\n %26 = inttoptr i64 %25 to i8*\n store i8 0, i8* %26, align 1\n %27 = call i8* @strchr(i8* nonnull %3, i32 13)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %27, align 1\n br label LBL_8\n LBL_8:\n %29 = call i8* @strchr(i8* nonnull %3, i32 10)\n %30 = icmp eq i8* %29, null\n br i1 %30, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %29, align 1\n br label LBL_11\n LBL_10:\n %31 = call i32 @close(i32 %5)\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %5)\n %33 = call i32 @close(i32 %14)\n br label LBL_12\n LBL_12:\n %.pr = load i32, i32* @gv_0, align 4\n %34 = icmp eq i32 %.pr, 0\n br i1 %34, label LBL_14, label LBL_13\n LBL_13:\n %35 = call i32 @puts(i8* nonnull %3)\n br label LBL_14\n LBL_14:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %21, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %3, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_14, { 1, 2, 0 }\n uselistorder label LBL_12, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_multiply_07-bad", "fun_name": "CWE191_Integer_Underflow__char_min_multiply_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %spec.store.select = select i1 %2, i32 32, i32 -128\n %4 = trunc i32 %spec.store.select to i8\n %5 = icmp slt i8 %4, 0\n %6 = icmp eq i1 %5, false\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = mul i32 %spec.store.select, 2\n %8 = and i32 %7, 64\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_environment_12-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_environment_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge35.reg2mem = alloca i32\n %sv_1.0.lcssa.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i32\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_4, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_3 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_4\n LBL_3:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = bitcast i64* %sv_3 to i16*\n store i16 13617, i16* %15, align 8\n %16 = or i64 %14, 2\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 2\n br label LBL_4\n LBL_4:\n %18 = call i64 @FUNC()\n %19 = trunc i64 %18 to i32\n %20 = icmp eq i32 %19, 0\n %21 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_2)\n %22 = icmp eq i32 %21, 1\n %23 = icmp eq i1 %22, false\n br i1 %20, label LBL_10, label LBL_5\n LBL_5:\n br i1 %23, label LBL_16, label LBL_6\n LBL_6:\n %24 = load i64, i64* %sv_2, align 8\n %25 = and i64 %24, 4294967295\n %26 = icmp eq i64 %25, 0\n store i32 0, i32* %storemerge7.reg2mem\n store i64 0, i64* %sv_1.0.lcssa.reg2mem\n br i1 %26, label LBL_9, label LBL_7\n LBL_7:\n %storemerge7.reload = load i32, i32* %storemerge7.reg2mem\n %27 = add i32 %storemerge7.reload, 1\n %28 = sext i32 %27 to i64\n %29 = icmp sgt i64 %25, %28\n store i32 %27, i32* %storemerge7.reg2mem\n br i1 %29, label LBL_7, label LBL_8\n LBL_8:\n %phitmp = zext i32 %27 to i64\n store i64 %phitmp, i64* %sv_1.0.lcssa.reg2mem\n br label LBL_9\n LBL_9:\n %sv_1.0.lcssa.reload = load i64, i64* %sv_1.0.lcssa.reg2mem\n %30 = call i64 @FUNC(i64 %sv_1.0.lcssa.reload)\n br label LBL_16\n LBL_10:\n br i1 %23, label LBL_16, label LBL_11\n LBL_11:\n %31 = load i64, i64* %sv_2, align 8\n %32 = trunc i64 %31 to i32\n %33 = icmp sgt i32 %32, ptrtoint (i1* @gv_2 to i32)\n br i1 %33, label LBL_16, label LBL_12\n LBL_12:\n %34 = and i64 %31, 4294967295\n %35 = icmp eq i64 %34, 0\n store i32 0, i32* %storemerge35.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %35, label LBL_15, label LBL_13\n LBL_13:\n %storemerge35.reload = load i32, i32* %storemerge35.reg2mem\n %36 = add i32 %storemerge35.reload, 1\n %37 = sext i32 %36 to i64\n %38 = icmp sgt i64 %34, %37\n store i32 %36, i32* %storemerge35.reg2mem\n br i1 %38, label LBL_13, label LBL_14\n LBL_14:\n %phitmp9 = zext i32 %36 to i64\n store i64 %phitmp9, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_15\n LBL_15:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %39 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_16\n LBL_16:\n %40 = call i64 @FUNC(i64 40)\n %41 = icmp eq i64 %0, %40\n store i64 0, i64* %rax.0.reg2mem\n br i1 %41, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %36, { 1, 0, 2 }\n uselistorder i32 %27, { 1, 0, 2 }\n uselistorder i1 %23, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 1 }\n uselistorder i32* %storemerge7.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_1.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32* %storemerge35.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memmove_07-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_memmove_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %7, -8\n %phitmp = inttoptr i64 %11 to i64*\n store i64* %phitmp, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %13 = call i64* @memmove(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 100)\n %14 = call i64 @FUNC(i64* nonnull %sv_1)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 100)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = ptrtoint i64* %2 to i64\n %6 = call i64* @memset(i64* %2, i32 65, i32 99)\n %7 = add i64 %5, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n call void @free(i64* %2)\n br label LBL_4\n LBL_4:\n %9 = load i32, i32* @gv_1, align 4\n %10 = icmp eq i32 %9, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_cpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC()\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = bitcast i8** %sv_2 to i64*\n store i64 %13, i64* %14, align 8\n br label LBL_2\n LBL_2:\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %16 = load i8*, i8** %sv_2, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i8* @strcpy(i8* nonnull %17, i8* %16)\n %19 = ptrtoint i64* %sv_0 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %1, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 2, 0, 1 }\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_max_square_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_3, label LBL_4\n LBL_3:\n %5 = call i64 @FUNC(i64 0)\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %6 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 99)\n %9 = add i64 %3, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_2\n LBL_2:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strcpy(i8* nonnull %12, i8* %11)\n %14 = call i64 @FUNC(i64 %3)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_pointer_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32*\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_2:\n %3 = call i64* @malloc(i32 4)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n store i32* %6, i32** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %7 = load i32, i32* @gv_0, align 4\n %8 = zext i32 %7 to i64\n %9 = icmp eq i32 %7, 5\n %10 = icmp eq i1 %9, false\n store i64 %8, i64* %rax.0.reg2mem\n br i1 %10, label LBL_7, label LBL_6\n LBL_6:\n %sv_0.0.reload = load i32*, i32** %sv_0.0.reg2mem\n %11 = load i32, i32* %sv_0.0.reload, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__freopen_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call %_IO_FILE* @freopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), %_IO_FILE* %4)\n %6 = call i32 @fclose(%_IO_FILE* %5)\n %7 = sext i32 %6 to i64\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* (i8*, i8*, %_IO_FILE*)* @freopen, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_char_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 67)\n %.pr = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_2\n LBL_2:\n %4 = call i64 @FUNC(i64 90)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 (i64)* @printHexCharLine, { 5, 4, 3, 2, 1, 0 }\n uselistorder i64 67, { 1, 2, 0 }\n uselistorder i32* @gv_0, { 0, 4, 3, 2, 1 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cat_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strcat(i8* %sv_0.0.reload, i8* nonnull %6)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*)* @strcat, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_file_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_1, align 8\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = sext i32 %10 to i64\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n store i32 1852400175, i32* %13, align 4\n %14 = add i64 %12, 4\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i32 @putenv(i8* nonnull %9)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %2, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %12, { 1, 0 }\n uselistorder i32 (i8*)* @putenv, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_multiply_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp slt i32 %6, 1\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = icmp sgt i32 %6, 1073741822\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = mul i32 %6, 2\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_6\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder label LBL_6, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_add_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 13, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %27 = load i32, i32* @gv_1, align 4\n %28 = icmp eq i32 %27, 0\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n %29 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_14\n LBL_11:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %30 = icmp eq i32 %sv_0.1.reload, 2147483647\n br i1 %30, label LBL_13, label LBL_12\n LBL_12:\n %31 = add i32 %sv_0.1.reload, 1\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_14\n LBL_13:\n %34 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_14\n LBL_14:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_sub_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 -3)\n ret i64 %0\n\n uselistorder i64 (i64)* @printLongLongLine, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_listen_socket_05-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_listen_socket_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv10.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_18, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %4, label LBL_9, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 13, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_9\n LBL_9:\n %.pr = load i32, i32* @gv_0, align 4\n %27 = icmp eq i32 %.pr, 0\n br i1 %27, label LBL_18, label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %28 = call i64* @malloc(i32 40)\n %29 = ptrtoint i64* %28 to i64\n %30 = icmp eq i64* %28, null\n %31 = icmp eq i1 %30, false\n store i64 0, i64* %indvars.iv10.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @exit(i32 -1)\n unreachable\n LBL_12:\n %indvars.iv10.reload = load i64, i64* %indvars.iv10.reg2mem\n %32 = mul i64 %indvars.iv10.reload, 4\n %33 = add i64 %32, %29\n %34 = inttoptr i64 %33 to i32*\n store i32 0, i32* %34, align 4\n %indvars.iv.next11 = add nuw nsw i64 %indvars.iv10.reload, 1\n %exitcond12 = icmp eq i64 %indvars.iv.next11, 10\n store i64 %indvars.iv.next11, i64* %indvars.iv10.reg2mem\n br i1 %exitcond12, label LBL_13, label LBL_12\n LBL_13:\n %35 = icmp slt i32 %sv_0.1.ph.reload, 0\n br i1 %35, label LBL_16, label LBL_14\n LBL_14:\n %36 = sext i32 %sv_0.1.ph.reload to i64\n %37 = mul i64 %36, 4\n %38 = add i64 %37, %29\n %39 = inttoptr i64 %38 to i32*\n store i32 1, i32* %39, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_15\n LBL_15:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %40 = mul i64 %indvars.iv.reload, 4\n %41 = add i64 %40, %29\n %42 = inttoptr i64 %41 to i32*\n %43 = load i32, i32* %42, align 4\n %44 = zext i32 %43 to i64\n %45 = call i64 @FUNC(i64 %44)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_17, label LBL_15\n LBL_16:\n %46 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_1 to i64))\n br label LBL_17\n LBL_17:\n call void @free(i64* %28)\n br label LBL_18\n LBL_18:\n %47 = call i64 @FUNC(i64 40)\n %48 = icmp eq i64 %0, %47\n store i64 0, i64* %rax.0.reg2mem\n br i1 %48, label LBL_20, label LBL_19\n LBL_19:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_20\n LBL_20:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %29, { 1, 0, 2 }\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64* %indvars.iv10.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 7, 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_18, { 1, 2, 0 }\n uselistorder label LBL_17, { 1, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_sleep_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -22\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n %20 = icmp slt i32 %sv_0.0.ph.reload, 1\n %21 = icmp sgt i32 %sv_0.0.ph.reload, ptrtoint (i1* @gv_1 to i32)\n %or.cond3 = or i1 %20, %21\n br i1 %or.cond3, label LBL_6, label LBL_5\n LBL_5:\n %22 = call i32 @usleep(i32 %sv_0.0.ph.reload)\n %23 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @usleep, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0, 2, 3 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_4, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_loop_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 49)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_8, label LBL_6\n LBL_6:\n %14 = sext i32 %12 to i64\n %15 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = add i64 %storemerge2.reload, %.pre-phi.reload\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = add i64 %storemerge2.reload, %15\n %20 = inttoptr i64 %19 to i8*\n store i8 %18, i8* %20, align 1\n %21 = add nuw i64 %storemerge2.reload, 1\n %22 = icmp ult i64 %21, %14\n store i64 %21, i64* %storemerge2.reg2mem\n br i1 %22, label LBL_7, label LBL_8\n LBL_8:\n %23 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i64* %1, { 2, 5, 1, 3, 0, 4 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_sleep_12-bad", "fun_name": "CWE400_Resource_Exhaustion__rand_sleep_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 20, i32* %storemerge1.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i32, i32* %storemerge1.reg2mem\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = call i32 @usleep(i32 %storemerge1.reload)\n %18 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_0 to i64))\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %19 = icmp slt i32 %storemerge1.reload, 1\n %20 = icmp sgt i32 %storemerge1.reload, ptrtoint (i1* @gv_1 to i32)\n %or.cond = or i1 %19, %20\n br i1 %or.cond, label LBL_6, label LBL_5\n LBL_5:\n %21 = call i32 @usleep(i32 %storemerge1.reload)\n %22 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_2 to i64))\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %23 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_3 to i64))\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge1.reload, { 0, 1, 3, 2 }\n uselistorder i32* %storemerge1.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @usleep, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__long_calloc_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 1, i32 8)\n %1 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %2 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 2, 4, 0, 3, 5, 1 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i64 @FUNC()\n %8 = trunc i64 %7 to i32\n %9 = icmp eq i32 %8, 0\n store i64 %7, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %10 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %10)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_loop_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_3, label LBL_1\n LBL_1:\n %7 = ptrtoint i64* %sv_1 to i64\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %7\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge1.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = add nuw i64 %storemerge1.reload, 1\n %16 = icmp ult i64 %15, %8\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %16, label LBL_2, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64* nonnull %sv_0)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_add_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n %7 = urem i32 %2, 2\n %8 = icmp eq i32 %7, 0\n %9 = sext i1 %8 to i32\n %storemerge = xor i32 %5, %9\n %10 = trunc i32 %storemerge to i8\n %11 = icmp eq i8 %10, 127\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %sext = mul i32 %storemerge, 16777216\n %sext2 = add i32 %sext, 16777216\n %12 = ashr exact i32 %sext2, 24\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncat_07-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncat_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i8* @strncat(i8* nonnull %13, i8* %11, i32 %12)\n %15 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %11, { 1, 0 }\n uselistorder i64* %1, { 1, 5, 2, 3, 0, 4 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_min_multiply_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 -4)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 -4, { 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 4, 3, 5 }\n uselistorder i32* @gv_0, { 4, 0, 3, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %7 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %7, 20\n store i64 %7, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %8 = bitcast i64* %0 to i32*\n %9 = load i32, i32* %8, align 4\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__open_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.in.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = icmp eq i32 %0, -1\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @close(i32 %0)\n br label LBL_2\n LBL_2:\n %3 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gv_1, i64 0, i64 0), i32 66)\n %4 = icmp eq i32 %3, -1\n store i64 -1, i64* %rax.0.in.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = call i32 @close(i32 %3)\n %phitmp = sext i32 %5 to i64\n store i64 %phitmp, i64* %rax.0.in.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.in.reload = load i64, i64* %rax.0.in.reg2mem\n ret i64 %rax.0.in.reload\n\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, ...)* @open, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_loop_05-bad", "fun_name": "CWE126_Buffer_Overread__char_alloca_loop_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -49\n %5 = and i64 %4, -16\n %6 = add i64 %2, -161\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %5 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %5, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = inttoptr i64 %7 to i64*\n %13 = call i64* @memset(i64* %12, i32 65, i32 99)\n %14 = add i64 %7, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = load i32, i32* @gv_0, align 4\n %17 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @strlen(i8* nonnull %18)\n %20 = icmp eq i32 %19, 0\n br i1 %20, label LBL_3, label LBL_1\n LBL_1:\n %21 = icmp eq i32 %16, 0\n %spec.select = select i1 %21, i64 %1, i64 %5\n %22 = sext i32 %19 to i64\n %23 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %24 = add i64 %storemerge1.reload, %spec.select\n %25 = inttoptr i64 %24 to i8*\n %26 = load i8, i8* %25, align 1\n %27 = add i64 %storemerge1.reload, %23\n %28 = inttoptr i64 %27 to i8*\n store i8 %26, i8* %28, align 1\n %29 = add nuw i64 %storemerge1.reload, 1\n %30 = icmp ult i64 %29, %22\n store i64 %29, i64* %storemerge1.reg2mem\n br i1 %30, label LBL_2, label LBL_3\n LBL_3:\n %31 = call i64 @FUNC(i64* nonnull %sv_0)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %3, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %19, { 1, 0 }\n uselistorder i64 %7, { 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 11)\n %5 = bitcast i64* %4 to i8*\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i8* %5, i8** %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %8, i32 %10)\n %12 = ptrtoint i8* %sv_0.0.reload to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %14)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_predec_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.14.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8428 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.14.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.14.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n br i1 %14, label LBL_4, label LBL_5\n LBL_4:\n %15 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.14.reg2mem\n br label LBL_6\n LBL_5:\n %16 = ptrtoint i64* %sv_3 to i64\n %17 = sext i32 %12 to i64\n %18 = add i64 %16, -22\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = bitcast i64* %sv_1 to i8*\n %22 = call i32 @atoi(i8* nonnull %21)\n %23 = call i32 @close(i32 %4)\n %24 = icmp eq i32 %22, -2147483648\n store i32 %22, i32* %sv_0.14.reg2mem\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n %sv_0.14.reload = load i32, i32* %sv_0.14.reg2mem\n %25 = add i32 %sv_0.14.reload, -1\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n br label LBL_8\n LBL_7:\n %28 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_8\n LBL_8:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.14.reg2mem, { 0, 4, 3, 1, 2 }\n uselistorder label LBL_6, { 3, 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_strncpy_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n store i64 0, i64* %sv_1, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %4 = bitcast i64* %sv_1 to i8*\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @strncpy(i8* nonnull %4, i8* nonnull %5, i32 99)\n %7 = add i64 %0, -13\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC(i64* nonnull %sv_1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %1, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_for_loop_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge213.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %3, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = add i64 %15, -22\n %17 = bitcast i64* %sv_1 to i8*\n %18 = sext i32 %12 to i64\n %19 = add i64 %16, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i32 @atoi(i8* nonnull %17)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_9\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.1.off = add i32 %sv_0.0.ph.reload, -1\n %25 = icmp ugt i32 %sv_0.1.off, 19\n %26 = sext i32 %sv_0.0.ph.reload to i64\n store i64 0, i64* %storemerge213.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %storemerge213.reload = load i64, i64* %storemerge213.reg2mem\n %27 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n %28 = add nuw i64 %storemerge213.reload, 1\n %29 = icmp ult i64 %28, %26\n store i64 %28, i64* %storemerge213.reg2mem\n br i1 %29, label LBL_8, label LBL_9\n LBL_9:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge213.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 0, 2, 3, 4, 5 }\n uselistorder label LBL_9, { 0, 3, 2, 1 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncpy_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strncpy(i8* nonnull %1, i8* nonnull %4, i32 99)\n %6 = add i64 %2, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC(i64 %2)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_fscanf_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i32, i32* %sv_0, align 4\n %9 = icmp ugt i32 %8, 9\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = ptrtoint i64* %sv_1 to i64\n %11 = sext i32 %8 to i64\n %12 = mul i64 %11, 4\n %13 = add i64 %10, -48\n %14 = add i64 %13, %12\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n br label LBL_6\n LBL_5:\n %19 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %8, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__short_connect_socket_14-bad", "fun_name": "CWE197_Numeric_Truncation_Error__short_connect_socket_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 7, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -16\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %sext = mul i32 %21, 65536\n %22 = ashr exact i32 %sext, 16\n store i32 %22, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext2 = mul i32 %sv_0.1.reload, 16777216\n %24 = ashr exact i32 %sext2, 24\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 8440 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64* @malloc(i32 40)\n %7 = ptrtoint i64* %6 to i64\n %8 = icmp eq i64* %6, null\n %9 = icmp eq i1 %8, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %10 = mul i64 %indvars.iv5.reload, 4\n %11 = add i64 %10, %7\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_5, label LBL_4\n LBL_5:\n %13 = load i32, i32* %sv_0, align 4\n %14 = icmp ugt i32 %13, 9\n br i1 %14, label LBL_8, label LBL_6\n LBL_6:\n %15 = sext i32 %13 to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %16, %7\n %18 = inttoptr i64 %17 to i32*\n store i32 1, i32* %18, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %19 = mul i64 %indvars.iv.reload, 4\n %20 = add i64 %19, %7\n %21 = inttoptr i64 %20 to i32*\n %22 = load i32, i32* %21, align 4\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %25 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_9\n LBL_9:\n call void @free(i64* %6)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_postdec_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, -2147483648\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i64 %3, 4294967296\n %sext = add i64 %6, -4294967296\n %7 = ashr exact i64 %sext, 32\n store i64 %7, i64* %sv_0, align 8\n %8 = and i64 %7, 4294967295\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_realloc_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 400)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* null, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_square_34-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge2.in = xor i32 %9, %10\n %storemerge2.in.off = add i32 %storemerge2.in, 65534\n %11 = icmp ugt i32 %storemerge2.in.off, 131068\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = mul i32 %storemerge2.in, %storemerge2.in\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %15, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i32 %storemerge2.in, { 1, 2, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__negative_malloc_12-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__negative_malloc_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %. = select i1 %2, i32 99, i32 -1\n %3 = trunc i32 %. to i16\n %4 = icmp sgt i16 %3, 99\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = call i64* @malloc(i32 %.)\n %6 = icmp eq i64* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %5 to i64\n %9 = add nsw i32 %., -1\n %10 = call i64* @memset(i64* %5, i32 65, i32 %9)\n %11 = zext i32 %. to i64\n %sext3 = mul i64 %11, 281474976710656\n %12 = ashr exact i64 %sext3, 48\n %13 = add nsw i64 %12, -1\n %14 = add i64 %13, %8\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %8)\n call void @free(i64* %5)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %5, { 0, 1, 3, 2 }\n uselistorder i32 %., { 2, 0, 1, 3 }\n uselistorder i32 -1, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__sizeof_int64_t_08-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__sizeof_int64_t_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64* @malloc(i32 8)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 2147483643, i64* %1, align 8\n %4 = call i64 @FUNC(i64 2147483643)\n call void @free(i64* %1)\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__rand_strncpy_01-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__rand_strncpy_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = call i32 @rand()\n %8 = xor i32 %7, %6\n %9 = sext i1 %3 to i32\n %storemerge.in = xor i32 %8, %9\n %10 = trunc i32 %storemerge.in to i16\n store i64 0, i64* %sv_1, align 8\n %11 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %12 = icmp sgt i16 %10, 99\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n %sext3 = mul i32 %storemerge.in, 65536\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = bitcast i64* %sv_1 to i8*\n %15 = bitcast i64* %sv_0 to i8*\n %16 = ashr exact i32 %sext3, 16\n %17 = call i8* @strncpy(i8* nonnull %14, i8* nonnull %15, i32 %16)\n %18 = sext i32 %16 to i64\n %19 = add i64 %13, -128\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n br label LBL_2\n LBL_2:\n %22 = call i64 @FUNC(i64* nonnull %sv_1)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_large_06-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_large_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -8\n %3 = inttoptr i64 %2 to i32*\n store i32 1, i32* %3, align 8\n %4 = add i64 %0, -48\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_1\n LBL_1:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %5 = mul i64 %indvars.iv.reload, 4\n %6 = add i64 %4, %5\n %7 = inttoptr i64 %6 to i32*\n %8 = load i32, i32* %7, align 4\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %1, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_preinc_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp eq i32 %sv_0.1.reload, 2147483647\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = add i32 %sv_0.1.reload, 1\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_10\n LBL_9:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_declare_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 400)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %5 = mul i64 %storemerge1.reload, 4\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n store i32 5, i32* %7, align 4\n %8 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %8, 100\n store i64 %8, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %9 = bitcast i64* %0 to i32*\n %10 = load i32, i32* %9, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_sleep_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i32 20, i32* %sv_0.01.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %3 = zext i32 %.pre to i64\n %4 = icmp eq i32 %.pre, 5\n %5 = icmp eq i1 %4, false\n store i32 -1, i32* %sv_0.01.reg2mem\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %6 = call i32 @usleep(i32 %sv_0.01.reload)\n %7 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_2 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.01.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 0, 2, 4, 9, 10, 11, 1, 12, 3, 6, 8, 13, 14, 15, 5, 16, 7 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 49)\n %6 = add i64 %3, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %3, i64* %sv_1, align 8\n store i64 0, i64* %sv_0, align 8\n %8 = inttoptr i64 %3 to i8*\n %9 = call i32 @strlen(i8* %8)\n %10 = call i64* @memcpy(i64* nonnull %sv_0, i64* %4, i32 %9)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 4, 3, 2, 5 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE478_Missing_Default_Case_in_Switch__basic_14-bad", "fun_name": "CWE478_Missing_Default_Case_in_Switch__basic_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = srem i32 %4, 3\n store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @gv_0, i64 0, i64 0), i8** %sv_0.0.reg2mem\n switch i32 %5, label LBL_4 [\n i32 0, label LBL_2\n i32 1, label LBL_3\n ]\n LBL_2:\n store i8* bitcast (i64* @gv_1 to i8*), i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n store i8* bitcast (i64* @gv_2 to i8*), i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %6 = ptrtoint i8* %sv_0.0.reload to i64\n %7 = call i64 @FUNC(i64 %6)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_printf_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = sext i32 %2 to i64\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n %11 = call i32 @puts(i8* nonnull %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i8* (i8*)* @getenv, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_memmove_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = call i64* @memmove(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 100)\n %5 = add i64 %2, 99\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %2)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_3 to i64\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = sext i32 %12 to i64\n %16 = add i64 %3, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %.pr = load i32, i32* @gv_0, align 4\n %22 = icmp eq i32 %.pr, 0\n br i1 %22, label LBL_11, label LBL_7\n LBL_7:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n store i64 0, i64* %sv_2, align 8\n %23 = icmp ugt i32 %sv_0.1.ph.reload, 9\n br i1 %23, label LBL_10, label LBL_8\n LBL_8:\n %24 = sext i32 %sv_0.1.ph.reload to i64\n %25 = mul i64 %24, 4\n %26 = add i64 %3, -64\n %27 = add i64 %25, %26\n %28 = inttoptr i64 %27 to i32*\n store i32 1, i32* %28, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_9\n LBL_9:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %29 = mul i64 %indvars.iv.reload, 4\n %30 = add i64 %29, %26\n %31 = inttoptr i64 %30 to i32*\n %32 = load i32, i32* %31, align 4\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_11, label LBL_9\n LBL_10:\n %35 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_11:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 0, 3, 1 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_strncpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %spec.select = select i1 %4, i32 0, i32 99\n store i64 0, i64* %sv_1, align 8\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i8* @strncpy(i8* nonnull %6, i8* nonnull %7, i32 %spec.select)\n %9 = zext i32 %spec.select to i64\n %10 = add i64 %0, -112\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %spec.select, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 2, 1, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_add_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.045.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.045.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.045.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, 2147483647\n store i32 %19, i32* %sv_0.045.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.045.reload = load i32, i32* %sv_0.045.reg2mem\n %22 = add i32 %sv_0.045.reload, 1\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.045.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_no_init_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n %7 = trunc i64 %indvars.iv5.reload to i32\n store i32 %7, i32* %6, align 4\n %8 = add i64 %5, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 %7, i32* %9, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %10 = mul i64 %indvars.iv.reload, 8\n %11 = add i64 %10, %1\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = add i64 %11, 4\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %20\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 2, 0, 1, 3, 4 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_environment_01-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_environment_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_1, align 8\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %11 = icmp eq i8* %10, null\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = sext i32 %9 to i64\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = add i64 %12, %13\n %15 = inttoptr i64 %14 to i8*\n %16 = sub i32 249, %9\n %17 = call i8* @strncat(i8* %15, i8* nonnull %10, i32 %16)\n br label LBL_2\n LBL_2:\n %18 = call i32 @putenv(i8* nonnull %8)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %2, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_memcpy_31-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = bitcast i64* %1 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = load i64, i64* %sv_0, align 8\n store i64 %7, i64* %1, align 8\n %8 = add i64 %4, 8\n %9 = inttoptr i64 %8 to i64*\n %10 = add i64 %4, 16\n %11 = inttoptr i64 %10 to i64*\n %12 = add i64 %4, 24\n %13 = inttoptr i64 %12 to i64*\n %14 = add i64 %4, 32\n %15 = inttoptr i64 %14 to i64*\n %16 = add i64 %4, 40\n %17 = inttoptr i64 %16 to i64*\n %18 = add i64 %4, 48\n %19 = inttoptr i64 %18 to i64*\n %20 = add i64 %4, 56\n %21 = inttoptr i64 %20 to i64*\n %22 = add i64 %4, 64\n %23 = inttoptr i64 %22 to i64*\n %24 = add i64 %4, 72\n %25 = inttoptr i64 %24 to i64*\n %26 = add i64 %4, 80\n %27 = inttoptr i64 %26 to i64*\n %28 = add i64 %4, 88\n %29 = inttoptr i64 %28 to i64*\n %30 = add i64 %4, 96\n %31 = inttoptr i64 %30 to i32*\n %32 = add i64 %4, 99\n %33 = inttoptr i64 %32 to i8*\n store i8 0, i8* %33, align 1\n %34 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 13, 12, 0, 8, 1, 11, 2, 3, 4, 5, 6, 7, 9, 10 }\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n uselistorder i64* %sv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__struct_realloc_04-bad", "fun_name": "CWE690_NULL_Deref_From_Return__struct_realloc_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = ptrtoint i64* %0 to i64\n %2 = bitcast i64* %0 to i32*\n store i32 1, i32* %2, align 4\n %3 = add i64 %1, 4\n %4 = inttoptr i64 %3 to i32*\n store i32 1, i32* %4, align 4\n %5 = call i64 @FUNC(i64 %1)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_fprintf_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = sext i32 %2 to i64\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %27 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 6, 7, 0 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 1 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_ncpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_0.LBL_3_crit_edge, label LBL_2\n LBL_1:\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, 49\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n store i64 %4, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %7 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strncpy(i8* nonnull %9, i8* nonnull %7, i32 %8)\n %11 = call i64 @FUNC(i64 %.pre-phi.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %7, { 1, 0 }\n uselistorder i64* %sv_1, { 3, 1, 2, 0 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_postinc_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp eq i16 %3, 32767\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i16 %3, 1\n store i16 %5, i16* %sv_0, align 2\n %6 = sext i16 %5 to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0, 3 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memmove_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 400)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 50)\n %5 = call i64* @memmove(i64* %1, i64* nonnull %sv_0, i32 400)\n %6 = bitcast i64* %1 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 400, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_multiply_17-bad", "fun_name": "CWE190_Integer_Overflow__int_listen_socket_multiply_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %3, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = add i64 %15, -22\n %17 = bitcast i64* %sv_1 to i8*\n %18 = sext i32 %12 to i64\n %19 = add i64 %16, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i32 @atoi(i8* nonnull %17)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_9\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp slt i32 %sv_0.0.ph.reload, 1\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %26 = mul i32 %sv_0.0.ph.reload, 2\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_9\n LBL_9:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_9, { 3, 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_loop_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = add i64 %0, -161\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = inttoptr i64 %5 to i64*\n %11 = call i64* @memset(i64* %10, i32 65, i32 99)\n %12 = add i64 %5, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC()\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = bitcast i64* %sv_0 to i8*\n %17 = call i32 @strlen(i8* nonnull %16)\n %18 = icmp eq i32 %17, 0\n br i1 %18, label LBL_3, label LBL_1\n LBL_1:\n %19 = sext i32 %17 to i64\n %20 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %21 = add i64 %storemerge2.reload, %5\n %22 = inttoptr i64 %21 to i8*\n %23 = load i8, i8* %22, align 1\n %24 = add i64 %storemerge2.reload, %20\n %25 = inttoptr i64 %24 to i8*\n store i8 %23, i8* %25, align 1\n %26 = add nuw i64 %storemerge2.reload, 1\n %27 = icmp ult i64 %26, %19\n store i64 %26, i64* %storemerge2.reg2mem\n br i1 %27, label LBL_2, label LBL_3\n LBL_3:\n %28 = call i64 @FUNC(i64* nonnull %sv_0)\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %1, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i32 %17, { 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 2, 1, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cat_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i8* null, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strcat(i8* %sv_0.0.reload, i8* nonnull %9)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %13)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_memcpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %spec.select = select i1 %4, i32 -1, i32 99\n store i64 0, i64* %sv_1, align 8\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %6 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %spec.select)\n %7 = sext i32 %spec.select to i64\n %8 = add i64 %0, -112\n %9 = add i64 %8, %7\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %spec.select, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 2, 1, 3, 0 }\n uselistorder i32 -1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_square_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %.off = add i32 %4, 46339\n %5 = icmp ugt i32 %.off, 92678\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %sext = mul i64 %3, 4294967296\n %6 = ashr exact i64 %sext, 32\n %7 = mul nsw i64 %6, %6\n %8 = and i64 %7, 4294967295\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_2:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_int_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 5)\n %.pr = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_2\n LBL_2:\n %4 = call i64 @FUNC(i64 10)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 (i64)* @printIntLine, { 5, 4, 3, 2, 1, 0 }\n uselistorder i64 5, { 1, 2, 0 }\n uselistorder i32* @gv_0, { 0, 4, 3, 2, 1 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_malloc_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 99)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64* @memset(i64* %0, i32 65, i32 98)\n %5 = add i64 %3, 98\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %5 = and i64 %4, -16\n store i64 %5, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %6 = ptrtoint i64* %sv_2 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %6\n %9 = add i64 %8, -816\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 8\n %11 = add i64 %8, -812\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %14 = load i64, i64* %sv_1, align 8\n %15 = inttoptr i64 %14 to i64*\n %16 = call i64* @memcpy(i64* %15, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_2 to i32))\n %17 = load i64, i64* %sv_1, align 8\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memcpy_15-bad", "fun_name": "CWE126_Buffer_Overread__char_declare_memcpy_15_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_2, i32 %5)\n %7 = call i64 @FUNC(i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 2, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_multiply_09-bad", "fun_name": "CWE190_Integer_Overflow__char_rand_multiply_09_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = sext i1 %2 to i32\n %storemerge = xor i32 %5, %6\n %7 = trunc i32 %storemerge to i8\n %8 = icmp slt i8 %7, 1\n store i64 1, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %sext2 = mul i32 %storemerge, 33554432\n %9 = ashr exact i32 %sext2, 24\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_max_add_07-bad", "fun_name": "CWE190_Integer_Overflow__short_max_add_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 4294934528)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_char_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 2, 1, 0, 3, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 3, 2, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_printf_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 32777976880262761, i64* %6, align 8\n br label LBL_2\n LBL_2:\n %7 = call i64 @FUNC()\n %8 = trunc i64 %7 to i32\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, ...) @printf(i8* nonnull %10)\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1, 3 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0 = alloca i8*, align 8\n %0 = call i64* @malloc(i32 50)\n %1 = bitcast i64* %0 to i8*\n store i8* %1, i8** %sv_0, align 8\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = call i64* @memset(i64* %0, i32 65, i32 49)\n %5 = ptrtoint i64* %0 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i8*, i8** %sv_0, align 8\n %9 = call i32 @strlen(i8* %8)\n %10 = add i32 %9, 1\n %11 = call i64* @calloc(i32 %10, i32 1)\n %12 = icmp eq i64* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %14 = bitcast i64* %11 to i8*\n %15 = call i8* @strcpy(i8* %14, i8* %8)\n %16 = ptrtoint i64* %11 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %11)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %11, { 1, 0, 3, 2 }\n uselistorder i8* %8, { 1, 0 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32, i32)* @calloc, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 7, 6, 5, 4, 3, 2, 1, 0, 8 }\n uselistorder i64* (i32)* @malloc, { 1, 2, 0, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_01-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = add i64 %1, 99\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 1\n store i64 0, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %6)\n %8 = call i64 @FUNC(i64 %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_rand_multiply_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = urem i32 %2, 2\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @rand()\n %6 = mul i32 %5, 1073741824\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = xor i32 %8, %6\n %10 = call i32 @rand()\n %11 = xor i32 %9, %10\n %12 = sext i1 %4 to i32\n %storemerge.in = xor i32 %11, %12\n %13 = load i32, i32* @gv_0, align 4\n %14 = zext i32 %13 to i64\n %15 = icmp eq i32 %13, 0\n %16 = icmp slt i32 %storemerge.in, 1\n %or.cond = or i1 %15, %16\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_5, label LBL_2\n LBL_2:\n %17 = icmp sgt i32 %storemerge.in, 1073741822\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n %18 = mul i32 %storemerge.in, 2\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %21 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__struct_calloc_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @calloc(i32 1, i32 8)\n %2 = icmp eq i64* %1, null\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %1 to i64\n %4 = bitcast i64* %1 to i32*\n store i32 1, i32* %4, align 4\n %5 = add i64 %3, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 1, i32* %6, align 4\n %7 = call i64 @FUNC(i64 %3)\n call void @free(i64* nonnull %1)\n br label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i32 %3, 1\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memmove_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %10 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %11 = bitcast i64* %sv_1 to i8*\n %12 = call i32 @strlen(i8* nonnull %11)\n %13 = call i64* @memmove(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 %12)\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = call i64 @FUNC(i64 %14)\n call void @free(i64* %sv_0.0.reload)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 3, 0, 1, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_execl_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = add i64 %6, %7\n %9 = inttoptr i64 %8 to i32*\n store i32 2764330, i32* %9, align 4\n br label LBL_2\n LBL_2:\n %10 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_1, i64 0, i64 0))\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i8*, ...)* @execl, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %sv_0.06.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.06.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -22\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.06.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.06.reload = load i32, i32* %sv_0.06.reg2mem\n %20 = call i64* @malloc(i32 40)\n %21 = ptrtoint i64* %20 to i64\n %22 = icmp eq i64* %20, null\n %23 = icmp eq i1 %22, false\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %24 = mul i64 %indvars.iv9.reload, 4\n %25 = add i64 %24, %21\n %26 = inttoptr i64 %25 to i32*\n store i32 0, i32* %26, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 10\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_8, label LBL_7\n LBL_8:\n %27 = icmp ugt i32 %sv_0.06.reload, 9\n br i1 %27, label LBL_11, label LBL_9\n LBL_9:\n %28 = sext i32 %sv_0.06.reload to i64\n %29 = mul i64 %28, 4\n %30 = add i64 %29, %21\n %31 = inttoptr i64 %30 to i32*\n store i32 1, i32* %31, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %32 = mul i64 %indvars.iv.reload, 4\n %33 = add i64 %32, %21\n %34 = inttoptr i64 %33 to i32*\n %35 = load i32, i32* %34, align 4\n %36 = zext i32 %35 to i64\n %37 = call i64 @FUNC(i64 %36)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_10\n LBL_11:\n %38 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_12\n LBL_12:\n call void @free(i64* %20)\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %21, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.06.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_calloc_07-bad", "fun_name": "CWE401_Memory_Leak__char_calloc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @calloc(i32 100, i32 1)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n store i64 7453010373643542593, i64* %4, align 8\n %8 = add i64 %7, 8\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %7)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__listen_socket_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @gv_2, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_3, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i8*, i8*, i32, i8*)* @__assert_fail, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_environment_execlp_05-bad", "fun_name": "CWE78_OS_Command_Injection__char_environment_execlp_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_3\n LBL_3:\n %13 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %5, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_1 to %sockaddr*\n %10 = call i32 @connect(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_8, label LBL_3\n LBL_3:\n %12 = sext i32 %4 to i64\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = add i64 %12, %13\n %15 = inttoptr i64 %14 to i64*\n %16 = sub i32 99, %4\n %17 = call i32 @recv(i32 %5, i64* %15, i32 %16, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n br i1 %19, label LBL_8, label LBL_4\n LBL_4:\n %20 = sext i32 %17 to i64\n %21 = add i64 %14, %20\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = call i8* @strchr(i8* nonnull %3, i32 13)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %23, align 1\n br label LBL_6\n LBL_6:\n %25 = call i8* @strchr(i8* nonnull %3, i32 10)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %25, align 1\n br label LBL_8\n LBL_8:\n %27 = call i32 @close(i32 %5)\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_2, align 4\n %29 = icmp eq i32 %28, 0\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_11:\n store i64 0, i64* %sv_0, align 8\n %31 = bitcast i64* %sv_0 to i8*\n %32 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %31, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_2)\n %33 = ptrtoint i64* %sv_0 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %5, { 3, 1, 2, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__equals_05-bad", "fun_name": "CWE398_Poor_Code_Quality__equals_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 1)\n %3 = call i64 @FUNC(i64 1)\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_preinc_17-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_rand_preinc_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = urem i32 %0, 2\n %7 = icmp eq i32 %6, 0\n %8 = zext i32 %1 to i64\n %9 = mul i64 %8, 1152921504606846976\n %10 = zext i32 %2 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = sext i32 %3 to i64\n %13 = mul i64 %12, 1073741824\n %14 = sext i32 %4 to i64\n %15 = mul i64 %14, 32768\n %16 = sext i32 %5 to i64\n %17 = sext i1 %7 to i64\n %18 = xor i64 %9, %17\n %19 = xor i64 %18, %11\n %20 = xor i64 %19, %13\n %21 = xor i64 %20, %15\n %storemerge2.le = xor i64 %21, %16\n %22 = add i64 %storemerge2.le, 1\n %23 = call i64 @FUNC(i64 %22)\n ret i64 %23\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__long_realloc_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %2 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 2, 4, 0, 3, 5, 1 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_rand_square_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge2.in = xor i32 %9, %10\n %storemerge2.in.off = add i32 %storemerge2.in, 46339\n %11 = icmp ugt i32 %storemerge2.in.off, 92678\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = mul i32 %storemerge2.in, %storemerge2.in\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %15, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i32 %storemerge2.in, { 1, 2, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_partial_init_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %6 = mul i64 %indvars.iv9.reload, 4\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n %9 = trunc i64 %indvars.iv9.reload to i32\n store i32 %9, i32* %8, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_4, label LBL_3\n LBL_4:\n %10 = load i32, i32* @gv_1, align 4\n %11 = icmp eq i32 %10, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %12, i64* %rax.2.reg2mem\n br label LBL_8\n LBL_6:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %13 = mul i64 %indvars.iv6.reload, 4\n %14 = add i64 %13, %3\n %15 = inttoptr i64 %14 to i32*\n %16 = trunc i64 %indvars.iv6.reload to i32\n store i32 %16, i32* %15, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_7, label LBL_6\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %17 = mul i64 %indvars.iv.reload, 4\n %18 = add i64 %17, %3\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %22, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_7\n LBL_8:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_fwrite_12-bad", "fun_name": "CWE400_Resource_Exhaustion__rand_fwrite_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge411.reg2mem = alloca i64\n %storemerge12.reg2mem = alloca i64\n %storemerge6.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 20, i32* %storemerge6.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge5.in = xor i32 %12, %13\n store i32 %storemerge5.in, i32* %storemerge6.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge6.reload = load i32, i32* %storemerge6.reg2mem\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_10, label LBL_3\n LBL_3:\n %17 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %18 = icmp eq %_IO_FILE* %17, null\n %19 = icmp eq i1 %18, false\n br i1 %19, label LBL_4, label LBL_5\n LBL_4:\n %20 = sext i32 %storemerge6.reload to i64\n %21 = icmp eq i32 %storemerge6.reload, 0\n store i64 0, i64* %storemerge12.reg2mem\n br i1 %21, label LBL_9, label LBL_6\n LBL_5:\n call void @exit(i32 1)\n unreachable\n LBL_6:\n %22 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %17)\n %23 = icmp eq i32 %22, 50\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %storemerge12.reload = load i64, i64* %storemerge12.reg2mem\n %24 = add nuw i64 %storemerge12.reload, 1\n %25 = icmp ult i64 %24, %20\n store i64 %24, i64* %storemerge12.reg2mem\n br i1 %25, label LBL_6, label LBL_9\n LBL_9:\n %26 = call i32 @fclose(%_IO_FILE* nonnull %17)\n %27 = sext i32 %26 to i64\n store i64 %27, i64* %rax.0.reg2mem\n br label LBL_18\n LBL_10:\n %storemerge6.off = add i32 %storemerge6.reload, -1\n %28 = icmp ugt i32 %storemerge6.off, 19\n store i64 ptrtoint ([16 x i8]* @gv_3 to i64), i64* %rax.0.reg2mem\n br i1 %28, label LBL_18, label LBL_11\n LBL_11:\n %29 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %30 = icmp eq %_IO_FILE* %29, null\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_12, label LBL_13\n LBL_12:\n %32 = sext i32 %storemerge6.reload to i64\n store i64 0, i64* %storemerge411.reg2mem\n br label LBL_14\n LBL_13:\n call void @exit(i32 1)\n unreachable\n LBL_14:\n %33 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %29)\n %34 = icmp eq i32 %33, 50\n br i1 %34, label LBL_16, label LBL_15\n LBL_15:\n call void @exit(i32 1)\n unreachable\n LBL_16:\n %storemerge411.reload = load i64, i64* %storemerge411.reg2mem\n %35 = add nuw i64 %storemerge411.reload, 1\n %36 = icmp ult i64 %35, %32\n store i64 %35, i64* %storemerge411.reg2mem\n br i1 %36, label LBL_14, label LBL_17\n LBL_17:\n %37 = call i32 @fclose(%_IO_FILE* nonnull %29)\n %38 = sext i32 %37 to i64\n store i64 %38, i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %29, { 1, 0, 2 }\n uselistorder %_IO_FILE* %17, { 1, 0, 2 }\n uselistorder i32 %storemerge6.reload, { 0, 2, 3, 1 }\n uselistorder i32* %storemerge6.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge12.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge411.reg2mem, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 1, 0, 2 }\n uselistorder i32 50, { 0, 2, 1, 3 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_preinc_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_11\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %27 = icmp eq i32 %sv_0.1.reload, 2147483647\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %28 = add i32 %sv_0.1.reload, 1\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n br label LBL_11\n LBL_10:\n %31 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_11:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_loop_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 400)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = ptrtoint i64* %1 to i64\n %6 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %6, i64 0, i64 50)\n %7 = add i64 %4, -416\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 4\n %9 = add i64 %8, %5\n %10 = add i64 %7, %8\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = inttoptr i64 %9 to i32*\n store i32 %12, i32* %13, align 4\n %14 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %14, 100\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %15 = bitcast i64* %1 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n call void @free(i64* %1)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 99)\n %9 = add i64 %3, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_2\n LBL_2:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strcpy(i8* nonnull %12, i8* %11)\n %14 = call i64 @FUNC(i64 %3)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_fgets_10-bad", "fun_name": "CWE127_Buffer_Underread__CWE839_fgets_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = icmp sgt i32 %sv_0.0.ph.reload, 9\n br i1 %10, label LBL_7, label LBL_6\n LBL_6:\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = sext i32 %sv_0.0.ph.reload to i64\n %13 = mul i64 %12, 4\n %14 = add i64 %11, -64\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n br label LBL_8\n LBL_7:\n %20 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder label LBL_8, { 1, 2, 3, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_pointer_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = call i128 @FUNC(i64 4617315517961601024)\n %4 = call i64 @__asm_movsd.1(i128 %3)\n store i64 %4, i64* %0, align 8\n %5 = call i128 @FUNC(i64 %4)\n %6 = call i64 @FUNC()\n ret i64 %6\n\n uselistorder i64 ()* @printDoubleLine, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 3, 1, 0, 2, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 2, 3, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_int64_t_14-bad", "fun_name": "CWE563_Unused_Variable__unused_value_int64_t_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 10)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE511_Logic_Time_Bomb__rand_17-bad", "fun_name": "CWE511_Logic_Time_Bomb__rand_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.in.reg2mem = alloca i32\n %0 = call i32 @time(i32* null)\n call void @srand(i32 %0)\n %1 = call i32 @rand()\n %2 = icmp eq i32 %1, 20000\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %rax.0.in.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @unlink(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0))\n store i32 %4, i32* %rax.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.in.reload = load i32, i32* %rax.0.in.reg2mem\n %rax.0.le = sext i32 %rax.0.in.reload to i64\n ret i64 %rax.0.le\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_long_11-bad", "fun_name": "CWE415_Double_Free__malloc_free_long_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %3)\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* null, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_declare_17-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_char_declare_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_0 to i64\n %3 = call i64 @FUNC(i64 %2)\n call void @free(i64* nonnull %sv_0)\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memmove_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 40)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %sv_1, align 8\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_1, i32 40)\n %10 = inttoptr i64 %sv_0.0.reload to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n call void @free(i64* %8)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_multiply_05-bad", "fun_name": "CWE190_Integer_Overflow__char_fscanf_multiply_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n %.pre2 = load i8, i8* %sv_0, align 1\n %phitmp = icmp eq i32 %.pre, 0\n %5 = icmp slt i8 %.pre2, 1\n %or.cond = or i1 %phitmp, %5\n br i1 %or.cond, label LBL_3, label LBL_2\n LBL_2:\n %6 = mul i8 %.pre2, 2\n %7 = sext i8 %6 to i64\n %8 = and i64 %7, 4294967294\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_listen_socket_17-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_listen_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_2, align 8\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_2 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = call i32 @socket(i32 2, i32 1, i32 6)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_11, label LBL_1\n LBL_1:\n %12 = bitcast i64* %sv_0 to %sockaddr*\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %14 = call i16 @htons(i16 27015)\n %15 = call i32 @bind(i32 %10, %sockaddr* nonnull %12, i32 16)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_9, label LBL_2\n LBL_2:\n %17 = call i32 @listen(i32 %10, i32 5)\n %18 = icmp eq i32 %17, -1\n br i1 %18, label LBL_9, label LBL_3\n LBL_3:\n %19 = call i32 @accept(i32 %10, %sockaddr* null, i32* null)\n %20 = icmp eq i32 %19, -1\n br i1 %20, label LBL_9, label LBL_4\n LBL_4:\n %21 = ptrtoint i64* %sv_2 to i64\n %22 = sext i32 %9 to i64\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i64*\n %25 = sub i32 249, %9\n %26 = call i32 @recv(i32 %19, i64* %24, i32 %25, i32 0)\n %27 = add i32 %26, 1\n %28 = icmp ult i32 %27, 2\n br i1 %28, label LBL_10, label LBL_5\n LBL_5:\n %29 = sext i32 %26 to i64\n %30 = add i64 %23, %29\n %31 = inttoptr i64 %30 to i8*\n store i8 0, i8* %31, align 1\n %32 = call i8* @strchr(i8* nonnull %8, i32 13)\n %33 = icmp eq i8* %32, null\n br i1 %33, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %32, align 1\n br label LBL_7\n LBL_7:\n %34 = call i8* @strchr(i8* nonnull %8, i32 10)\n %35 = icmp eq i8* %34, null\n br i1 %35, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %34, align 1\n br label LBL_10\n LBL_9:\n %36 = call i32 @close(i32 %10)\n br label LBL_11\n LBL_10:\n %37 = call i32 @close(i32 %10)\n %38 = call i32 @close(i32 %19)\n br label LBL_11\n LBL_11:\n %39 = call i32 @putenv(i8* nonnull %8)\n %40 = call i64 @FUNC(i64 40)\n %41 = icmp eq i64 %2, %40\n store i64 0, i64* %rax.0.reg2mem\n br i1 %41, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %26, { 1, 0 }\n uselistorder i32 %10, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_0, { 2, 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE478_Missing_Default_Case_in_Switch__basic_08-bad", "fun_name": "CWE478_Missing_Default_Case_in_Switch__basic_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = srem i32 %3, 3\n store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @gv_0, i64 0, i64 0), i8** %sv_0.0.reg2mem\n switch i32 %4, label LBL_4 [\n i32 0, label LBL_2\n i32 1, label LBL_3\n ]\n LBL_2:\n store i8* bitcast (i64* @gv_1 to i8*), i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n store i8* bitcast (i64* @gv_2 to i8*), i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = ptrtoint i8* %sv_0.0.reload to i64\n %6 = call i64 @FUNC(i64 %5)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_square_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.2.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n store i32 0, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_17, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 0, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_9:\n store i32 0, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_17, label LBL_10\n LBL_10:\n %28 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %29 = call i16 @htons(i16 27015)\n %30 = bitcast i64* %sv_2 to %sockaddr*\n %31 = call i32 @bind(i32 %5, %sockaddr* nonnull %30, i32 16)\n %32 = icmp eq i32 %31, -1\n br i1 %32, label LBL_15, label LBL_11\n LBL_11:\n %33 = call i32 @listen(i32 %5, i32 5)\n %34 = icmp eq i32 %33, -1\n br i1 %34, label LBL_15, label LBL_12\n LBL_12:\n %35 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %36 = icmp eq i32 %35, -1\n br i1 %36, label LBL_15, label LBL_13\n LBL_13:\n %37 = call i32 @recv(i32 %35, i64* nonnull %sv_1, i32 13, i32 0)\n %38 = add i32 %37, 1\n %39 = icmp ult i32 %38, 2\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %39, label LBL_16, label LBL_14\n LBL_14:\n %40 = sext i32 %37 to i64\n %41 = add i64 %0, -22\n %42 = add i64 %41, %40\n %43 = inttoptr i64 %42 to i8*\n store i8 0, i8* %43, align 1\n %44 = bitcast i64* %sv_1 to i8*\n %45 = call i32 @atoi(i8* nonnull %44)\n store i32 %45, i32* %sv_0.1.ph.reg2mem\n br label LBL_16\n LBL_15:\n %46 = call i32 @close(i32 %5)\n store i32 0, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_16:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %47 = call i32 @close(i32 %5)\n %48 = call i32 @close(i32 %35)\n store i32 %sv_0.1.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_17:\n %sv_0.2.reload = load i32, i32* %sv_0.2.reg2mem\n %49 = call i64 @FUNC()\n %50 = trunc i64 %49 to i32\n %51 = icmp eq i32 %50, 0\n %sv_0.2.off = add i32 %sv_0.2.reload, 46339\n %52 = icmp ugt i32 %sv_0.2.off, 92678\n br i1 %51, label LBL_21, label LBL_18\n LBL_18:\n br i1 %52, label LBL_20, label LBL_19\n LBL_19:\n %53 = mul i32 %sv_0.2.reload, %sv_0.2.reload\n %54 = zext i32 %53 to i64\n %55 = call i64 @FUNC(i64 %54)\n br label LBL_24\n LBL_20:\n %56 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_24\n LBL_21:\n br i1 %52, label LBL_23, label LBL_22\n LBL_22:\n %57 = mul i32 %sv_0.2.reload, %sv_0.2.reload\n %58 = zext i32 %57 to i64\n %59 = call i64 @FUNC(i64 %58)\n br label LBL_24\n LBL_23:\n %60 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_24\n LBL_24:\n %61 = call i64 @FUNC(i64 40)\n %62 = icmp eq i64 %1, %61\n store i64 0, i64* %rax.0.reg2mem\n br i1 %62, label LBL_26, label LBL_25\n LBL_25:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_26\n LBL_26:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %52, { 1, 0 }\n uselistorder i32 %sv_0.2.reload, { 3, 2, 1, 0, 4 }\n uselistorder i32 %37, { 1, 0 }\n uselistorder i32 %16, { 1, 0 }\n uselistorder i1 %6, { 1, 0 }\n uselistorder i32 %5, { 9, 0, 6, 7, 8, 2, 1, 5, 4, 3, 10 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 0, 4, 1, 2, 5, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.2.reg2mem, { 0, 6, 3, 1, 5, 4, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 1, 2, 4, 5, 6, 3 }\n uselistorder label LBL_17, { 4, 2, 0, 5, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cat_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i8* null, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strcat(i8* %sv_0.0.reload, i8* nonnull %9)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %13)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE242_Use_of_Inherently_Dangerous_Function__basic_13-bad", "fun_name": "CWE242_Use_of_Inherently_Dangerous_Function__basic_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @gets(i8* nonnull %4)\n %6 = ptrtoint i8* %5 to i64\n %sext.mask = and i64 %6, 4294967295\n %7 = icmp eq i64 %sext.mask, 0\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([61 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %10 = ptrtoint i64* %sv_0 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memmove_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_0.LBL_3_crit_edge, label LBL_2\n LBL_1:\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, 49\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n store i64 %4, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %7 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %8)\n %10 = call i64 @FUNC(i64 %.pre-phi.reload)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 4, 2, 3, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE506_Embedded_Malicious_Code__file_transfer_connect_socket_05-bad", "fun_name": "CWE506_Embedded_Malicious_Code__file_transfer_connect_socket_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %rsp.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 %0, i64* %rsp.0.reg2mem\n br label LBL_1\n LBL_1:\n %rsp.0.reload = load i64, i64* %rsp.0.reg2mem\n %2 = add i64 %rsp.0.reload, -4096\n %3 = icmp eq i64 %2, %1\n %4 = icmp eq i1 %3, false\n store i64 %2, i64* %rsp.0.reg2mem\n br i1 %4, label LBL_1, label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = load i32, i32* @gv_0, align 4\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_11, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = bitcast i64* %sv_1 to i8*\n %11 = call i8* @fgets(i8* nonnull %10, i32 65535, %_IO_FILE* nonnull %8)\n %12 = icmp eq i8* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i64 0, i64* %sv_1, align 8\n br label LBL_6\n LBL_6:\n %15 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %16 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %16, -1\n br i1 %cond, label LBL_11, label LBL_8\n LBL_8:\n %17 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %18 = call i16 @htons(i16 27015)\n %19 = bitcast i64* %sv_0 to %sockaddr*\n %20 = call i32 @connect(i32 %16, %sockaddr* nonnull %19, i32 16)\n %21 = icmp eq i32 %20, -1\n br i1 %21, label LBL_10, label LBL_9\n LBL_9:\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @strlen(i8* nonnull %22)\n %24 = call i32 @send(i32 %16, i64* nonnull %sv_1, i32 %23, i32 0)\n %25 = call i32 @strlen(i8* nonnull %22)\n br label LBL_10\n LBL_10:\n %26 = call i32 @close(i32 %16)\n br label LBL_11\n LBL_11:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %5, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 3, 1, 2, 0 }\n uselistorder i64* %sv_1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %rsp.0.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_11, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_file_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge47.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = sub i32 100, %2\n %10 = add i64 %3, %8\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %9, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n %17 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %18 = icmp eq i32 %17, 1\n %19 = icmp eq i1 %18, false\n br i1 %19, label LBL_11, label LBL_6\n LBL_6:\n %20 = load i64, i64* %sv_1, align 8\n %21 = trunc i64 %20 to i32\n %22 = icmp sgt i32 %21, ptrtoint (i1* @gv_4 to i32)\n br i1 %22, label LBL_11, label LBL_7\n LBL_7:\n %23 = and i64 %20, 4294967295\n %24 = icmp eq i64 %23, 0\n store i32 0, i32* %storemerge47.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %24, label LBL_10, label LBL_8\n LBL_8:\n %storemerge47.reload = load i32, i32* %storemerge47.reg2mem\n %25 = add i32 %storemerge47.reload, 1\n %26 = sext i32 %25 to i64\n %27 = icmp sgt i64 %23, %26\n store i32 %25, i32* %storemerge47.reg2mem\n br i1 %27, label LBL_8, label LBL_9\n LBL_9:\n %phitmp = zext i32 %25 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %28 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_11\n LBL_11:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %25, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge47.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_11, { 2, 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_long_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_loop_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -97\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 99)\n %8 = add i64 %5, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 0\n %spec.select = select i1 %11, i64 %1, i64 %5\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %13 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %spec.select\n %15 = add i64 %storemerge1.reload, %13\n %16 = inttoptr i64 %15 to i8*\n %17 = load i8, i8* %16, align 1\n %18 = inttoptr i64 %14 to i8*\n store i8 %17, i8* %18, align 1\n %19 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %19, 100\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %20 = add i64 %spec.select, 99\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = call i64 @FUNC(i64 %spec.select)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %3, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %spec.select, { 2, 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_no_init_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n %7 = trunc i64 %indvars.iv5.reload to i32\n store i32 %7, i32* %6, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_2, label LBL_1\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %8, %1\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64* @memset(i64* %0, i32 65, i32 99)\n %5 = add i64 %3, 99\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %3)\n ret i64 %7\n\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 3, 2, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %2 = add i64 %1, 8\n %3 = inttoptr i64 %2 to i64*\n store i64 32777976880262761, i64* %3, align 8\n store i64 0, i64* %sv_0, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %4, i32 99, i8* nonnull %5)\n %7 = call i64 @FUNC(i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 2, 1, 3, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2, 5, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_ncpy_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = bitcast i64* %sv_1 to i8*\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @strncpy(i8* nonnull %2, i8* nonnull %5, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC(i64 %3)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge2.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n %4 = ptrtoint i64* %0 to i64\n store i64 8382078947037833542, i64* %0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i32*\n store i32 1735289202, i32* %6, align 4\n %7 = add i64 %4, 12\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i32 @strlen(i8* %3)\n %10 = icmp eq i32 %9, 0\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %11 = add i64 %storemerge2.reload, %4\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = icmp eq i8 %13, 83\n %15 = icmp eq i1 %14, false\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n br label LBL_6\n LBL_5:\n %17 = add nuw i64 %storemerge2.reload, 1\n %18 = call i32 @strlen(i8* %3)\n %19 = sext i32 %18 to i64\n %20 = icmp ult i64 %17, %19\n store i64 %17, i64* %storemerge2.reg2mem\n br i1 %20, label LBL_3, label LBL_6\n LBL_6:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %4, { 0, 2, 1 }\n uselistorder i8* %3, { 1, 0 }\n uselistorder i64* %0, { 0, 2, 1, 4, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_6, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_max_square_12-bad", "fun_name": "CWE190_Integer_Overflow__char_max_square_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %narrow = select i1 %2, i64 4, i64 1\n %6 = call i64 @FUNC(i64 %narrow)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n br i1 %2, label LBL_3, label LBL_4\n LBL_3:\n %7 = call i64 @FUNC(i64 4)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %8 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_rand_to_char_32-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_rand_to_char_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = call i32 @rand()\n %7 = sext i1 %3 to i32\n %storemerge.in = xor i32 %6, %7\n %sext = mul i32 %storemerge.in, 16777216\n %8 = ashr exact i32 %sext, 24\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_modulo_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = load i32, i32* @gv_3, align 4\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i32, i32* %sv_0, align 4\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %10 = urem i32 100, %8\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_7\n LBL_6:\n %13 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_5 to i64))\n br label LBL_7\n LBL_7:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_sleep_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = icmp slt i32 %sv_0.1.reload, 1\n %32 = icmp sgt i32 %sv_0.1.reload, ptrtoint (i1* @gv_1 to i32)\n %or.cond4 = or i1 %31, %32\n br i1 %or.cond4, label LBL_12, label LBL_11\n LBL_11:\n %33 = call i32 @usleep(i32 %sv_0.1.reload)\n %34 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_2 to i64))\n br label LBL_13\n LBL_12:\n %35 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_3 to i64))\n br label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_sleep_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_9\n LBL_6:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %14 = icmp slt i32 %sv_0.0.reload, 1\n %15 = icmp sgt i32 %sv_0.0.reload, ptrtoint (i1* @gv_3 to i32)\n %or.cond = or i1 %14, %15\n br i1 %or.cond, label LBL_8, label LBL_7\n LBL_7:\n %16 = call i32 @usleep(i32 %sv_0.0.reload)\n %17 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_4 to i64))\n br label LBL_9\n LBL_8:\n %18 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_5 to i64))\n br label LBL_9\n LBL_9:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_multiply_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = mul i32 %4, 32768\n %6 = call i32 @rand()\n %7 = xor i32 %6, %5\n %8 = sext i1 %2 to i32\n %storemerge.in = xor i32 %7, %8\n %9 = trunc i32 %storemerge.in to i16\n %10 = icmp slt i16 %9, 1\n store i64 5, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_1\n LBL_1:\n %11 = icmp sgt i16 %9, ptrtoint (i1* @gv_0 to i16)\n br i1 %11, label LBL_3, label LBL_2\n LBL_2:\n %sext2 = mul i32 %storemerge.in, 131072\n %12 = ashr exact i32 %sext2, 16\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64 5, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_fputc_14-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_fputc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 @fputc(i32 65, %_IO_FILE* %4)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_min_multiply_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i32 -2, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_5, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %5 = zext i32 %3 to i64\n %6 = trunc i32 %sv_0.0.reload to i16\n %7 = icmp slt i16 %6, 0\n %8 = icmp eq i1 %7, false\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = mul i32 %sv_0.0.reload, 2\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i32 %3, { 1, 0 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_02-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0368.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.0368.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.0368.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp sgt i32 %sv_0.0.ph.reload, 99\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0368.reg2mem\n br i1 %25, label LBL_11, label LBL_8\n LBL_8:\n %sv_0.0368.reload = load i32, i32* %sv_0.0368.reg2mem\n %26 = call i64* @malloc(i32 %sv_0.0368.reload)\n %27 = icmp eq i64* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %29 = ptrtoint i64* %26 to i64\n %30 = add i32 %sv_0.0368.reload, -1\n %31 = call i64* @memset(i64* %26, i32 65, i32 %30)\n %32 = sext i32 %sv_0.0368.reload to i64\n %33 = add nsw i64 %32, -1\n %34 = add i64 %33, %29\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n %36 = call i64 @FUNC(i64 %29)\n call void @free(i64* %26)\n br label LBL_11\n LBL_11:\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %29, { 1, 0 }\n uselistorder i64* %26, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.0368.reload, { 1, 2, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0368.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 8, 1, 2, 4, 5, 6, 0, 7 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memcpy_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 400)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 50)\n %5 = call i64* @memcpy(i64* %1, i64* nonnull %sv_0, i32 400)\n %6 = bitcast i64* %1 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_multiply_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n %13 = icmp slt i32 %sv_0.0.reload, 0\n %14 = icmp eq i1 %13, false\n %or.cond = or i1 %14, %12\n br i1 %or.cond, label LBL_8, label LBL_5\n LBL_5:\n %15 = icmp slt i32 %sv_0.0.reload, -1073741823\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n %16 = mul i32 %sv_0.0.reload, 2\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n br label LBL_8\n LBL_7:\n %19 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_multiply_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_4:\n %9 = load i64, i64* %sv_0, align 8\n %10 = trunc i64 %9 to i32\n %11 = icmp slt i32 %10, 1\n br i1 %11, label LBL_8, label LBL_5\n LBL_5:\n %12 = icmp sgt i32 %10, 1073741822\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n %13 = mul i64 %9, 2\n %14 = and i64 %13, 4294967294\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_8\n LBL_7:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_8\n LBL_8:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_31-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %4 = and i64 %3, -16\n %5 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 100)\n store i64 0, i64* %sv_1, align 8\n %6 = add i64 %2, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %4\n %9 = add i64 %6, %7\n %10 = inttoptr i64 %9 to i64*\n %11 = load i64, i64* %10, align 8\n %12 = inttoptr i64 %8 to i64*\n store i64 %11, i64* %12, align 8\n %13 = load i64, i64* %sv_1, align 8\n %14 = add i64 %13, 1\n store i64 %14, i64* %sv_1, align 8\n %15 = icmp ult i64 %14, 100\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %15, label LBL_1, label LBL_2\n LBL_2:\n %16 = inttoptr i64 %4 to i64*\n %17 = load i64, i64* %16, align 16\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %14, { 0, 2, 1 }\n uselistorder i64 %4, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_loop_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %5 = ptrtoint i64* %sv_2 to i64\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %7 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = add i64 %storemerge1.reload, %sv_0.0.reload\n %9 = inttoptr i64 %8 to i8*\n %10 = load i8, i8* %9, align 1\n %11 = add i64 %storemerge1.reload, %7\n %12 = inttoptr i64 %11 to i8*\n store i8 %10, i8* %12, align 1\n %13 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %14 = call i64 @FUNC(i64 %7)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %7, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_square_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 8420 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.03.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n %sv_0.0.off = add i32 %storemerge.in, 65534\n %14 = icmp ugt i32 %sv_0.0.off, 131068\n store i32 %storemerge.in, i32* %sv_0.03.reg2mem\n br i1 %14, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.03.reload = load i32, i32* %sv_0.03.reg2mem\n %15 = mul i32 %sv_0.03.reload, %sv_0.03.reload\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %18 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.03.reload, { 1, 0 }\n uselistorder i32* %sv_0.03.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_alloca_no_init_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.03.reg2mem = alloca i128\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %xmm0.03.reload = load i128, i128* %xmm0.03.reg2mem\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %7 = mul i64 %indvars.iv5.reload, 8\n %8 = add i64 %7, %3\n %9 = call i128 @FUNC(i128 %xmm0.03.reload, i128 %xmm0.03.reload)\n %10 = trunc i64 %indvars.iv5.reload to i32\n %11 = call i128 @FUNC(i32 %10)\n %12 = call i64 @FUNC(i128 %11)\n %13 = inttoptr i64 %8 to i64*\n store i64 %12, i64* %13, align 8\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i128 %11, i128* %xmm0.03.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %14 = load i32, i32* @gv_2, align 4\n %15 = icmp eq i32 %14, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %16 = mul i64 %indvars.iv.reload, 8\n %17 = add i64 %16, %3\n %18 = inttoptr i64 %17 to i64*\n %19 = load i64, i64* %18, align 8\n %20 = call i128 @FUNC(i64 %19)\n %21 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.03.reload, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.03.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_listen_socket_execl_08-bad", "fun_name": "CWE78_OS_Command_Injection__char_listen_socket_execl_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_0, i64 0, i64 0))\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memcpy_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memcpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = add i32 %7, 1\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memcpy(i64* %9, i64* nonnull %sv_1, i32 %8)\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_accept_bind_13-bad", "fun_name": "CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__listen_accept_bind_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_13, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = call i32 @listen(i32 %6, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_10, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_10, label LBL_4\n LBL_4:\n %14 = bitcast i64* %sv_0 to %sockaddr*\n %15 = call i32 @bind(i32 %6, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_5\n LBL_5:\n %17 = sub i32 99, %5\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = sext i32 %5 to i64\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i64*\n %22 = call i32 @recv(i32 %12, i64* %21, i32 %17, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = ptrtoint i64* %sv_2 to i64\n %26 = sext i32 %22 to i64\n %27 = add i64 %25, -112\n %28 = add i64 %27, %26\n %29 = inttoptr i64 %28 to i8*\n store i8 0, i8* %29, align 1\n %30 = call i8* @strchr(i8* nonnull %4, i32 13)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %30, align 1\n br label LBL_8\n LBL_8:\n %32 = call i8* @strchr(i8* nonnull %4, i32 10)\n %33 = icmp eq i8* %32, null\n br i1 %33, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %32, align 1\n br label LBL_11\n LBL_10:\n %34 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %35 = call i32 @close(i32 %6)\n %36 = call i32 @close(i32 %12)\n br label LBL_12\n LBL_12:\n %37 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_13\n LBL_13:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 0, 4, 1, 2, 3, 5 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 0, 1, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_environment_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = sext i32 %2 to i64\n %6 = ptrtoint i64* %sv_2 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n %11 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %12 = icmp eq i32 %11, 1\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_8, label LBL_3\n LBL_3:\n %14 = load i64, i64* %sv_1, align 8\n %15 = trunc i64 %14 to i32\n %16 = icmp sgt i32 %15, ptrtoint (i1* @gv_2 to i32)\n br i1 %16, label LBL_8, label LBL_4\n LBL_4:\n %17 = and i64 %14, 4294967295\n %18 = icmp eq i64 %17, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %18, label LBL_7, label LBL_5\n LBL_5:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %19 = add i32 %storemerge4.reload, 1\n %20 = sext i32 %19 to i64\n %21 = icmp sgt i64 %17, %20\n store i32 %19, i32* %storemerge4.reg2mem\n br i1 %21, label LBL_5, label LBL_6\n LBL_6:\n %phitmp = zext i32 %19 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %22 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_8\n LBL_8:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_loop_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %5 = add i64 %storemerge2.reload, %2\n %6 = add i64 %storemerge2.reload, %4\n %7 = inttoptr i64 %6 to i8*\n %8 = load i8, i8* %7, align 1\n %9 = inttoptr i64 %5 to i8*\n store i8 %8, i8* %9, align 1\n %10 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %10, 100\n store i64 %10, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %11 = add i64 %2, 99\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %2)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i64 %2, { 1, 2, 0 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__double_pointer_malloc_use_12-bad", "fun_name": "CWE758_Undefined_Behavior__double_pointer_malloc_use_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = load i64, i64* %3, align 8\n call void @free(i64* %3)\n %7 = inttoptr i64 %6 to i64*\n %8 = load i64, i64* %7, align 8\n %9 = call i128 @FUNC(i64 %8)\n %10 = call i64 @FUNC()\n store i64 %10, i64* %storemerge.reg2mem\n br label LBL_9\n LBL_4:\n br i1 %5, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = call i64* @malloc(i32 8)\n %12 = icmp eq i64* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %14 = ptrtoint i64* %11 to i64\n %15 = call i128 @FUNC(i64 4617315517961601024)\n %16 = call i64 @__asm_movsd.1(i128 %15)\n store i64 %16, i64* %11, align 8\n store i64 %14, i64* %3, align 8\n %17 = load i64, i64* %11, align 8\n %18 = call i128 @FUNC(i64 %17)\n %19 = call i64 @FUNC()\n call void @free(i64* %3)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %11, { 0, 1, 3, 2 }\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @printDoubleLine, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 2, 1, 0, 3 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_loop_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE131_loop_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %.reg2mem3 = alloca i32*\n %.reg2mem = alloca i32*\n %sv_0 = alloca i32*, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32* null, i32** %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i32** %sv_0 to i64\n %5 = add i64 %4, -17\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i32*\n store i32* %7, i32** %sv_0, align 8\n store i32* %7, i32** %.reg2mem\n br label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_1 to i64\n %.reload = load i32*, i32** %.reg2mem\n %9 = add i64 %8, -48\n store i32* %.reload, i32** %.reg2mem3\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %.reload4 = load i32*, i32** %.reg2mem3\n %10 = mul i64 %storemerge2.reload, 4\n %11 = ptrtoint i32* %.reload4 to i64\n %12 = add i64 %10, %11\n %13 = add i64 %9, %10\n %14 = inttoptr i64 %13 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = inttoptr i64 %12 to i32*\n store i32 %15, i32* %16, align 4\n %17 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %17, 10\n %18 = load i32*, i32** %sv_0, align 8\n store i32* %18, i32** %.reg2mem3\n store i64 %17, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %19 = load i32, i32* %18, align 4\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %18, { 1, 0 }\n uselistorder i32** %sv_0, { 3, 2, 0, 1 }\n uselistorder i32** %.reg2mem, { 0, 2, 1 }\n uselistorder i32** %.reg2mem3, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memmove_07-bad", "fun_name": "CWE126_Buffer_Overread__char_alloca_memmove_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -49\n %5 = and i64 %4, -16\n %6 = add i64 %2, -161\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %5 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %5, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = inttoptr i64 %7 to i64*\n %13 = call i64* @memset(i64* %12, i32 65, i32 99)\n %14 = add i64 %7, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = load i32, i32* @gv_0, align 4\n %17 = icmp eq i32 %16, 5\n %18 = icmp eq i1 %17, false\n %spec.select = select i1 %18, i64 %1, i64 %5\n %19 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %20 = bitcast i64* %sv_0 to i8*\n %21 = call i32 @strlen(i8* nonnull %20)\n %22 = inttoptr i64 %spec.select to i64*\n %23 = call i64* @memmove(i64* nonnull %sv_0, i64* %22, i32 %21)\n %24 = call i64 @FUNC(i64* nonnull %sv_0)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %3, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_for_loop_10-bad", "fun_name": "CWE400_Resource_Exhaustion__fgets_for_loop_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n %phitmp = sext i32 %7 to i64\n store i64 %phitmp, i64* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i64 -1, i64* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i64, i64* %sv_0.0.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n %10 = icmp eq i64 %sv_0.0.ph.reload, 0\n %or.cond = or i1 %10, %9\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %or.cond, label LBL_6, label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_3 to i64))\n %12 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, %sv_0.0.ph.reload\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_6, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_sub_15-bad", "fun_name": "CWE191_Integer_Underflow__int_listen_socket_sub_15_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.047.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i64 4294967295, i64* %sv_0.047.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i64 4294967295, i64* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %phitmp = add i32 %21, -1\n %phitmp2 = zext i32 %phitmp to i64\n store i64 %phitmp2, i64* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i64 4294967295, i64* %sv_0.047.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i64, i64* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i64 %sv_0.0.ph.reload, i64* %sv_0.047.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.047.reload = load i64, i64* %sv_0.047.reg2mem\n %25 = call i64 @FUNC(i64 %sv_0.047.reload)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %sv_0.047.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_execl_03-bad", "fun_name": "CWE78_OS_Command_Injection__char_connect_socket_execl_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = sext i32 %2 to i64\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_1, i64 0, i64 0))\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_12, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 25, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -48\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @strtoul(i8* nonnull %19, i8** null, i32 0)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %.pr = load i32, i32* @gv_0, align 4\n %22 = icmp eq i32 %.pr, 0\n br i1 %22, label LBL_12, label LBL_7\n LBL_7:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %sv_0.1.off = add i32 %sv_0.1.ph.reload, -6\n %23 = icmp ult i32 %sv_0.1.off, 94\n br i1 %23, label LBL_8, label LBL_11\n LBL_8:\n %24 = call i64* @malloc(i32 %sv_0.1.ph.reload)\n %25 = icmp eq i64* %24, null\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %27 = ptrtoint i64* %24 to i64\n %28 = bitcast i64* %24 to i32*\n store i32 1819043176, i32* %28, align 4\n %29 = add i64 %27, 4\n %30 = inttoptr i64 %29 to i16*\n store i16 111, i16* %30, align 2\n %31 = call i64 @FUNC(i64 %27)\n call void @free(i64* %24)\n br label LBL_12\n LBL_11:\n %32 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_2 to i64))\n br label LBL_12\n LBL_12:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %24, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.1.ph.reload, { 1, 0 }\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*, i8**, i32)* @strtoul, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_12, { 1, 2, 3, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int64_t_declare_02-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_int64_t_declare_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %3 = mul i64 %storemerge1.reload, 8\n %4 = add i64 %2, %3\n %5 = inttoptr i64 %4 to i64*\n store i64 5, i64* %5, align 8\n %6 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %6, 100\n store i64 %6, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %7 = load i64, i64* %sv_0, align 8\n %8 = call i64 @FUNC(i64 %7)\n call void @free(i64* nonnull %sv_0)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_multiply_13-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_max_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 5, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %spec.store.select = sext i1 %1 to i64\n %3 = mul i64 %spec.store.select, 2\n %4 = and i64 %3, 4294967294\n %5 = call i64 @FUNC(i64 %4)\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_execlp_17-bad", "fun_name": "CWE78_OS_Command_Injection__char_console_execlp_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %8 = sub i32 100, %2\n %9 = add i64 %3, %6\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %8, %_IO_FILE* %7)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = add i64 %6, -1\n %16 = sext i32 %13 to i64\n %17 = add i64 %15, %16\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_6, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_snprintf_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* inttoptr (i64 12492 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_1 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n store i64 0, i64* %sv_0, align 8\n %20 = bitcast i64* %sv_0 to i8*\n %21 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %20, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %22 = ptrtoint i64* %sv_0 to i64\n %23 = call i64 @FUNC(i64 %22)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_6, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %.reg2mem4 = alloca i32\n %.reg2mem = alloca i32*\n %sv_0 = alloca i32*, align 8\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32* null, i32** %.reg2mem\n store i32 %0, i32* %.reg2mem4\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 200)\n %4 = bitcast i64* %3 to i32*\n store i32* %4, i32** %sv_0, align 8\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i32* @wmemset(i32* %4, i32 65, i32 49)\n %8 = ptrtoint i64* %3 to i64\n %9 = add i64 %8, 196\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = load i32*, i32** %sv_0, align 8\n %.pr = load i32, i32* @gv_0, align 4\n store i32* %11, i32** %.reg2mem\n store i32 %.pr, i32* %.reg2mem4\n br label LBL_4\n LBL_4:\n %.reload5 = load i32, i32* %.reg2mem4\n %12 = icmp eq i32 %.reload5, 5\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %13, i64* %storemerge.reg2mem\n br label LBL_9\n LBL_6:\n %.reload = load i32*, i32** %.reg2mem\n %14 = call i32 @wcslen(i32* %.reload)\n %15 = add i32 %14, 1\n %16 = call i64* @calloc(i32 %15, i32 4)\n %17 = icmp eq i64* %16, null\n %18 = icmp eq i1 %17, false\n br i1 %18, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %19 = bitcast i64* %16 to i32*\n %20 = call i32* @wcscpy(i32* %19, i32* %.reload)\n %21 = ptrtoint i64* %16 to i64\n %22 = call i64 @FUNC(i64 %21)\n call void @free(i64* %16)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %16, { 1, 0, 3, 2 }\n uselistorder i32** %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %.reg2mem4, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_for_loop_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %sv_1.0.off = add i32 %6, -1\n %7 = icmp ugt i32 %sv_1.0.off, 19\n br i1 %7, label LBL_5, label LBL_3\n LBL_3:\n %8 = sext i32 %6 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %9 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %10 = add nuw i64 %storemerge3.reload, 1\n %11 = icmp ult i64 %10, %8\n store i64 %10, i64* %storemerge3.reg2mem\n br i1 %11, label LBL_4, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 1, 0 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder label LBL_5, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_divide_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = mul i32 %4, 1073741824\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = xor i32 %7, %5\n %9 = call i32 @rand()\n %10 = xor i32 %8, %9\n %11 = sext i1 %3 to i32\n %storemerge2.in = xor i32 %10, %11\n %12 = call i64 @FUNC()\n %13 = trunc i64 %12 to i32\n %14 = icmp eq i32 %13, 0\n %15 = icmp eq i32 %storemerge2.in, 0\n br i1 %14, label LBL_4, label LBL_1\n LBL_1:\n br i1 %15, label LBL_3, label LBL_2\n LBL_2:\n %16 = udiv i32 100, %storemerge2.in\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n store i64 %18, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_3:\n %19 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n %20 = udiv i32 100, %storemerge2.in\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n store i64 %22, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %23 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %15, { 1, 0 }\n uselistorder i32 %storemerge2.in, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i64 %0, -49\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 16\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %8 = add i64 %0, -161\n %9 = and i64 %8, -16\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 16\n store i64 %9, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = inttoptr i64 %sv_0.0.reload to i64*\n %13 = call i64* @memmove(i64* %12, i64* nonnull %sv_1, i32 100)\n %14 = add i64 %sv_0.0.reload, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %sv_0.0.reload)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_07-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.06.reg2mem = alloca i8*\n %sv_0.07.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_10\n LBL_10:\n %29 = load i32, i32* @gv_1, align 4\n %30 = icmp eq i32 %29, 5\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_16, label LBL_11\n LBL_11:\n %32 = load i8, i8* %4, align 1\n %33 = icmp eq i8 %32, 0\n %34 = icmp eq i1 %33, false\n store i8 %32, i8* %.reg2mem\n store i8* %4, i8** %sv_0.07.reg2mem\n store i8* %4, i8** %sv_0.06.reg2mem\n br i1 %34, label LBL_12, label LBL_15\n LBL_12:\n %sv_0.07.reload = load i8*, i8** %sv_0.07.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %35 = icmp eq i8 %.reload, 83\n %36 = icmp eq i1 %35, false\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n %37 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n store i8* %sv_0.07.reload, i8** %sv_0.06.reg2mem\n br label LBL_15\n LBL_14:\n %38 = ptrtoint i8* %sv_0.07.reload to i64\n %39 = add i64 %38, 1\n %40 = inttoptr i64 %39 to i8*\n %41 = load i8, i8* %40, align 1\n %42 = icmp eq i8 %41, 0\n %43 = icmp eq i1 %42, false\n store i8 %41, i8* %.reg2mem\n store i8* %40, i8** %sv_0.07.reg2mem\n store i8* %40, i8** %sv_0.06.reg2mem\n br i1 %43, label LBL_12, label LBL_15\n LBL_15:\n %sv_0.06.reload = load i8*, i8** %sv_0.06.reg2mem\n %44 = bitcast i8* %sv_0.06.reload to i64*\n call void @free(i64* %44)\n br label LBL_16\n LBL_16:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.07.reload, { 1, 0 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 0, 1, 2, 3, 4, 6, 5 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.07.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.06.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4, 5, 6 }\n uselistorder i32 -1, { 1, 0, 2 }\n uselistorder label LBL_15, { 0, 2, 1 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = bitcast i64* %sv_1 to i8*\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = sext i32 %13 to i64\n %15 = icmp eq i32 %13, 0\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %16 = add i64 %storemerge1.reload, %sv_0.0.reload\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = add i64 %storemerge1.reload, %.pre\n %20 = inttoptr i64 %19 to i8*\n store i8 %18, i8* %20, align 1\n %21 = add nuw i64 %storemerge1.reload, 1\n %22 = icmp ult i64 %21, %14\n store i64 %21, i64* %storemerge1.reg2mem\n br i1 %22, label LBL_5, label LBL_6\n LBL_6:\n %23 = call i64 @FUNC(i64 %.pre)\n %24 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %24)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %.pre, { 1, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_13, label LBL_3\n LBL_3:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_11, label LBL_4\n LBL_4:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_11, label LBL_5\n LBL_5:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_6\n LBL_6:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_12, label LBL_7\n LBL_7:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %28, align 1\n br label LBL_9\n LBL_9:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_12, label LBL_10\n LBL_10:\n store i8 0, i8* %30, align 1\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %6)\n br label LBL_13\n LBL_12:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_13\n LBL_13:\n %35 = call i64 @FUNC()\n %36 = trunc i64 %35 to i32\n %37 = icmp eq i32 %36, 0\n br i1 %37, label LBL_20, label LBL_14\n LBL_14:\n %38 = call i32 @strlen(i8* nonnull %4)\n %39 = icmp eq i32 %38, 0\n br i1 %39, label LBL_19, label LBL_15\n LBL_15:\n %40 = ptrtoint i64* %1 to i64\n store i64 0, i64* %storemerge7.reg2mem\n br label LBL_16\n LBL_16:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %41 = add i64 %storemerge7.reload, %40\n %42 = inttoptr i64 %41 to i8*\n %43 = load i8, i8* %42, align 1\n %44 = icmp eq i8 %43, 83\n %45 = icmp eq i1 %44, false\n br i1 %45, label LBL_18, label LBL_17\n LBL_17:\n %46 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n br label LBL_19\n LBL_18:\n %47 = add nuw i64 %storemerge7.reload, 1\n %48 = call i32 @strlen(i8* %4)\n %49 = sext i32 %48 to i64\n %50 = icmp ult i64 %47, %49\n store i64 %47, i64* %storemerge7.reg2mem\n br i1 %50, label LBL_16, label LBL_19\n LBL_19:\n call void @free(i64* %1)\n br label LBL_20\n LBL_20:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %0, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_22, label LBL_21\n LBL_21:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_22\n LBL_22:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %4, { 3, 0, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge7.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 5, 0, 4, 3, 1, 2, 6 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_19, { 0, 2, 1 }\n uselistorder label LBL_16, { 1, 0 }\n uselistorder label LBL_13, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_17-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_0 to i8*\n store i64 0, i64* %sv_0, align 8\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i8* @fgets(i8* nonnull %1, i32 26, %_IO_FILE* %2)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_2:\n %6 = call i32 @strtoul(i8* nonnull %1, i8** null, i32 0)\n %7 = icmp ult i32 %6, 6\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = call i64* @malloc(i32 %6)\n %9 = icmp eq i64* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %11 = ptrtoint i64* %8 to i64\n %12 = bitcast i64* %8 to i32*\n store i32 1819043176, i32* %12, align 4\n %13 = add i64 %11, 4\n %14 = inttoptr i64 %13 to i16*\n store i16 111, i16* %14, align 2\n %15 = call i64 @FUNC(i64 %11)\n call void @free(i64* %8)\n br label LBL_7\n LBL_6:\n %16 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_7:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %8, { 0, 1, 3, 2 }\n uselistorder i32 %6, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_05-bad", "fun_name": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %22 = mul i32 %sv_0.1.reload, 4\n %23 = call i64* @malloc(i32 %22)\n %24 = icmp eq i64* %23, null\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_7, label LBL_8\n LBL_7:\n %26 = ptrtoint i64* %23 to i64\n %27 = sext i32 %sv_0.1.reload to i64\n %28 = icmp eq i32 %sv_0.1.reload, 0\n store i64 0, i64* %storemerge3.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_8:\n call void @exit(i32 -1)\n unreachable\n LBL_9:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %29 = mul i64 %storemerge3.reload, 4\n %30 = add i64 %29, %26\n %31 = inttoptr i64 %30 to i32*\n store i32 0, i32* %31, align 4\n %32 = add nuw i64 %storemerge3.reload, 1\n %33 = icmp ult i64 %32, %27\n store i64 %32, i64* %storemerge3.reg2mem\n br i1 %33, label LBL_9, label LBL_10\n LBL_10:\n %34 = bitcast i64* %23 to i32*\n %35 = load i32, i32* %34, align 4\n %36 = zext i32 %35 to i64\n %37 = call i64 @FUNC(i64 %36)\n call void @free(i64* %23)\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %23, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.1.reload, { 1, 0, 2 }\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %storemerge3.reg2mem, { 2, 0, 1 }\n uselistorder i32 -1, { 6, 3, 2, 4, 0, 5, 1 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncat_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncat_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_3 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i8* %5, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %7 = bitcast i64* %sv_1 to i8*\n %8 = call i8* @strncat(i8* %sv_0.0.reload, i8* nonnull %7, i32 100)\n %9 = ptrtoint i8* %sv_0.0.reload to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_preinc_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp eq i32 %sv_0.1.reload, 2147483647\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = add i32 %sv_0.1.reload, 1\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_10\n LBL_9:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_multiply_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_11\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp slt i32 %sv_0.0.ph.reload, 0\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_11, label LBL_8\n LBL_8:\n %27 = icmp slt i32 %sv_0.0.ph.reload, -1073741823\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %28 = mul i32 %sv_0.0.ph.reload, 2\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n br label LBL_11\n LBL_10:\n %31 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 2, 0, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 3, 4, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_struct_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %3 = call i64 @FUNC(i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %.pr, 0\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n store i64 1, i64* %sv_0, align 8\n %5 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 0, 2, 1, 3 }\n uselistorder i64 (i64*)* @printStructLine, { 5, 4, 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 0, 4, 3, 2, 1 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_divide_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = udiv i32 100, %6\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_snprintf_12-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_environment_snprintf_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_4, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_4\n LBL_3:\n %14 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %15 = add i64 %14, 8\n %16 = inttoptr i64 %15 to i64*\n store i64 32777976880262761, i64* %16, align 8\n br label LBL_4\n LBL_4:\n %17 = call i64 @FUNC()\n %18 = trunc i64 %17 to i32\n %19 = icmp eq i32 %18, 0\n store i64 0, i64* %sv_0, align 8\n %20 = bitcast i64* %sv_0 to i8*\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n %21 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %20, i32 99, i8* nonnull %1)\n %22 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_7\n LBL_6:\n %23 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %20, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %24 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_7\n LBL_7:\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %20, { 1, 0 }\n uselistorder i64* %sv_1, { 2, 0, 1, 3, 4, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1, 3 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 99, { 1, 2, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_snprintf_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i8* null, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %sv_0.0.reload, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %12)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_negative_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_snprintf_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = sub i32 100, %2\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = add i64 %3, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %8, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64* bitcast ([15 x i8]* @gv_2 to i64*))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n store i64 0, i64* %sv_0, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %17, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %19 = call i64 @FUNC(i64* nonnull %sv_0)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_alloca_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 400)\n %2 = ptrtoint i64* %1 to i64\n %3 = icmp eq i64* %1, null\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 4\n %7 = add i64 %6, %2\n %8 = inttoptr i64 %7 to i32*\n store i32 5, i32* %8, align 4\n %9 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %9, 100\n store i64 %9, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %10 = bitcast i64* %1 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n call void @free(i64* %1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memcpy_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 0\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %7 = and i64 %6, -16\n %sv_2.0 = select i1 %4, i64 %1, i64 %7\n %8 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = inttoptr i64 %sv_2.0 to i64*\n %10 = call i64* @memcpy(i64* %9, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_2 to i32))\n %11 = load i64, i64* %9, align 8\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %2, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_sub_07-bad", "fun_name": "CWE191_Integer_Underflow__char_fscanf_sub_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = load i8, i8* %sv_0, align 1\n %9 = add i8 %8, -1\n %10 = sext i8 %9 to i64\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memcpy_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %10)\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = call i64 @FUNC(i64 %12)\n call void @free(i64* %1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_pointer_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 8)\n %5 = bitcast i64* %4 to i32*\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i32 5, i32* %5, align 4\n %8 = ptrtoint i64* %4 to i64\n %9 = add i64 %8, 4\n %10 = inttoptr i64 %9 to i32*\n store i32 6, i32* %10, align 4\n %11 = load i32, i32* %5, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = load i32, i32* %10, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n store i64 %16, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n store i32 5, i32* %5, align 4\n %17 = ptrtoint i64* %4 to i64\n %18 = add i64 %17, 4\n %19 = inttoptr i64 %18 to i32*\n store i32 6, i32* %19, align 4\n %20 = load i32, i32* %5, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %23 = load i32, i32* %19, align 4\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n store i64 %25, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i1 %7, { 1, 0 }\n uselistorder i32* %5, { 1, 3, 0, 2 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_preinc_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC(i64 3)\n ret i64 %2\n\n uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_for_loop_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge1.in = xor i32 %9, %10\n %storemerge1.in.off = add i32 %storemerge1.in, -1\n %11 = icmp ugt i32 %storemerge1.in.off, 19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_3, label LBL_1\n LBL_1:\n %12 = sext i32 %storemerge1.in to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %13 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n %14 = add nuw i64 %storemerge3.reload, 1\n %15 = icmp ult i64 %14, %12\n store i64 %14, i64* %storemerge3.reg2mem\n store i64 %12, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge1.in, { 1, 0 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE170_char_memcpy_08-bad", "fun_name": "CWE126_Buffer_Overread__CWE170_char_memcpy_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 149)\n %5 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 99)\n %6 = call i64 @FUNC(i64* nonnull %sv_1)\n br label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 40)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = ptrtoint i64* %sv_1 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = add i64 %8, -48\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = mul i64 %storemerge1.reload, 4\n %11 = add i64 %10, %sv_0.0.reload\n %12 = add i64 %9, %10\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = inttoptr i64 %11 to i32*\n store i32 %14, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %16, 10\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %17 = inttoptr i64 %sv_0.0.reload to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %21)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_add_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 3)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 3, { 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_short_05-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_connect_socket_to_short_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext = mul i32 %sv_0.1.reload, 65536\n %22 = ashr exact i32 %sext, 16\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__long_realloc_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i64* %0, null\n %or.cond = or i1 %4, %3\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_no_init_16-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n %7 = trunc i64 %indvars.iv5.reload to i32\n store i32 %7, i32* %6, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %8, %1\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %13\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_modulo_10-bad", "fun_name": "CWE369_Divide_by_Zero__int_fgets_modulo_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = urem i32 100, %sv_0.0.ph.reload\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_6\n LBL_6:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_6, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_pointer_11-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_pointer_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = call i64 @FUNC()\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = inttoptr i64 %1 to i64*\n %7 = load i64, i64* %6, align 8\n %8 = call i128 @FUNC(i64 %7)\n %9 = call i64 @FUNC()\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_file_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_2 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = load i32, i32* @gv_0, align 4\n %21 = icmp eq i32 %20, 5\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_13, label LBL_7\n LBL_7:\n %23 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n %24 = icmp eq i32 %23, 1\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_13, label LBL_8\n LBL_8:\n %26 = load i64, i64* %sv_1, align 8\n %27 = trunc i64 %26 to i32\n %28 = icmp sgt i32 %27, ptrtoint (i1* @gv_5 to i32)\n br i1 %28, label LBL_13, label LBL_9\n LBL_9:\n %29 = and i64 %26, 4294967295\n %30 = icmp eq i64 %29, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %30, label LBL_12, label LBL_10\n LBL_10:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %31 = add i32 %storemerge5.reload, 1\n %32 = sext i32 %31 to i64\n %33 = icmp sgt i64 %29, %32\n store i32 %31, i32* %storemerge5.reg2mem\n br i1 %33, label LBL_10, label LBL_11\n LBL_11:\n %phitmp = zext i32 %31 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_12\n LBL_12:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %34 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_13\n LBL_13:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %31, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 ptrtoint (i1* @gv_5 to i32), { 1, 0 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_calloc_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 20, i32 1)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = add i64 %1, 10\n %4 = inttoptr i64 %3 to i8*\n %5 = add i64 %1, 8\n %6 = inttoptr i64 %5 to i16*\n store i64 7596553777019711049, i64* %0, align 8\n store i16 25978, i16* %6, align 2\n store i8 0, i8* %4, align 1\n %7 = call i64 @FUNC(i64 %1)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %1, { 1, 2, 3, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca %_IO_FILE*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store %_IO_FILE* null, %_IO_FILE** %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store %_IO_FILE* %3, %_IO_FILE** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %4 = zext i32 %.reload to i64\n %5 = icmp eq i32 %.reload, 5\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load %_IO_FILE*, %_IO_FILE** %sv_0.0.reg2mem\n %7 = call i32 @fclose(%_IO_FILE* %sv_0.0.reload)\n %8 = sext i32 %7 to i64\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*)* @fclose, { 0, 2, 1, 3, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 2, 0, 1, 3, 4 }\n uselistorder i32* @gv_0, { 0, 6, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_14-bad", "fun_name": "CWE126_Buffer_Overread__malloc_char_loop_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 49)\n %9 = add i64 %7, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = bitcast i64* %sv_1 to i8*\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = sext i32 %13 to i64\n %16 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_6\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %17 = add i64 %storemerge1.reload, %sv_0.0.reload\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = add i64 %storemerge1.reload, %16\n %21 = inttoptr i64 %20 to i8*\n store i8 %19, i8* %21, align 1\n %22 = add nuw i64 %storemerge1.reload, 1\n %23 = icmp ult i64 %22, %15\n store i64 %22, i64* %storemerge1.reg2mem\n br i1 %23, label LBL_6, label LBL_7\n LBL_7:\n %24 = call i64 @FUNC(i64* nonnull %sv_1)\n %25 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %25)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_static_12-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_char_static_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull @gv_0, i32 65, i32 99)\n store i8 0, i8* bitcast (i64* @gv_1 to i8*), align 8\n store i64 ptrtoint (i64* @gv_0 to i64), i64* %storemerge.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %8 = ptrtoint i64* %4 to i64\n %9 = call i64* @memset(i64* %4, i32 65, i32 99)\n %10 = add i64 %8, 99\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n store i64 %8, i64* %storemerge.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n %12 = call i64 @FUNC(i64 %storemerge.reload)\n %13 = inttoptr i64 %storemerge.reload to i64*\n call void @free(i64* %13)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i64* @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_8, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %4)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_8\n LBL_8:\n %.reload = load i32, i32* %.reg2mem\n %26 = icmp eq i32 %.reload, 5\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n %27 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_11\n LBL_10:\n store i64 0, i64* %sv_0, align 8\n %28 = bitcast i64* %sv_0 to i8*\n %29 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %28, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0), i64* nonnull %sv_1)\n %30 = ptrtoint i64* %sv_0 to i64\n %31 = call i64 @FUNC(i64 %30)\n br label LBL_11\n LBL_11:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_7, { 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memmove_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %7 = ptrtoint i64* %sv_2 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 8\n %9 = add i64 %8, %7\n %10 = add i64 %9, -816\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 8\n %12 = add i64 %9, -812\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 4\n %14 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %14, 100\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %15 = load i64, i64* %sv_1, align 8\n %16 = inttoptr i64 %15 to i64*\n %17 = call i64* @memmove(i64* %16, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_2 to i32))\n %18 = load i64, i64* %sv_1, align 8\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 -2, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 32, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = trunc i32 %sv_0.0.reload to i8\n %8 = icmp slt i8 %7, 0\n %9 = icmp eq i1 %8, false\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = mul i32 %sv_0.0.reload, 2\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_divide_13-bad", "fun_name": "CWE369_Divide_by_Zero__int_rand_divide_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %14 = udiv i32 100, %sv_0.0.reload\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n ret i64 %16\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_declare_partial_init_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %5 = mul i64 %indvars.iv9.reload, 8\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = trunc i64 %indvars.iv9.reload to i32\n store i32 %8, i32* %7, align 8\n %9 = or i64 %6, 4\n %10 = inttoptr i64 %9 to i32*\n store i32 %8, i32* %10, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_2, label LBL_1\n LBL_2:\n %11 = load i32, i32* @gv_0, align 4\n %12 = icmp eq i32 %11, 5\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %13 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_4:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %14 = mul i64 %indvars.iv6.reload, 8\n %15 = add i64 %14, %1\n %16 = inttoptr i64 %15 to i32*\n %17 = trunc i64 %indvars.iv6.reload to i32\n store i32 %17, i32* %16, align 8\n %18 = or i64 %15, 4\n %19 = inttoptr i64 %18 to i32*\n store i32 %17, i32* %19, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_5, label LBL_4\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %20 = mul i64 %indvars.iv.reload, 8\n %21 = add i64 %20, %1\n %22 = inttoptr i64 %21 to i32*\n %23 = load i32, i32* %22, align 8\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = or i64 %21, 4\n %27 = inttoptr i64 %26 to i32*\n %28 = load i32, i32* %27, align 4\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_sleep_17-bad", "fun_name": "CWE400_Resource_Exhaustion__rand_sleep_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = mul i32 %1, 1073741824\n %7 = mul i32 %2, 32768\n %8 = xor i32 %7, %6\n %9 = xor i32 %8, %3\n %10 = sext i1 %5 to i32\n %storemerge2.in.le = xor i32 %9, %10\n %11 = call i32 @usleep(i32 %storemerge2.in.le)\n %12 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_0 to i64))\n ret i64 %12\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_malloc_02-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__connect_socket_malloc_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0910.reg2mem = alloca i32\n %sv_0.0.ph.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.0910.reg2mem\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 0, i32* %sv_0.0.ph.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 7, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 0, i32* %sv_0.0.ph.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = sext i32 %9 to i64\n %14 = add i64 %12, -16\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = bitcast i64* %sv_1 to i8*\n %18 = call i32 @atoi(i8* nonnull %17)\n %.off = add i32 %18, 32768\n %19 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.ph.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n %sv_0.0.ph.ph.reload = load i32, i32* %sv_0.0.ph.ph.reg2mem\n %20 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.ph.reload, i32* %sv_0.0910.reg2mem\n br label LBL_6\n LBL_5:\n %sext4 = mul i32 %18, 65536\n %21 = ashr exact i32 %sext4, 16\n %22 = call i32 @close(i32 %1)\n %23 = trunc i32 %21 to i16\n %24 = icmp sgt i16 %23, 99\n store i32 %21, i32* %sv_0.0910.reg2mem\n br i1 %24, label LBL_9, label LBL_6\n LBL_6:\n %sv_0.0910.reload = load i32, i32* %sv_0.0910.reg2mem\n %25 = call i64* @malloc(i32 %sv_0.0910.reload)\n %26 = icmp eq i64* %25, null\n %27 = icmp eq i1 %26, false\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %28 = ptrtoint i64* %25 to i64\n %29 = add nsw i32 %sv_0.0910.reload, -1\n %30 = call i64* @memset(i64* %25, i32 65, i32 %29)\n %31 = zext i32 %sv_0.0910.reload to i64\n %sext3 = mul i64 %31, 281474976710656\n %32 = ashr exact i64 %sext3, 48\n %33 = add i64 %28, -1\n %34 = add i64 %33, %32\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n %36 = call i64 @FUNC(i64 %28)\n call void @free(i64* %25)\n br label LBL_9\n LBL_9:\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %28, { 1, 0 }\n uselistorder i64* %25, { 0, 1, 3, 2 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0910.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 4, 0, 2, 3 }\n uselistorder label LBL_6, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_large_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_large_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_2\n LBL_2:\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = add i64 %7, -8\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 8\n %10 = add i64 %7, -48\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_3\n LBL_4:\n %17 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_5:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_fwrite_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8464 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_11, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_2, label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_11\n LBL_3:\n %9 = call i32 @atoi(i8* nonnull %5)\n %sv_1.0.off = add i32 %9, -1\n %10 = icmp ugt i32 %sv_1.0.off, 19\n br i1 %10, label LBL_11, label LBL_4\n LBL_4:\n %11 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %12 = icmp eq %_IO_FILE* %11, null\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_5, label LBL_6\n LBL_5:\n %14 = sext i32 %9 to i64\n store i64 0, i64* %storemerge5.reg2mem\n br label LBL_7\n LBL_6:\n call void @exit(i32 1)\n unreachable\n LBL_7:\n %15 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_4 to i64*), i32 1, i32 50, %_IO_FILE* %11)\n %16 = icmp eq i32 %15, 50\n br i1 %16, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 1)\n unreachable\n LBL_9:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %17 = add nuw i64 %storemerge5.reload, 1\n %18 = icmp ult i64 %17, %14\n store i64 %17, i64* %storemerge5.reg2mem\n br i1 %18, label LBL_7, label LBL_10\n LBL_10:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %11)\n br label LBL_11\n LBL_11:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %11, { 1, 0, 2 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i64* %storemerge5.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 3, 0, 1 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 49)\n %9 = add i64 %3, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_2\n LBL_2:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strcpy(i8* nonnull %12, i8* %11)\n %14 = call i64 @FUNC(i64 %3)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1, 4 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__rand_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8544 to i32*), align 32\n %1 = icmp eq i32 %0, 5\n store i64 5, i64* %rax.1.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([126 x i8], [126 x i8]* @gv_2, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_3, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.1.reg2mem\n br label LBL_2\n LBL_2:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %rax.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_multiply_11-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_rand_multiply_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n %17 = icmp eq i32 %sv_0.0.reload, 0\n %or.cond = or i1 %17, %16\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %18 = mul i32 %sv_0.0.reload, 2\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @calloc(i32 100, i32 4)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = call i64 @FUNC(i64 5)\n br label LBL_7\n LBL_4:\n br i1 %5, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %8 = bitcast i64* %3 to i32*\n store i32 5, i32* %8, align 4\n %9 = call i64 @FUNC(i64 5)\n br label LBL_7\n LBL_7:\n %10 = call i64 @FUNC()\n call void @free(i64* nonnull %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %3, { 1, 0, 2, 3 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_fwrite_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge11.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_12, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_12\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %sv_3.0.off = add i32 %19, -1\n %21 = icmp ugt i32 %sv_3.0.off, 19\n br i1 %21, label LBL_12, label LBL_5\n LBL_5:\n %22 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %23 = icmp eq %_IO_FILE* %22, null\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_6, label LBL_7\n LBL_6:\n %25 = sext i32 %19 to i64\n store i64 0, i64* %storemerge11.reg2mem\n br label LBL_8\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %26 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_3 to i64*), i32 1, i32 50, %_IO_FILE* %22)\n %27 = icmp eq i32 %26, 50\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 1)\n unreachable\n LBL_10:\n %storemerge11.reload = load i64, i64* %storemerge11.reg2mem\n %28 = add nuw i64 %storemerge11.reload, 1\n %29 = icmp ult i64 %28, %25\n store i64 %28, i64* %storemerge11.reg2mem\n br i1 %29, label LBL_8, label LBL_11\n LBL_11:\n %30 = call i32 @fclose(%_IO_FILE* nonnull %22)\n br label LBL_12\n LBL_12:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %22, { 1, 0, 2 }\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %storemerge11.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 2, 3, 1, 4, 5 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 3, 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_rand_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n %14 = sext i1 %6 to i32\n %storemerge1.in = xor i32 %13, %14\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32 %storemerge1.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %15 = icmp eq i32 %.reload, 5\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_7, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %17 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %17, label LBL_6, label LBL_4\n LBL_4:\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = sext i32 %sv_0.0.reload to i64\n %20 = mul i64 %19, 4\n %21 = add i64 %18, -64\n %22 = add i64 %20, %21\n %23 = inttoptr i64 %22 to i32*\n store i32 1, i32* %23, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %24 = mul i64 %indvars.iv.reload, 4\n %25 = add i64 %24, %21\n %26 = inttoptr i64 %25 to i32*\n %27 = load i32, i32* %26, align 4\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_5\n LBL_6:\n %30 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_declare_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge24.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 400)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %storemerge5.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %8 = mul i64 %storemerge5.reload, 4\n %9 = add i64 %8, %4\n %10 = inttoptr i64 %9 to i32*\n store i32 5, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge5.reload, 1\n %exitcond6 = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge5.reg2mem\n br i1 %exitcond6, label LBL_7, label LBL_3\n LBL_4:\n store i64 0, i64* %storemerge24.reg2mem\n br i1 %6, label LBL_6, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_6:\n %storemerge24.reload = load i64, i64* %storemerge24.reg2mem\n %13 = mul i64 %storemerge24.reload, 4\n %14 = add i64 %13, %4\n %15 = inttoptr i64 %14 to i32*\n store i32 5, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge24.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge24.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %17 = bitcast i64* %3 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge24.reg2mem, { 2, 0, 1 }\n uselistorder i64 100, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE483_Incorrect_Block_Delimitation__semicolon_13-bad", "fun_name": "CWE483_Incorrect_Block_Delimitation__semicolon_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8352 to i32*), align 32\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = call i64 @FUNC(i64 ptrtoint ([7 x i8]* @gv_0 to i64))\n %6 = call i64 @FUNC(i64 ptrtoint ([9 x i8]* @gv_1 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 11)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memcpy(i64* %11, i64* nonnull %sv_1, i32 %10)\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %11)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_rand_to_char_01-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_rand_to_char_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = sext i1 %2 to i32\n %storemerge.in = xor i32 %5, %6\n %sext = mul i32 %storemerge.in, 16777216\n %7 = ashr exact i32 %sext, 24\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n ret i64 %9\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_ncpy_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i8*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i8* null, i8** %.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = bitcast i64* %4 to i8*\n store i8* %5, i8** %sv_1, align 8\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = ptrtoint i64* %4 to i64\n %10 = add i64 %9, 99\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = load i8*, i8** %sv_1, align 8\n store i8* %12, i8** %.reg2mem\n br label LBL_5\n LBL_5:\n %.reload = load i8*, i8** %.reg2mem\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = bitcast i64* %sv_0 to i8*\n %15 = call i32 @strlen(i8* nonnull %14)\n %16 = call i8* @strncpy(i8* nonnull %14, i8* %.reload, i32 %15)\n %17 = ptrtoint i64* %sv_0 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i8** %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_17-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = bitcast i64* %sv_1 to %sockaddr*\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %5, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = sext i32 %2 to i64\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n %32 = bitcast i64* %sv_0 to i8*\n store i64 0, i64* %sv_0, align 8\n %33 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %32, i32 99, i8* nonnull %1)\n %34 = call i64 @FUNC(i64* nonnull %sv_0)\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 2, 1, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_scanf_14-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_scanf_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0), i32** %sv_0, align 8\n %2 = call i32 @wcslen(i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0))\n %3 = sext i32 %2 to i64\n %4 = mul i64 %3, 4\n %5 = add nsw i64 %4, 27\n %6 = udiv i64 %5, 16\n %7 = mul i64 %6, 16\n %8 = and i64 %7, -4096\n %9 = and i64 %7, 4080\n %10 = add i64 %0, 15\n %11 = sub i64 %10, %9\n %12 = sub i64 %11, %8\n %13 = and i64 %12, -16\n %14 = load i32*, i32** %sv_0, align 8\n %15 = inttoptr i64 %13 to i32*\n %16 = call i32* @wcscpy(i32* %15, i32* %14)\n %17 = call i64 @FUNC(i64 %13)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64 %7, { 1, 0 }\n uselistorder i32** %sv_0, { 2, 1, 0 }\n uselistorder i64 (i64)* @printWLine, { 1, 0 }\n uselistorder i32* (i32*, i32*)* @wcscpy, { 1, 0, 2 }\n uselistorder i32 (i32*)* @wcslen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i64 5, i64* %sv_0.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %phitmp = zext i32 %1 to i64\n store i64 %phitmp, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_rand_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = mul i32 %4, 1073741824\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = xor i32 %7, %5\n %9 = call i32 @rand()\n %10 = xor i32 %8, %9\n %11 = sext i1 %3 to i32\n %storemerge1.in = xor i32 %10, %11\n %12 = icmp ugt i32 %storemerge1.in, 9\n br i1 %12, label LBL_3, label LBL_1\n LBL_1:\n %13 = ptrtoint i64* %sv_0 to i64\n %14 = sext i32 %storemerge1.in to i64\n %15 = mul i64 %14, 4\n %16 = add i64 %13, -64\n %17 = add i64 %15, %16\n %18 = inttoptr i64 %17 to i32*\n store i32 1, i32* %18, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %19 = mul i64 %indvars.iv.reload, 4\n %20 = add i64 %19, %16\n %21 = inttoptr i64 %20 to i32*\n %22 = load i32, i32* %21, align 4\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_2\n LBL_3:\n %25 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_4\n LBL_4:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge1.in, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fscanf_malloc_05-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__fscanf_malloc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i16\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i16 0, i16* %.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pr = load i16, i16* %sv_0, align 2\n %5 = icmp sgt i16 %.pr, 99\n store i16 %.pr, i16* %.reg2mem\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %.reload = load i16, i16* %.reg2mem\n %6 = sext i16 %.reload to i32\n %7 = call i64* @malloc(i32 %6)\n %8 = icmp eq i64* %7, null\n %9 = icmp eq i1 %8, false\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %10 = ptrtoint i64* %7 to i64\n %11 = load i16, i16* %sv_0, align 2\n %12 = sext i16 %11 to i32\n %13 = add nsw i32 %12, -1\n %14 = call i64* @memset(i64* %7, i32 65, i32 %13)\n %15 = load i16, i16* %sv_0, align 2\n %16 = sext i16 %15 to i64\n %17 = add i64 %10, -1\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = call i64 @FUNC(i64 %10)\n call void @free(i64* %7)\n br label LBL_5\n LBL_5:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %10, { 1, 0 }\n uselistorder i64* %7, { 0, 1, 3, 2 }\n uselistorder i16* %sv_0, { 2, 3, 0, 1, 4 }\n uselistorder i16* %.reg2mem, { 0, 2, 1 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memcpy_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memcpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = add i64 %9, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n store i64 %9, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %12 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %13)\n %15 = call i64 @FUNC(i64 %.pre-phi.reload)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 5, 0, 4, 2, 3 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64 @FUNC()\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n store i64 %5, i64* %rax.2.reg2mem\n br i1 %7, label LBL_5, label LBL_3\n LBL_3:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %8 = mul i64 %indvars.iv6.reload, 8\n %9 = add i64 %8, %3\n %10 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %11 = trunc i64 %indvars.iv6.reload to i32\n %12 = call i128 @FUNC(i32 %11)\n %13 = call i64 @FUNC(i128 %12)\n %14 = inttoptr i64 %9 to i64*\n store i64 %13, i64* %14, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %12, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_4, label LBL_3\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %15 = mul i64 %indvars.iv.reload, 8\n %16 = add i64 %15, %3\n %17 = inttoptr i64 %16 to i64*\n %18 = load i64, i64* %17, align 8\n %19 = call i128 @FUNC(i64 %18)\n %20 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %20, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_loop_06-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 49)\n %7 = add i64 %3, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n store i64 0, i64* %sv_1, align 8\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_3, label LBL_1\n LBL_1:\n %11 = sext i32 %9 to i64\n %12 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %13 = add i64 %storemerge2.reload, %3\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge2.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = load i64, i64* %sv_1, align 8\n %19 = add i64 %18, 1\n store i64 %19, i64* %sv_1, align 8\n %20 = icmp ult i64 %19, %11\n store i64 %19, i64* %storemerge2.reg2mem\n br i1 %20, label LBL_2, label LBL_3\n LBL_3:\n %21 = call i64 @FUNC(i64 %3)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %19, { 0, 2, 1 }\n uselistorder i64 %storemerge2.reload, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i64 %3, { 1, 0, 3, 2, 4 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__long_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 5)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLine, { 3, 2, 1, 0 }\n uselistorder i64 5, { 1, 0, 2, 3 }\n uselistorder i32* @gv_0, { 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_listen_socket_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %12, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n br label LBL_10\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i64 0, i64* %sv_2, align 8\n %25 = icmp ugt i32 %sv_0.0.ph.reload, 9\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n %26 = sext i32 %sv_0.0.ph.reload to i64\n %27 = mul i64 %26, 4\n %28 = add i64 %12, -64\n %29 = add i64 %28, %27\n %30 = inttoptr i64 %29 to i32*\n %31 = load i32, i32* %30, align 4\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_11\n LBL_10:\n %34 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 3, 0, 1, 4, 2 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 2, 3, 4, 5, 1, 6, 7, 8, 9 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_multiply_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 -2, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = icmp slt i32 %sv_0.0.reload, 0\n %8 = icmp eq i1 %7, false\n %or.cond = or i1 %8, %6\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %9 = mul i32 %sv_0.0.reload, 2\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memcpy_17-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memcpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = ptrtoint i64* %1 to i64\n %6 = add i64 %5, 99\n %7 = inttoptr i64 %6 to i8*\n %8 = call i64* @memset(i64* %1, i32 65, i32 99)\n store i8 0, i8* %7, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %9)\n %11 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 2, 3, 1, 0, 5, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_char_16-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %spec.store.select = select i1 %2, i32 -1, i32 20\n %3 = mul i32 %spec.store.select, 4\n %4 = call i64* @malloc(i32 %3)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_1, label LBL_2\n LBL_1:\n %7 = ptrtoint i64* %4 to i64\n %8 = sext i32 %spec.store.select to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 4\n %10 = add i64 %9, %7\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw i64 %storemerge1.reload, 1\n %13 = icmp ult i64 %12, %8\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %13, label LBL_3, label LBL_4\n LBL_4:\n %14 = bitcast i64* %4 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %4)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i32 %spec.store.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fgets_34-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %7 = icmp ugt i32 %6, 9\n br i1 %7, label LBL_5, label LBL_3\n LBL_3:\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = sext i32 %6 to i64\n %10 = mul i64 %9, 4\n %11 = add i64 %8, -64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i32*\n store i32 1, i32* %13, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %14 = mul i64 %indvars.iv.reload, 4\n %15 = add i64 %14, %11\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_4\n LBL_5:\n %20 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge3.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_8, label LBL_3\n LBL_3:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_7, label LBL_4\n LBL_4:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_8, label LBL_5\n LBL_5:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_8, label LBL_6\n LBL_6:\n store i8 0, i8* %20, align 1\n br label LBL_8\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_8\n LBL_8:\n %25 = call i32 @strlen(i8* nonnull %3)\n %26 = icmp eq i32 %25, 0\n br i1 %26, label LBL_13, label LBL_9\n LBL_9:\n %27 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_10\n LBL_10:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %28 = add i64 %storemerge3.reload, %27\n %29 = inttoptr i64 %28 to i8*\n %30 = load i8, i8* %29, align 1\n %31 = icmp eq i8 %30, 83\n %32 = icmp eq i1 %31, false\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n %33 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n br label LBL_13\n LBL_12:\n %34 = add nuw i64 %storemerge3.reload, 1\n %35 = call i32 @strlen(i8* %3)\n %36 = sext i32 %35 to i64\n %37 = icmp ult i64 %34, %36\n store i64 %34, i64* %storemerge3.reg2mem\n br i1 %37, label LBL_10, label LBL_13\n LBL_13:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 2, 0, 1, 4, 3 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 7, 0, 6, 5, 4, 1, 3, 2, 8 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 6, 7, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_13, { 0, 2, 1 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_fprintf_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_2, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = load i32, i32* @gv_0, align 4\n %21 = icmp eq i32 %20, 5\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n %23 = load %_IO_FILE*, %_IO_FILE** @gv_4, align 8\n %24 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_5, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_8\n LBL_8:\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -49\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n store i64 %3, i64* %sv_1, align 8\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @strcpy(i8* %4, i8* nonnull %5)\n %7 = call i64 @FUNC(i64 %3)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %1, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_6, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %26 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = sext i32 %sv_0.1.reload to i64\n %28 = mul i64 %27, 4\n %29 = add i64 %0, -64\n %30 = add i64 %29, %28\n %31 = inttoptr i64 %30 to i32*\n %32 = load i32, i32* %31, align 4\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_10\n LBL_9:\n %35 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_10\n LBL_10:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %1, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 2, 8, 0, 9, 1, 7, 6, 10, 4, 11, 5 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_cpy_11-bad", "fun_name": "CWE127_Buffer_Underread__char_declare_cpy_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = bitcast i8** %sv_1 to i8*\n store i8* %5, i8** %sv_1, align 8\n br label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %7 = load i8*, i8** %sv_1, align 8\n %8 = bitcast i64* %sv_0 to i8*\n %9 = call i8* @strcpy(i8* nonnull %8, i8* %7)\n %10 = call i64 @FUNC(i64* nonnull %sv_0)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int64_t_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 5, i64* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %5 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_no_init_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv4.reg2mem\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %6 = mul i64 %indvars.iv4.reload, 8\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n %9 = trunc i64 %indvars.iv4.reload to i32\n store i32 %9, i32* %8, align 8\n %10 = or i64 %7, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 %9, i32* %11, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 10\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n br i1 %exitcond6, label LBL_2, label LBL_1\n LBL_2:\n %.pr = load i32, i32* @gv_0, align 4\n %12 = icmp eq i32 %.pr, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 8\n %14 = add i64 %13, %3\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 8\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = or i64 %14, 4\n %20 = inttoptr i64 %19 to i32*\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %1, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder i32* @gv_0, { 0, 3, 2, 1 }\n uselistorder label LBL_4, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_execl_13-bad", "fun_name": "CWE78_OS_Command_Injection__char_file_execl_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8380 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_0 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_3, i64 0, i64 0))\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_popen_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = sext i32 %4 to i64\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i32*\n store i32 2764330, i32* %8, align 4\n br label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = call i32 @pclose(%_IO_FILE* nonnull %9)\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*)* @pclose, { 1, 0, 2 }\n uselistorder %_IO_FILE* (i8*, i8*)* @popen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_square_14-bad", "fun_name": "CWE190_Integer_Overflow__int_connect_socket_square_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_1, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = mul i32 %sv_0.1.reload, %sv_0.1.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_8\n LBL_8:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_rand_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 -4, i64 28\n %6 = call i64* @malloc(i32 40)\n %7 = ptrtoint i64* %6 to i64\n %8 = icmp eq i64* %6, null\n %9 = icmp eq i1 %8, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %9, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %10 = mul i64 %indvars.iv5.reload, 4\n %11 = add i64 %10, %7\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n br i1 %5, label LBL_7, label LBL_5\n LBL_5:\n %13 = add i64 %spec.select, %7\n %14 = inttoptr i64 %13 to i32*\n store i32 1, i32* %14, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_6\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %15 = mul i64 %indvars.iv.reload, 4\n %16 = add i64 %15, %7\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_6\n LBL_7:\n %21 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_8\n LBL_8:\n call void @free(i64* %6)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0, 2 }\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 3, 4, 0, 5, 1, 6, 2 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncpy_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %6, i32 99)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %8)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_ncpy_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %10 = icmp eq i32 %9, 5\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = bitcast i8** %sv_2 to i64*\n store i64 %13, i64* %14, align 8\n br label LBL_3\n LBL_3:\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = load i8*, i8** %sv_2, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i8* @strncpy(i8* %16, i8* nonnull %17, i32 99)\n %19 = load i8*, i8** %sv_2, align 8\n %20 = ptrtoint i8* %19 to i64\n %21 = add i64 %20, 99\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = load i8*, i8** %sv_2, align 8\n %24 = ptrtoint i8* %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %1, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 4, 3, 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_malloc_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 4)\n %1 = icmp eq i64* %0, null\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = bitcast i64* %0 to i32*\n store i32 5, i32* %2, align 4\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_realloc_05-bad", "fun_name": "CWE690_NULL_Deref_From_Return__int_realloc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 4)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_malloc_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 5, i64* %0, align 8\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 1, 2, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__empty_block_05-bad", "fun_name": "CWE398_Poor_Code_Quality__empty_block_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %3, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 25, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = add i64 %15, -48\n %17 = bitcast i64* %sv_1 to i8*\n %18 = sext i32 %12 to i64\n %19 = add i64 %16, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i32 @strtoul(i8* nonnull %17, i8** null, i32 0)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_11\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.1.off = add i32 %sv_0.0.ph.reload, -6\n %25 = icmp ult i32 %sv_0.1.off, 94\n br i1 %25, label LBL_8, label LBL_11\n LBL_8:\n %26 = call i64* @malloc(i32 %sv_0.0.ph.reload)\n %27 = icmp eq i64* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %29 = ptrtoint i64* %26 to i64\n %30 = bitcast i64* %26 to i32*\n store i32 1819043176, i32* %30, align 4\n %31 = add i64 %29, 4\n %32 = inttoptr i64 %31 to i16*\n store i16 111, i16* %32, align 2\n %33 = call i64 @FUNC(i64 %29)\n call void @free(i64* %26)\n br label LBL_12\n LBL_11:\n %34 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_0 to i64))\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %26, { 0, 1, 3, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_11, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_for_loop_08-bad", "fun_name": "CWE400_Resource_Exhaustion__rand_for_loop_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 -1, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge1.in = xor i32 %12, %13\n %phitmp = sext i32 %storemerge1.in to i64\n store i64 %phitmp, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %17 = icmp eq i64 %sv_0.0.reload, 0\n store i64 0, i64* %storemerge2.reg2mem\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %18 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n %19 = add nuw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %19, %sv_0.0.reload\n store i64 %19, i64* %storemerge2.reg2mem\n store i64 %sv_0.0.reload, i64* %rax.0.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_popen_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %6 = call i32 @strlen(i8* nonnull %1)\n %7 = sext i32 %6 to i64\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 2764330, i32* %10, align 4\n br label LBL_3\n LBL_3:\n %11 = call %_IO_FILE* @popen(i8* nonnull %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %12 = icmp eq %_IO_FILE* %11, null\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n %13 = call i32 @pclose(%_IO_FILE* nonnull %11)\n br label LBL_5\n LBL_5:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_multiply_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_11\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp slt i32 %sv_0.0.ph.reload, 1\n br i1 %25, label LBL_11, label LBL_8\n LBL_8:\n %26 = icmp sgt i32 %sv_0.0.ph.reload, 1073741822\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n %27 = mul i32 %sv_0.0.ph.reload, 2\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_11\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 2, 0, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 3, 4, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_no_init_08-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_no_init_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 8\n %9 = add i64 %8, %3\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 8\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = or i64 %9, 4\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %1, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_listen_socket_12-bad", "fun_name": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_listen_socket_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge8.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 20, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %28 = mul i32 %sv_0.1.reload, 4\n %29 = call i64* @malloc(i32 %28)\n %30 = icmp eq i64* %29, null\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_10, label LBL_11\n LBL_10:\n %32 = ptrtoint i64* %29 to i64\n %33 = sext i32 %sv_0.1.reload to i64\n %34 = icmp eq i32 %sv_0.1.reload, 0\n store i64 0, i64* %storemerge8.reg2mem\n br i1 %34, label LBL_13, label LBL_12\n LBL_11:\n call void @exit(i32 -1)\n unreachable\n LBL_12:\n %storemerge8.reload = load i64, i64* %storemerge8.reg2mem\n %35 = mul i64 %storemerge8.reload, 4\n %36 = add i64 %35, %32\n %37 = inttoptr i64 %36 to i32*\n store i32 0, i32* %37, align 4\n %38 = add nuw i64 %storemerge8.reload, 1\n %39 = icmp ult i64 %38, %33\n store i64 %38, i64* %storemerge8.reg2mem\n br i1 %39, label LBL_12, label LBL_13\n LBL_13:\n %40 = bitcast i64* %29 to i32*\n %41 = load i32, i32* %40, align 4\n %42 = zext i32 %41 to i64\n %43 = call i64 @FUNC(i64 %42)\n call void @free(i64* %29)\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %29, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.1.reload, { 1, 0, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 4, 2, 1, 3 }\n uselistorder i64* %storemerge8.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 7, 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_9, { 3, 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_struct_static_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %3 = ptrtoint i64* %2 to i64\n %4 = icmp eq i64* %2, null\n %5 = icmp eq i1 %4, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 1, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n store i64 %3, i64* %sv_0.0.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n %14 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %14)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_loop_08-bad", "fun_name": "CWE126_Buffer_Overread__char_declare_loop_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %5 = call i64 @FUNC()\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_3, label LBL_1\n LBL_1:\n %10 = trunc i64 %5 to i32\n %11 = icmp eq i32 %10, 0\n %12 = ptrtoint i64* %sv_2 to i64\n %spec.select = select i1 %11, i64 %1, i64 %12\n %13 = sext i32 %8 to i64\n %14 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %15 = add i64 %storemerge1.reload, %spec.select\n %16 = inttoptr i64 %15 to i8*\n %17 = load i8, i8* %16, align 1\n %18 = add i64 %storemerge1.reload, %14\n %19 = inttoptr i64 %18 to i8*\n store i8 %17, i8* %19, align 1\n %20 = add nuw i64 %storemerge1.reload, 1\n %21 = icmp ult i64 %20, %13\n store i64 %20, i64* %storemerge1.reg2mem\n br i1 %21, label LBL_2, label LBL_3\n LBL_3:\n %22 = call i64 @FUNC(i64* nonnull %sv_0)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %2, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %8, { 1, 0 }\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 0, 1, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_10-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_snprintf_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_1 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_2\n LBL_2:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %sv_1 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_7, label LBL_4\n LBL_4:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %20, align 1\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_7\n LBL_7:\n %.pr = load i32, i32* @gv_0, align 4\n %25 = icmp eq i32 %.pr, 0\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n store i64 0, i64* %sv_0, align 8\n %26 = bitcast i64* %sv_0 to i8*\n %27 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %26, i32 99, i8* nonnull %3)\n %28 = ptrtoint i64* %sv_0 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_9\n LBL_9:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 1, 0, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder label LBL_9, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.2.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n store i32 0, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_17, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 25, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -48\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @strtoul(i8* nonnull %23, i8** null, i32 0)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 0, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_9:\n store i32 0, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_17, label LBL_10\n LBL_10:\n %28 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %29 = call i16 @htons(i16 27015)\n %30 = bitcast i64* %sv_2 to %sockaddr*\n %31 = call i32 @bind(i32 %5, %sockaddr* nonnull %30, i32 16)\n %32 = icmp eq i32 %31, -1\n br i1 %32, label LBL_15, label LBL_11\n LBL_11:\n %33 = call i32 @listen(i32 %5, i32 5)\n %34 = icmp eq i32 %33, -1\n br i1 %34, label LBL_15, label LBL_12\n LBL_12:\n %35 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %36 = icmp eq i32 %35, -1\n br i1 %36, label LBL_15, label LBL_13\n LBL_13:\n %37 = call i32 @recv(i32 %35, i64* nonnull %sv_1, i32 25, i32 0)\n %38 = add i32 %37, 1\n %39 = icmp ult i32 %38, 2\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %39, label LBL_16, label LBL_14\n LBL_14:\n %40 = sext i32 %37 to i64\n %41 = add i64 %0, -48\n %42 = add i64 %41, %40\n %43 = inttoptr i64 %42 to i8*\n store i8 0, i8* %43, align 1\n %44 = bitcast i64* %sv_1 to i8*\n %45 = call i32 @strtoul(i8* nonnull %44, i8** null, i32 0)\n store i32 %45, i32* %sv_0.1.ph.reg2mem\n br label LBL_16\n LBL_15:\n %46 = call i32 @close(i32 %5)\n store i32 0, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_16:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %47 = call i32 @close(i32 %5)\n %48 = call i32 @close(i32 %35)\n store i32 %sv_0.1.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_17:\n %sv_0.2.reload = load i32, i32* %sv_0.2.reg2mem\n %49 = call i64 @FUNC()\n %50 = trunc i64 %49 to i32\n %51 = icmp eq i32 %50, 0\n %sv_0.2.off = add i32 %sv_0.2.reload, -6\n %52 = icmp ult i32 %sv_0.2.off, 94\n br i1 %51, label LBL_23, label LBL_18\n LBL_18:\n br i1 %52, label LBL_19, label LBL_22\n LBL_19:\n %53 = call i64* @malloc(i32 %sv_0.2.reload)\n %54 = icmp eq i64* %53, null\n %55 = icmp eq i1 %54, false\n br i1 %55, label LBL_21, label LBL_20\n LBL_20:\n call void @exit(i32 -1)\n unreachable\n LBL_21:\n %56 = ptrtoint i64* %53 to i64\n %57 = bitcast i64* %53 to i32*\n store i32 1819043176, i32* %57, align 4\n %58 = add i64 %56, 4\n %59 = inttoptr i64 %58 to i16*\n store i16 111, i16* %59, align 2\n %60 = call i64 @FUNC(i64 %56)\n call void @free(i64* %53)\n br label LBL_28\n LBL_22:\n %61 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_0 to i64))\n br label LBL_28\n LBL_23:\n br i1 %52, label LBL_24, label LBL_27\n LBL_24:\n %62 = call i64* @malloc(i32 %sv_0.2.reload)\n %63 = icmp eq i64* %62, null\n %64 = icmp eq i1 %63, false\n br i1 %64, label LBL_26, label LBL_25\n LBL_25:\n call void @exit(i32 -1)\n unreachable\n LBL_26:\n %65 = ptrtoint i64* %62 to i64\n %66 = bitcast i64* %62 to i32*\n store i32 1819043176, i32* %66, align 4\n %67 = add i64 %65, 4\n %68 = inttoptr i64 %67 to i16*\n store i16 111, i16* %68, align 2\n %69 = call i64 @FUNC(i64 %65)\n call void @free(i64* %62)\n br label LBL_28\n LBL_27:\n %70 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_0 to i64))\n br label LBL_28\n LBL_28:\n %71 = call i64 @FUNC(i64 40)\n %72 = icmp eq i64 %1, %71\n store i64 0, i64* %rax.0.reg2mem\n br i1 %72, label LBL_30, label LBL_29\n LBL_29:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_30\n LBL_30:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %62, { 0, 1, 3, 2 }\n uselistorder i64* %53, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.2.reload, { 1, 0, 2 }\n uselistorder i32 %37, { 1, 0 }\n uselistorder i32 %16, { 1, 0 }\n uselistorder i1 %6, { 1, 0 }\n uselistorder i32 %5, { 9, 0, 6, 7, 8, 2, 1, 5, 4, 3, 10 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 0, 4, 1, 2, 5, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.2.reg2mem, { 0, 6, 3, 1, 5, 4, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*, i8**, i32)* @strtoul, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_17, { 4, 2, 0, 5, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__freopen_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %1 = call %_IO_FILE* @freopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), %_IO_FILE* %0)\n %2 = call i32 @fclose(%_IO_FILE* %1)\n %3 = sext i32 %2 to i64\n ret i64 %3\n\n uselistorder %_IO_FILE* (i8*, i8*, %_IO_FILE*)* @freopen, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_malloc_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %spec.select = select i1 %2, i32 0, i32 99\n %3 = call i64* @malloc(i32 %spec.select)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %spec.select, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = zext i32 %spec.select to i64\n %10 = add i64 %6, -1\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_square_07-bad", "fun_name": "CWE190_Integer_Overflow__char_rand_square_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i32 32, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %10 = urem i32 %storemerge, 256\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %11 = zext i32 %.reload to i64\n %12 = icmp eq i32 %.reload, 5\n %13 = icmp eq i1 %12, false\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %narrow = mul i32 %sv_0.0.reload, 16777216\n %sext2 = mul i32 %narrow, %sv_0.0.reload\n %14 = ashr exact i32 %sext2, 24\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n store i64 %16, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_ncpy_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %10 = icmp eq i32 %9, 5\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %12 = load i8*, i8** %sv_1, align 8\n %13 = ptrtoint i8* %12 to i64\n %14 = bitcast i8** %sv_2 to i64*\n store i64 %13, i64* %14, align 8\n br label LBL_3\n LBL_3:\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = load i8*, i8** %sv_2, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i8* @strncpy(i8* %16, i8* nonnull %17, i32 99)\n %19 = load i8*, i8** %sv_2, align 8\n %20 = ptrtoint i8* %19 to i64\n %21 = add i64 %20, 99\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = load i8*, i8** %sv_2, align 8\n %24 = ptrtoint i8* %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %1, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 4, 3, 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_calloc_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = add i64 %3, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %5 = and i64 %4, -16\n store i64 %5, i64* %sv_0, align 8\n %6 = inttoptr i64 %5 to i64*\n store i64 5, i64* %6, align 16\n %7 = load i64, i64* %sv_0, align 8\n %8 = inttoptr i64 %7 to i64*\n %9 = load i64, i64* %8, align 8\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_2\n LBL_2:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 0, 1, 3, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i64 5, { 2, 3, 0, 4, 1, 5 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n uselistorder i32* @gv_0, { 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_square_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp ne i32 %3, 0\n %spec.store.select = sext i1 %4 to i32\n %5 = mul nsw i32 %spec.store.select, %spec.store.select\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE681_Incorrect_Conversion_Between_Numeric_Types__doubleNaN2int_10-bad", "fun_name": "CWE681_Incorrect_Conversion_Between_Numeric_Types__doubleNaN2int_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_5, label LBL_1\n LBL_1:\n %5 = call i128 @FUNC(i128 %1, i128 %1)\n %6 = call i64 @FUNC(i128 %5)\n %7 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @fgets(i8* nonnull %8, i32 256, %_IO_FILE* %7)\n %10 = icmp eq i8* %9, null\n br i1 %10, label LBL_3, label LBL_2\n LBL_2:\n %11 = call double @atof(i8* nonnull %8)\n %12 = fptrunc double %11 to float\n %13 = bitcast float %12 to i32\n %14 = sext i32 %13 to i128\n %15 = call i64 @FUNC(i128 %14)\n store i64 %15, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %16 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %17 = call i128 @__asm_movq.1(i64 %sv_0.0.reload)\n %18 = trunc i128 %17 to i64\n %19 = bitcast i64 %18 to double\n %20 = call double @sqrt(double %19)\n %21 = fptrunc double %20 to float\n %22 = bitcast float %21 to i32\n %23 = sext i32 %22 to i128\n %24 = call i32 @FUNC(i128 %23)\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n br label LBL_5\n LBL_5:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %2, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @calloc(i32 100, i32 4)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_multiply_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i64, i64* %sv_0, align 8\n %5 = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %5, 0\n %7 = icmp slt i64 %.pr, 1\n %or.cond = or i1 %7, %6\n br i1 %or.cond, label LBL_5, label LBL_2\n LBL_2:\n %8 = icmp sgt i64 %.pr, 4611686018427387902\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = mul i64 %.pr, 2\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %.pr, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %6)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__rand_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([126 x i8], [126 x i8]* @gv_1, i64 0, i64 0), i32 75, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_2, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i8*, i8*, i32, i8*)* @__assert_fail, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_rand_divide_14-bad", "fun_name": "CWE369_Divide_by_Zero__int_rand_divide_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = load i32, i32* @gv_0, align 4\n %15 = zext i32 %14 to i64\n %16 = icmp eq i32 %14, 5\n %17 = icmp eq i1 %16, false\n store i64 %15, i64* %rax.0.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %18 = udiv i32 100, %sv_0.0.reload\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncat_14-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncat_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strncat(i8* %sv_0.0.reload, i8* nonnull %9, i32 100)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %13)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_add_10-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_fscanf_add_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = add i64 %6, 1\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_no_init_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %6 = mul i64 %indvars.iv6.reload, 8\n %7 = add i64 %6, %1\n %8 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %9 = trunc i64 %indvars.iv6.reload to i32\n %10 = call i128 @FUNC(i32 %9)\n %11 = call i64 @FUNC(i128 %10)\n %12 = inttoptr i64 %7 to i64*\n store i64 %11, i64* %12, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %10, i128* %xmm0.04.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %16 = mul i64 %indvars.iv.reload, 8\n %17 = add i64 %16, %1\n %18 = inttoptr i64 %17 to i64*\n %19 = load i64, i64* %18, align 8\n %20 = call i128 @FUNC(i64 %19)\n %21 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_sleep_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %3, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = add i64 %12, -22\n %14 = bitcast i64* %sv_1 to i8*\n %15 = sext i32 %9 to i64\n %16 = add i64 %13, %15\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i32 @atoi(i8* nonnull %14)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n %20 = icmp slt i32 %sv_0.0.ph.reload, 1\n %21 = icmp sgt i32 %sv_0.0.ph.reload, ptrtoint (i1* @gv_1 to i32)\n %or.cond4 = or i1 %20, %21\n br i1 %or.cond4, label LBL_6, label LBL_5\n LBL_5:\n %22 = call i32 @usleep(i32 %sv_0.0.ph.reload)\n %23 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 -1, { 1, 0, 2, 3 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_4, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE510_Trapdoor__network_listen_01-bad", "fun_name": "CWE510_Trapdoor__network_listen_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %4 = call i16 @htons(i16 30000)\n %5 = bitcast i64* %sv_0 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_3, label LBL_4\n LBL_3:\n %10 = call i32 @close(i32 %1)\n br label LBL_6\n LBL_4:\n %11 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %12 = call i32 @close(i32 %1)\n %13 = icmp eq i32 %11, -1\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n %14 = call i32 @close(i32 %11)\n br label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %1, { 4, 1, 0, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_6, { 2, 3, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC()\n %36 = trunc i64 %35 to i32\n %37 = icmp eq i32 %36, 0\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n %38 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_15\n LBL_14:\n store i64 0, i64* %sv_0, align 8\n %39 = bitcast i64* %sv_0 to i8*\n %40 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %39, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_2)\n %41 = ptrtoint i64* %sv_0 to i64\n %42 = call i64 @FUNC(i64 %41)\n br label LBL_15\n LBL_15:\n %43 = call i64 @FUNC(i64 40)\n %44 = icmp eq i64 %0, %43\n store i64 0, i64* %rax.0.reg2mem\n br i1 %44, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memcpy_12-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memcpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %storemerge.v.v = select i1 %4, i64 add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416)), i64 -401\n %storemerge.v = add i64 %storemerge.v.v, %0\n %storemerge = and i64 %storemerge.v, -16\n %5 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 100)\n %6 = inttoptr i64 %storemerge to i64*\n %7 = call i64* @memcpy(i64* %6, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %8 = load i64, i64* %6, align 16\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %1, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_pointer_16-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = call i128 @FUNC(i64 4617315517961601024)\n %4 = call i64 @__asm_movsd.1(i128 %3)\n store i64 %4, i64* %0, align 8\n %5 = call i128 @FUNC(i64 %4)\n %6 = call i64 @FUNC()\n ret i64 %6\n\n uselistorder i64 ()* @printDoubleLine, { 1, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memmove_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %5 = ptrtoint i64* %sv_2 to i64\n %6 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %6, align 8\n store i64 %5, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %7 = bitcast i64* %sv_1 to i8*\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = add i32 %8, 1\n %10 = inttoptr i64 %sv_0.0.reload to i64*\n %11 = call i64* @memmove(i64* %10, i64* nonnull %sv_1, i32 %9)\n %12 = call i64 @FUNC(i64 %sv_0.0.reload)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_postinc_14-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_postinc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = add i32 %9, 1\n store i32 %10, i32* %sv_0, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int64_t_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 5)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i64 5, { 1, 0, 2, 3 }\n uselistorder i32* @gv_0, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_fgets_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8456 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_2, label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_3:\n %9 = call i32 @atoi(i8* nonnull %5)\n %10 = icmp ugt i32 %9, 9\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = sext i32 %9 to i64\n %13 = mul i64 %12, 4\n %14 = add i64 %11, -64\n %15 = add i64 %14, %13\n %16 = inttoptr i64 %15 to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n br label LBL_6\n LBL_5:\n %20 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder label LBL_5, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -609\n %3 = and i64 %2, -16\n store i32 0, i32* %storemerge.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge.reload = load i32, i32* %storemerge.reg2mem\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %4 = add nuw nsw i32 %storemerge.reload, 1\n %exitcond = icmp eq i32 %4, 2\n store i64 %3, i64* %sv_0.0.reg2mem\n store i32 %4, i32* %storemerge.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %5 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 50)\n %6 = inttoptr i64 %sv_0.0.reload to i64*\n %7 = call i64* @memcpy(i64* %6, i64* nonnull %sv_1, i32 400)\n %8 = inttoptr i64 %sv_0.0.reload to i32*\n %9 = load i32, i32* %8, align 4\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 1, 0 }\n uselistorder i32* %storemerge.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fixed_05-bad", "fun_name": "CWE617_Reachable_Assertion__fixed_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([127 x i8], [127 x i8]* @gv_1, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @gv_2, i64 0, i64 0))\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_fgets_07-bad", "fun_name": "CWE126_Buffer_Overread__CWE129_fgets_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %14, -64\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n br label LBL_8\n LBL_7:\n %23 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_01-bad", "fun_name": "CWE416_Use_After_Free__malloc_free_char_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64* @memset(i64* %0, i32 65, i32 99)\n %5 = add i64 %3, 99\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n call void @free(i64* %0)\n %7 = call i64 @FUNC(i64 %3)\n ret i64 %7\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %4 = call i32 @fclose(%_IO_FILE* %3)\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC()\n ret i64 %5\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_multiply_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = mul i32 %1, 1073741824\n %7 = mul i32 %2, 32768\n %8 = xor i32 %7, %6\n %9 = xor i32 %8, %3\n %10 = sext i1 %5 to i32\n %storemerge3.in.le = xor i32 %9, %10\n %storemerge3.le = zext i32 %storemerge3.in.le to i64\n %11 = icmp slt i32 %storemerge3.in.le, 0\n %12 = icmp eq i1 %11, false\n store i64 %storemerge3.le, i64* %rax.1.reg2mem\n br i1 %12, label LBL_4, label LBL_1\n LBL_1:\n %13 = icmp slt i32 %storemerge3.in.le, -1073741823\n br i1 %13, label LBL_3, label LBL_2\n LBL_2:\n %14 = mul i32 %storemerge3.in.le, 2\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n store i64 %16, i64* %rax.1.reg2mem\n br label LBL_4\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %17, i64* %rax.1.reg2mem\n br label LBL_4\n LBL_4:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i32 %storemerge3.in.le, { 0, 2, 1, 3 }\n uselistorder i64* %rax.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_4, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_memcpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n %6 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %7, i64 0, i64 100)\n %8 = inttoptr i64 %spec.select to i64*\n %9 = call i64* @memcpy(i64* %8, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %10 = load i64, i64* %8, align 8\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %2, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_09-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_09_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = add i64 %0, -401\n %4 = and i64 %3, -16\n store i64 %4, i64* %sv_1, align 8\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %5 = mul i64 %storemerge1.reload, 8\n %6 = add i64 %5, %2\n %7 = add i64 %6, -816\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 8\n %9 = add i64 %6, -812\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %12 = load i64, i64* %sv_1, align 8\n %13 = inttoptr i64 %12 to i64*\n %14 = call i64* @memcpy(i64* %13, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %15 = load i64, i64* %sv_1, align 8\n %16 = call i64 @FUNC(i64 %15)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__struct_pointer_malloc_use_08-bad", "fun_name": "CWE758_Undefined_Behavior__struct_pointer_malloc_use_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = load i64, i64* %3, align 8\n call void @free(i64* %3)\n %7 = inttoptr i64 %6 to i32*\n %8 = load i32, i32* %7, align 4\n %9 = zext i32 %8 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = add i64 %6, 4\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %5, i32 %7)\n %9 = ptrtoint i8* %sv_0.0.reload to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE835_Infinite_Loop__for_01-bad", "fun_name": "CWE835_Infinite_Loop__for_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i32\n store i32 0, i32* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i32, i32* %storemerge1.reg2mem\n %0 = zext i32 %storemerge1.reload to i64\n %1 = call i64 @FUNC(i64 %0)\n %2 = add nsw i32 %storemerge1.reload, 1\n %3 = srem i32 %2, 256\n %4 = icmp slt i32 %3, 0\n %5 = icmp eq i1 %4, false\n store i32 %3, i32* %storemerge1.reg2mem\n br i1 %5, label LBL_1, label LBL_2\n LBL_2:\n %6 = zext i32 %3 to i64\n ret i64 %6\n\n uselistorder i32 %3, { 2, 0, 1 }\n uselistorder i32 %storemerge1.reload, { 1, 0 }\n uselistorder i32* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_modulo_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 7\n %6 = urem i32 100, %spec.select\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 7, { 1, 0 }\n uselistorder i32 -1, { 1, 0, 2, 3 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_square_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i64, i64* %sv_0, align 8\n %9 = trunc i64 %8 to i32\n %.off = add i32 %9, 46339\n %10 = icmp ugt i32 %.off, 92678\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %sext = mul i64 %8, 4294967296\n %11 = ashr exact i64 %sext, 32\n %12 = mul nsw i64 %11, %11\n %13 = and i64 %12, 4294967295\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_6\n LBL_5:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_loop_08-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_loop_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_1 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = add i64 %8, -816\n %10 = add i64 %8, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %11 = mul i64 %storemerge13.reload, 8\n %12 = add i64 %11, %9\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 8\n %14 = add i64 %10, %11\n %15 = inttoptr i64 %14 to i32*\n store i32 0, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge13.reg2mem\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %exitcond4, label LBL_5, label LBL_4\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %17 = mul i64 %storemerge2.reload, 8\n %18 = add i64 %17, %sv_0.0.reload\n %19 = add i64 %17, %9\n %20 = inttoptr i64 %19 to i64*\n %21 = load i64, i64* %20, align 8\n %22 = inttoptr i64 %18 to i64*\n store i64 %21, i64* %22, align 8\n %23 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %23, 100\n store i64 %23, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %24 = call i64 @FUNC(i64 %sv_0.0.reload)\n %25 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %25)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %17, { 1, 0 }\n uselistorder i64 %11, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i64 100, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_alloca_04-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_int_alloca_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %2 = add i64 %0, -401\n %3 = and i64 %2, -16\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %4 = mul i64 %storemerge1.reload, 4\n %5 = add i64 %4, %3\n %6 = inttoptr i64 %5 to i32*\n store i32 5, i32* %6, align 4\n %7 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %7, 100\n store i64 %7, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n store i64 %3, i64* %sv_0, align 8\n %8 = inttoptr i64 %3 to i32*\n %9 = load i32, i32* %8, align 16\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = load i64, i64* %sv_0, align 8\n %13 = inttoptr i64 %12 to i64*\n call void @free(i64* %13)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memmove_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %7 = inttoptr i64 %sv_0.0.reload to i64*\n %8 = call i64* @memmove(i64* %7, i64* nonnull %sv_1, i32 100)\n %9 = add i64 %sv_0.0.reload, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_square_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.071013.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.071013.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.071013.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.0.off = add i32 %sv_0.0.ph.reload, 46339\n %25 = icmp ugt i32 %sv_0.0.off, 92678\n store i32 %sv_0.0.ph.reload, i32* %sv_0.071013.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.071013.reload = load i32, i32* %sv_0.071013.reg2mem\n %26 = mul i32 %sv_0.071013.reload, %sv_0.071013.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.071013.reload, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.071013.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memcpy_07-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_memcpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %7, -8\n store i64 %11, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %13 = load i64, i64* %sv_1, align 8\n %14 = inttoptr i64 %sv_0.0.reload to i64*\n store i64 %13, i64* %14, align 8\n %15 = add i64 %sv_0.0.reload, 8\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %sv_0.0.reload, 16\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %sv_0.0.reload, 24\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %sv_0.0.reload, 32\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %sv_0.0.reload, 40\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %sv_0.0.reload, 48\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %sv_0.0.reload, 56\n %28 = inttoptr i64 %27 to i64*\n %29 = add i64 %sv_0.0.reload, 64\n %30 = inttoptr i64 %29 to i64*\n %31 = add i64 %sv_0.0.reload, 72\n %32 = inttoptr i64 %31 to i64*\n %33 = add i64 %sv_0.0.reload, 80\n %34 = inttoptr i64 %33 to i64*\n %35 = add i64 %sv_0.0.reload, 88\n %36 = inttoptr i64 %35 to i64*\n %37 = add i64 %sv_0.0.reload, 96\n %38 = inttoptr i64 %37 to i32*\n %39 = add i64 %sv_0.0.reload, 99\n %40 = inttoptr i64 %39 to i8*\n store i8 0, i8* %40, align 1\n %41 = call i64 @FUNC(i64 %sv_0.0.reload)\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 14, 13, 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__listen_socket_02-bad", "fun_name": "CWE617_Reachable_Assertion__listen_socket_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_1 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_0, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_2 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_0 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %phitmp = icmp sgt i32 %21, 5\n %22 = call i32 @close(i32 %1)\n %23 = call i32 @close(i32 %10)\n br i1 %phitmp, label LBL_9, label LBL_8\n LBL_6:\n %24 = call i32 @close(i32 %1)\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %1)\n %26 = call i32 @close(i32 %10)\n br label LBL_8\n LBL_8:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @gv_1, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @gv_2, i64 0, i64 0))\n br label LBL_9\n LBL_9:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 0, 1, 5, 2, 3, 4, 6 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 0, 1, 2, 4, 3, 5 }\n uselistorder label LBL_8, { 0, 2, 3, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = bitcast i64* %sv_1 to i8*\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = sext i32 %13 to i64\n %15 = icmp eq i32 %13, 0\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %16 = add i64 %storemerge1.reload, %sv_0.0.reload\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = add i64 %storemerge1.reload, %.pre\n %20 = inttoptr i64 %19 to i8*\n store i8 %18, i8* %20, align 1\n %21 = add nuw i64 %storemerge1.reload, 1\n %22 = icmp ult i64 %21, %14\n store i64 %21, i64* %storemerge1.reg2mem\n br i1 %22, label LBL_6, label LBL_7\n LBL_7:\n %23 = call i64 @FUNC(i64 %.pre)\n %24 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %24)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %.pre, { 1, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_postinc_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp eq i16 %3, 32767\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i16 %3, 1\n store i16 %5, i16* %sv_0, align 2\n %6 = sext i16 %5 to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_printf_05-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_environment_printf_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = sext i32 %4 to i64\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = sub i32 99, %4\n %12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)\n br label LBL_3\n LBL_3:\n %.pr = load i32, i32* @gv_0, align 4\n %13 = icmp eq i32 %.pr, 0\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = call i32 (i8*, ...) @printf(i8* nonnull %3)\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_realloc_14-bad", "fun_name": "CWE401_Memory_Leak__char_realloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @realloc(i64* null, i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n store i64 7453010373643542593, i64* %4, align 8\n %8 = add i64 %7, 8\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %7)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* null, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_multiply_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp eq i32 %3, 0\n %spec.store.select = select i1 %4, i32 32, i32 -128\n %5 = trunc i32 %spec.store.select to i8\n %6 = icmp slt i8 %5, 0\n %7 = icmp eq i1 %6, false\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = icmp slt i8 %5, -63\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = mul i32 %spec.store.select, 2\n %10 = and i32 %9, 64\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i32 99, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %3 = call i64* @malloc(i32 %sv_0.0.reload)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %sv_0.0.reload, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = sext i32 %7 to i64\n %10 = add i64 %6, %9\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.0.reload, { 1, 0 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_08-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = load i32, i32* %sv_0, align 4\n %10 = icmp eq i32 %9, 0\n %or.cond = or i1 %8, %10\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %11 = mul i32 %9, 2\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 0, 2, 1 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_memcpy_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n %6 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %7, i64 0, i64 50)\n %8 = inttoptr i64 %spec.select to i64*\n %9 = call i64* @memcpy(i64* %8, i64* nonnull %sv_0, i32 400)\n %10 = inttoptr i64 %spec.select to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %2, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_postinc_10-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_max_postinc_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 0)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_connect_socket_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n store i32 %5, i32* %sv_0.1.reg2mem\n br i1 %8, label LBL_6, label LBL_1\n LBL_1:\n %9 = call i32 @socket(i32 2, i32 1, i32 6)\n %10 = icmp eq i32 %9, -1\n store i32 %5, i32* %sv_0.1.reg2mem\n br i1 %10, label LBL_6, label LBL_2\n LBL_2:\n %11 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %12 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %13 = call i16 @htons(i16 27015)\n %14 = bitcast i64* %sv_2 to %sockaddr*\n %15 = call i32 @connect(i32 %9, %sockaddr* nonnull %14, i32 16)\n %16 = icmp eq i32 %15, -1\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_5, label LBL_3\n LBL_3:\n %17 = call i32 @recv(i32 %9, i64* nonnull %sv_1, i32 19, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n %20 = ptrtoint i64* %sv_3 to i64\n %21 = sext i32 %17 to i64\n %22 = add i64 %20, -32\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = bitcast i64* %sv_1 to i8*\n %26 = call double @atof(i8* nonnull %25)\n %27 = fptrunc double %26 to float\n %28 = bitcast float %27 to i32\n %29 = sext i32 %28 to i128\n %30 = call i128 @FUNC(i128 %29)\n %31 = call i64 @FUNC(i128 %30)\n %32 = trunc i64 %31 to i32\n store i32 %32, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %33 = call i32 @close(i32 %9)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %34 = call i64 @FUNC()\n %35 = trunc i64 %34 to i32\n %36 = icmp eq i32 %35, 0\n br i1 %36, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %37 = call i128 @__asm_movss.1(i32 %sv_0.1.reload)\n %38 = call i128 @__asm_movss.1(i32 2147483647)\n %39 = call i128 @FUNC(i128 %37, i128 %38)\n %40 = call i128 @FUNC(i128 %39)\n %41 = load i128, i128* @gv_1, align 8\n call void @FUNC(i128 %40, i128 %41)\n %42 = call i128 @FUNC(i128 %38, i128 %38)\n %43 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.1.reload)\n %44 = call i128 @FUNC(i64 4636737291354636288)\n %45 = call i128 @FUNC(i128 %44, i128 %43)\n %46 = call i32 @FUNC(i128 %45)\n %47 = zext i32 %46 to i64\n %48 = call i64 @FUNC(i64 %47)\n br label LBL_8\n LBL_8:\n %49 = call i64 @FUNC(i64 40)\n %50 = icmp eq i64 %2, %49\n store i64 0, i64* %rax.0.reg2mem\n br i1 %50, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %38, { 1, 0, 2 }\n uselistorder i32 %sv_0.1.reload, { 1, 0 }\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %9, { 2, 0, 1, 3 }\n uselistorder i32 %5, { 3, 2, 0, 1 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i128* @gv_1, { 1, 0 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder double (i8*)* @atof, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_1, align 4\n %24 = icmp eq i32 %23, 5\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n %25 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp eq i32 %sv_0.1.reload, 0\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n %27 = udiv i32 100, %sv_0.1.reload\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_11\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n br label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_loop_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %4\n %11 = add i64 %storemerge1.reload, %9\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = inttoptr i64 %10 to i8*\n store i8 %13, i8* %14, align 1\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n store i8 0, i8* %7, align 1\n %16 = call i64 @FUNC(i64 %4)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %4, { 1, 0, 2 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %3 = call i32 @fclose(%_IO_FILE* %2)\n %4 = sext i32 %3 to i64\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memcpy_13-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memcpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memcpy(i64* %9, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_0 to i32))\n %11 = load i64, i64* %9, align 8\n %12 = call i64 @FUNC(i64 %11)\n call void @free(i64* %9)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_17-bad", "fun_name": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge6.reg2mem = alloca i64\n %sv_0.05.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.05.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %3, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = add i64 %12, -22\n %14 = bitcast i64* %sv_1 to i8*\n %15 = sext i32 %9 to i64\n %16 = add i64 %13, %15\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i32 @atoi(i8* nonnull %14)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.05.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.05.reload = load i32, i32* %sv_0.05.reg2mem\n %20 = mul i32 %sv_0.05.reload, 4\n %21 = call i64* @malloc(i32 %20)\n %22 = icmp eq i64* %21, null\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_6, label LBL_7\n LBL_6:\n %24 = ptrtoint i64* %21 to i64\n %25 = sext i32 %sv_0.05.reload to i64\n %26 = icmp eq i32 %sv_0.05.reload, 0\n store i64 0, i64* %storemerge6.reg2mem\n br i1 %26, label LBL_9, label LBL_8\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %storemerge6.reload = load i64, i64* %storemerge6.reg2mem\n %27 = mul i64 %storemerge6.reload, 4\n %28 = add i64 %27, %24\n %29 = inttoptr i64 %28 to i32*\n store i32 0, i32* %29, align 4\n %30 = add nuw i64 %storemerge6.reload, 1\n %31 = icmp ult i64 %30, %25\n store i64 %30, i64* %storemerge6.reg2mem\n br i1 %31, label LBL_8, label LBL_9\n LBL_9:\n %32 = bitcast i64* %21 to i32*\n %33 = load i32, i32* %32, align 4\n %34 = zext i32 %33 to i64\n %35 = call i64 @FUNC(i64 %34)\n call void @free(i64* %21)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %21, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.05.reload, { 1, 0, 2 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.05.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge6.reg2mem, { 2, 0, 1 }\n uselistorder i32 -1, { 5, 2, 1, 3, 0, 4 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_multiply_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %3, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = add i64 %15, -22\n %17 = bitcast i64* %sv_1 to i8*\n %18 = sext i32 %12 to i64\n %19 = add i64 %16, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i32 @atoi(i8* nonnull %17)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_11\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp slt i32 %sv_0.0.ph.reload, 0\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_11, label LBL_8\n LBL_8:\n %27 = icmp slt i32 %sv_0.0.ph.reload, -1073741823\n br i1 %27, label LBL_10, label LBL_9\n LBL_9:\n %28 = mul i32 %sv_0.0.ph.reload, 2\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n br label LBL_11\n LBL_10:\n %31 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 2, 0, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_11, { 4, 3, 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE188_Reliance_on_Data_Memory_Layout__modify_local_02-bad", "fun_name": "CWE188_Reliance_on_Data_Memory_Layout__modify_local_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n store i32 1, i32* %sv_0, align 4\n %3 = ptrtoint i32* %sv_0 to i64\n %4 = add i64 %3, 4\n %5 = inttoptr i64 %4 to i32*\n store i32 5, i32* %5, align 4\n %6 = load i32, i32* %sv_0, align 4\n %sext = mul i32 %6, 16777216\n %7 = ashr exact i32 %sext, 24\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = zext i32 %1 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %2, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %3 = zext i32 %.pre to i64\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64 @FUNC(i64 4294967292)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = sext i32 %10 to i64\n %13 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %4\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = add i64 %storemerge1.reload, %13\n %18 = inttoptr i64 %17 to i8*\n store i8 %16, i8* %18, align 1\n %19 = add nuw i64 %storemerge1.reload, 1\n %20 = icmp ult i64 %19, %12\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %20, label LBL_4, label LBL_5\n LBL_5:\n %21 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %1)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %10, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 2, 3, 0, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE688_Function_Call_With_Incorrect_Variable_or_Reference_as_Argument__basic_05-bad", "fun_name": "CWE688_Function_Call_With_Incorrect_Variable_or_Reference_as_Argument__basic_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* inttoptr (i64 5 to i8*))\n %5 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_08-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memcpy_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_2 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_2 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %6 = mul i64 %storemerge1.reload, 8\n %7 = add i64 %6, %2\n %8 = add i64 %7, -816\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %7, -812\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = icmp eq i32 %5, 0\n %spec.select = select i1 %14, i64 %1, i64 %13\n %15 = inttoptr i64 %spec.select to i64*\n %16 = call i64* @memcpy(i64* %15, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %17 = call i64 @FUNC(i64 %spec.select)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %3, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_memmove_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %9 = icmp eq i32 %8, 5\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n %10 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n store i64 %3, i64* %sv_1, align 8\n br label LBL_3\n LBL_3:\n %11 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %12 = load i64, i64* %sv_1, align 8\n %13 = inttoptr i64 %12 to i64*\n %14 = call i64* @memmove(i64* %13, i64* nonnull %sv_0, i32 100)\n %15 = load i64, i64* %sv_1, align 8\n %16 = add i64 %15, 99\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = load i64, i64* %sv_1, align 8\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %1, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE511_Logic_Time_Bomb__time_17-bad", "fun_name": "CWE511_Logic_Time_Bomb__time_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_0 to i32*\n %2 = call i32 @time(i32* nonnull %1)\n %3 = load i64, i64* %sv_0, align 8\n %4 = icmp slt i64 %3, 1199163601\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @unlink(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0))\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_postinc_11-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_postinc_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = mul i64 %9, 4294967296\n %sext = add i64 %10, 4294967296\n %11 = ashr exact i64 %sext, 32\n store i64 %11, i64* %sv_0, align 8\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE123_Write_What_Where_Condition__listen_socket_17-bad", "fun_name": "CWE123_Write_What_Where_Condition__listen_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 %1, i64* %sv_1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 %2, i64* %sv_2, align 8\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = bitcast i64* %sv_0 to %sockaddr*\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %5, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_4, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_4, label LBL_5\n LBL_4:\n %14 = call i32 @close(i32 %3)\n br label LBL_6\n LBL_5:\n %15 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 16, i32 0)\n %16 = call i32 @close(i32 %3)\n %17 = call i32 @close(i32 %12)\n br label LBL_6\n LBL_6:\n store i64 %1, i64* @gv_0, align 8\n %18 = load i64, i64* %sv_1, align 8\n store i64 %18, i64* @gv_1, align 8\n store i64 %18, i64* %sv_2, align 8\n %19 = add i64 %18, 8\n %20 = inttoptr i64 %19 to i64*\n store i64 %1, i64* %20, align 8\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 1, 0, 2, 3 }\n uselistorder i64* %sv_0, { 2, 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_postinc_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = add i32 %9, 1\n store i32 %11, i32* %sv_0, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 49)\n %6 = add i64 %3, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %3, i64* %sv_1, align 8\n store i64 0, i64* %sv_0, align 8\n %8 = bitcast i64* %sv_0 to i8*\n %9 = inttoptr i64 %3 to i8*\n %10 = call i8* @strcpy(i8* nonnull %8, i8* %9)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 4, 3, 2, 5 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_loop_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %sv_1 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = add i64 %7, -816\n %9 = add i64 %7, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %10 = mul i64 %storemerge13.reload, 8\n %11 = add i64 %10, %8\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 8\n %13 = add i64 %9, %10\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge13.reg2mem\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %exitcond4, label LBL_5, label LBL_4\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = mul i64 %storemerge2.reload, 8\n %17 = add i64 %16, %sv_0.0.reload\n %18 = add i64 %16, %8\n %19 = inttoptr i64 %18 to i64*\n %20 = load i64, i64* %19, align 8\n %21 = inttoptr i64 %17 to i64*\n store i64 %20, i64* %21, align 8\n %22 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %22, 100\n store i64 %22, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %23 = call i64 @FUNC(i64 %sv_0.0.reload)\n %24 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %24)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 1, 0 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64 100, { 1, 0, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge12.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n store i64 0, i64* %storemerge3.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %7 = mul i64 %storemerge3.reload, 8\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 2, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge3.reload, 1\n %exitcond4 = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge3.reg2mem\n br i1 %exitcond4, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %3)\n br label LBL_9\n LBL_5:\n store i64 0, i64* %storemerge12.reg2mem\n br i1 %6, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %storemerge12.reload = load i64, i64* %storemerge12.reg2mem\n %13 = mul i64 %storemerge12.reload, 8\n %14 = add i64 %13, %4\n %15 = inttoptr i64 %14 to i32*\n store i32 1, i32* %15, align 4\n %16 = add i64 %14, 4\n %17 = inttoptr i64 %16 to i32*\n store i32 2, i32* %17, align 4\n %18 = add nuw nsw i64 %storemerge12.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge12.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_7\n LBL_8:\n call void @free(i64* %3)\n br label LBL_9\n LBL_9:\n %19 = call i64 @FUNC()\n ret i64 %19\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder i64* %storemerge3.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge12.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_realloc_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 5, i64* %0, align 8\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i64*, i32)* @realloc, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_loop_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_6, label LBL_4\n LBL_4:\n %11 = sext i32 %9 to i64\n %12 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %13 = add i64 %storemerge2.reload, %.pre-phi.reload\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge2.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw i64 %storemerge2.reload, 1\n %19 = icmp ult i64 %18, %11\n store i64 %18, i64* %storemerge2.reg2mem\n br i1 %19, label LBL_5, label LBL_6\n LBL_6:\n %20 = call i64 @FUNC(i64 %.pre-phi.reload)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i64* %sv_1, { 3, 1, 2, 0 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_preinc_11-bad", "fun_name": "CWE190_Integer_Overflow__short_rand_preinc_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 1, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %sext = mul i32 %storemerge.in, 65536\n %phitmp = add i32 %sext, 65536\n %phitmp3 = ashr exact i32 %phitmp, 16\n %phitmp4 = zext i32 %phitmp3 to i64\n store i64 %phitmp4, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %12 = call i64 @FUNC()\n %13 = trunc i64 %12 to i32\n %14 = icmp eq i32 %13, 0\n store i64 %12, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %15 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 65536, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_square_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = call i32 @rand()\n %8 = xor i32 %7, %6\n %9 = sext i1 %3 to i32\n %storemerge.in = xor i32 %8, %9\n %10 = trunc i32 %storemerge.in to i16\n %11 = sub i16 0, %10\n %12 = icmp slt i16 %11, 0\n %13 = icmp eq i1 %12, false\n %.v = select i1 %13, i16 %11, i16 %10\n %14 = icmp ult i16 %.v, 182\n br i1 %14, label LBL_1, label LBL_2\n LBL_1:\n %15 = urem i32 %storemerge.in, 65536\n %narrow = mul i32 %storemerge.in, 65536\n %sext = mul i32 %narrow, %15\n %16 = ashr exact i32 %sext, 16\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n br label LBL_3\n LBL_2:\n %19 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %10, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_predec_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_10, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = add i32 %sv_0.1.reload, -1\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_10\n LBL_9:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__long_malloc_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 8)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i64* %0, null\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %4, label LBL_5, label LBL_2\n LBL_2:\n store i64 5, i64* %0, align 8\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_3:\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %4, label LBL_5, label LBL_4\n LBL_4:\n store i64 5, i64* %0, align 8\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %1, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 4, 1, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fscanf_07-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fscanf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %6 = icmp eq i32 %5, 0\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_multiply_14-bad", "fun_name": "CWE190_Integer_Overflow__int_listen_socket_multiply_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_10, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_10, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n br label LBL_10\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n %31 = icmp slt i32 %sv_0.0.ph.reload, 1\n %or.cond3 = or i1 %31, %30\n br i1 %or.cond3, label LBL_10, label LBL_9\n LBL_9:\n %32 = mul i32 %sv_0.0.ph.reload, 2\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_10\n LBL_10:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder label LBL_10, { 3, 4, 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__rand_04-bad", "fun_name": "CWE617_Reachable_Assertion__rand_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge.in = xor i32 %9, %10\n %storemerge = zext i32 %storemerge.in to i64\n %11 = icmp sgt i32 %storemerge.in, 5\n store i64 %storemerge, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([126 x i8], [126 x i8]* @gv_1, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @gv_2, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_multiply_05-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_fscanf_multiply_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n %.pre2 = load i64, i64* %sv_0, align 8\n %phitmp = icmp eq i32 %.pre, 0\n %5 = icmp slt i64 %.pre2, 1\n %or.cond = or i1 %phitmp, %5\n br i1 %or.cond, label LBL_3, label LBL_2\n LBL_2:\n %6 = mul i64 %.pre2, 2\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_short_05-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_short_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 13, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext = mul i32 %sv_0.1.reload, 65536\n %27 = ashr exact i32 %sext, 16\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_printf_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = sext i32 %2 to i64\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = call i32 @puts(i8* nonnull %1)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 1 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_preinc_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = call i32 @rand()\n %7 = sext i1 %3 to i32\n %storemerge.v = xor i32 %6, %7\n %storemerge = trunc i32 %storemerge.v to i8\n %8 = icmp eq i8 %storemerge, 127\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %sext4 = mul i32 %storemerge.v, 16777216\n %sext = add i32 %sext4, 16777216\n %9 = ashr exact i32 %sext, 24\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_2:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_execl_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %3, %4\n %6 = inttoptr i64 %5 to i32*\n store i32 2764330, i32* %6, align 4\n %7 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i8*, ...)* @execl, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_snprintf_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = sext i32 %2 to i64\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n store i64 0, i64* %sv_0, align 8\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %11, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %13 = ptrtoint i64* %sv_0 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i8* (i8*)* @getenv, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_partial_init_02-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_partial_init_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %indvars.iv6.reg2mem\n br label LBL_1\n LBL_1:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %2 = mul i64 %indvars.iv6.reload, 8\n %3 = add i64 %2, %1\n %4 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %5 = trunc i64 %indvars.iv6.reload to i32\n %6 = call i128 @FUNC(i32 %5)\n %7 = call i64 @FUNC(i128 %6)\n %8 = inttoptr i64 %3 to i64*\n store i64 %7, i64* %8, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 5\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %6, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_2, label LBL_1\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %9 = mul i64 %indvars.iv.reload, 8\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i64*\n %12 = load i64, i64* %11, align 8\n %13 = call i128 @FUNC(i64 %12)\n %14 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 1, 0, 2 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__char_pointer_13-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__char_pointer_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %3 = zext i32 %2 to i64\n %4 = icmp eq i32 %2, 5\n %5 = icmp eq i1 %4, false\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 %1)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_for_loop_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = load i32, i32* %sv_0, align 4\n %.off = add i32 %9, -1\n %10 = icmp ugt i32 %.off, 19\n %11 = or i1 %8, %10\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %12 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %13 = add nuw i64 %storemerge4.reload, 1\n %14 = load i32, i32* %sv_0, align 4\n %15 = sext i32 %14 to i64\n %16 = icmp ult i64 %13, %15\n store i64 %13, i64* %storemerge4.reg2mem\n br i1 %16, label LBL_3, label LBL_4\n LBL_4:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 0, 1, 3 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder i32 -1, { 0, 2, 1, 3 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_sleep_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.2.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n store i32 -1, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_17, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_9:\n store i32 -1, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_17, label LBL_10\n LBL_10:\n %28 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %29 = call i16 @htons(i16 27015)\n %30 = bitcast i64* %sv_2 to %sockaddr*\n %31 = call i32 @bind(i32 %5, %sockaddr* nonnull %30, i32 16)\n %32 = icmp eq i32 %31, -1\n br i1 %32, label LBL_15, label LBL_11\n LBL_11:\n %33 = call i32 @listen(i32 %5, i32 5)\n %34 = icmp eq i32 %33, -1\n br i1 %34, label LBL_15, label LBL_12\n LBL_12:\n %35 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %36 = icmp eq i32 %35, -1\n br i1 %36, label LBL_15, label LBL_13\n LBL_13:\n %37 = call i32 @recv(i32 %35, i64* nonnull %sv_1, i32 13, i32 0)\n %38 = add i32 %37, 1\n %39 = icmp ult i32 %38, 2\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %39, label LBL_16, label LBL_14\n LBL_14:\n %40 = sext i32 %37 to i64\n %41 = add i64 %0, -22\n %42 = add i64 %41, %40\n %43 = inttoptr i64 %42 to i8*\n store i8 0, i8* %43, align 1\n %44 = bitcast i64* %sv_1 to i8*\n %45 = call i32 @atoi(i8* nonnull %44)\n store i32 %45, i32* %sv_0.1.ph.reg2mem\n br label LBL_16\n LBL_15:\n %46 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_16:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %47 = call i32 @close(i32 %5)\n %48 = call i32 @close(i32 %35)\n store i32 %sv_0.1.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_17:\n %sv_0.2.reload = load i32, i32* %sv_0.2.reg2mem\n %49 = call i64 @FUNC()\n %50 = trunc i64 %49 to i32\n %51 = icmp eq i32 %50, 0\n %52 = icmp slt i32 %sv_0.2.reload, 1\n %53 = icmp sgt i32 %sv_0.2.reload, ptrtoint (i1* @gv_0 to i32)\n %or.cond7 = or i1 %52, %53\n br i1 %51, label LBL_21, label LBL_18\n LBL_18:\n br i1 %or.cond7, label LBL_20, label LBL_19\n LBL_19:\n %54 = call i32 @usleep(i32 %sv_0.2.reload)\n %55 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_24\n LBL_20:\n %56 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_2 to i64))\n br label LBL_24\n LBL_21:\n br i1 %or.cond7, label LBL_23, label LBL_22\n LBL_22:\n %57 = call i32 @usleep(i32 %sv_0.2.reload)\n %58 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_24\n LBL_23:\n %59 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_2 to i64))\n br label LBL_24\n LBL_24:\n %60 = call i64 @FUNC(i64 40)\n %61 = icmp eq i64 %1, %60\n store i64 0, i64* %rax.0.reg2mem\n br i1 %61, label LBL_26, label LBL_25\n LBL_25:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_26\n LBL_26:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %or.cond7, { 1, 0 }\n uselistorder i32 %sv_0.2.reload, { 1, 0, 2, 3 }\n uselistorder i32 %37, { 1, 0 }\n uselistorder i32 %16, { 1, 0 }\n uselistorder i1 %6, { 1, 0 }\n uselistorder i32 %5, { 9, 0, 6, 7, 8, 2, 1, 5, 4, 3, 10 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 0, 4, 1, 2, 5, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.2.reg2mem, { 0, 6, 3, 1, 5, 4, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 4, 6, 7, 8, 0, 3, 5, 10, 11, 12, 1, 9 }\n uselistorder label LBL_17, { 4, 2, 0, 5, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_loop_12-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_loop_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 100)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %5, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %5, -8\n store i64 %11, i64* %storemerge1.reg2mem\n br label LBL_7\n LBL_4:\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %12 = call i64* @memset(i64* %4, i32 65, i32 99)\n %13 = add i64 %5, 99\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n store i64 %5, i64* %storemerge1.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %15 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %16 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_8\n LBL_8:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %17 = add i64 %storemerge2.reload, %storemerge1.reload\n %18 = add i64 %storemerge2.reload, %16\n %19 = inttoptr i64 %18 to i8*\n %20 = load i8, i8* %19, align 1\n %21 = inttoptr i64 %17 to i8*\n store i8 %20, i8* %21, align 1\n %22 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %22, 100\n store i64 %22, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_8\n LBL_9:\n %23 = add i64 %storemerge1.reload, 99\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i64 @FUNC(i64 %storemerge1.reload)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i64 %storemerge1.reload, { 1, 0, 2 }\n uselistorder i1 %7, { 1, 0 }\n uselistorder i64 %5, { 0, 3, 1, 2 }\n uselistorder i64* %4, { 1, 0, 2, 3 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE123_Write_What_Where_Condition__listen_socket_01-bad", "fun_name": "CWE123_Write_What_Where_Condition__listen_socket_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 %1, i64* %sv_1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 %2, i64* %sv_2, align 8\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_4, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_4, label LBL_5\n LBL_4:\n %14 = call i32 @close(i32 %3)\n br label LBL_6\n LBL_5:\n %15 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 16, i32 0)\n %16 = call i32 @close(i32 %3)\n %17 = call i32 @close(i32 %12)\n br label LBL_6\n LBL_6:\n store i64 %1, i64* @gv_0, align 8\n %18 = load i64, i64* %sv_1, align 8\n store i64 %18, i64* @gv_1, align 8\n store i64 %18, i64* %sv_2, align 8\n %19 = add i64 %18, 8\n %20 = inttoptr i64 %19 to i64*\n store i64 %1, i64* %20, align 8\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 1, 0, 2, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_6, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_sub_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 4294967293, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_malloc_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 4)\n %1 = load i32, i32* @gv_0, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n %5 = icmp eq i64* %0, null\n %or.cond = or i1 %5, %4\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %6 = bitcast i64* %0 to i32*\n store i32 5, i32* %6, align 4\n %7 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 5, { 1, 2, 0 }\n uselistorder i32 5, { 3, 0, 4, 1, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_loop_07-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE131_loop_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %.reg2mem3 = alloca i32*\n %.reg2mem = alloca i32*\n %sv_0 = alloca i32*, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32* null, i32** %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i32** %sv_0 to i64\n %5 = add i64 %4, -17\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i32*\n store i32* %7, i32** %sv_0, align 8\n store i32* %7, i32** %.reg2mem\n br label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_1 to i64\n %.reload = load i32*, i32** %.reg2mem\n %9 = add i64 %8, -48\n store i32* %.reload, i32** %.reg2mem3\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %.reload4 = load i32*, i32** %.reg2mem3\n %10 = mul i64 %storemerge2.reload, 4\n %11 = ptrtoint i32* %.reload4 to i64\n %12 = add i64 %10, %11\n %13 = add i64 %9, %10\n %14 = inttoptr i64 %13 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = inttoptr i64 %12 to i32*\n store i32 %15, i32* %16, align 4\n %17 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %17, 10\n %18 = load i32*, i32** %sv_0, align 8\n store i32* %18, i32** %.reg2mem3\n store i64 %17, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %19 = load i32, i32* %18, align 4\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %18, { 1, 0 }\n uselistorder i32** %sv_0, { 3, 2, 0, 1 }\n uselistorder i32** %.reg2mem, { 0, 2, 1 }\n uselistorder i32** %.reg2mem3, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fgets_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = bitcast i64* %sv_1 to i8*\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = call i8* @fgets(i8* nonnull %5, i32 20, %_IO_FILE* %6)\n %8 = icmp eq i8* %7, null\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %9 = call double @atof(i8* nonnull %5)\n %10 = fptrunc double %9 to float\n %11 = bitcast float %10 to i32\n %12 = sext i32 %11 to i128\n %13 = call i128 @FUNC(i128 %12)\n %14 = call i64 @FUNC(i128 %13)\n store i64 %14, i64* %sv_0.0.in.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 %4, i64* %sv_0.0.in.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %16 = load i128, i128* @gv_2, align 8\n %17 = call i128 @__asm_movss.1(i32 %sv_0.0)\n %18 = call i128 @__asm_movss.1(i32 2147483647)\n %19 = call i128 @FUNC(i128 %17, i128 %18)\n %20 = call i128 @FUNC(i128 %19)\n call void @FUNC(i128 %20, i128 %16)\n %21 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %2, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.in.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__sizeof_double_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n unreachable\n LBL_2:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %6 = call i128 @FUNC(i64 9098483789791991595)\n %7 = call i64 @__asm_movsd.1(i128 %6)\n store i64 %7, i64* %3, align 8\n %8 = call i128 @FUNC(i64 %7)\n %9 = call i64 @FUNC()\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_fprintf_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_0 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = sext i32 %2 to i64\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = add i64 %14, %15\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n %32 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %33 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 6, 7, 0 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memmove_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %2, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = call i64* @memmove(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 100)\n %5 = add i64 %1, 99\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %1)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_12-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_add_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_3\n LBL_2:\n store i32 2, i32* %sv_0, align 4\n br label LBL_3\n LBL_3:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n %9 = load i32, i32* %sv_0, align 4\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %10 = add i32 %9, 1\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_8\n LBL_5:\n %13 = icmp eq i32 %9, -1\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = add i32 %9, 1\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_8\n LBL_7:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 0, 2, 1 }\n uselistorder i32* %sv_0, { 1, 2, 0, 3 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = call i64 @FUNC()\n %30 = trunc i64 %29 to i32\n %31 = icmp eq i32 %30, 0\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n %32 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_17\n LBL_11:\n %33 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %34 = icmp eq i32 %33, 1\n %35 = icmp eq i1 %34, false\n br i1 %35, label LBL_17, label LBL_12\n LBL_12:\n %36 = load i64, i64* %sv_1, align 8\n %37 = trunc i64 %36 to i32\n %38 = icmp sgt i32 %37, 9999\n br i1 %38, label LBL_17, label LBL_13\n LBL_13:\n %39 = and i64 %36, 4294967295\n %40 = icmp eq i64 %39, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %40, label LBL_16, label LBL_14\n LBL_14:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %41 = add i32 %storemerge5.reload, 1\n %42 = sext i32 %41 to i64\n %43 = icmp sgt i64 %39, %42\n store i32 %41, i32* %storemerge5.reg2mem\n br i1 %43, label LBL_14, label LBL_15\n LBL_15:\n %phitmp = zext i32 %41 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_16\n LBL_16:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %44 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_17\n LBL_17:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_19, label LBL_18\n LBL_18:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_19\n LBL_19:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %41, { 1, 0, 2 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_16, { 1, 0 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = call i32 @close(i32 %0)\n %2 = sext i32 %1 to i64\n ret i64 %2\n\n uselistorder i32 (i32)* @close, { 1, 2, 3, 0, 4 }\n uselistorder i32 (i8*, i32, ...)* @open, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %4 = mul i64 %indvars.iv.reload, 4\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 10, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fscanf_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gv_2, i64 0, i64 0), i32 75, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_3, i64 0, i64 0))\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i8*, i8*, i32, i8*)* @__assert_fail, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fgets_memmove_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %3 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 99)\n %4 = add i64 %0, -13\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64 @FUNC(i64* nonnull %sv_1)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %1, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 99, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fscanf_12-bad", "fun_name": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fscanf_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %phitmp = mul i32 %.pre, 4\n store i32 %phitmp, i32* %.reg2mem\n br label LBL_3\n LBL_2:\n store i32 20, i32* %sv_0, align 4\n store i32 80, i32* %.reg2mem\n br label LBL_3\n LBL_3:\n %.reload = load i32, i32* %.reg2mem\n %6 = call i64* @malloc(i32 %.reload)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_5\n LBL_4:\n %9 = ptrtoint i64* %6 to i64\n %10 = load i32, i32* %sv_0, align 4\n %11 = icmp eq i32 %10, 0\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %11, label LBL_7, label LBL_6\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %12 = mul i64 %storemerge1.reload, 4\n %13 = add i64 %12, %9\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 4\n %15 = add nuw i64 %storemerge1.reload, 1\n %16 = load i32, i32* %sv_0, align 4\n %17 = sext i32 %16 to i64\n %18 = icmp ult i64 %15, %17\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %18, label LBL_6, label LBL_7\n LBL_7:\n %19 = bitcast i64* %6 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n call void @free(i64* %6)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %6, { 0, 1, 3, 2 }\n uselistorder i32* %sv_0, { 3, 1, 4, 0, 2, 5 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_snprintf_07-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_snprintf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %4, i32 93, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_2, i64 0, i64 0))\n %6 = icmp eq i32 %5, 0\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cat_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %1, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strcat(i8* nonnull %1, i8* nonnull %4)\n %6 = call i64 @FUNC(i64 %2)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_listen_socket_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %31 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %34, %33\n %36 = inttoptr i64 %35 to i32*\n %37 = load i32, i32* %36, align 4\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n br label LBL_13\n LBL_12:\n %40 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_13\n LBL_13:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %1, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 3, 8, 9, 10, 0, 11, 2, 5, 7, 12, 13, 14, 4, 15, 6 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_realloc_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 400)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* null, { 3, 1, 4, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_05-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = inttoptr i64 %3 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 99)\n %8 = add i64 %3, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n br label LBL_2\n LBL_2:\n %10 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i8* @strcpy(i8* nonnull %11, i8* %10)\n %13 = call i64 @FUNC(i64 %3)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 3, 2, 1, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_sub_05-bad", "fun_name": "CWE191_Integer_Underflow__char_fscanf_sub_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i8, i8* %sv_0, align 1\n %7 = add i8 %6, -1\n %8 = sext i8 %7 to i64\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_calloc_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 20, i32 1)\n %1 = load i32, i32* @gv_0, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n %5 = icmp eq i64* %0, null\n %or.cond = or i1 %5, %4\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %6 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %7 = add i64 %6, 8\n %8 = inttoptr i64 %7 to i16*\n store i16 25978, i16* %8, align 2\n %9 = add i64 %6, 10\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %6)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %6, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_for_loop_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge8.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_8, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n %22 = load i32, i32* @gv_0, align 4\n %23 = icmp eq i32 %22, 0\n %sv_0.1.off = add i32 %sv_0.0.ph.reload, -1\n %24 = icmp ugt i32 %sv_0.1.off, 19\n %25 = or i1 %24, %23\n br i1 %25, label LBL_8, label LBL_6\n LBL_6:\n %26 = sext i32 %sv_0.0.ph.reload to i64\n store i64 0, i64* %storemerge8.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge8.reload = load i64, i64* %storemerge8.reg2mem\n %27 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %28 = add nuw i64 %storemerge8.reload, 1\n %29 = icmp ult i64 %28, %26\n store i64 %28, i64* %storemerge8.reg2mem\n br i1 %29, label LBL_7, label LBL_8\n LBL_8:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %storemerge8.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 6, 1, 0, 8, 9, 7, 5, 4, 10, 2, 11, 3 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_8, { 0, 3, 1, 2 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_5, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_multiply_08-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_rand_multiply_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 1152921504606846976\n %9 = call i32 @rand()\n %10 = zext i32 %9 to i64\n %11 = mul i64 %10, 35184372088832\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 1073741824\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = mul i64 %16, 32768\n %18 = call i32 @rand()\n %19 = sext i32 %18 to i64\n %20 = sext i1 %5 to i64\n %21 = xor i64 %8, %20\n %22 = xor i64 %21, %11\n %23 = xor i64 %22, %14\n %24 = xor i64 %23, %17\n %storemerge = xor i64 %24, %19\n store i64 %storemerge, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %25 = call i64 @FUNC()\n %26 = trunc i64 %25 to i32\n %27 = icmp eq i32 %26, 0\n %28 = icmp slt i64 %sv_0.0.reload, 1\n %or.cond = or i1 %28, %27\n store i64 %25, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %29 = mul i64 %sv_0.0.reload, 2\n %30 = call i64 @FUNC(i64 %29)\n store i64 %30, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__struct_alloca_use_12-bad", "fun_name": "CWE758_Undefined_Behavior__struct_alloca_use_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %sv_0 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_0 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = add i64 %2, -1\n %8 = and i64 %7, -16\n %9 = inttoptr i64 %8 to i64*\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %10 = load i64, i64* %9, align 16\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n %13 = zext i32 %1 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_3\n LBL_2:\n store i64 1, i64* %9, align 16\n %15 = call i64 @FUNC(i64 1)\n %16 = zext i32 %1 to i64\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_3\n LBL_3:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %3, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %9, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_sub_08-bad", "fun_name": "CWE191_Integer_Underflow__int_fscanf_sub_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = add i64 %9, 4294967295\n %11 = and i64 %10, 4294967295\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_system_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = add i64 %6, %7\n %9 = inttoptr i64 %8 to i32*\n store i32 2764330, i32* %9, align 4\n br label LBL_2\n LBL_2:\n %10 = call i32 @system(i8* nonnull %1)\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 (i8*)* @system, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_11-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fscanf_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_8, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = icmp ult i64 %9, 6\n br i1 %10, label LBL_7, label LBL_4\n LBL_4:\n %11 = trunc i64 %9 to i32\n %12 = call i64* @malloc(i32 %11)\n %13 = icmp eq i64* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %15 = ptrtoint i64* %12 to i64\n %16 = bitcast i64* %12 to i32*\n store i32 1819043176, i32* %16, align 4\n %17 = add i64 %15, 4\n %18 = inttoptr i64 %17 to i16*\n store i16 111, i16* %18, align 2\n %19 = call i64 @FUNC(i64 %15)\n call void @free(i64* %12)\n br label LBL_8\n LBL_7:\n %20 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %12, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_rand_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv7.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_10, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_10, label LBL_2\n LBL_2:\n %7 = urem i32 %2, 2\n %8 = icmp eq i32 %7, 0\n %9 = mul i32 %3, 1073741824\n %10 = mul i32 %4, 32768\n %11 = xor i32 %10, %9\n %12 = xor i32 %11, %5\n %13 = sext i1 %8 to i32\n %storemerge3.in = xor i32 %12, %13\n %14 = call i64* @malloc(i32 40)\n %15 = ptrtoint i64* %14 to i64\n %16 = icmp eq i64* %14, null\n %17 = icmp eq i1 %16, false\n store i64 0, i64* %indvars.iv7.reg2mem\n br i1 %17, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %indvars.iv7.reload = load i64, i64* %indvars.iv7.reg2mem\n %18 = mul i64 %indvars.iv7.reload, 4\n %19 = add i64 %18, %15\n %20 = inttoptr i64 %19 to i32*\n store i32 0, i32* %20, align 4\n %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7.reload, 1\n %exitcond9 = icmp eq i64 %indvars.iv.next8, 10\n store i64 %indvars.iv.next8, i64* %indvars.iv7.reg2mem\n br i1 %exitcond9, label LBL_5, label LBL_4\n LBL_5:\n %21 = icmp ugt i32 %storemerge3.in, 9\n br i1 %21, label LBL_8, label LBL_6\n LBL_6:\n %22 = sext i32 %storemerge3.in to i64\n %23 = mul i64 %22, 4\n %24 = add i64 %23, %15\n %25 = inttoptr i64 %24 to i32*\n store i32 1, i32* %25, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %26 = mul i64 %indvars.iv.reload, 4\n %27 = add i64 %26, %15\n %28 = inttoptr i64 %27 to i32*\n %29 = load i32, i32* %28, align 4\n %30 = zext i32 %29 to i64\n %31 = call i64 @FUNC(i64 %30)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %32 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n call void @free(i64* %14)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %15, { 1, 0, 2 }\n uselistorder i64* %indvars.iv7.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder label LBL_10, { 1, 2, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_square_09-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = sub i8 0, %3\n %5 = icmp slt i8 %4, 0\n %6 = icmp eq i1 %5, false\n %.v = select i1 %6, i8 %4, i8 %3\n %7 = icmp ult i8 %.v, 12\n br i1 %7, label LBL_1, label LBL_2\n LBL_1:\n %8 = mul i8 %3, %3\n %9 = sext i8 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_2:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8 %3, { 1, 0, 2, 3 }\n uselistorder i8* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_int64_t_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %storemerge.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %4, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %5 = load i32, i32* @gv_2, align 4\n %6 = icmp eq i32 %5, 0\n %spec.select = select i1 %6, i64 %1, i64 5\n %7 = call i64 @FUNC(i64 %spec.select)\n store i64 %7, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE688_Function_Call_With_Incorrect_Variable_or_Reference_as_Argument__basic_03-bad", "fun_name": "CWE688_Function_Call_With_Incorrect_Variable_or_Reference_as_Argument__basic_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i8* inttoptr (i64 5 to i8*))\n %3 = call i64 @FUNC(i64* nonnull %sv_0)\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_listen_socket_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv13.reg2mem = alloca i64\n %sv_0.069.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.069.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.069.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.069.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.069.reload = load i32, i32* %sv_0.069.reg2mem\n %25 = call i64* @malloc(i32 40)\n %26 = ptrtoint i64* %25 to i64\n %27 = icmp eq i64* %25, null\n %28 = icmp eq i1 %27, false\n store i64 0, i64* %indvars.iv13.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %indvars.iv13.reload = load i64, i64* %indvars.iv13.reg2mem\n %29 = mul i64 %indvars.iv13.reload, 4\n %30 = add i64 %29, %26\n %31 = inttoptr i64 %30 to i32*\n store i32 0, i32* %31, align 4\n %indvars.iv.next14 = add nuw nsw i64 %indvars.iv13.reload, 1\n %exitcond15 = icmp eq i64 %indvars.iv.next14, 10\n store i64 %indvars.iv.next14, i64* %indvars.iv13.reg2mem\n br i1 %exitcond15, label LBL_11, label LBL_10\n LBL_11:\n %32 = icmp ugt i32 %sv_0.069.reload, 9\n br i1 %32, label LBL_14, label LBL_12\n LBL_12:\n %33 = sext i32 %sv_0.069.reload to i64\n %34 = mul i64 %33, 4\n %35 = add i64 %34, %26\n %36 = inttoptr i64 %35 to i32*\n store i32 1, i32* %36, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_13\n LBL_13:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %37 = mul i64 %indvars.iv.reload, 4\n %38 = add i64 %37, %26\n %39 = inttoptr i64 %38 to i32*\n %40 = load i32, i32* %39, align 4\n %41 = zext i32 %40 to i64\n %42 = call i64 @FUNC(i64 %41)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_15, label LBL_13\n LBL_14:\n %43 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_15\n LBL_15:\n call void @free(i64* %25)\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %26, { 0, 2, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.069.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %indvars.iv13.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_03-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 49)\n %7 = add i64 %3, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memcpy(i64* nonnull %sv_0, i64* %5, i32 %9)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 1, 0, 3 }\n uselistorder i8** %sv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_popen_17-bad", "fun_name": "CWE426_Untrusted_Search_Path__char_popen_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 757101420, i64* %sv_0, align 8\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = or i64 %1, 4\n %3 = inttoptr i64 %2 to i16*\n %4 = or i64 %1, 6\n %5 = inttoptr i64 %4 to i8*\n store i16 24940, i16* %3, align 4\n store i8 0, i8* %5, align 2\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call %_IO_FILE* @popen(i8* nonnull %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0))\n %8 = icmp eq %_IO_FILE* %7, null\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %9 = call i32 @pclose(%_IO_FILE* nonnull %7)\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8448 to i32*), align 256\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_4, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_1 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_46, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_0, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n br i1 %14, label LBL_46, label LBL_6\n LBL_4:\n store i64 0, i64* %sv_1, align 8\n br label LBL_8\n LBL_5:\n %15 = call i32 @close(i32 %4)\n store i64 0, i64* %sv_1, align 8\n br label LBL_8\n LBL_6:\n %16 = ptrtoint i64* %sv_2 to i64\n %17 = sext i32 %12 to i64\n %18 = add i64 %16, -22\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = bitcast i64* %sv_0 to i8*\n %22 = call i32 @atoi(i8* nonnull %21)\n %23 = call i32 @close(i32 %4)\n store i64 0, i64* %sv_1, align 8\n %24 = icmp ugt i32 %22, 9\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n %25 = sext i32 %22 to i64\n %26 = mul i64 %25, 4\n %27 = add i64 %16, -64\n %28 = add i64 %27, %26\n %29 = inttoptr i64 %28 to i32*\n %30 = load i32, i32* %29, align 4\n %31 = zext i32 %30 to i64\n %32 = call i64 @FUNC(i64 %31)\n br label LBL_9\n LBL_8:\n %33 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i64 %16, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 4, 0, 1, 2, 5, 3 }\n uselistorder label LBL_8, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_10, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_10\n LBL_10:\n %29 = call i32 @strlen(i8* nonnull %4)\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_15, label LBL_11\n LBL_11:\n %31 = ptrtoint i64* %1 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_12\n LBL_12:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %32 = add i64 %storemerge4.reload, %31\n %33 = inttoptr i64 %32 to i8*\n %34 = load i8, i8* %33, align 1\n %35 = icmp eq i8 %34, 83\n %36 = icmp eq i1 %35, false\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n %37 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n br label LBL_15\n LBL_14:\n %38 = add nuw i64 %storemerge4.reload, 1\n %39 = call i32 @strlen(i8* %4)\n %40 = sext i32 %39 to i64\n %41 = icmp ult i64 %38, %40\n store i64 %38, i64* %storemerge4.reg2mem\n br i1 %41, label LBL_12, label LBL_15\n LBL_15:\n call void @free(i64* %1)\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 3, 0, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 4, 0, 5, 2, 1, 3, 6 }\n uselistorder i32 -1, { 2, 0, 3, 4, 1, 5 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_15, { 0, 2, 1 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_square_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 2, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %7 = mul nuw nsw i32 %sv_0.0.reload, %sv_0.0.reload\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_cpy_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i8*\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i8*, i8** %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = bitcast i64* %sv_1 to i8*\n %spec.select = select i1 %6, i8* %1, i8* %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strcpy(i8* nonnull %9, i8* %spec.select)\n %11 = ptrtoint i64* %sv_0 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %2, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 3, 0, 2, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__int_malloc_use_01-bad", "fun_name": "CWE758_Undefined_Behavior__int_malloc_use_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 4)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n %4 = load i32, i32* %3, align 4\n call void @free(i64* %0)\n %5 = zext i32 %4 to i64\n %6 = call i64 @FUNC(i64 %5)\n ret i64 %6\n\n uselistorder i64* %0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.02.reg2mem = alloca i64\n %sv_0.03.reg2mem = alloca i64\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n store i64 8382078947037833542, i64* %0, align 8\n %4 = add i64 %3, 8\n %5 = inttoptr i64 %4 to i32*\n store i32 1735289202, i32* %5, align 4\n %6 = add i64 %3, 12\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC()\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, 0\n store i64 %8, i64* %rax.0.reg2mem\n br i1 %10, label LBL_8, label LBL_3\n LBL_3:\n %11 = bitcast i64* %0 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = icmp eq i8 %12, 0\n %14 = icmp eq i1 %13, false\n store i8 %12, i8* %.reg2mem\n store i64 %3, i64* %sv_0.03.reg2mem\n store i64 %3, i64* %sv_0.02.reg2mem\n br i1 %14, label LBL_4, label LBL_7\n LBL_4:\n %sv_0.03.reload = load i64, i64* %sv_0.03.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %15 = icmp eq i8 %.reload, 83\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n store i64 %sv_0.03.reload, i64* %sv_0.02.reg2mem\n br label LBL_7\n LBL_6:\n %18 = add i64 %sv_0.03.reload, 1\n %19 = inttoptr i64 %18 to i8*\n %20 = load i8, i8* %19, align 1\n %21 = icmp eq i8 %20, 0\n %22 = icmp eq i1 %21, false\n store i8 %20, i8* %.reg2mem\n store i64 %18, i64* %sv_0.03.reg2mem\n store i64 %18, i64* %sv_0.02.reg2mem\n br i1 %22, label LBL_4, label LBL_7\n LBL_7:\n %sv_0.02.reload = load i64, i64* %sv_0.02.reg2mem\n %23 = inttoptr i64 %sv_0.02.reload to i64*\n call void @free(i64* %23)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.03.reload, { 1, 0 }\n uselistorder i64* %0, { 1, 0, 3, 2 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.03.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.02.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8 0, { 1, 0, 2, 3 }\n uselistorder label LBL_7, { 0, 2, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_static_12-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_int_static_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %storemerge24.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %storemerge5.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %3 = mul i64 %storemerge5.reload, 4\n %4 = add i64 %3, ptrtoint (i64* @gv_0 to i64)\n %5 = inttoptr i64 %4 to i32*\n store i32 5, i32* %5, align 4\n %6 = add nuw nsw i64 %storemerge5.reload, 1\n %exitcond6 = icmp eq i64 %6, 100\n store i64 %6, i64* %storemerge5.reg2mem\n store i64 ptrtoint (i64* @gv_0 to i64), i64* %storemerge1.reg2mem\n br i1 %exitcond6, label LBL_5, label LBL_1\n LBL_2:\n %7 = call i64* @malloc(i32 400)\n %8 = ptrtoint i64* %7 to i64\n %9 = icmp eq i64* %7, null\n %10 = icmp eq i1 %9, false\n store i64 0, i64* %storemerge24.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %storemerge24.reload = load i64, i64* %storemerge24.reg2mem\n %12 = mul i64 %storemerge24.reload, 4\n %13 = add i64 %12, %8\n %14 = inttoptr i64 %13 to i32*\n store i32 5, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge24.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge24.reg2mem\n store i64 %8, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %16 = inttoptr i64 %storemerge1.reload to i32*\n %17 = load i32, i32* %16, align 4\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %20 = inttoptr i64 %storemerge1.reload to i64*\n call void @free(i64* %20)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge24.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 0, 2, 1 }\n uselistorder i64 100, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %sv_0.1.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_7\n LBL_7:\n %.reload = load i32, i32* %.reg2mem\n %23 = icmp eq i32 %.reload, 5\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_12\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %25 = icmp eq i32 %sv_0.1.reload, 0\n br i1 %25, label LBL_11, label LBL_10\n LBL_10:\n %26 = udiv i32 100, %sv_0.1.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_12\n LBL_11:\n %29 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_12:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_declare_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @malloc(i32 100)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %2 to i64\n %7 = call i64* @memset(i64* %2, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %10 = call i64 @FUNC(i64 %sv_0.0.reload)\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %11)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %2, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_no_init_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %rax.2.reg2mem\n br i1 %5, label LBL_5, label LBL_3\n LBL_3:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %6 = mul i64 %indvars.iv6.reload, 8\n %7 = add i64 %6, %3\n %8 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %9 = trunc i64 %indvars.iv6.reload to i32\n %10 = call i128 @FUNC(i32 %9)\n %11 = call i64 @FUNC(i128 %10)\n %12 = inttoptr i64 %7 to i64*\n store i64 %11, i64* %12, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %10, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_4, label LBL_3\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 8\n %14 = add i64 %13, %3\n %15 = inttoptr i64 %14 to i64*\n %16 = load i64, i64* %15, align 8\n %17 = call i128 @FUNC(i64 %16)\n %18 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %18, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge3.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = sext i32 %10 to i64\n %13 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge3.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge3.reload = load i64, i64* %storemerge3.reg2mem\n %14 = add i64 %storemerge3.reload, %4\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = add i64 %storemerge3.reload, %13\n %18 = inttoptr i64 %17 to i8*\n store i8 %16, i8* %18, align 1\n %19 = add nuw i64 %storemerge3.reload, 1\n %20 = icmp ult i64 %19, %12\n store i64 %19, i64* %storemerge3.reg2mem\n br i1 %20, label LBL_4, label LBL_5\n LBL_5:\n %21 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %1)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge3.reload, { 0, 2, 1 }\n uselistorder i32 %10, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge3.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_square_03-bad", "fun_name": "CWE190_Integer_Overflow__char_fscanf_square_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = mul i8 %3, %3\n %5 = sext i8 %4 to i64\n %6 = and i64 %5, 4294967295\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_loop_03-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 49)\n %6 = add i64 %3, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 0, i64* %sv_0, align 8\n %8 = inttoptr i64 %3 to i8*\n %9 = call i32 @strlen(i8* %8)\n store i64 0, i64* %sv_1, align 8\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_3, label LBL_1\n LBL_1:\n %11 = sext i32 %9 to i64\n %12 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %3\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge1.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = load i64, i64* %sv_1, align 8\n %19 = add i64 %18, 1\n store i64 %19, i64* %sv_1, align 8\n %20 = icmp ult i64 %19, %11\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %20, label LBL_2, label LBL_3\n LBL_3:\n %21 = call i64 @FUNC(i64 %3)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %19, { 0, 2, 1 }\n uselistorder i64 %storemerge1.reload, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i64 %3, { 1, 0, 4, 3, 2 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_multiply_01-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_multiply_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = trunc i64 %3 to i32\n %5 = icmp slt i32 %4, 1\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i64 %3, 2\n %7 = and i64 %6, 4294967294\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_loop_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = sext i32 %9 to i64\n %12 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %13 = add i64 %storemerge2.reload, %6\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge2.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw i64 %storemerge2.reload, 1\n %19 = icmp ult i64 %18, %11\n store i64 %18, i64* %storemerge2.reg2mem\n br i1 %19, label LBL_4, label LBL_5\n LBL_5:\n %20 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i64 %6, { 1, 0, 2 }\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.04.reg2mem = alloca i8*\n %sv_0.05.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_8, label LBL_3\n LBL_3:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_7, label LBL_4\n LBL_4:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_8, label LBL_5\n LBL_5:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_8, label LBL_6\n LBL_6:\n store i8 0, i8* %20, align 1\n br label LBL_8\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_8\n LBL_8:\n %25 = load i32, i32* inttoptr (i64 8368 to i32*), align 16\n %26 = zext i32 %25 to i64\n %27 = icmp eq i32 %25, 5\n %28 = icmp eq i1 %27, false\n store i64 %26, i64* %rax.0.reg2mem\n br i1 %28, label LBL_14, label LBL_9\n LBL_9:\n %29 = load i8, i8* %3, align 1\n %30 = icmp eq i8 %29, 0\n %31 = icmp eq i1 %30, false\n store i8 %29, i8* %.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n store i8* %3, i8** %sv_0.04.reg2mem\n br i1 %31, label LBL_10, label LBL_13\n LBL_10:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %32 = icmp eq i8 %.reload, 83\n %33 = icmp eq i1 %32, false\n br i1 %33, label LBL_12, label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n store i8* %sv_0.05.reload, i8** %sv_0.04.reg2mem\n br label LBL_13\n LBL_12:\n %35 = ptrtoint i8* %sv_0.05.reload to i64\n %36 = add i64 %35, 1\n %37 = inttoptr i64 %36 to i8*\n %38 = load i8, i8* %37, align 1\n %39 = icmp eq i8 %38, 0\n %40 = icmp eq i1 %39, false\n store i8 %38, i8* %.reg2mem\n store i8* %37, i8** %sv_0.05.reg2mem\n store i8* %37, i8** %sv_0.04.reg2mem\n br i1 %40, label LBL_10, label LBL_13\n LBL_13:\n %sv_0.04.reload = load i8*, i8** %sv_0.04.reg2mem\n %41 = bitcast i8* %sv_0.04.reload to i64*\n call void @free(i64* %41)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.05.reload, { 1, 0 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 0, 1, 2, 3, 5, 4 }\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.05.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.04.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8 0, { 2, 0, 3, 4, 5, 6, 1 }\n uselistorder label LBL_13, { 0, 2, 1 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_05-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05.reg2mem = alloca i8*\n %sv_0.06.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = load i32, i32* @gv_3, align 4\n %20 = icmp eq i32 %19, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_13, label LBL_8\n LBL_8:\n %21 = load i8, i8* %3, align 1\n %22 = icmp eq i8 %21, 0\n %23 = icmp eq i1 %22, false\n store i8 %21, i8* %.reg2mem\n store i8* %3, i8** %sv_0.06.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n br i1 %23, label LBL_9, label LBL_12\n LBL_9:\n %sv_0.06.reload = load i8*, i8** %sv_0.06.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %24 = icmp eq i8 %.reload, 83\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_11, label LBL_10\n LBL_10:\n %26 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_4 to i64))\n store i8* %sv_0.06.reload, i8** %sv_0.05.reg2mem\n br label LBL_12\n LBL_11:\n %27 = ptrtoint i8* %sv_0.06.reload to i64\n %28 = add i64 %27, 1\n %29 = inttoptr i64 %28 to i8*\n %30 = load i8, i8* %29, align 1\n %31 = icmp eq i8 %30, 0\n %32 = icmp eq i1 %31, false\n store i8 %30, i8* %.reg2mem\n store i8* %29, i8** %sv_0.06.reg2mem\n store i8* %29, i8** %sv_0.05.reg2mem\n br i1 %32, label LBL_9, label LBL_12\n LBL_12:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %33 = bitcast i8* %sv_0.05.reload to i64*\n call void @free(i64* %33)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.06.reload, { 1, 0 }\n uselistorder i8* %3, { 0, 1, 2, 4, 3 }\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.06.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.05.reg2mem, { 0, 1, 3, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4 }\n uselistorder label LBL_12, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %3 = call i64* @memcpy(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 99)\n %4 = add i64 %0, -13\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %1, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 99, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_malloc_13-bad", "fun_name": "CWE690_NULL_Deref_From_Return__int_malloc_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 4)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = bitcast i64* %0 to i32*\n store i32 5, i32* %5, align 4\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.08.reg2mem = alloca i8*\n %sv_0.09.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_13, label LBL_3\n LBL_3:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_11, label LBL_4\n LBL_4:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_11, label LBL_5\n LBL_5:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_6\n LBL_6:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_12, label LBL_7\n LBL_7:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %28, align 1\n br label LBL_9\n LBL_9:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_12, label LBL_10\n LBL_10:\n store i8 0, i8* %30, align 1\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %6)\n br label LBL_13\n LBL_12:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_13\n LBL_13:\n %35 = call i64 @FUNC()\n %36 = trunc i64 %35 to i32\n %37 = icmp eq i32 %36, 0\n br i1 %37, label LBL_19, label LBL_14\n LBL_14:\n %38 = load i8, i8* %4, align 1\n %39 = icmp eq i8 %38, 0\n %40 = icmp eq i1 %39, false\n store i8 %38, i8* %.reg2mem\n store i8* %4, i8** %sv_0.09.reg2mem\n store i8* %4, i8** %sv_0.08.reg2mem\n br i1 %40, label LBL_15, label LBL_18\n LBL_15:\n %sv_0.09.reload = load i8*, i8** %sv_0.09.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %41 = icmp eq i8 %.reload, 83\n %42 = icmp eq i1 %41, false\n br i1 %42, label LBL_17, label LBL_16\n LBL_16:\n %43 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n store i8* %sv_0.09.reload, i8** %sv_0.08.reg2mem\n br label LBL_18\n LBL_17:\n %44 = ptrtoint i8* %sv_0.09.reload to i64\n %45 = add i64 %44, 1\n %46 = inttoptr i64 %45 to i8*\n %47 = load i8, i8* %46, align 1\n %48 = icmp eq i8 %47, 0\n %49 = icmp eq i1 %48, false\n store i8 %47, i8* %.reg2mem\n store i8* %46, i8** %sv_0.09.reg2mem\n store i8* %46, i8** %sv_0.08.reg2mem\n br i1 %49, label LBL_15, label LBL_18\n LBL_18:\n %sv_0.08.reload = load i8*, i8** %sv_0.08.reg2mem\n %50 = bitcast i8* %sv_0.08.reload to i64*\n call void @free(i64* %50)\n br label LBL_19\n LBL_19:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %0, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_21, label LBL_20\n LBL_20:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_21\n LBL_21:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.09.reload, { 1, 0 }\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %4, { 0, 1, 2, 3, 4, 6, 5 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.09.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.08.reg2mem, { 0, 1, 3, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4, 5, 6 }\n uselistorder label LBL_18, { 0, 2, 1 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_13, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memmove_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64*\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %5 = icmp eq i32 %4, 5\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = inttoptr i64 %3 to i64*\n store i64* %.pre, i64** %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 49)\n %9 = add i64 %3, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64* %7, i64** %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %11 = inttoptr i64 %3 to i8*\n %.pre-phi.reload = load i64*, i64** %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = call i64* @memmove(i64* nonnull %sv_0, i64* %.pre-phi.reload, i32 %12)\n %14 = call i64 @FUNC(i64 %3)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %1, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 2, 4, 3, 1, 0, 5 }\n uselistorder i64** %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_zero_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %1 = load i128, i128* %0\n %2 = call i128 @FUNC(i128 %1, i128 %1)\n %3 = call i64 @FUNC(i128 %2)\n %4 = call i128 @FUNC(i128 %2, i128 %2)\n %5 = call i64 @FUNC(i128 %4)\n %6 = trunc i64 %5 to i32\n %7 = call i128 @__asm_movss.1(i32 %6)\n %8 = call i128 @__asm_movss.1(i32 2147483647)\n %9 = call i128 @FUNC(i128 %7, i128 %8)\n %10 = call i128 @FUNC(i128 %9)\n %11 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %10, i128 %11)\n %12 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n ret i64 %12\n\n uselistorder i128 %2, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_min_sub_12-bad", "fun_name": "CWE191_Integer_Underflow__int_min_sub_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %. = select i1 %2, i32 -2, i32 -2147483648\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = add i32 %., -1\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n br i1 %2, label LBL_3, label LBL_4\n LBL_3:\n %9 = add i32 %., -1\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %., { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fscanf_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_4:\n %9 = load i32, i32* %sv_0, align 4\n %10 = icmp ugt i32 %9, 9\n br i1 %10, label LBL_7, label LBL_5\n LBL_5:\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = sext i32 %9 to i64\n %13 = mul i64 %12, 4\n %14 = add i64 %11, -48\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i32*\n store i32 1, i32* %16, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_6\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %17 = mul i64 %indvars.iv.reload, 4\n %18 = add i64 %17, %14\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_6\n LBL_7:\n %23 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_4 to i64))\n br label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memmove_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 40)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 0, i64* %sv_0, align 8\n %4 = call i64* @memmove(i64* %1, i64* nonnull %sv_0, i32 40)\n %5 = bitcast i64* %1 to i32*\n %6 = load i32, i32* %5, align 4\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n call void @free(i64* %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 0, 2, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_connect_socket_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n br label LBL_8\n LBL_2:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_17, label LBL_3\n LBL_3:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_17, label LBL_5\n LBL_4:\n %12 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n br label LBL_8\n LBL_5:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n store i64 0, i64* %sv_1, align 8\n %21 = icmp ugt i32 %19, 9\n br i1 %21, label LBL_8, label LBL_6\n LBL_6:\n %22 = sext i32 %19 to i64\n %23 = mul i64 %22, 4\n %24 = add i64 %13, -64\n %25 = add i64 %23, %24\n %26 = inttoptr i64 %25 to i32*\n store i32 1, i32* %26, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %27 = mul i64 %indvars.iv.reload, 4\n %28 = add i64 %27, %24\n %29 = inttoptr i64 %28 to i32*\n %30 = load i32, i32* %29, align 4\n %31 = zext i32 %30 to i64\n %32 = call i64 @FUNC(i64 %31)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %33 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i64 %13, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 4, 0, 2, 5, 3, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_8, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fixed_13-bad", "fun_name": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fixed_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %spec.store.select = select i1 %2, i32 -1, i32 1073741825\n %3 = mul i32 %spec.store.select, 4\n %4 = call i64* @malloc(i32 %3)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_1, label LBL_2\n LBL_1:\n %7 = ptrtoint i64* %4 to i64\n %8 = sext i32 %spec.store.select to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 4\n %10 = add i64 %9, %7\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw i64 %storemerge1.reload, 1\n %13 = icmp ult i64 %12, %8\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %13, label LBL_3, label LBL_4\n LBL_4:\n %14 = bitcast i64* %4 to i32*\n %15 = load i32, i32* %14, align 4\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n call void @free(i64* %4)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i32 %spec.store.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_32-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_ncpy_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %3, i64* %sv_1, align 8\n store i64 0, i64* %sv_0, align 8\n %8 = inttoptr i64 %3 to i8*\n %9 = call i32 @strlen(i8* %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i8* @strncpy(i8* nonnull %10, i8* %8, i32 %9)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 4, 3, 2, 5 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__struct_alloca_use_17-bad", "fun_name": "CWE758_Undefined_Behavior__struct_alloca_use_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32\n %rax.0.reg2mem = alloca i64\n %1 = load i32, i32* %0\n %sv_0 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_0 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = zext i32 %1 to i64\n %5 = add i64 %2, -1\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i64*\n %8 = load i64, i64* %7, align 16\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 %4)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %3, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_struct_01-bad", "fun_name": "CWE563_Unused_Variable__unused_value_struct_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 1, i64* %sv_0, align 8\n %1 = call i64 @FUNC(i64* nonnull %sv_0)\n %2 = call i64 @FUNC(i64 40)\n %3 = icmp eq i64 %0, %2\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_declare_cat_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, 49\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 1\n store i64 0, i64* %sv_0, align 8\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strcat(i8* nonnull %6, i8* nonnull %1)\n %8 = call i64 @FUNC(i64 %3)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*)* @strcat, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_no_init_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_4\n LBL_2:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %5 = mul i64 %indvars.iv6.reload, 8\n %6 = add i64 %5, %1\n %7 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %8 = trunc i64 %indvars.iv6.reload to i32\n %9 = call i128 @FUNC(i32 %8)\n %10 = call i64 @FUNC(i128 %9)\n %11 = inttoptr i64 %6 to i64*\n store i64 %10, i64* %11, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %9, i128* %xmm0.04.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %12 = mul i64 %indvars.iv.reload, 8\n %13 = add i64 %12, %1\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = call i128 @FUNC(i64 %15)\n %17 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_fprintf_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load i32, i32* inttoptr (i64 12472 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %30 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder label LBL_9, { 2, 0, 1 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE665_Improper_Initialization__char_ncat_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n store i8 0, i8* %1, align 8\n br label LBL_3\n LBL_3:\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = call i8* @strncat(i8* nonnull %1, i8* nonnull %6, i32 %7)\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_environment_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = sext i32 %2 to i64\n %6 = ptrtoint i64* %sv_2 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n %11 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %12 = icmp eq i32 %11, 1\n %13 = icmp eq i1 %12, false\n br i1 %13, label LBL_8, label LBL_3\n LBL_3:\n %14 = load i64, i64* %sv_1, align 8\n %15 = trunc i64 %14 to i32\n %16 = icmp sgt i32 %15, ptrtoint (i1* @gv_2 to i32)\n br i1 %16, label LBL_8, label LBL_4\n LBL_4:\n %17 = and i64 %14, 4294967295\n %18 = icmp eq i64 %17, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %18, label LBL_7, label LBL_5\n LBL_5:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %19 = add i32 %storemerge4.reload, 1\n %20 = sext i32 %19 to i64\n %21 = icmp sgt i64 %17, %20\n store i32 %19, i32* %storemerge4.reg2mem\n br i1 %21, label LBL_5, label LBL_6\n LBL_6:\n %phitmp = zext i32 %19 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %22 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_8\n LBL_8:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 ptrtoint (i1* @gv_2 to i32), { 1, 0 }\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = call i64 @FUNC()\n %30 = trunc i64 %29 to i32\n %31 = icmp eq i32 %30, 0\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n %32 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_12\n LBL_11:\n store i64 0, i64* %sv_0, align 8\n %33 = bitcast i64* %sv_0 to i8*\n %34 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %33, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_2)\n %35 = ptrtoint i64* %sv_0 to i64\n %36 = call i64 @FUNC(i64 %35)\n br label LBL_12\n LBL_12:\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_postdec_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %spec.store.select = select i1 %2, i32 32, i32 -128\n %4 = trunc i32 %spec.store.select to i8\n %5 = icmp eq i8 %4, -128\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = mul i32 %spec.store.select, 16777216\n %sext = add i32 %6, -16777216\n %7 = ashr exact i32 %sext, 24\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %2, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_malloc_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = bitcast i64* %3 to i32*\n store i32 0, i32* %7, align 4\n %8 = add i64 %6, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 4\n %10 = call i64 @FUNC(i64 %6)\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n store i64 %11, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fscanf_06-bad", "fun_name": "CWE617_Reachable_Assertion__fscanf_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp sgt i32 %3, 5\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gv_3, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @gv_4, i64 0, i64 0))\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_multiply_02-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = icmp slt i64 %3, 0\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %6 = icmp slt i64 %3, -4611686018427387903\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = mul i64 %3, 2\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_11-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, -401\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %7 = ptrtoint i64* %sv_2 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 8\n %9 = add i64 %8, %7\n %10 = add i64 %9, -816\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 8\n %12 = add i64 %9, -812\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 4\n %14 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %14, 100\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %15 = load i64, i64* %sv_1, align 8\n %16 = inttoptr i64 %15 to i64*\n %17 = call i64* @memcpy(i64* %16, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %18 = load i64, i64* %sv_1, align 8\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 400)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n br i1 %5, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %6 = call i64 @FUNC()\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %5, { 1, 0 }\n uselistorder void (i64*)* @free, { 2, 1, 0, 3 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %3 = call i128 @FUNC(i64 4617315517961601024)\n %4 = call i64 @__asm_movsd.1(i128 %3)\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %5 = load i32, i32* @gv_0, align 4\n %6 = zext i32 %5 to i64\n %7 = icmp eq i32 %5, 5\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i128 @FUNC(i64 %sv_0.0.reload)\n %10 = call i64 @FUNC()\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_rename_13-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_rename_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8392 to i32*), align 8\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i32 @rename(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_1, i64 0, i64 0))\n %5 = sext i32 %4 to i64\n %6 = icmp eq i32 %4, 0\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_sub_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = zext i32 %3 to i64\n %5 = mul i64 %4, 1152921504606846976\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 35184372088832\n %9 = call i32 @rand()\n %10 = sext i32 %9 to i64\n %11 = mul i64 %10, 1073741824\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 32768\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = sext i1 %2 to i64\n %18 = xor i64 %5, %17\n %19 = xor i64 %18, %8\n %20 = xor i64 %19, %11\n %21 = xor i64 %20, %14\n %storemerge1 = xor i64 %21, %16\n %22 = icmp eq i64 %storemerge1, -9223372036854775808\n br i1 %22, label LBL_2, label LBL_1\n LBL_1:\n %23 = add i64 %storemerge1, -1\n %24 = call i64 @FUNC(i64 %23)\n store i64 %24, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %25 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %25, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64 %storemerge1, { 1, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %5 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %6 = ptrtoint i64* %5 to i64\n %7 = icmp eq i64* %5, null\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %sv_0.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %9 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = mul i64 %storemerge1.reload, 8\n %11 = add i64 %10, %9\n %12 = add i64 %11, -816\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 8\n %14 = add i64 %11, -812\n %15 = inttoptr i64 %14 to i32*\n store i32 0, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %17 = inttoptr i64 %sv_0.0.reload to i64*\n %18 = call i64* @memcpy(i64* %17, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %19 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %17)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_square_14-bad", "fun_name": "CWE190_Integer_Overflow__short_rand_square_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = call i32 @rand()\n %10 = xor i32 %9, %8\n %11 = sext i1 %5 to i32\n %storemerge.in = xor i32 %10, %11\n %12 = urem i32 %storemerge.in, 65536\n store i32 %12, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %13 = load i32, i32* @gv_0, align 4\n %14 = zext i32 %13 to i64\n %15 = icmp eq i32 %13, 5\n %16 = icmp eq i1 %15, false\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %narrow = mul i32 %sv_0.0.reload, 65536\n %sext2 = mul i32 %narrow, %sv_0.0.reload\n %17 = ashr exact i32 %sext2, 16\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_14, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %31 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %31, label LBL_13, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %33, %34\n %36 = inttoptr i64 %35 to i32*\n store i32 1, i32* %36, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_12\n LBL_12:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %37 = mul i64 %indvars.iv.reload, 4\n %38 = add i64 %37, %34\n %39 = inttoptr i64 %38 to i32*\n %40 = load i32, i32* %39, align 4\n %41 = zext i32 %40 to i64\n %42 = call i64 @FUNC(i64 %41)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_14, label LBL_12\n LBL_13:\n %43 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_14\n LBL_14:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %1, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 2, 0, 3, 4, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 3, 8, 9, 10, 0, 11, 2, 5, 7, 12, 13, 14, 4, 15, 6 }\n uselistorder label LBL_14, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_struct_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = mul i64 %storemerge1.reload, 8\n %8 = add i64 %7, %4\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 4\n %10 = add i64 %8, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 2, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n call void @free(i64* %3)\n br label LBL_5\n LBL_5:\n %13 = call i64 @FUNC()\n ret i64 %13\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_08-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.04.reg2mem = alloca i8*\n %sv_0.05.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_8, label LBL_3\n LBL_3:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_7, label LBL_4\n LBL_4:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_8, label LBL_5\n LBL_5:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_8, label LBL_6\n LBL_6:\n store i8 0, i8* %20, align 1\n br label LBL_8\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_8\n LBL_8:\n %25 = call i64 @FUNC()\n %26 = trunc i64 %25 to i32\n %27 = icmp eq i32 %26, 0\n store i64 %25, i64* %rax.0.reg2mem\n br i1 %27, label LBL_14, label LBL_9\n LBL_9:\n %28 = load i8, i8* %3, align 1\n %29 = icmp eq i8 %28, 0\n %30 = icmp eq i1 %29, false\n store i8 %28, i8* %.reg2mem\n store i8* %3, i8** %sv_0.05.reg2mem\n store i8* %3, i8** %sv_0.04.reg2mem\n br i1 %30, label LBL_10, label LBL_13\n LBL_10:\n %sv_0.05.reload = load i8*, i8** %sv_0.05.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %31 = icmp eq i8 %.reload, 83\n %32 = icmp eq i1 %31, false\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n %33 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_2 to i64))\n store i8* %sv_0.05.reload, i8** %sv_0.04.reg2mem\n br label LBL_13\n LBL_12:\n %34 = ptrtoint i8* %sv_0.05.reload to i64\n %35 = add i64 %34, 1\n %36 = inttoptr i64 %35 to i8*\n %37 = load i8, i8* %36, align 1\n %38 = icmp eq i8 %37, 0\n %39 = icmp eq i1 %38, false\n store i8 %37, i8* %.reg2mem\n store i8* %36, i8** %sv_0.05.reg2mem\n store i8* %36, i8** %sv_0.04.reg2mem\n br i1 %39, label LBL_10, label LBL_13\n LBL_13:\n %sv_0.04.reload = load i8*, i8** %sv_0.04.reg2mem\n %40 = bitcast i8* %sv_0.04.reload to i64*\n call void @free(i64* %40)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.05.reload, { 1, 0 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 0, 1, 2, 3, 5, 4 }\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.05.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.04.reg2mem, { 0, 1, 3, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i8 0, { 2, 0, 3, 4, 5, 6, 1 }\n uselistorder label LBL_13, { 0, 2, 1 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_square_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %.off = add i32 %3, 65534\n %4 = icmp ugt i32 %.off, 131068\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = mul i32 %3, %3\n %6 = zext i32 %5 to i64\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 2, 1, 0 }\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge2.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n %4 = ptrtoint i64* %0 to i64\n store i64 8382078947037833542, i64* %0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i32*\n store i32 1735289202, i32* %6, align 4\n %7 = add i64 %4, 12\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i32 @strlen(i8* %3)\n %10 = icmp eq i32 %9, 0\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %11 = add i64 %storemerge2.reload, %4\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = icmp eq i8 %13, 83\n %15 = icmp eq i1 %14, false\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n br label LBL_6\n LBL_5:\n %17 = add nuw i64 %storemerge2.reload, 1\n %18 = call i32 @strlen(i8* %3)\n %19 = sext i32 %18 to i64\n %20 = icmp ult i64 %17, %19\n store i64 %17, i64* %storemerge2.reg2mem\n br i1 %20, label LBL_3, label LBL_6\n LBL_6:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %4, { 0, 2, 1 }\n uselistorder i8* %3, { 1, 0 }\n uselistorder i64* %0, { 0, 2, 1, 4, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 3, 0, 2, 1, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_6, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n %spec.store.select = select i1 %1, i32 -1, i32 20\n %2 = mul i32 %spec.store.select, 4\n %3 = call i64* @malloc(i32 %2)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_1, label LBL_2\n LBL_1:\n %6 = ptrtoint i64* %3 to i64\n %7 = sext i32 %spec.store.select to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 4\n %9 = add i64 %8, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %11 = add nuw i64 %storemerge1.reload, 1\n %12 = icmp ult i64 %11, %7\n store i64 %11, i64* %storemerge1.reg2mem\n br i1 %12, label LBL_3, label LBL_4\n LBL_4:\n %13 = bitcast i64* %3 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.store.select, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 2, 1, 3, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__fopen_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = icmp eq %_IO_FILE* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %3 = sext i32 %2 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %0, { 1, 0 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_listen_socket_execlp_14-bad", "fun_name": "CWE78_OS_Command_Injection__char_listen_socket_execlp_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0))\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_12-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 10)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n store i64* %4, i64** %sv_0.0.in.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i64* @malloc(i32 11)\n %8 = icmp eq i64* %7, null\n %9 = icmp eq i1 %8, false\n store i64* %7, i64** %sv_0.0.in.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %sv_0.0.in.reload = load i64*, i64** %sv_0.0.in.reg2mem\n %sv_0.0 = bitcast i64* %sv_0.0.in.reload to i8*\n store i64 4702111234474983745, i64* %sv_1, align 8\n %10 = bitcast i64* %sv_1 to i8*\n %11 = call i32 @strlen(i8* nonnull %10)\n %12 = add i32 %11, 1\n %13 = call i8* @strncpy(i8* %sv_0.0, i8* nonnull %10, i32 %12)\n %14 = ptrtoint i64* %sv_0.0.in.reload to i64\n %15 = call i64 @FUNC(i64 %14)\n call void @free(i64* %sv_0.0.in.reload)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.in.reload, { 2, 1, 0 }\n uselistorder i64** %sv_0.0.in.reg2mem, { 0, 2, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_memmove_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -33\n %3 = and i64 %2, -16\n store i64 0, i64* %sv_0, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memmove(i64* %4, i64* nonnull %sv_0, i32 40)\n %6 = inttoptr i64 %3 to i32*\n %7 = load i32, i32* %6, align 16\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %1, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE390_Error_Without_Action__sqrt_07-bad", "fun_name": "CWE390_Error_Without_Action__sqrt_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32* @__errno_location()\n store i32 0, i32* %4, align 4\n %5 = call i128 @FUNC(i64 -4616189618054758400)\n %6 = trunc i128 %5 to i64\n %7 = bitcast i64 %6 to double\n %8 = call double @sqrt(double %7)\n %9 = fptrunc double %8 to float\n %10 = bitcast float %9 to i32\n %11 = sext i32 %10 to i128\n %12 = call i64 @__asm_movq.1(i128 %11)\n %13 = call i32* @__errno_location()\n %14 = call i128 @FUNC(i64 %12)\n %15 = call i64 @FUNC()\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* ()* @__errno_location, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memmove_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memmove_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, -401\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %7 = ptrtoint i64* %sv_2 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 8\n %9 = add i64 %8, %7\n %10 = add i64 %9, -816\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 8\n %12 = add i64 %9, -812\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 4\n %14 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %14, 100\n store i64 %14, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %15 = load i64, i64* %sv_1, align 8\n %16 = inttoptr i64 %15 to i64*\n %17 = call i64* @memmove(i64* %16, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %18 = load i64, i64* %sv_1, align 8\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_rand_add_10-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = urem i32 %2, 2\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @rand()\n %6 = mul i32 %5, 1073741824\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = xor i32 %8, %6\n %10 = call i32 @rand()\n %11 = xor i32 %9, %10\n %12 = sext i1 %4 to i32\n %storemerge.in = xor i32 %11, %12\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %13 = load i32, i32* @gv_1, align 4\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %16 = icmp eq i32 %sv_0.0.reload, 2147483647\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = add i32 %sv_0.0.reload, 1\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %20 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge4.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 100)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i8*\n store i8 0, i8* %3, align 1\n %4 = call i32 @strlen(i8* %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n br i1 %9, label LBL_7, label LBL_4\n LBL_4:\n %10 = sub i32 100, %4\n %11 = ptrtoint i64* %0 to i64\n %12 = add i64 %5, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* nonnull %8)\n %15 = icmp eq i8* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_6\n LBL_6:\n %18 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_7\n LBL_7:\n %19 = call i32 @strlen(i8* nonnull %3)\n %20 = icmp eq i32 %19, 0\n br i1 %20, label LBL_12, label LBL_8\n LBL_8:\n %21 = ptrtoint i64* %0 to i64\n store i64 0, i64* %storemerge4.reg2mem\n br label LBL_9\n LBL_9:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %22 = add i64 %storemerge4.reload, %21\n %23 = inttoptr i64 %22 to i8*\n %24 = load i8, i8* %23, align 1\n %25 = icmp eq i8 %24, 83\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_11, label LBL_10\n LBL_10:\n %27 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_3 to i64))\n br label LBL_12\n LBL_11:\n %28 = add nuw i64 %storemerge4.reload, 1\n %29 = call i32 @strlen(i8* %3)\n %30 = sext i32 %29 to i64\n %31 = icmp ult i64 %28, %30\n store i64 %28, i64* %storemerge4.reg2mem\n br i1 %31, label LBL_9, label LBL_12\n LBL_12:\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i8* %3, { 1, 0, 3, 2 }\n uselistorder i64* %0, { 1, 0, 2, 4, 3 }\n uselistorder i64* %storemerge4.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_12, { 0, 2, 1 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_9, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp ugt i32 %sv_0.0.reload, 9\n br i1 %13, label LBL_8, label LBL_6\n LBL_6:\n %14 = ptrtoint i64* %sv_2 to i64\n %15 = sext i32 %sv_0.0.reload to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %14, -64\n %18 = add i64 %16, %17\n %19 = inttoptr i64 %18 to i32*\n store i32 1, i32* %19, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %20 = mul i64 %indvars.iv.reload, 4\n %21 = add i64 %20, %17\n %22 = inttoptr i64 %21 to i32*\n %23 = load i32, i32* %22, align 4\n %24 = zext i32 %23 to i64\n %25 = call i64 @FUNC(i64 %24)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %26 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_9\n LBL_9:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder i32 -1, { 0, 1, 3, 2 }\n uselistorder label LBL_9, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_square_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 8420 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %.off = add i32 %.pre, 65534\n %6 = icmp ugt i32 %.off, 131068\n store i32 %.pre, i32* %.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %7 = mul i32 %.reload, %.reload\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_4\n LBL_3:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %.reload, { 1, 0 }\n uselistorder i32* %sv_0, { 0, 2, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_memcpy_14-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_memcpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %7, -8\n store i64 %11, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %13 = load i64, i64* %sv_1, align 8\n %14 = inttoptr i64 %sv_0.0.reload to i64*\n store i64 %13, i64* %14, align 8\n %15 = add i64 %sv_0.0.reload, 8\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %sv_0.0.reload, 16\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %sv_0.0.reload, 24\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %sv_0.0.reload, 32\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %sv_0.0.reload, 40\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %sv_0.0.reload, 48\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %sv_0.0.reload, 56\n %28 = inttoptr i64 %27 to i64*\n %29 = add i64 %sv_0.0.reload, 64\n %30 = inttoptr i64 %29 to i64*\n %31 = add i64 %sv_0.0.reload, 72\n %32 = inttoptr i64 %31 to i64*\n %33 = add i64 %sv_0.0.reload, 80\n %34 = inttoptr i64 %33 to i64*\n %35 = add i64 %sv_0.0.reload, 88\n %36 = inttoptr i64 %35 to i64*\n %37 = add i64 %sv_0.0.reload, 96\n %38 = inttoptr i64 %37 to i32*\n %39 = add i64 %sv_0.0.reload, 99\n %40 = inttoptr i64 %39 to i8*\n store i8 0, i8* %40, align 1\n %41 = call i64 @FUNC(i64 %sv_0.0.reload)\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 14, 13, 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_for_loop_07-bad", "fun_name": "CWE400_Resource_Exhaustion__fgets_for_loop_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 -1, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n %phitmp = sext i32 %8 to i64\n store i64 %phitmp, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i64 -1, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n %13 = icmp eq i64 %sv_0.0.reload, 0\n %or.cond = or i1 %13, %12\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %or.cond, label LBL_6, label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_3 to i64))\n %15 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, %sv_0.0.reload\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_snprintf_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_0)\n %7 = ptrtoint i64* %1 to i64\n %8 = call i64 @FUNC(i64 %7)\n call void @free(i64* %1)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 1, 0, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_memmove_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_2 to i64\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %5 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %5, i64 0, i64 100)\n %6 = inttoptr i64 %sv_0.0.reload to i64*\n %7 = call i64* @memmove(i64* %6, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_1 to i32))\n %8 = load i64, i64* %6, align 8\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_malloc_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %3, align 8\n %6 = call i64 @FUNC(i64 5)\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %7 = load i32, i32* @gv_1, align 4\n %8 = icmp eq i32 %7, 5\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %9, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_no_init_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %5 = mul i64 %indvars.iv5.reload, 4\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = trunc i64 %indvars.iv5.reload to i32\n store i32 %8, i32* %7, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_2, label LBL_1\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %9 = mul i64 %indvars.iv.reload, 4\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = sext i32 %2 to i64\n %11 = ptrtoint i64* %sv_3 to i64\n %12 = add i64 %10, %11\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %27 = icmp eq i32 %26, 1\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_14, label LBL_9\n LBL_9:\n %29 = load i64, i64* %sv_1, align 8\n %30 = trunc i64 %29 to i32\n %31 = icmp sgt i32 %30, ptrtoint (i1* @gv_2 to i32)\n br i1 %31, label LBL_14, label LBL_10\n LBL_10:\n %32 = and i64 %29, 4294967295\n %33 = icmp eq i64 %32, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %33, label LBL_13, label LBL_11\n LBL_11:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %34 = add i32 %storemerge5.reload, 1\n %35 = sext i32 %34 to i64\n %36 = icmp sgt i64 %32, %35\n store i32 %34, i32* %storemerge5.reg2mem\n br i1 %36, label LBL_11, label LBL_12\n LBL_12:\n %phitmp = zext i32 %34 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_13\n LBL_13:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %37 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_14\n LBL_14:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %34, { 1, 0, 2 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_ncpy_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strncpy(i8* nonnull %2, i8* nonnull %4, i32 99)\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC(i64 %6)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n br i1 %5, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %6 = call i64 @FUNC()\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i1 %5, { 1, 0 }\n uselistorder void (i64*)* @free, { 2, 1, 0, 3 }\n uselistorder void (i32)* @exit, { 0, 3, 2, 1, 4 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_sleep_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = icmp slt i32 %6, 1\n %8 = icmp sgt i32 %6, ptrtoint (i1* @gv_3 to i32)\n %or.cond = or i1 %7, %8\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i32 @usleep(i32 %6)\n %10 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_4 to i64))\n br label LBL_5\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_5 to i64))\n br label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memcpy_11-bad", "fun_name": "CWE126_Buffer_Overread__char_alloca_memcpy_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -49\n %5 = and i64 %4, -16\n %6 = add i64 %2, -161\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %5 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %5, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = inttoptr i64 %7 to i64*\n %13 = call i64* @memset(i64* %12, i32 65, i32 99)\n %14 = add i64 %7, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC()\n %17 = trunc i64 %16 to i32\n %18 = icmp eq i32 %17, 0\n %spec.select = select i1 %18, i64 %1, i64 %5\n %19 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %20 = bitcast i64* %sv_0 to i8*\n %21 = call i32 @strlen(i8* nonnull %20)\n %22 = inttoptr i64 %spec.select to i64*\n %23 = call i64* @memcpy(i64* nonnull %sv_0, i64* %22, i32 %21)\n %24 = call i64 @FUNC(i64* nonnull %sv_0)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %3, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14-bad", "fun_name": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 26, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @strtoul(i8* nonnull %5, i8** null, i32 0)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_2, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_10, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp ult i32 %sv_0.0.reload, 6\n br i1 %13, label LBL_9, label LBL_6\n LBL_6:\n %14 = call i64* @malloc(i32 %sv_0.0.reload)\n %15 = icmp eq i64* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %17 = ptrtoint i64* %14 to i64\n %18 = bitcast i64* %14 to i32*\n store i32 1819043176, i32* %18, align 4\n %19 = add i64 %17, 4\n %20 = inttoptr i64 %19 to i16*\n store i16 111, i16* %20, align 2\n %21 = call i64 @FUNC(i64 %17)\n call void @free(i64* %14)\n br label LBL_10\n LBL_9:\n %22 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_10\n LBL_10:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %14, { 0, 1, 3, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_add_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i8, i8* %sv_0, align 1\n %7 = icmp eq i8 %6, 127\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i8 %6, 1\n %9 = sext i8 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_5\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*, i8*, ...)* @fscanf, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_01-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 10)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = call i8* @strncpy(i8* %4, i8* nonnull %5, i32 %7)\n %9 = ptrtoint i64* %1 to i64\n %10 = call i64 @FUNC(i64 %9)\n call void @free(i64* %1)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_cpy_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @strcpy(i8* nonnull %2, i8* nonnull %4)\n %6 = ptrtoint i64* %sv_1 to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memmove_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 11)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memmove(i64* %11, i64* nonnull %sv_1, i32 %10)\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %11)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0), i32** %sv_0, align 8\n %2 = call i32 @wcslen(i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0))\n %3 = sext i32 %2 to i64\n %4 = mul i64 %3, 4\n %5 = add nsw i64 %4, 27\n %6 = udiv i64 %5, 16\n %7 = mul i64 %6, 16\n %8 = and i64 %7, -4096\n %9 = and i64 %7, 4080\n %10 = add i64 %0, 15\n %11 = sub i64 %10, %9\n %12 = sub i64 %11, %8\n %13 = and i64 %12, -16\n %14 = load i32*, i32** %sv_0, align 8\n %15 = inttoptr i64 %13 to i32*\n %16 = call i32* @wcscpy(i32* %15, i32* %14)\n %17 = call i64 @FUNC(i64 %13)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64 %7, { 1, 0 }\n uselistorder i32** %sv_0, { 2, 1, 0 }\n uselistorder i64 16, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_loop_12-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_loop_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i64* %4, i64** %sv_0.0.in.reg2mem\n br label LBL_7\n LBL_4:\n %8 = call i64* @malloc(i32 100)\n %9 = icmp eq i64* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = bitcast i64* %8 to i8*\n store i8 0, i8* %11, align 1\n store i64* %8, i64** %sv_0.0.in.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.0.in.reload = load i64*, i64** %sv_0.0.in.reg2mem\n %sv_0.0 = ptrtoint i64* %sv_0.0.in.reload to i64\n %12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %13 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_8\n LBL_8:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %sv_0.0\n %15 = add i64 %storemerge1.reload, %13\n %16 = inttoptr i64 %15 to i8*\n %17 = load i8, i8* %16, align 1\n %18 = inttoptr i64 %14 to i8*\n store i8 %17, i8* %18, align 1\n %19 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %19, 100\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_8\n LBL_9:\n %20 = add i64 %sv_0.0, 99\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = call i64 @FUNC(i64 %sv_0.0)\n call void @free(i64* %sv_0.0.in.reload)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %sv_0.0, { 2, 1, 0 }\n uselistorder i64* %sv_0.0.in.reload, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64** %sv_0.0.in.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_printf_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %3, -1\n br i1 %cond, label LBL_8, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to %sockaddr*\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = call i32 @connect(i32 %3, %sockaddr* nonnull %4, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_2\n LBL_2:\n %10 = ptrtoint i64* %sv_1 to i64\n %11 = sext i32 %2 to i64\n %12 = add i64 %11, %10\n %13 = inttoptr i64 %12 to i64*\n %14 = sub i32 99, %2\n %15 = call i32 @recv(i32 %3, i64* %13, i32 %14, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n br i1 %17, label LBL_7, label LBL_3\n LBL_3:\n %18 = sext i32 %15 to i64\n %19 = add i64 %12, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i8* @strchr(i8* nonnull %1, i32 13)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n store i8 0, i8* %21, align 1\n br label LBL_5\n LBL_5:\n %23 = call i8* @strchr(i8* nonnull %1, i32 10)\n %24 = icmp eq i8* %23, null\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %23, align 1\n br label LBL_7\n LBL_7:\n %25 = call i32 @close(i32 %3)\n br label LBL_8\n LBL_8:\n %26 = call i32 @puts(i8* nonnull %1)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %3, { 3, 1, 2, 0 }\n uselistorder i64* %sv_0, { 2, 1, 0 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n uselistorder label LBL_7, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_partial_init_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %7 = mul i64 %indvars.iv9.reload, 8\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv9.reload to i32\n store i32 %10, i32* %9, align 8\n %11 = or i64 %8, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 %10, i32* %12, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_2, label LBL_1\n LBL_2:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n %16 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_6\n LBL_4:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %17 = mul i64 %indvars.iv6.reload, 8\n %18 = add i64 %17, %3\n %19 = inttoptr i64 %18 to i32*\n %20 = trunc i64 %indvars.iv6.reload to i32\n store i32 %20, i32* %19, align 8\n %21 = or i64 %18, 4\n %22 = inttoptr i64 %21 to i32*\n store i32 %20, i32* %22, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_5, label LBL_4\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %23 = mul i64 %indvars.iv.reload, 8\n %24 = add i64 %23, %3\n %25 = inttoptr i64 %24 to i32*\n %26 = load i32, i32* %25, align 8\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n %29 = or i64 %24, 4\n %30 = inttoptr i64 %29 to i32*\n %31 = load i32, i32* %30, align 4\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %1, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_14-bad", "fun_name": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* %sv_0, align 4\n %6 = icmp sgt i32 %.pr, 99\n store i32 %.pr, i32* %.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %7 = call i64* @malloc(i32 %.reload)\n %8 = icmp eq i64* %7, null\n %9 = icmp eq i1 %8, false\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %10 = ptrtoint i64* %7 to i64\n %11 = load i32, i32* %sv_0, align 4\n %12 = add i32 %11, -1\n %13 = call i64* @memset(i64* %7, i32 65, i32 %12)\n %14 = load i32, i32* %sv_0, align 4\n %15 = sext i32 %14 to i64\n %16 = add i64 %10, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = call i64 @FUNC(i64 %10)\n call void @free(i64* %7)\n br label LBL_5\n LBL_5:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %10, { 1, 0 }\n uselistorder i64* %7, { 0, 1, 3, 2 }\n uselistorder i32* %sv_0, { 2, 3, 0, 1, 4 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder i32 -1, { 1, 2, 0, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_add_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = icmp eq i64 %6, 9223372036854775807\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i64 %6, 1\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_5\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memmove_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %2, align 8\n store i64 4702111234474983745, i64* %sv_0, align 8\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = add i32 %4, 1\n %6 = call i64* @memmove(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 %5)\n %7 = call i64 @FUNC(i64 %1)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_min_sub_05-bad", "fun_name": "CWE191_Integer_Underflow__short_min_sub_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 32767)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_zero_03-bad", "fun_name": "CWE369_Divide_by_Zero__float_zero_03_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = call i128 @FUNC(i128 %3, i128 %3)\n %6 = call i64 @FUNC(i128 %5)\n %7 = trunc i64 %6 to i32\n %8 = call i128 @FUNC(i128 %1, i128 %1)\n %9 = call i128 @FUNC(i32 %7)\n %10 = call i128 @FUNC(i64 4636737291354636288)\n %11 = call i128 @FUNC(i128 %10, i128 %9)\n %12 = call i32 @FUNC(i128 %11)\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n ret i64 %14\n\n uselistorder i128 %3, { 2, 1, 0 }\n uselistorder i128 %2, { 1, 0 }\n uselistorder i128* %0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_divide_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i32 7, i32* %sv_0.01.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %3 = zext i32 %.pre to i64\n %4 = icmp eq i32 %.pre, 5\n %5 = icmp eq i1 %4, false\n store i32 -1, i32* %sv_0.01.reg2mem\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %6 = udiv i32 100, %sv_0.01.reload\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.01.reg2mem, { 0, 2, 1 }\n uselistorder i32 -1, { 0, 2, 4, 9, 10, 11, 1, 12, 3, 7, 8, 13, 14, 15, 6, 16, 5 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_ncpy_04-bad", "fun_name": "CWE127_Buffer_Underread__char_alloca_ncpy_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %3, -8\n %9 = inttoptr i64 %8 to i8*\n store i8* %9, i8** %sv_1, align 8\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i32 @strlen(i8* nonnull %11)\n %13 = load i8*, i8** %sv_1, align 8\n %14 = call i8* @strncpy(i8* nonnull %11, i8* %13, i32 %12)\n %15 = call i64 @FUNC(i64* nonnull %sv_0)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i8** %sv_1, { 2, 1, 0 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_snprintf_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %10, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* %1)\n %12 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 3, 5, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncpy_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 49)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i8* @strncpy(i8* nonnull %13, i8* %11, i32 %12)\n %15 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %11, { 1, 0 }\n uselistorder i64* %1, { 1, 5, 2, 3, 0, 4 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_cpy_13-bad", "fun_name": "CWE124_Buffer_Underwrite__char_alloca_cpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %9 = icmp eq i32 %8, 5\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = add i64 %3, -8\n %12 = inttoptr i64 %11 to i8*\n store i8* %12, i8** %sv_1, align 8\n br label LBL_2\n LBL_2:\n %13 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %14 = load i8*, i8** %sv_1, align 8\n %15 = bitcast i64* %sv_0 to i8*\n %16 = call i8* @strcpy(i8* %14, i8* nonnull %15)\n %17 = load i8*, i8** %sv_1, align 8\n %18 = ptrtoint i8* %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %1, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i8** %sv_1, { 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_modulo_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i32 7, i32* %sv_0.01.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %3 = zext i32 %.pre to i64\n %4 = icmp eq i32 %.pre, 5\n %5 = icmp eq i1 %4, false\n store i32 -1, i32* %sv_0.01.reg2mem\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %sv_0.01.reload = load i32, i32* %sv_0.01.reg2mem\n %6 = urem i32 100, %sv_0.01.reload\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.01.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_multiply_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_2 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_7, label LBL_3\n LBL_3:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_4\n LBL_4:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_5\n LBL_5:\n %14 = call i32 @recv(i32 %12, i64* nonnull %sv_1, i32 13, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = sext i32 %14 to i64\n %19 = add i64 %17, -22\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = bitcast i64* %sv_1 to i8*\n %23 = call i32 @atoi(i8* nonnull %22)\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %3)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %3)\n %26 = call i32 @close(i32 %12)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %27 = load i32, i32* @gv_1, align 4\n %28 = icmp eq i32 %27, 0\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n %29 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_15\n LBL_11:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %30 = icmp slt i32 %sv_0.1.reload, 0\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_15, label LBL_12\n LBL_12:\n %32 = icmp slt i32 %sv_0.1.reload, -1073741823\n br i1 %32, label LBL_14, label LBL_13\n LBL_13:\n %33 = mul i32 %sv_0.1.reload, 2\n %34 = zext i32 %33 to i64\n %35 = call i64 @FUNC(i64 %34)\n br label LBL_15\n LBL_14:\n %36 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_15\n LBL_15:\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %0, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 2, 0, 1 }\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_multiply_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 4294967292)\n ret i64 %0\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE123_Write_What_Where_Condition__connect_socket_04-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n store i64 %1, i64* @gv_0, align 8\n store i64 %1, i64* @gv_1, align 8\n store i64 %1, i64* %sv_0, align 8\n %2 = add i64 %1, 8\n %3 = inttoptr i64 %2 to i64*\n store i64 %1, i64* %3, align 8\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %1, { 0, 1, 3, 2, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_17-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv13.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.07.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.07.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %6 = call i16 @htons(i16 27015)\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %3, i32 16)\n %8 = icmp eq i32 %7, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %8, label LBL_4, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = add i64 %12, -22\n %14 = bitcast i64* %sv_1 to i8*\n %15 = sext i32 %9 to i64\n %16 = add i64 %13, %15\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i32 @atoi(i8* nonnull %14)\n store i32 %18, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %19 = call i32 @close(i32 %1)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.07.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.07.reload = load i32, i32* %sv_0.07.reg2mem\n %20 = icmp slt i32 %sv_0.07.reload, 0\n %21 = sext i32 %sv_0.07.reload to i64\n %22 = mul i64 %21, 4\n %23 = call i64* @malloc(i32 40)\n %24 = ptrtoint i64* %23 to i64\n %25 = icmp eq i64* %23, null\n %26 = icmp eq i1 %25, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %27 = mul i64 %indvars.iv.reload, 4\n %28 = add i64 %27, %24\n %29 = inttoptr i64 %28 to i32*\n store i32 0, i32* %29, align 4\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_7\n LBL_8:\n br i1 %20, label LBL_11, label LBL_9\n LBL_9:\n %30 = add i64 %22, %24\n %31 = inttoptr i64 %30 to i32*\n store i32 1, i32* %31, align 4\n store i64 0, i64* %indvars.iv13.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv13.reload = load i64, i64* %indvars.iv13.reg2mem\n %32 = mul i64 %indvars.iv13.reload, 4\n %33 = add i64 %32, %24\n %34 = inttoptr i64 %33 to i32*\n %35 = load i32, i32* %34, align 4\n %36 = zext i32 %35 to i64\n %37 = call i64 @FUNC(i64 %36)\n %indvars.iv.next14 = add nuw nsw i64 %indvars.iv13.reload, 1\n %exitcond15 = icmp eq i64 %indvars.iv.next14, 10\n store i64 %indvars.iv.next14, i64* %indvars.iv13.reg2mem\n br i1 %exitcond15, label LBL_12, label LBL_10\n LBL_11:\n %38 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_1 to i64))\n br label LBL_12\n LBL_12:\n call void @free(i64* %23)\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %24, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.07.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv13.reg2mem, { 1, 0, 2 }\n uselistorder i32 -1, { 5, 2, 1, 3, 0, 4 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_11-bad", "fun_name": "CWE369_Divide_by_Zero__int_connect_socket_modulo_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = urem i32 100, %sv_0.1.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_8\n LBL_8:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_13-bad", "fun_name": "CWE415_Double_Free__malloc_free_int64_t_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64*\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %3)\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* null, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fscanf_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %sv_0 = alloca i32, align 4\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n store i32 %5, i32* %sv_0, align 4\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %8 = load i32, i32* %sv_0, align 4\n %9 = call i128 @__asm_movss.1(i32 %8)\n %10 = call i128 @__asm_movss.1(i32 2147483647)\n %11 = call i128 @FUNC(i128 %9, i128 %10)\n %12 = call i128 @FUNC(i128 %11)\n %13 = load i128, i128* @gv_2, align 8\n call void @FUNC(i128 %12, i128 %13)\n %14 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %2, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 0, 1 }\n uselistorder i128* @gv_2, { 1, 0 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 2)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_rand_multiply_06-bad", "fun_name": "CWE190_Integer_Overflow__int_rand_multiply_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge.in = xor i32 %9, %10\n %11 = icmp slt i32 %storemerge.in, 1\n store i64 5, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = mul i32 %storemerge.in, 2\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_rand_preinc_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = mul i32 %4, 32768\n %6 = call i32 @rand()\n %7 = xor i32 %6, %5\n %8 = sext i1 %2 to i32\n %storemerge.in = xor i32 %7, %8\n %9 = trunc i32 %storemerge.in to i16\n %10 = icmp eq i16 %9, 32767\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %sext = mul i32 %storemerge.in, 65536\n %sext2 = add i32 %sext, 65536\n %11 = ashr exact i32 %sext2, 16\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n uselistorder i32 65536, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_rand_14-bad", "fun_name": "CWE126_Buffer_Overread__CWE129_rand_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n %14 = sext i1 %6 to i32\n %storemerge.in = xor i32 %13, %14\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %15 = load i32, i32* @gv_0, align 4\n %16 = icmp eq i32 %15, 5\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %18 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n %19 = ptrtoint i64* %sv_1 to i64\n %20 = sext i32 %sv_0.0.reload to i64\n %21 = mul i64 %20, 4\n %22 = add i64 %19, -64\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i32*\n %25 = load i32, i32* %24, align 4\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n br label LBL_6\n LBL_5:\n %28 = call i64 @FUNC(i64 ptrtoint ([31 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_6:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_no_init_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %rax.1.reg2mem\n br i1 %5, label LBL_6, label LBL_3\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %6 = mul i64 %indvars.iv5.reload, 4\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n %9 = trunc i64 %indvars.iv5.reload to i32\n store i32 %9, i32* %8, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %.pr, 0\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 0, i64* %rax.1.reg2mem\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %16, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64* %rax.1.reg2mem, { 0, 1, 3, 2 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder i32* @gv_0, { 0, 3, 2, 1 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 0, 1, 4 }\n uselistorder label LBL_6, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 25, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i64 0, i64* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -48\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @strtoul(i8* nonnull %20, i8** null, i32 0)\n %22 = sext i32 %21 to i64\n store i64 %22, i64* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %23 = call i32 @close(i32 %1)\n br label LBL_11\n LBL_7:\n %sv_0.0.ph.reload = load i64, i64* %sv_0.0.ph.reg2mem\n %24 = call i32 @close(i32 %1)\n %25 = call i32 @close(i32 %10)\n %26 = trunc i64 %sv_0.0.ph.reload to i32\n %27 = icmp ugt i64 %sv_0.0.ph.reload, 5\n %28 = icmp ult i32 %26, 100\n %or.cond4 = icmp eq i1 %27, %28\n br i1 %or.cond4, label LBL_8, label LBL_11\n LBL_8:\n %29 = call i64* @malloc(i32 %26)\n %30 = icmp eq i64* %29, null\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %32 = ptrtoint i64* %29 to i64\n %33 = bitcast i64* %29 to i32*\n store i32 1819043176, i32* %33, align 4\n %34 = add i64 %32, 4\n %35 = inttoptr i64 %34 to i16*\n store i16 111, i16* %35, align 2\n %36 = call i64 @FUNC(i64 %32)\n call void @free(i64* %29)\n br label LBL_12\n LBL_11:\n %37 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_0 to i64))\n br label LBL_12\n LBL_12:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %29, { 0, 1, 3, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 2, 0, 3 }\n uselistorder i32 -1, { 4, 0, 1, 2, 3, 5 }\n uselistorder label LBL_11, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__freopen_12-bad", "fun_name": "CWE675_Duplicate_Operations_on_Resource__freopen_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca %_IO_FILE*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %4 = call %_IO_FILE* @freopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), %_IO_FILE* %3)\n %5 = call i32 @fclose(%_IO_FILE* %4)\n store %_IO_FILE* %4, %_IO_FILE** %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n store %_IO_FILE* %6, %_IO_FILE** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %7 = call i64 @FUNC()\n %8 = trunc i64 %7 to i32\n %9 = icmp eq i32 %8, 0\n store i64 %7, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %sv_0.0.reload = load %_IO_FILE*, %_IO_FILE** %sv_0.0.reg2mem\n %10 = call i32 @fclose(%_IO_FILE* %sv_0.0.reload)\n %11 = sext i32 %10 to i64\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_rand_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %storemerge.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i128\n %1 = load i128, i128* %0\n %2 = call i128 @FUNC(i128 %1, i128 %1)\n %3 = call i64 @FUNC(i128 %2)\n %4 = call i32 @rand()\n %5 = urem i32 %4, 2\n %6 = icmp eq i32 %5, 0\n %7 = call i32 @rand()\n %8 = mul i32 %7, 1073741824\n %9 = call i32 @rand()\n %10 = mul i32 %9, 32768\n %11 = xor i32 %10, %8\n %12 = call i32 @rand()\n %13 = xor i32 %11, %12\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %14 = call i128 @FUNC(i128 %2, i128 %2)\n %15 = call i128 @FUNC(i32 %13)\n store i128 %15, i128* %storemerge1.reg2mem\n br label LBL_3\n LBL_2:\n %16 = sub i32 0, %13\n %17 = sub i32 %16, 1\n %18 = call i128 @FUNC(i128 %2, i128 %2)\n %19 = call i128 @FUNC(i32 %17)\n store i128 %19, i128* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %20 = icmp eq i32 %13, 0\n %storemerge1.reload = load i128, i128* %storemerge1.reg2mem\n %21 = call i64 @FUNC(i128 %storemerge1.reload)\n %22 = trunc i64 %21 to i32\n %23 = call i128 @__asm_movss.1(i32 %22)\n %24 = call i128 @__asm_movss.1(i32 2147483647)\n %25 = call i128 @FUNC(i128 %23, i128 %24)\n %26 = call i128 @__asm_cvtss2sd.2(i128 %25)\n %27 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %26, i128 %27)\n br i1 %20, label LBL_5, label LBL_4\n LBL_4:\n %28 = call i128 @FUNC(i128 %24, i128 %24)\n %29 = call i128 @FUNC(i32 %22)\n %30 = call i128 @FUNC(i64 4636737291354636288)\n %31 = call i128 @FUNC(i128 %30, i128 %29)\n %32 = call i32 @FUNC(i128 %31)\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n store i64 %34, i64* %storemerge.reg2mem\n br label LBL_6\n LBL_5:\n %35 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n store i64 %35, i64* %storemerge.reg2mem\n br label LBL_6\n LBL_6:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i128 %24, { 1, 0, 2 }\n uselistorder i32 %13, { 2, 0, 1 }\n uselistorder i128 %2, { 3, 2, 1, 0, 4 }\n uselistorder i128* %storemerge1.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_postinc_02-bad", "fun_name": "CWE190_Integer_Overflow__char_fscanf_postinc_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = add i8 %3, 1\n store i8 %4, i8* %sv_0, align 1\n %5 = sext i8 %4 to i64\n %6 = and i64 %5, 4294967295\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 2, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__char_pointer_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge3.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i8*\n store i32 0, i32* %storemerge3.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge3.reload = load i32, i32* %storemerge3.reg2mem\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %0 = add nuw nsw i32 %storemerge3.reload, 1\n %exitcond = icmp eq i32 %0, 2\n store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_0, i64 0, i64 0), i8** %sv_0.0.reg2mem\n store i32 %0, i32* %storemerge3.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %1 = ptrtoint i8* %sv_0.0.reload to i64\n %2 = call i64 @FUNC(i64 %1)\n ret i64 %2\n\n uselistorder i8** %sv_0.0.reg2mem, { 1, 0 }\n uselistorder i32* %storemerge3.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memcpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %6 = call i64* @memset(i64* %1, i32 65, i32 49)\n %7 = ptrtoint i64* %1 to i64\n %8 = add i64 %7, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 %7, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %10 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %11 = call i32 @strlen(i8* %10)\n %12 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %11)\n %13 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 2, 6, 3, 4, 0, 5 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_predec_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = icmp eq i8 %3, -128\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i8 %3, -1\n store i8 %5, i8* %sv_0, align 1\n %6 = sext i8 %5 to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 2, 0, 3 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder i8 32, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__long_realloc_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n uselistorder i64* (i64*, i32)* @realloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE571_Expression_Always_True__global_01-bad", "fun_name": "CWE571_Expression_Always_True__global_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE416_Use_After_Free__malloc_free_char_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %10 = zext i32 %.reload to i64\n %11 = icmp eq i32 %.reload, 5\n %12 = icmp eq i1 %11, false\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 3, 2, 1, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i32* @gv_0, { 0, 6, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_04-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -17\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = add i32 %6, 1\n %8 = load i64, i64* %sv_1, align 8\n %9 = inttoptr i64 %8 to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_0, i32 %7)\n %11 = load i64, i64* %sv_1, align 8\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_predec_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05810.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.05810.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.05810.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp eq i32 %sv_0.0.ph.reload, -2147483648\n store i32 %sv_0.0.ph.reload, i32* %sv_0.05810.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.05810.reload = load i32, i32* %sv_0.05810.reg2mem\n %26 = add i32 %sv_0.05810.reload, -1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.05810.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fgets_sub_34-bad", "fun_name": "CWE191_Integer_Underflow__int_fgets_sub_34_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %2)\n %phitmp = add i32 %5, -1\n %phitmp1 = zext i32 %phitmp to i64\n store i64 %phitmp1, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64 @FUNC(i64 %sv_0.0.reload)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_partial_init_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.2.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.24.reg2mem = alloca i128\n %indvars.iv9.reg2mem = alloca i64\n %xmm0.1.reg2mem = alloca i128\n %.reg2mem = alloca i32\n %xmm0.06.reg2mem = alloca i128\n %indvars.iv12.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %indvars.iv12.reg2mem\n store i32 %4, i32* %.reg2mem\n br i1 %6, label LBL_5, label LBL_3\n LBL_3:\n %xmm0.06.reload = load i128, i128* %xmm0.06.reg2mem\n %indvars.iv12.reload = load i64, i64* %indvars.iv12.reg2mem\n %7 = mul i64 %indvars.iv12.reload, 8\n %8 = add i64 %7, %3\n %9 = call i128 @FUNC(i128 %xmm0.06.reload, i128 %xmm0.06.reload)\n %10 = trunc i64 %indvars.iv12.reload to i32\n %11 = call i128 @FUNC(i32 %10)\n %12 = call i64 @FUNC(i128 %11)\n %13 = inttoptr i64 %8 to i64*\n store i64 %12, i64* %13, align 8\n %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12.reload, 1\n %exitcond14 = icmp eq i64 %indvars.iv.next13, 5\n store i64 %indvars.iv.next13, i64* %indvars.iv12.reg2mem\n store i128 %11, i128* %xmm0.06.reg2mem\n br i1 %exitcond14, label LBL_4, label LBL_3\n LBL_4:\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i128 %11, i128* %xmm0.1.reg2mem\n br label LBL_5\n LBL_5:\n %xmm0.1.reload = load i128, i128* %xmm0.1.reg2mem\n %.reload = load i32, i32* %.reg2mem\n %14 = zext i32 %.reload to i64\n %15 = icmp eq i32 %.reload, 5\n %16 = icmp eq i1 %15, false\n store i64 0, i64* %indvars.iv9.reg2mem\n store i128 %xmm0.1.reload, i128* %xmm0.24.reg2mem\n store i64 %14, i64* %rax.2.reg2mem\n br i1 %16, label LBL_8, label LBL_6\n LBL_6:\n %xmm0.24.reload = load i128, i128* %xmm0.24.reg2mem\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %17 = mul i64 %indvars.iv9.reload, 8\n %18 = add i64 %17, %3\n %19 = call i128 @FUNC(i128 %xmm0.24.reload, i128 %xmm0.24.reload)\n %20 = trunc i64 %indvars.iv9.reload to i32\n %21 = call i128 @FUNC(i32 %20)\n %22 = call i64 @FUNC(i128 %21)\n %23 = inttoptr i64 %18 to i64*\n store i64 %22, i64* %23, align 8\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 10\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n store i128 %21, i128* %xmm0.24.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond11, label LBL_7, label LBL_6\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %24 = mul i64 %indvars.iv.reload, 8\n %25 = add i64 %24, %3\n %26 = inttoptr i64 %25 to i64*\n %27 = load i64, i64* %26, align 8\n %28 = call i128 @FUNC(i64 %27)\n %29 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %29, i64* %rax.2.reg2mem\n br i1 %exitcond, label LBL_8, label LBL_7\n LBL_8:\n %rax.2.reload = load i64, i64* %rax.2.reg2mem\n ret i64 %rax.2.reload\n\n uselistorder i128 %xmm0.24.reload, { 1, 0 }\n uselistorder i128 %xmm0.06.reload, { 1, 0 }\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv12.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.06.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.24.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_loop_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %6 = and i64 %5, -16\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %7 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = add i64 %7, -816\n %9 = add i64 %7, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %10 = mul i64 %storemerge13.reload, 8\n %11 = add i64 %10, %8\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 8\n %13 = add i64 %9, %10\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge13.reg2mem\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %exitcond4, label LBL_5, label LBL_4\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = mul i64 %storemerge2.reload, 8\n %17 = add i64 %16, %sv_0.0.reload\n %18 = add i64 %16, %8\n %19 = inttoptr i64 %18 to i64*\n %20 = load i64, i64* %19, align 8\n %21 = inttoptr i64 %17 to i64*\n store i64 %20, i64* %21, align 8\n %22 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %22, 100\n store i64 %22, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %23 = call i64 @FUNC(i64 %sv_0.0.reload)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 1, 0 }\n uselistorder i64 %10, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_multiply_15-bad", "fun_name": "CWE190_Integer_Overflow__char_rand_multiply_15_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = sub i32 0, %5\n %7 = sub i32 %6, 1\n %8 = zext i32 %7 to i64\n %9 = sext i32 %5 to i64\n %storemerge = select i1 %2, i64 %8, i64 %9\n %10 = trunc i64 %storemerge to i8\n %11 = icmp slt i8 %10, 1\n store i64 %storemerge, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = trunc i64 %storemerge to i32\n %sext = mul i32 %12, 33554432\n %13 = ashr exact i32 %sext, 24\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge, { 1, 0, 2 }\n uselistorder i32 %5, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_multiply_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n %3 = load i8, i8* %sv_0, align 1\n %4 = icmp slt i8 %3, 0\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %6 = icmp slt i8 %3, -63\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = mul i8 %3, 2\n %8 = sext i8 %7 to i64\n %9 = and i64 %8, 4294967294\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_4\n LBL_3:\n %11 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE404_Improper_Resource_Shutdown__open_fclose_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = load i32, i32* @gv_1, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n %5 = icmp eq i32 %0, -1\n %or.cond = or i1 %5, %4\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i32 @close(i32 %0)\n %7 = sext i32 %6 to i64\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i32* @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_zero_modulo_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 2)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }\n uselistorder i32* @gv_0, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_max_preinc_08-bad", "fun_name": "CWE190_Integer_Overflow__char_max_preinc_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 33, i64 4294967168\n %6 = call i64 @FUNC(i64 %spec.select)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_loop_05-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_loop_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %1 = load i64, i64* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = load i32, i32* @gv_0, align 4\n %5 = add i64 %2, -816\n %6 = add i64 %2, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %7 = mul i64 %storemerge13.reload, 8\n %8 = add i64 %7, %5\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 8\n %10 = add i64 %6, %7\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %12, 100\n store i64 %12, i64* %storemerge13.reg2mem\n br i1 %exitcond4, label LBL_2, label LBL_1\n LBL_2:\n %13 = ptrtoint i64* %sv_0 to i64\n %14 = icmp eq i32 %4, 0\n %spec.select = select i1 %14, i64 %1, i64 %13\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %15 = mul i64 %storemerge2.reload, 8\n %16 = add i64 %15, %spec.select\n %17 = add i64 %15, %5\n %18 = inttoptr i64 %17 to i64*\n %19 = load i64, i64* %18, align 8\n %20 = inttoptr i64 %16 to i64*\n store i64 %19, i64* %20, align 8\n %21 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %21, 100\n store i64 %21, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %22 = call i64 @FUNC(i64 %spec.select)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %3, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %15, { 1, 0 }\n uselistorder i64 %spec.select, { 1, 0 }\n uselistorder i64 %7, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64 100, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_for_loop_14-bad", "fun_name": "CWE400_Resource_Exhaustion__rand_for_loop_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 -1, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge1.in = xor i32 %12, %13\n %phitmp = sext i32 %storemerge1.in to i64\n store i64 %phitmp, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = load i32, i32* @gv_0, align 4\n %15 = zext i32 %14 to i64\n %16 = icmp eq i32 %14, 5\n %17 = icmp eq i1 %16, false\n store i64 %15, i64* %rax.0.reg2mem\n br i1 %17, label LBL_5, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %18 = icmp eq i64 %sv_0.0.reload, 0\n store i64 0, i64* %storemerge2.reg2mem\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %19 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_1 to i64))\n %20 = add nuw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %20, %sv_0.0.reload\n store i64 %20, i64* %storemerge2.reg2mem\n store i64 %sv_0.0.reload, i64* %rax.0.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 0, 2, 1 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_multiply_10-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = load i32, i32* @gv_3, align 4\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_8\n LBL_4:\n %8 = load i64, i64* %sv_0, align 8\n %9 = icmp slt i64 %8, 0\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_8, label LBL_5\n LBL_5:\n %11 = icmp slt i64 %8, -4611686018427387903\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n %12 = mul i64 %8, 2\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_8\n LBL_7:\n %14 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_5 to i64))\n br label LBL_8\n LBL_8:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memcpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_3, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %7 = ptrtoint i64* %sv_2 to i64\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memcpy(i64* nonnull %sv_1, i64* %11, i32 %10)\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_2, { 1, 0 }\n uselistorder i64* %sv_1, { 3, 0, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_calloc_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0, align 8\n %2 = call i64 @FUNC()\n %3 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %4 = and i64 %3, -16\n %5 = inttoptr i64 %4 to i32*\n store i32* %5, i32** %sv_0, align 8\n store i32 0, i32* %5, align 16\n %6 = load i32*, i32** %sv_0, align 8\n %7 = ptrtoint i32* %6 to i64\n %8 = add i64 %7, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 0, i32* %9, align 4\n %10 = load i32*, i32** %sv_0, align 8\n %11 = ptrtoint i32* %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC()\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_0, { 4, 3, 2, 1, 0 }\n uselistorder i64 (i64)* @printStructLine, { 2, 1, 0 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncat_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strncat(i8* %sv_0.0.reload, i8* nonnull %6, i32 100)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_malloc_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 400)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i32*\n store i32 5, i32* %6, align 4\n %7 = call i64 @FUNC(i64 5)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %8 = icmp eq i32 %.reload, 5\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %9, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64** %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_sleep_10-bad", "fun_name": "CWE400_Resource_Exhaustion__fscanf_sleep_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = call i32 @usleep(i32 %6)\n %8 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_3 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_loop_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_1 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_1 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = add i64 %8, -816\n %10 = add i64 %8, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %11 = mul i64 %storemerge13.reload, 8\n %12 = add i64 %11, %9\n %13 = inttoptr i64 %12 to i32*\n store i32 0, i32* %13, align 8\n %14 = add i64 %10, %11\n %15 = inttoptr i64 %14 to i32*\n store i32 0, i32* %15, align 4\n %16 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge13.reg2mem\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %exitcond4, label LBL_5, label LBL_4\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %17 = mul i64 %storemerge2.reload, 8\n %18 = add i64 %17, %sv_0.0.reload\n %19 = add i64 %17, %9\n %20 = inttoptr i64 %19 to i64*\n %21 = load i64, i64* %20, align 8\n %22 = inttoptr i64 %18 to i64*\n store i64 %21, i64* %22, align 8\n %23 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %23, 100\n store i64 %23, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %24 = call i64 @FUNC(i64 %sv_0.0.reload)\n %25 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %25)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %17, { 1, 0 }\n uselistorder i64 %11, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder i64 100, { 1, 0, 3, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_02-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_snprintf_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_1 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n store i64 0, i64* %sv_0, align 8\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %23, i32 99, i8* nonnull %1)\n %25 = ptrtoint i64* %sv_0 to i64\n %26 = call i64 @FUNC(i64 %25)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_max_multiply_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp ne i32 %0, 0\n %2 = zext i32 %0 to i64\n %3 = icmp eq i32 %0, 0\n %4 = icmp eq i1 %1, false\n %or.cond = or i1 %3, %4\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_sleep_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp slt i32 %3, 1\n %5 = icmp sgt i32 %3, ptrtoint (i1* @gv_2 to i32)\n %or.cond = or i1 %4, %5\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i32 @usleep(i32 %3)\n %7 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_3 to i64))\n br label LBL_3\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_4 to i64))\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_malloc_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 20)\n %1 = icmp eq i64* %0, null\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %3 = add i64 %2, 8\n %4 = inttoptr i64 %3 to i16*\n store i16 25978, i16* %4, align 2\n %5 = add i64 %2, 10\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %2)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %2, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_declare_no_init_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %5 = mul i64 %indvars.iv5.reload, 8\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = trunc i64 %indvars.iv5.reload to i32\n store i32 %8, i32* %7, align 8\n %9 = or i64 %6, 4\n %10 = inttoptr i64 %9 to i32*\n store i32 %8, i32* %10, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %11 = load i32, i32* @gv_2, align 4\n %12 = icmp eq i32 %11, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 8\n %14 = add i64 %13, %1\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 8\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %19 = or i64 %14, 4\n %20 = inttoptr i64 %19 to i32*\n %21 = load i32, i32* %20, align 4\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_multiply_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_11\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp slt i32 %sv_0.0.ph.reload, 1\n br i1 %25, label LBL_11, label LBL_8\n LBL_8:\n %26 = icmp sgt i32 %sv_0.0.ph.reload, 1073741822\n br i1 %26, label LBL_10, label LBL_9\n LBL_9:\n %27 = mul i32 %sv_0.0.ph.reload, 2\n %28 = zext i32 %27 to i64\n %29 = call i64 @FUNC(i64 %28)\n br label LBL_11\n LBL_10:\n %30 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 2, 0, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 (i32)* @close, { 1, 2, 0, 3 }\n uselistorder label LBL_11, { 2, 3, 4, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__char_malloc_use_13-bad", "fun_name": "CWE758_Undefined_Behavior__char_malloc_use_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 1)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n %8 = load i8, i8* %7, align 1\n call void @free(i64* %4)\n %9 = sext i8 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__strdup_char_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n store i64 7453010373643565421, i64* %sv_0, align 8\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i8* @strdup(i8* nonnull %3)\n %5 = ptrtoint i8* %4 to i64\n %6 = call i64 @FUNC(i64 %5)\n %.pr = load i32, i32* @gv_0, align 4\n %7 = icmp eq i32 %.pr, 0\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %phitmp = bitcast i8* %4 to i64*\n call void @free(i64* %phitmp)\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*)* @strdup, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_modulo_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n br i1 %12, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n %14 = urem i32 100, %sv_0.0.reload\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_8\n LBL_7:\n %17 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_8:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_fwrite_31-bad", "fun_name": "CWE400_Resource_Exhaustion__listen_socket_fwrite_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge10.reg2mem = alloca i64\n %sv_0.058.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i64 -1, i64* %sv_0.058.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i64 -1, i64* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %phitmp = sext i32 %21 to i64\n store i64 %phitmp, i64* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i64 -1, i64* %sv_0.058.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i64, i64* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i64 %sv_0.0.ph.reload, i64* %sv_0.058.reg2mem\n br label LBL_8\n LBL_8:\n %25 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %26 = icmp eq %_IO_FILE* %25, null\n %27 = icmp eq i1 %26, false\n br i1 %27, label LBL_9, label LBL_10\n LBL_9:\n %sv_0.058.reload = load i64, i64* %sv_0.058.reg2mem\n %28 = icmp eq i64 %sv_0.058.reload, 0\n store i64 0, i64* %storemerge10.reg2mem\n br i1 %28, label LBL_14, label LBL_11\n LBL_10:\n call void @exit(i32 1)\n unreachable\n LBL_11:\n %29 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %25)\n %30 = icmp eq i32 %29, 50\n br i1 %30, label LBL_13, label LBL_12\n LBL_12:\n call void @exit(i32 1)\n unreachable\n LBL_13:\n %storemerge10.reload = load i64, i64* %storemerge10.reg2mem\n %31 = add nuw i64 %storemerge10.reload, 1\n %32 = icmp ult i64 %31, %sv_0.058.reload\n store i64 %31, i64* %storemerge10.reg2mem\n br i1 %32, label LBL_11, label LBL_14\n LBL_14:\n %33 = call i32 @fclose(%_IO_FILE* nonnull %25)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %25, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %sv_0.058.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %storemerge10.reg2mem, { 2, 0, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64 -1, { 1, 2, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_05-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_7, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_3 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_6, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_2, i32 7, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_6, label LBL_4\n LBL_4:\n %15 = sext i32 %12 to i64\n %16 = add i64 %0, -112\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_2 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n %.off = add i32 %20, 32768\n %21 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %21, label LBL_5, label LBL_6\n LBL_5:\n %sext3 = mul i32 %20, 65536\n %22 = ashr exact i32 %sext3, 16\n store i32 %22, i32* %sv_0.0.ph.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %24 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %25 = trunc i32 %sv_0.1.reload to i16\n %26 = icmp sgt i16 %25, 99\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.1.reload)\n %28 = sext i32 %sv_0.1.reload to i64\n %29 = add i64 %0, -112\n %30 = add i64 %29, %28\n %31 = inttoptr i64 %30 to i8*\n store i8 0, i8* %31, align 1\n br label LBL_9\n LBL_9:\n %32 = call i64 @FUNC(i64* nonnull %sv_2)\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %1, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 2, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 4, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_7, { 1, 0, 2 }\n uselistorder label LBL_6, { 2, 0, 3, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_03-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 25, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_8\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -48\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @strtoul(i8* nonnull %18, i8** null, i32 0)\n %20 = call i32 @close(i32 %1)\n %sv_3.0.off = add i32 %19, -6\n %21 = icmp ult i32 %sv_3.0.off, 94\n br i1 %21, label LBL_5, label LBL_8\n LBL_5:\n %22 = call i64* @malloc(i32 %19)\n %23 = icmp eq i64* %22, null\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 -1)\n unreachable\n LBL_7:\n %25 = ptrtoint i64* %22 to i64\n %26 = bitcast i64* %22 to i32*\n store i32 1819043176, i32* %26, align 4\n %27 = add i64 %25, 4\n %28 = inttoptr i64 %27 to i16*\n store i16 111, i16* %28, align 2\n %29 = call i64 @FUNC(i64 %25)\n call void @free(i64* %22)\n br label LBL_9\n LBL_8:\n %30 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_1 to i64))\n br label LBL_9\n LBL_9:\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %22, { 0, 1, 3, 2 }\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i8*, i8**, i32)* @strtoul, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_printf_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %4 = add i64 %3, 8\n %5 = inttoptr i64 %4 to i64*\n store i64 32777976880262761, i64* %5, align 8\n %6 = call i64 @FUNC()\n %7 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_fscanf_postdec_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i8* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %6 = load i8, i8* %sv_0, align 1\n %7 = icmp eq i8 %6, -128\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = add i8 %6, -1\n store i8 %8, i8* %sv_0, align 1\n %9 = sext i8 %8 to i64\n %10 = and i64 %9, 4294967295\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_5\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 2, 0, 3 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_5, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_fwrite_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_2\n LBL_2:\n %5 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %6 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @connect(i32 %3, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = call i32 @recv(i32 %3, i64* nonnull %sv_1, i32 13, i32 0)\n %12 = add i32 %11, 1\n %13 = icmp ult i32 %12, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = sext i32 %11 to i64\n %16 = add i64 %14, -22\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = bitcast i64* %sv_1 to i8*\n %20 = call i32 @atoi(i8* nonnull %19)\n store i32 %20, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %21 = call i32 @close(i32 %3)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %22 = load i32, i32* @gv_2, align 4\n %23 = icmp eq i32 %22, 0\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n %24 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_16\n LBL_8:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sv_0.1.off = add i32 %sv_0.1.reload, -1\n %25 = icmp ugt i32 %sv_0.1.off, 19\n br i1 %25, label LBL_16, label LBL_9\n LBL_9:\n %26 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_5, i64 0, i64 0))\n %27 = icmp eq %_IO_FILE* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_10, label LBL_11\n LBL_10:\n %29 = sext i32 %sv_0.1.reload to i64\n store i64 0, i64* %storemerge7.reg2mem\n br label LBL_12\n LBL_11:\n call void @exit(i32 1)\n unreachable\n LBL_12:\n %30 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_6 to i64*), i32 1, i32 50, %_IO_FILE* %26)\n %31 = icmp eq i32 %30, 50\n br i1 %31, label LBL_14, label LBL_13\n LBL_13:\n call void @exit(i32 1)\n unreachable\n LBL_14:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %32 = add nuw i64 %storemerge7.reload, 1\n %33 = icmp ult i64 %32, %29\n store i64 %32, i64* %storemerge7.reg2mem\n br i1 %33, label LBL_12, label LBL_15\n LBL_15:\n %34 = call i32 @fclose(%_IO_FILE* nonnull %26)\n br label LBL_16\n LBL_16:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %26, { 1, 0, 2 }\n uselistorder i32 %11, { 1, 0 }\n uselistorder i32 %3, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %storemerge7.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_pointer_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i128 @FUNC(i64 4617315517961601024)\n %8 = call i64 @__asm_movsd.1(i128 %7)\n store i64 %8, i64* %3, align 8\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %9 = zext i32 %.reload to i64\n %10 = icmp eq i32 %.reload, 5\n %11 = icmp eq i1 %10, false\n store i64 %9, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = inttoptr i64 %sv_0.0.reload to i64*\n %13 = load i64, i64* %12, align 8\n %14 = call i128 @FUNC(i64 %13)\n %15 = call i64 @FUNC()\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64 ()* @printDoubleLine, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 3, 1, 2, 0, 4 }\n uselistorder i64* (i32)* @malloc, { 2, 1, 0, 3, 4 }\n uselistorder i32* @gv_0, { 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_connect_socket_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_1, align 8\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 5\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %11 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %12 = call i32 @strlen(i8* nonnull %8)\n %13 = sext i32 %12 to i64\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i32*\n store i32 1852400175, i32* %16, align 4\n %17 = add i64 %15, 4\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n br label LBL_3\n LBL_3:\n %19 = call i32 @putenv(i8* nonnull %8)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %2, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %15, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE377_Insecure_Temporary_File__char_mktemp_05-bad", "fun_name": "CWE377_Insecure_Temporary_File__char_mktemp_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n store i64 6365935209750752870, i64* %sv_0, align 8\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i8* @mktemp(i8* nonnull %3)\n %5 = icmp eq i8* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %7 = ptrtoint i8* %4 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i32 (i8*, i32, ...) @open(i8* %4, i32 66)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([45 x i8]* @gv_1 to i64))\n %12 = call i32 @close(i32 %9)\n br label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_multiply_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_4:\n %8 = load i64, i64* %sv_0, align 8\n %9 = icmp slt i64 %8, 0\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_8, label LBL_5\n LBL_5:\n %11 = icmp slt i64 %8, -4611686018427387903\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n %12 = mul i64 %8, 2\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_8\n LBL_7:\n %14 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_4 to i64))\n br label LBL_8\n LBL_8:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_fprintf_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = sext i32 %2 to i64\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n %11 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %12 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder i8* (i8*)* @getenv, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 2)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = load i32, i32* @gv_3, align 4\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i16, i16* %sv_0, align 2\n %9 = sub i16 0, %8\n %10 = icmp slt i16 %9, 0\n %11 = icmp eq i1 %10, false\n %.v = select i1 %11, i16 %9, i16 %8\n %12 = icmp ult i16 %.v, 182\n br i1 %12, label LBL_5, label LBL_6\n LBL_5:\n %13 = mul i16 %8, %8\n %14 = sext i16 %13 to i64\n %15 = and i64 %14, 4294967295\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_7\n LBL_6:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_5 to i64))\n br label LBL_7\n LBL_7:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %8, { 1, 0, 2, 3 }\n uselistorder i16* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__rand_for_loop_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = mul i32 %4, 1073741824\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = xor i32 %7, %5\n %9 = call i32 @rand()\n %10 = xor i32 %8, %9\n %11 = sext i1 %3 to i32\n %storemerge3.in = xor i32 %10, %11\n %storemerge3.in.off = add i32 %storemerge3.in, -1\n %12 = icmp ugt i32 %storemerge3.in.off, 19\n br i1 %12, label LBL_3, label LBL_1\n LBL_1:\n %13 = sext i32 %storemerge3.in to i64\n store i64 0, i64* %storemerge5.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %14 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n %15 = add nuw i64 %storemerge5.reload, 1\n %16 = icmp ult i64 %15, %13\n store i64 %15, i64* %storemerge5.reg2mem\n br i1 %16, label LBL_2, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge3.in, { 1, 0 }\n uselistorder i64* %storemerge5.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE483_Incorrect_Block_Delimitation__semicolon_07-bad", "fun_name": "CWE483_Incorrect_Block_Delimitation__semicolon_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = call i64 @FUNC(i64 ptrtoint ([7 x i8]* @gv_1 to i64))\n %6 = call i64 @FUNC(i64 ptrtoint ([9 x i8]* @gv_2 to i64))\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_calloc_14-bad", "fun_name": "CWE690_NULL_Deref_From_Return__char_calloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 20, i32 1)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i16*\n store i16 25978, i16* %7, align 2\n %8 = add i64 %5, 10\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %5)\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_malloc_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 4)\n %2 = icmp eq i64* %1, null\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = bitcast i64* %1 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %1)\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_11, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 25, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -48\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @strtoul(i8* nonnull %20, i8** null, i32 0)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_11\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %sv_0.0.off = add i32 %sv_0.0.ph.reload, -6\n %25 = icmp ult i32 %sv_0.0.off, 94\n br i1 %25, label LBL_8, label LBL_11\n LBL_8:\n %26 = call i64* @malloc(i32 %sv_0.0.ph.reload)\n %27 = icmp eq i64* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 -1)\n unreachable\n LBL_10:\n %29 = ptrtoint i64* %26 to i64\n %30 = bitcast i64* %26 to i32*\n store i32 1819043176, i32* %30, align 4\n %31 = add i64 %29, 4\n %32 = inttoptr i64 %31 to i16*\n store i16 111, i16* %32, align 2\n %33 = call i64 @FUNC(i64 %29)\n call void @free(i64* %26)\n br label LBL_12\n LBL_11:\n %34 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_0 to i64))\n br label LBL_12\n LBL_12:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %26, { 0, 1, 3, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*, i8**, i32)* @strtoul, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_calloc_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @calloc(i32 100, i32 8)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %2, align 8\n %5 = call i64 @FUNC(i64 5)\n %.pr = load i32, i32* @gv_0, align 4\n %6 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n call void @free(i64* nonnull %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* null, { 1, 2, 0 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_fwrite_32-bad", "fun_name": "CWE400_Resource_Exhaustion__fscanf_fwrite_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %5 = icmp eq %_IO_FILE* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_1, label LBL_2\n LBL_1:\n %7 = sext i32 %3 to i64\n %8 = icmp eq i32 %3, 0\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %8, label LBL_6, label LBL_3\n LBL_2:\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %9 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_4 to i64*), i32 1, i32 50, %_IO_FILE* %4)\n %10 = icmp eq i32 %9, 50\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 1)\n unreachable\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %11 = add nuw i64 %storemerge2.reload, 1\n %12 = icmp ult i64 %11, %7\n store i64 %11, i64* %storemerge2.reg2mem\n br i1 %12, label LBL_3, label LBL_6\n LBL_6:\n %13 = call i32 @fclose(%_IO_FILE* nonnull %4)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %4, { 1, 0, 2 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_add_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_4:\n %9 = load i64, i64* %sv_0, align 8\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 2147483647\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = add i64 %9, 1\n %13 = and i64 %12, 4294967295\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_7\n LBL_6:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_7:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0), i32** %sv_0, align 8\n %2 = call i32 @wcslen(i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_0, i64 0, i64 0))\n %3 = sext i32 %2 to i64\n %4 = mul i64 %3, 4\n %5 = add nsw i64 %4, 27\n %6 = udiv i64 %5, 16\n %7 = mul i64 %6, 16\n %8 = and i64 %7, -4096\n %9 = and i64 %7, 4080\n %10 = add i64 %0, 15\n %11 = sub i64 %10, %9\n %12 = sub i64 %11, %8\n %13 = and i64 %12, -16\n %14 = load i32*, i32** %sv_0, align 8\n %15 = inttoptr i64 %13 to i32*\n %16 = call i32* @wcscpy(i32* %15, i32* %14)\n %17 = call i64 @FUNC(i64 %13)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64 %7, { 1, 0 }\n uselistorder i32** %sv_0, { 2, 1, 0 }\n uselistorder i64 (i64)* @printWLine, { 1, 0 }\n uselistorder i32* (i32*, i32*)* @wcscpy, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memcpy_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64*\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -49\n %5 = and i64 %4, -16\n %6 = add i64 %2, -161\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %5 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %5, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = inttoptr i64 %7 to i64*\n %13 = call i64* @memset(i64* %12, i32 65, i32 99)\n %14 = add i64 %7, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = load i32, i32* @gv_0, align 4\n %17 = icmp eq i32 %16, 5\n store i64* %12, i64** %.pre-phi.reg2mem\n br i1 %17, label LBL_2, label LBL_1\n LBL_1:\n %18 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = inttoptr i64 %1 to i64*\n store i64* %.pre, i64** %.pre-phi.reg2mem\n br label LBL_2\n LBL_2:\n %.pre-phi.reload = load i64*, i64** %.pre-phi.reg2mem\n %19 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %20 = bitcast i64* %sv_0 to i8*\n %21 = call i32 @strlen(i8* nonnull %20)\n %22 = call i64* @memcpy(i64* nonnull %sv_0, i64* %.pre-phi.reload, i32 %21)\n %23 = ptrtoint i64* %sv_0 to i64\n %24 = call i64 @FUNC(i64 %23)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %3, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0 }\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_add_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = mul i32 %4, 1073741824\n %6 = call i32 @rand()\n %7 = mul i32 %6, 32768\n %8 = xor i32 %7, %5\n %9 = call i32 @rand()\n %10 = xor i32 %8, %9\n %11 = sext i1 %3 to i32\n %storemerge.in = xor i32 %10, %11\n %12 = icmp eq i32 %storemerge.in, -1\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n %13 = add i32 %storemerge.in, 1\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_3\n LBL_2:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge.in, { 1, 0 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_realloc_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 5, i64* %0, align 8\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* null, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE377_Insecure_Temporary_File__char_tmpnam_13-bad", "fun_name": "CWE377_Insecure_Temporary_File__char_tmpnam_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8388 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_5, label LBL_1\n LBL_1:\n %4 = call i8* @tmpnam(i8* null)\n %5 = icmp eq i8* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %7 = ptrtoint i8* %4 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i32 (i8*, i32, ...) @open(i8* %4, i32 66)\n %10 = icmp eq i32 %9, -1\n store i64 -1, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = call i64 @FUNC(i64 ptrtoint ([45 x i8]* @gv_0 to i64))\n %12 = call i32 @close(i32 %9)\n %13 = sext i32 %12 to i64\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_ncat_05-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_ncat_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i64* %sv_2 to i64\n %4 = add i64 %3, -49\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 16\n store i8* %6, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @strncat(i8* %sv_0.0.reload, i8* nonnull %8, i32 100)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_struct_static_13-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_struct_static_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 0, i64* %storemerge1.reg2mem\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %3 = mul i64 %storemerge1.reload, 8\n %4 = add i64 %3, ptrtoint (i64* @gv_0 to i64)\n %5 = inttoptr i64 %4 to i32*\n store i32 1, i32* %5, align 8\n %6 = add i64 %3, ptrtoint (i64* @gv_1 to i64)\n %7 = inttoptr i64 %6 to i32*\n store i32 1, i32* %7, align 8\n %8 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %8, 100\n store i64 %8, i64* %storemerge1.reg2mem\n store i64 ptrtoint (i64* @gv_0 to i64), i64* %sv_0.0.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i64 @FUNC(i64 %sv_0.0.reload)\n %10 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %10)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %3, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_postdec_17-bad", "fun_name": "CWE191_Integer_Underflow__int_fscanf_postdec_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = add i32 %3, -1\n store i32 %4, i32* %sv_0, align 4\n %5 = zext i32 %4 to i64\n %6 = call i64 @FUNC(i64 %5)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cpy_07-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__dest_char_declare_cpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %6)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_partial_init_08-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_partial_init_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv4.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %7 = mul i64 %indvars.iv4.reload, 8\n %8 = add i64 %7, %3\n %9 = inttoptr i64 %8 to i32*\n %10 = trunc i64 %indvars.iv4.reload to i32\n store i32 %10, i32* %9, align 8\n %11 = or i64 %8, 4\n %12 = inttoptr i64 %11 to i32*\n store i32 %10, i32* %12, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 5\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n br i1 %exitcond6, label LBL_2, label LBL_1\n LBL_2:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %16 = mul i64 %indvars.iv.reload, 8\n %17 = add i64 %16, %3\n %18 = inttoptr i64 %17 to i32*\n %19 = load i32, i32* %18, align 8\n %20 = zext i32 %19 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = or i64 %17, 4\n %23 = inttoptr i64 %22 to i32*\n %24 = load i32, i32* %23, align 4\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %1, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_realloc_05-bad", "fun_name": "CWE401_Memory_Leak__char_realloc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @realloc(i64* null, i32 100)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = ptrtoint i64* %2 to i64\n store i64 7453010373643542593, i64* %2, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC(i64 %5)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 0, 2, 1 }\n uselistorder i64* null, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_snprintf_11-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_file_snprintf_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_6, label LBL_2\n LBL_2:\n %9 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %10 = icmp eq %_IO_FILE* %9, null\n br i1 %10, label LBL_6, label LBL_3\n LBL_3:\n %11 = sub i32 100, %5\n %12 = ptrtoint i64* %sv_1 to i64\n %13 = add i64 %6, %12\n %14 = inttoptr i64 %13 to i8*\n %15 = call i8* @fgets(i8* %14, i32 %11, %_IO_FILE* nonnull %9)\n %16 = icmp eq i8* %15, null\n %17 = icmp eq i1 %16, false\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %14, align 1\n br label LBL_5\n LBL_5:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %9)\n br label LBL_6\n LBL_6:\n %20 = call i64 @FUNC()\n %21 = trunc i64 %20 to i32\n %22 = icmp eq i32 %21, 0\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n store i64 0, i64* %sv_0, align 8\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %23, i32 99, i8* nonnull %1)\n %25 = ptrtoint i64* %sv_0 to i64\n %26 = call i64 @FUNC(i64 %25)\n br label LBL_8\n LBL_8:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %1, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_ncat_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 49)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i8* @strncat(i8* nonnull %13, i8* %11, i32 %12)\n %15 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %11, { 1, 0 }\n uselistorder i64* %1, { 2, 5, 1, 3, 0, 4 }\n uselistorder i64* %.pre-phi.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_console_11-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_console_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %1)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC()\n %27 = trunc i64 %26 to i32\n %28 = icmp eq i32 %27, 0\n br i1 %28, label LBL_13, label LBL_8\n LBL_8:\n %29 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %30 = icmp eq i32 %29, 1\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_13, label LBL_9\n LBL_9:\n %32 = load i64, i64* %sv_1, align 8\n %33 = and i64 %32, 4294967295\n %34 = icmp eq i64 %33, 0\n store i32 0, i32* %storemerge4.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %34, label LBL_12, label LBL_10\n LBL_10:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %35 = add i32 %storemerge4.reload, 1\n %36 = sext i32 %35 to i64\n %37 = icmp sgt i64 %33, %36\n store i32 %35, i32* %storemerge4.reg2mem\n br i1 %37, label LBL_10, label LBL_11\n LBL_11:\n %phitmp = zext i32 %35 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_12\n LBL_12:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %38 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_13\n LBL_13:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %35, { 1, 0, 2 }\n uselistorder i64 %11, { 1, 0 }\n uselistorder i8* %1, { 2, 0, 1 }\n uselistorder i32* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_10, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_postinc_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = icmp eq i64 %3, 9223372036854775807\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i64 %3, 1\n store i64 %5, i64* %sv_0, align 8\n %6 = call i64 @FUNC(i64 %5)\n br label LBL_3\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_postdec_11-bad", "fun_name": "CWE191_Integer_Underflow__short_fscanf_postdec_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i16, i16* %sv_0, align 2\n %10 = add i16 %9, -1\n store i16 %10, i16* %sv_0, align 2\n %11 = sext i16 %10 to i64\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 2, 0, 3 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_postdec_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = zext i32 %3 to i64\n %5 = mul i64 %4, 1152921504606846976\n %6 = call i32 @rand()\n %7 = zext i32 %6 to i64\n %8 = mul i64 %7, 35184372088832\n %9 = call i32 @rand()\n %10 = sext i32 %9 to i64\n %11 = mul i64 %10, 1073741824\n %12 = call i32 @rand()\n %13 = sext i32 %12 to i64\n %14 = mul i64 %13, 32768\n %15 = call i32 @rand()\n %16 = sext i32 %15 to i64\n %17 = sext i1 %2 to i64\n %18 = xor i64 %5, %17\n %19 = xor i64 %18, %8\n %20 = xor i64 %19, %11\n %21 = xor i64 %20, %14\n %storemerge1 = xor i64 %21, %16\n %22 = icmp eq i64 %storemerge1, -9223372036854775808\n br i1 %22, label LBL_2, label LBL_1\n LBL_1:\n %23 = add i64 %storemerge1, -1\n %24 = call i64 @FUNC(i64 %23)\n store i64 %24, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %25, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64 %storemerge1, { 1, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_listen_socket_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge8.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* inttoptr (i64 20500 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = load i32, i32* @gv_0, align 4\n %36 = icmp eq i32 %35, 5\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n %37 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_20\n LBL_14:\n %38 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_3)\n %39 = icmp eq i32 %38, 1\n %40 = icmp eq i1 %39, false\n br i1 %40, label LBL_20, label LBL_15\n LBL_15:\n %41 = load i64, i64* %sv_3, align 8\n %42 = trunc i64 %41 to i32\n %43 = icmp sgt i32 %42, 9999\n br i1 %43, label LBL_20, label LBL_16\n LBL_16:\n %44 = and i64 %41, 4294967295\n %45 = icmp eq i64 %44, 0\n store i32 0, i32* %storemerge8.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %45, label LBL_19, label LBL_17\n LBL_17:\n %storemerge8.reload = load i32, i32* %storemerge8.reg2mem\n %46 = add i32 %storemerge8.reload, 1\n %47 = sext i32 %46 to i64\n %48 = icmp sgt i64 %44, %47\n store i32 %46, i32* %storemerge8.reg2mem\n br i1 %48, label LBL_17, label LBL_18\n LBL_18:\n %phitmp = zext i32 %46 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_19\n LBL_19:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %49 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_20\n LBL_20:\n %50 = call i64 @FUNC(i64 40)\n %51 = icmp eq i64 %0, %50\n store i64 0, i64* %rax.0.reg2mem\n br i1 %51, label LBL_22, label LBL_21\n LBL_21:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_22\n LBL_22:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %46, { 1, 0, 2 }\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_3, { 1, 0 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32* %storemerge8.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_19, { 1, 0 }\n uselistorder label LBL_17, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE758_Undefined_Behavior__int_pointer_alloca_use_08-bad", "fun_name": "CWE758_Undefined_Behavior__int_pointer_alloca_use_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -1\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i64*\n %8 = load i64, i64* %7, align 16\n %9 = inttoptr i64 %8 to i32*\n %10 = load i32, i32* %9, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_2\n LBL_2:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_sleep_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i32 -1, i32 20\n %6 = call i32 @usleep(i32 %spec.select)\n %7 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_0 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i32)* @usleep, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i32 -1, { 1, 0, 2, 3 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_postinc_13-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_postinc_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %phitmp = add i32 %.pre, 1\n store i32 %phitmp, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n store i32 %.reload, i32* %sv_0, align 4\n %6 = zext i32 %.reload to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 0, 3, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memcpy_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i8*\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 49)\n %7 = add i64 %3, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memcpy(i64* nonnull %sv_0, i64* %5, i32 %9)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1, 3, 4 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_printf_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %2 = add i64 %1, 8\n %3 = inttoptr i64 %2 to i64*\n store i64 32777976880262761, i64* %3, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 (i8*, ...) @printf(i8* nonnull %4)\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memmove_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64*\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -49\n %5 = and i64 %4, -16\n %6 = add i64 %2, -161\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %5 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %5, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = inttoptr i64 %7 to i64*\n %13 = call i64* @memset(i64* %12, i32 65, i32 99)\n %14 = add i64 %7, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC()\n %17 = trunc i64 %16 to i32\n %18 = icmp eq i32 %17, 0\n store i64* %12, i64** %.pre-phi.reg2mem\n br i1 %18, label LBL_2, label LBL_1\n LBL_1:\n %19 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = inttoptr i64 %1 to i64*\n store i64* %.pre, i64** %.pre-phi.reg2mem\n br label LBL_2\n LBL_2:\n %.pre-phi.reload = load i64*, i64** %.pre-phi.reg2mem\n %20 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %21 = bitcast i64* %sv_0 to i8*\n %22 = call i32 @strlen(i8* nonnull %21)\n %23 = call i64* @memmove(i64* nonnull %sv_0, i64* %.pre-phi.reload, i32 %22)\n %24 = ptrtoint i64* %sv_0 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %3, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0 }\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_pointer_18-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = ptrtoint i64* %0 to i64\n %5 = add i64 %4, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 6, i32* %6, align 4\n %7 = load i32, i32* %3, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = load i32, i32* %6, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n ret i64 %12\n\n uselistorder i64* %0, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @calloc(i32 100, i32 4)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fprintf_08-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fprintf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_2, i64 0, i64 0))\n %5 = sext i32 %4 to i64\n %6 = icmp eq i32 %4, 0\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_3 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_sscanf_01-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_sscanf_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_1, i64 0, i64 0))\n %2 = call i64 @FUNC(i64 40)\n %3 = icmp eq i64 %0, %2\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_10-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_cpy_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i8** %sv_1 to i64\n %4 = add i64 %3, -17\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i8*\n %7 = bitcast i8** %sv_1 to i64*\n store i64 %5, i64* %7, align 8\n store i8 0, i8* %6, align 16\n br label LBL_2\n LBL_2:\n store i64 4702111234474983745, i64* %sv_0, align 8\n %8 = load i8*, i8** %sv_1, align 8\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strcpy(i8* %8, i8* nonnull %9)\n %11 = load i8*, i8** %sv_1, align 8\n %12 = ptrtoint i8* %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 3, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_negative_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = call i64 @FUNC()\n %3 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_ncpy_12-bad", "fun_name": "CWE127_Buffer_Underread__char_declare_ncpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = bitcast i64* %sv_2 to i8*\n %6 = bitcast i8** %sv_1 to i8*\n %storemerge = select i1 %4, i8* %5, i8* %6\n store i8* %storemerge, i8** %sv_1, align 8\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %8 = bitcast i64* %sv_0 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = load i8*, i8** %sv_1, align 8\n %11 = call i8* @strncpy(i8* nonnull %8, i8* %10, i32 %9)\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 2, 0, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_memmove_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = load i64, i64* %sv_1, align 8\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i64, i64* %sv_1, align 8\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %11 = inttoptr i64 %9 to i64*\n %12 = call i64* @memmove(i64* %11, i64* nonnull %sv_0, i32 100)\n %13 = add i64 %9, 99\n %14 = inttoptr i64 %13 to i8*\n store i8 0, i8* %14, align 1\n %15 = call i64 @FUNC(i64 %9)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_multiply_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = call i64 @FUNC(i64 4)\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fgets_malloc_01-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__fgets_malloc_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.05.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_1 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 8, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.05.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %2)\n %sext = mul i32 %6, 65536\n %7 = ashr exact i32 %sext, 16\n %8 = trunc i32 %7 to i16\n %9 = icmp sgt i16 %8, 99\n store i32 %7, i32* %sv_0.05.reg2mem\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.05.reload = load i32, i32* %sv_0.05.reg2mem\n %10 = call i64* @malloc(i32 %sv_0.05.reload)\n %11 = icmp eq i64* %10, null\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %13 = ptrtoint i64* %10 to i64\n %14 = add nsw i32 %sv_0.05.reload, -1\n %15 = call i64* @memset(i64* %10, i32 65, i32 %14)\n %16 = zext i32 %sv_0.05.reload to i64\n %sext4 = mul i64 %16, 281474976710656\n %17 = ashr exact i64 %sext4, 48\n %18 = add i64 %13, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i64 @FUNC(i64 %13)\n call void @free(i64* %10)\n br label LBL_6\n LBL_6:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 1, 0 }\n uselistorder i64* %10, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.05.reload, { 0, 2, 1 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_add_09-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = call i32 @rand()\n %6 = sext i1 %2 to i32\n %storemerge = xor i32 %5, %6\n %7 = trunc i32 %storemerge to i8\n %8 = icmp eq i8 %7, 127\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %sext = mul i32 %storemerge, 16777216\n %sext2 = add i32 %sext, 16777216\n %9 = ashr exact i32 %sext2, 24\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n store i64 %11, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %12, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fgets_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 %4, i64* %sv_0.0.in.reg2mem\n br i1 %7, label LBL_2, label LBL_1\n LBL_1:\n %8 = call i128 @__asm_movss.1(i32 1073741824)\n %9 = call i64 @FUNC(i128 %8)\n store i64 %9, i64* %sv_0.0.in.reg2mem\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n store i64 %10, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %13 = call i128 @FUNC(i128 %1, i128 %1)\n %14 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.0)\n %15 = call i128 @FUNC(i64 4636737291354636288)\n %16 = call i128 @FUNC(i128 %15, i128 %14)\n %17 = call i32 @FUNC(i128 %16)\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %2, { 1, 0 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_rand_sub_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n store i64 %14, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %17 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %17, label LBL_5, label LBL_4\n LBL_4:\n %18 = add i32 %sv_0.0.reload, -1\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %21 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %21, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_add_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 3)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 3, { 1, 0 }\n uselistorder i32* @gv_0, { 5, 0, 4, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_sub_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.2.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n store i32 0, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_11, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_11\n LBL_6:\n store i32 0, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_11, label LBL_7\n LBL_7:\n %23 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %24 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %25 = call i16 @htons(i16 27015)\n %26 = bitcast i64* %sv_2 to %sockaddr*\n %27 = call i32 @connect(i32 %5, %sockaddr* nonnull %26, i32 16)\n %28 = icmp eq i32 %27, -1\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n %29 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %30 = add i32 %29, 1\n %31 = icmp ult i32 %30, 2\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %31, label LBL_10, label LBL_9\n LBL_9:\n %32 = sext i32 %29 to i64\n %33 = add i64 %0, -22\n %34 = add i64 %33, %32\n %35 = inttoptr i64 %34 to i8*\n store i8 0, i8* %35, align 1\n %36 = bitcast i64* %sv_1 to i8*\n %37 = call i32 @atoi(i8* nonnull %36)\n store i32 %37, i32* %sv_0.1.ph.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %38 = call i32 @close(i32 %5)\n store i32 %sv_0.1.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_11\n LBL_11:\n %sv_0.2.reload = load i32, i32* %sv_0.2.reg2mem\n %39 = call i64 @FUNC()\n %40 = trunc i64 %39 to i32\n %41 = icmp eq i32 %40, 0\n %42 = icmp eq i32 %sv_0.2.reload, -2147483648\n br i1 %41, label LBL_15, label LBL_12\n LBL_12:\n br i1 %42, label LBL_14, label LBL_13\n LBL_13:\n %43 = add i32 %sv_0.2.reload, -1\n %44 = zext i32 %43 to i64\n %45 = call i64 @FUNC(i64 %44)\n br label LBL_18\n LBL_14:\n %46 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_1 to i64))\n br label LBL_18\n LBL_15:\n br i1 %42, label LBL_17, label LBL_16\n LBL_16:\n %47 = add i32 %sv_0.2.reload, -1\n %48 = zext i32 %47 to i64\n %49 = call i64 @FUNC(i64 %48)\n br label LBL_18\n LBL_17:\n %50 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_1 to i64))\n br label LBL_18\n LBL_18:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %1, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_20, label LBL_19\n LBL_19:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_20\n LBL_20:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %42, { 1, 0 }\n uselistorder i32 %sv_0.2.reload, { 1, 0, 2 }\n uselistorder i32 %29, { 1, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i1 %6, { 1, 0 }\n uselistorder i32 %5, { 5, 3, 4, 2, 0, 1, 6 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 0, 4, 1, 2, 5, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.2.reg2mem, { 0, 4, 1, 3, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 3, 0, 4, 1 }\n uselistorder label LBL_11, { 2, 0, 3, 1 }\n uselistorder label LBL_10, { 1, 2, 0 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fgets_malloc_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %spec.select = select i1 %2, i32 0, i32 99\n %3 = call i64* @malloc(i32 %spec.select)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %spec.select, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = zext i32 %spec.select to i64\n %10 = add i64 %6, -1\n %11 = add i64 %10, %9\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 0, 2, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_loop_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = bitcast i64* %1 to i8*\n store i8 0, i8* %5, align 1\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = add i64 %storemerge1.reload, %4\n %9 = add i64 %storemerge1.reload, %7\n %10 = inttoptr i64 %9 to i8*\n %11 = load i8, i8* %10, align 1\n %12 = inttoptr i64 %8 to i8*\n store i8 %11, i8* %12, align 1\n %13 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %14 = add i64 %4, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC(i64 %4)\n call void @free(i64* %1)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %4, { 1, 2, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__twoIntsStruct_realloc_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_0 to i32))\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = bitcast i64* %0 to i32*\n store i32 0, i32* %4, align 4\n %5 = add i64 %3, 4\n %6 = inttoptr i64 %5 to i32*\n store i32 0, i32* %6, align 4\n %7 = call i64 @FUNC(i64 %3)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %0, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32)* @realloc, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_11-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_14, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %31 = icmp slt i32 %sv_0.1.reload, 0\n br i1 %31, label LBL_13, label LBL_11\n LBL_11:\n %32 = sext i32 %sv_0.1.reload to i64\n %33 = mul i64 %32, 4\n %34 = add i64 %0, -64\n %35 = add i64 %33, %34\n %36 = inttoptr i64 %35 to i32*\n store i32 1, i32* %36, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_12\n LBL_12:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %37 = mul i64 %indvars.iv.reload, 4\n %38 = add i64 %37, %34\n %39 = inttoptr i64 %38 to i32*\n %40 = load i32, i32* %39, align 4\n %41 = zext i32 %40 to i64\n %42 = call i64 @FUNC(i64 %41)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_14, label LBL_12\n LBL_13:\n %43 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_14\n LBL_14:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %1, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_14, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_sleep_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp slt i32 %sv_0.0.reload, 1\n %14 = icmp sgt i32 %sv_0.0.reload, ptrtoint (i1* @gv_3 to i32)\n %or.cond = or i1 %13, %14\n br i1 %or.cond, label LBL_7, label LBL_6\n LBL_6:\n %15 = call i32 @usleep(i32 %sv_0.0.reload)\n %16 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_4 to i64))\n br label LBL_8\n LBL_7:\n %17 = call i64 @FUNC(i64 ptrtoint ([20 x i8]* @gv_5 to i64))\n br label LBL_8\n LBL_8:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n %2 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %3 = add i64 %2, 8\n %4 = inttoptr i64 %3 to i64*\n store i64 32777976880262761, i64* %4, align 8\n store i64 0, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %5, i32 99, i8* nonnull %1)\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 0, 2, 3, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memmove_13-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memmove_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 10)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %sv_1, align 8\n %8 = inttoptr i64 %sv_0.0.reload to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_1, i32 40)\n %10 = inttoptr i64 %sv_0.0.reload to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n call void @free(i64* %8)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_rand_14-bad", "fun_name": "CWE369_Divide_by_Zero__float_rand_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %storemerge.reg2mem = alloca i128\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %6 = icmp eq i32 %5, 5\n %7 = icmp eq i1 %6, false\n store i64 %4, i64* %sv_0.0.in.reg2mem\n br i1 %7, label LBL_5, label LBL_1\n LBL_1:\n %8 = call i32 @rand()\n %9 = urem i32 %8, 2\n %10 = icmp eq i32 %9, 0\n %11 = call i32 @rand()\n %12 = mul i32 %11, 1073741824\n %13 = call i32 @rand()\n %14 = mul i32 %13, 32768\n %15 = xor i32 %14, %12\n %16 = call i32 @rand()\n %17 = xor i32 %15, %16\n br i1 %10, label LBL_3, label LBL_2\n LBL_2:\n %18 = call i128 @FUNC(i128 %3, i128 %3)\n %19 = call i128 @FUNC(i32 %17)\n store i128 %19, i128* %storemerge.reg2mem\n br label LBL_4\n LBL_3:\n %20 = sub i32 0, %17\n %21 = sub i32 %20, 1\n %22 = call i128 @FUNC(i128 %3, i128 %3)\n %23 = call i128 @FUNC(i32 %21)\n store i128 %23, i128* %storemerge.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge.reload = load i128, i128* %storemerge.reg2mem\n %24 = call i64 @FUNC(i128 %storemerge.reload)\n store i64 %24, i64* %sv_0.0.in.reg2mem\n br label LBL_5\n LBL_5:\n %25 = load i32, i32* @gv_0, align 4\n %26 = zext i32 %25 to i64\n %27 = icmp eq i32 %25, 5\n %28 = icmp eq i1 %27, false\n store i64 %26, i64* %rax.0.reg2mem\n br i1 %28, label LBL_7, label LBL_6\n LBL_6:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %29 = call i128 @FUNC(i128 %1, i128 %1)\n %30 = call i128 @FUNC(i32 %sv_0.0)\n %31 = call i128 @FUNC(i64 4636737291354636288)\n %32 = call i128 @FUNC(i128 %31, i128 %30)\n %33 = call i32 @FUNC(i128 %32)\n %34 = zext i32 %33 to i64\n %35 = call i64 @FUNC(i64 %34)\n store i64 %35, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %3, { 3, 2, 1, 0, 4 }\n uselistorder i128* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i128* %0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_03-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -161\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n store i64 0, i64* %sv_1, align 8\n %6 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %7 = add i64 %storemerge1.reload, %3\n %8 = add i64 %storemerge1.reload, %6\n %9 = inttoptr i64 %8 to i8*\n %10 = load i8, i8* %9, align 1\n %11 = inttoptr i64 %7 to i8*\n store i8 %10, i8* %11, align 1\n %12 = load i64, i64* %sv_1, align 8\n %13 = add i64 %12, 1\n store i64 %13, i64* %sv_1, align 8\n %14 = icmp ult i64 %13, 100\n store i64 %13, i64* %storemerge1.reg2mem\n br i1 %14, label LBL_1, label LBL_2\n LBL_2:\n %15 = add i64 %3, 99\n %16 = inttoptr i64 %15 to i8*\n store i8 0, i8* %16, align 1\n %17 = call i64 @FUNC(i64 %3)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %13, { 0, 2, 1 }\n uselistorder i64 %storemerge1.reload, { 1, 0 }\n uselistorder i64 %3, { 1, 2, 0, 3 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_connect_socket_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_6, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_11, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %26 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %26, label LBL_10, label LBL_8\n LBL_8:\n %27 = sext i32 %sv_0.1.reload to i64\n %28 = mul i64 %27, 4\n %29 = add i64 %0, -64\n %30 = add i64 %28, %29\n %31 = inttoptr i64 %30 to i32*\n store i32 1, i32* %31, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_9\n LBL_9:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %32 = mul i64 %indvars.iv.reload, 4\n %33 = add i64 %32, %29\n %34 = inttoptr i64 %33 to i32*\n %35 = load i32, i32* %34, align 4\n %36 = zext i32 %35 to i64\n %37 = call i64 @FUNC(i64 %36)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_11, label LBL_9\n LBL_10:\n %38 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_11\n LBL_11:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %1, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 2, 8, 0, 9, 1, 7, 6, 10, 4, 11, 5 }\n uselistorder label LBL_11, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_realloc_07-bad", "fun_name": "CWE401_Memory_Leak__char_realloc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @realloc(i64* null, i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n store i64 7453010373643542593, i64* %4, align 8\n %8 = add i64 %7, 8\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %7)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* null, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_memmove_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n %6 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %8 = inttoptr i64 %spec.select to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_0, i32 100)\n %10 = add i64 %spec.select, 99\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = call i64 @FUNC(i64 %spec.select)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %2, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %spec.select, { 2, 0, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_multiply_15-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_1 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_0, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n br label LBL_8\n LBL_4:\n %13 = ptrtoint i64* %sv_2 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp slt i32 %19, 0\n %22 = icmp eq i1 %21, false\n br i1 %22, label LBL_8, label LBL_5\n LBL_5:\n %23 = icmp slt i32 %19, -1073741823\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n %24 = mul i32 %19, 2\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n br label LBL_8\n LBL_7:\n %27 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))\n br label LBL_8\n LBL_8:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder label LBL_8, { 2, 3, 4, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE467_Use_of_sizeof_on_Pointer_Type__char_14-bad", "fun_name": "CWE467_Use_of_sizeof_on_Pointer_Type__char_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 8)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 66, i8* %7, align 1\n %8 = call i64 @FUNC(i64 66)\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_system_11-bad", "fun_name": "CWE78_OS_Command_Injection__char_console_system_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_0 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %1)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %26 = call i32 @system(i8* nonnull %1)\n %27 = icmp eq i32 %26, 0\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n %28 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_2 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_9:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 1, 0 }\n uselistorder i8* %1, { 2, 0, 1 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__open_no_close_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = load i32, i32* @gv_1, align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n %5 = icmp eq i32 %0, -1\n %or.cond = or i1 %5, %4\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %6 = call i32 @close(i32 %0)\n %7 = sext i32 %6 to i64\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32* @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 100)\n %4 = call i64 @FUNC(i64* nonnull %sv_0)\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_src_char_cat_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_2.LBL_5_crit_edge, label LBL_4\n LBL_3:\n %.pre = ptrtoint i64* %1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_4:\n %7 = call i64* @memset(i64* %1, i32 65, i32 49)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 49\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %8, i64* %.pre-phi.reg2mem\n br label LBL_5\n LBL_5:\n %11 = bitcast i64* %1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i8* @strcat(i8* nonnull %12, i8* %11)\n %14 = call i64 @FUNC(i64 %.pre-phi.reload)\n call void @free(i64* %1)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 5, 2, 3, 0, 4 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_memmove_09-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %1, i64 0, i64 50)\n %2 = call i64* @memmove(i64* nonnull %sv_1, i64* nonnull %sv_0, i32 400)\n %3 = bitcast i64* %sv_1 to i32*\n %4 = load i32, i32* %3, align 8\n %5 = zext i32 %4 to i64\n %6 = call i64 @FUNC(i64 %5)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_no_init_11-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__int_array_malloc_no_init_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 40)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64 @FUNC()\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 %5, i64* %rax.1.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %8 = mul i64 %indvars.iv.reload, 4\n %9 = add i64 %8, %3\n %10 = inttoptr i64 %9 to i32*\n %11 = load i32, i32* %10, align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %13, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_multiply_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_8\n LBL_4:\n %10 = load i8, i8* %sv_0, align 1\n %11 = icmp slt i8 %10, 1\n br i1 %11, label LBL_8, label LBL_5\n LBL_5:\n %12 = icmp sgt i8 %10, 62\n br i1 %12, label LBL_7, label LBL_6\n LBL_6:\n %13 = mul i8 %10, 2\n %14 = sext i8 %13 to i64\n %15 = and i64 %14, 4294967294\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_8\n LBL_7:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memcpy_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64* null, i64** %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64* %4, i64** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = load i64, i64* %sv_0.0.reload, align 8\n store i64 %12, i64* %sv_1, align 8\n %13 = ptrtoint i64* %sv_1 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 1, 2, 0 }\n uselistorder i64** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_fscanf_09-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp ugt i32 %3, 9\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = sext i32 %3 to i64\n %7 = mul i64 %6, 4\n %8 = add i64 %5, -48\n %9 = add i64 %7, %8\n %10 = inttoptr i64 %9 to i32*\n store i32 1, i32* %10, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_2\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %8\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_2\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %3, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_printf_12-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_environment_printf_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_4, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_4\n LBL_3:\n %14 = ptrtoint i64* %sv_0 to i64\n store i64 8247343692658534758, i64* %sv_0, align 8\n %15 = add i64 %14, 8\n %16 = inttoptr i64 %15 to i64*\n store i64 32777976880262761, i64* %16, align 8\n br label LBL_4\n LBL_4:\n %17 = call i64 @FUNC()\n %18 = trunc i64 %17 to i32\n %19 = icmp eq i32 %18, 0\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n %20 = call i32 (i8*, ...) @printf(i8* nonnull %1)\n br label LBL_7\n LBL_6:\n %21 = call i32 @puts(i8* nonnull %1)\n br label LBL_7\n LBL_7:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_for_loop_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_9\n LBL_6:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %sv_0.0.off = add i32 %sv_0.0.reload, -1\n %14 = icmp ugt i32 %sv_0.0.off, 19\n br i1 %14, label LBL_9, label LBL_7\n LBL_7:\n %15 = sext i32 %sv_0.0.reload to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_8\n LBL_8:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_3 to i64))\n %17 = add nuw i64 %storemerge2.reload, 1\n %18 = icmp ult i64 %17, %15\n store i64 %17, i64* %storemerge2.reg2mem\n br i1 %18, label LBL_8, label LBL_9\n LBL_9:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__sizeof_int64_t_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64* @malloc(i32 8)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n store i64 2147483643, i64* %1, align 8\n %4 = call i64 @FUNC(i64 2147483643)\n call void @free(i64* %1)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 2147483643, { 0, 2, 1, 3 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_fprintf_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_2\n LBL_2:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %sv_0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_7, label LBL_4\n LBL_4:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %20, align 1\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_7\n LBL_7:\n %25 = load i32, i32* @gv_3, align 4\n %26 = icmp eq i32 %25, 0\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n %27 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_10\n LBL_9:\n %28 = load %_IO_FILE*, %_IO_FILE** @gv_5, align 8\n %29 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_6, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %10, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_04-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i8*\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i8* @strcpy(i8* nonnull %9, i8* %4)\n %11 = call i64 @FUNC(i64 %3)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %1, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1, 3, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_system_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 @strlen(i8* nonnull %1)\n %5 = sext i32 %4 to i64\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i32*\n store i32 2764330, i32* %8, align 4\n br label LBL_2\n LBL_2:\n %9 = call i32 @system(i8* nonnull %1)\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_alloca_no_init_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv11.reg2mem = alloca i64\n %indvars.iv14.reg2mem = alloca i64\n %storemerge310.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = ptrtoint i32* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -81\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv14.reg2mem\n br i1 %6, label LBL_3, label LBL_1\n LBL_1:\n store i32 0, i32* %sv_0, align 4\n store i32 0, i32* %storemerge310.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge310.reload = load i32, i32* %storemerge310.reg2mem\n %7 = sext i32 %storemerge310.reload to i64\n %8 = mul i64 %7, 8\n %9 = add i64 %8, %3\n %10 = inttoptr i64 %9 to i32*\n store i32 %storemerge310.reload, i32* %10, align 8\n %11 = load i32, i32* %sv_0, align 4\n %12 = sext i32 %11 to i64\n %13 = mul i64 %12, 8\n %14 = add i64 %13, %3\n %15 = or i64 %14, 4\n %16 = inttoptr i64 %15 to i32*\n store i32 %11, i32* %16, align 4\n %17 = load i32, i32* %sv_0, align 4\n %18 = add i32 %17, 1\n store i32 %18, i32* %sv_0, align 4\n %19 = icmp slt i32 %18, 10\n store i32 %18, i32* %storemerge310.reg2mem\n br i1 %19, label LBL_2, label LBL_4\n LBL_3:\n %indvars.iv14.reload = load i64, i64* %indvars.iv14.reg2mem\n %20 = mul i64 %indvars.iv14.reload, 8\n %21 = add i64 %20, %3\n %22 = inttoptr i64 %21 to i32*\n %23 = trunc i64 %indvars.iv14.reload to i32\n store i32 %23, i32* %22, align 8\n %24 = or i64 %21, 4\n %25 = inttoptr i64 %24 to i32*\n store i32 %23, i32* %25, align 4\n %indvars.iv.next15 = add nuw nsw i64 %indvars.iv14.reload, 1\n %exitcond16 = icmp eq i64 %indvars.iv.next15, 10\n store i64 %indvars.iv.next15, i64* %indvars.iv14.reg2mem\n br i1 %exitcond16, label LBL_4, label LBL_3\n LBL_4:\n %26 = call i64 @FUNC()\n %27 = trunc i64 %26 to i32\n %28 = icmp eq i32 %27, 0\n store i64 0, i64* %indvars.iv11.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %28, label LBL_6, label LBL_5\n LBL_5:\n %indvars.iv11.reload = load i64, i64* %indvars.iv11.reg2mem\n %29 = mul i64 %indvars.iv11.reload, 8\n %30 = add i64 %29, %3\n %31 = inttoptr i64 %30 to i32*\n %32 = load i32, i32* %31, align 8\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n %35 = or i64 %30, 4\n %36 = inttoptr i64 %35 to i32*\n %37 = load i32, i32* %36, align 4\n %38 = zext i32 %37 to i64\n %39 = call i64 @FUNC(i64 %38)\n %indvars.iv.next12 = add nuw nsw i64 %indvars.iv11.reload, 1\n %exitcond13 = icmp eq i64 %indvars.iv.next12, 10\n store i64 %indvars.iv.next12, i64* %indvars.iv11.reg2mem\n br i1 %exitcond13, label LBL_7, label LBL_5\n LBL_6:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %40 = mul i64 %indvars.iv.reload, 8\n %41 = add i64 %40, %3\n %42 = inttoptr i64 %41 to i32*\n %43 = load i32, i32* %42, align 8\n %44 = zext i32 %43 to i64\n %45 = call i64 @FUNC(i64 %44)\n %46 = or i64 %41, 4\n %47 = inttoptr i64 %46 to i32*\n %48 = load i32, i32* %47, align 4\n %49 = zext i32 %48 to i64\n %50 = call i64 @FUNC(i64 %49)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %51 = call i64 @FUNC(i64 40)\n %52 = icmp eq i64 %1, %51\n store i64 0, i64* %rax.0.reg2mem\n br i1 %52, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 0, 2, 1 }\n uselistorder i32 %storemerge310.reload, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 4, 3, 0, 2 }\n uselistorder i32* %storemerge310.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv14.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv11.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 7, 6, 5, 4, 3, 2, 1, 0 }\n uselistorder i64 10, { 2, 1, 0, 5, 4, 3 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n uselistorder label LBL_6, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_realloc_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n store i64 5, i64* %0, align 8\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_alloca_memcpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64*\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -49\n %5 = and i64 %4, -16\n %6 = add i64 %2, -161\n %7 = and i64 %6, -16\n %8 = inttoptr i64 %5 to i64*\n %9 = call i64* @memset(i64* %8, i32 65, i32 49)\n %10 = add i64 %5, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = inttoptr i64 %7 to i64*\n %13 = call i64* @memset(i64* %12, i32 65, i32 99)\n %14 = add i64 %7, 99\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n %16 = call i64 @FUNC()\n %17 = trunc i64 %16 to i32\n %18 = icmp eq i32 %17, 0\n store i64* %12, i64** %.pre-phi.reg2mem\n br i1 %18, label LBL_2, label LBL_1\n LBL_1:\n %19 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n %.pre = inttoptr i64 %1 to i64*\n store i64* %.pre, i64** %.pre-phi.reg2mem\n br label LBL_2\n LBL_2:\n %.pre-phi.reload = load i64*, i64** %.pre-phi.reg2mem\n %20 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %21 = bitcast i64* %sv_0 to i8*\n %22 = call i32 @strlen(i8* nonnull %21)\n %23 = call i64* @memcpy(i64* nonnull %sv_0, i64* %.pre-phi.reload, i32 %22)\n %24 = ptrtoint i64* %sv_0 to i64\n %25 = call i64 @FUNC(i64 %24)\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %3, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %7, { 1, 0 }\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_multiply_13-bad", "fun_name": "CWE191_Integer_Underflow__int_fscanf_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i64, i64* %sv_0, align 8\n %6 = trunc i64 %.pre to i32\n %7 = icmp slt i32 %6, 0\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = mul i64 %.pre, 2\n %10 = and i64 %9, 4294967294\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memcpy_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64* null, i64** %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64* %4, i64** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = bitcast i64* %sv_1 to i8*\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = call i64* @memcpy(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 %13)\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %sv_0.0.reload)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 3, 0, 1, 2 }\n uselistorder i64** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_multiply_13-bad", "fun_name": "CWE190_Integer_Overflow__int_connect_socket_multiply_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8348 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_7, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_1 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_0, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n br i1 %14, label LBL_4, label LBL_5\n LBL_4:\n %15 = call i32 @close(i32 %4)\n br label LBL_7\n LBL_5:\n %16 = ptrtoint i64* %sv_2 to i64\n %17 = sext i32 %12 to i64\n %18 = add i64 %16, -22\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = bitcast i64* %sv_0 to i8*\n %22 = call i32 @atoi(i8* nonnull %21)\n %23 = call i32 @close(i32 %4)\n %24 = icmp slt i32 %22, 1\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n %25 = mul i32 %22, 2\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n br label LBL_7\n LBL_7:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder label LBL_7, { 3, 4, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_printf_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 %2, i32* %.reg2mem\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_3\n LBL_3:\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %14 = icmp eq i32 %.reload, 5\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_7\n LBL_6:\n %16 = call i32 @puts(i8* nonnull %1)\n br label LBL_7\n LBL_7:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fscanf_malloc_07-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__fscanf_malloc_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i16\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i16 0, i16* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pr = load i16, i16* %sv_0, align 2\n %6 = icmp sgt i16 %.pr, 99\n store i16 %.pr, i16* %.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n %.reload = load i16, i16* %.reg2mem\n %7 = sext i16 %.reload to i32\n %8 = call i64* @malloc(i32 %7)\n %9 = icmp eq i64* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %11 = ptrtoint i64* %8 to i64\n %12 = load i16, i16* %sv_0, align 2\n %13 = sext i16 %12 to i32\n %14 = add nsw i32 %13, -1\n %15 = call i64* @memset(i64* %8, i32 65, i32 %14)\n %16 = load i16, i16* %sv_0, align 2\n %17 = sext i16 %16 to i64\n %18 = add i64 %11, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i64 @FUNC(i64 %11)\n call void @free(i64* %8)\n br label LBL_5\n LBL_5:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 1, 0 }\n uselistorder i64* %8, { 0, 1, 3, 2 }\n uselistorder i16* %sv_0, { 2, 3, 0, 1, 4 }\n uselistorder i16* %.reg2mem, { 0, 2, 1 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_max_multiply_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_2:\n %3 = icmp eq i1 %1, false\n %spec.store.select = select i1 %3, i32 0, i32 32767\n %4 = trunc i32 %spec.store.select to i16\n %5 = icmp eq i16 %4, 0\n store i64 5, i64* %rax.0.reg2mem\n br i1 %5, label LBL_6, label LBL_3\n LBL_3:\n %6 = icmp ugt i16 %4, 16382\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n %sext = mul i32 %spec.store.select, 131072\n %7 = ashr exact i32 %sext, 16\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %1, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 4, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_fwrite_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_10, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_10, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %.off = add i32 %6, -1\n %7 = icmp ugt i32 %.off, 19\n br i1 %7, label LBL_10, label LBL_3\n LBL_3:\n %8 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_4, i64 0, i64 0))\n %9 = icmp eq %_IO_FILE* %8, null\n %10 = icmp eq i1 %9, false\n br i1 %10, label LBL_4, label LBL_5\n LBL_4:\n %11 = load i32, i32* %sv_0, align 4\n %12 = icmp eq i32 %11, 0\n store i64 0, i64* %storemerge4.reg2mem\n br i1 %12, label LBL_9, label LBL_6\n LBL_5:\n call void @exit(i32 1)\n unreachable\n LBL_6:\n %13 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_5 to i64*), i32 1, i32 50, %_IO_FILE* %8)\n %14 = icmp eq i32 %13, 50\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %storemerge4.reload = load i64, i64* %storemerge4.reg2mem\n %15 = add nuw i64 %storemerge4.reload, 1\n %16 = load i32, i32* %sv_0, align 4\n %17 = sext i32 %16 to i64\n %18 = icmp ult i64 %15, %17\n store i64 %15, i64* %storemerge4.reg2mem\n br i1 %18, label LBL_6, label LBL_9\n LBL_9:\n %19 = call i32 @fclose(%_IO_FILE* nonnull %8)\n br label LBL_10\n LBL_10:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %8, { 1, 0, 2 }\n uselistorder i32* %sv_0, { 2, 0, 3, 1, 4 }\n uselistorder i64* %storemerge4.reg2mem, { 2, 0, 1 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder i32 -1, { 0, 2, 1, 3 }\n uselistorder label LBL_10, { 1, 2, 3, 0 }\n uselistorder label LBL_6, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE367_TOC_TOU__access_07-bad", "fun_name": "CWE367_TOC_TOU__access_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_12, label LBL_1\n LBL_1:\n store i8 0, i8* %sv_0, align 1\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i8* @fgets(i8* nonnull %sv_0, i32 100, %_IO_FILE* %4)\n %6 = icmp eq i8* %5, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %sv_0, align 1\n br label LBL_5\n LBL_3:\n %.pr = load i8, i8* %sv_0, align 1\n %9 = icmp eq i8 %.pr, 0\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = ptrtoint i64* %sv_1 to i64\n %11 = call i32 @strlen(i8* nonnull %sv_0)\n %12 = sext i32 %11 to i64\n %13 = add i64 %10, -113\n %14 = add i64 %13, %12\n %15 = inttoptr i64 %14 to i8*\n store i8 0, i8* %15, align 1\n br label LBL_5\n LBL_5:\n %16 = call i32 @access(i8* nonnull %sv_0, i32 2)\n %17 = icmp eq i32 %16, -1\n %18 = icmp eq i1 %17, false\n br i1 %18, label LBL_7, label LBL_6\n LBL_6:\n call void @exit(i32 1)\n unreachable\n LBL_7:\n %19 = call i32 (i8*, i32, ...) @open(i8* nonnull %sv_0, i32 2)\n %20 = icmp eq i32 %19, -1\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 1)\n unreachable\n LBL_9:\n %22 = call i32 @write(i32 %19, i64* bitcast ([12 x i8]* @gv_3 to i64*), i32 11)\n %23 = icmp eq i32 %22, -1\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_11, label LBL_10\n LBL_10:\n call void @exit(i32 1)\n unreachable\n LBL_11:\n %25 = call i32 @close(i32 %19)\n br label LBL_12\n LBL_12:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0, { 6, 5, 4, 0, 2, 3, 1 }\n uselistorder void (i32)* @exit, { 2, 1, 0, 3 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i8 0, { 3, 4, 0, 1, 5, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_08-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %9 = mul i64 %storemerge1.reload, 8\n %10 = add i64 %9, %8\n %11 = add i64 %10, -816\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 8\n %13 = add i64 %10, -812\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 4\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %16 = inttoptr i64 %sv_0.0.reload to i64*\n %17 = call i64* @memcpy(i64* %16, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_0 to i32))\n %18 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %16)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__listen_socket_memcpy_07-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__listen_socket_memcpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_10, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_10, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_3 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_8, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_8, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_2, i32 7, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_9, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -112\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_2 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n %.off = add i32 %24, 32768\n %25 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %25, label LBL_7, label LBL_9\n LBL_7:\n %sext3 = mul i32 %24, 65536\n %26 = ashr exact i32 %sext3, 16\n store i32 %26, i32* %sv_0.0.ph.reg2mem\n br label LBL_9\n LBL_8:\n %27 = call i32 @close(i32 %5)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_10\n LBL_9:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %28 = call i32 @close(i32 %5)\n %29 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %30 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %31 = trunc i32 %sv_0.1.reload to i16\n %32 = icmp sgt i16 %31, 99\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n %33 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.1.reload)\n %34 = sext i32 %sv_0.1.reload to i64\n %35 = add i64 %0, -112\n %36 = add i64 %35, %34\n %37 = inttoptr i64 %36 to i8*\n store i8 0, i8* %37, align 1\n br label LBL_12\n LBL_12:\n %38 = call i64 @FUNC(i64* nonnull %sv_2)\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %1, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 2, 0 }\n uselistorder i32 %16, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0, 2 }\n uselistorder label LBL_10, { 2, 1, 0, 3 }\n uselistorder label LBL_9, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_console_execl_08-bad", "fun_name": "CWE78_OS_Command_Injection__char_console_execl_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_0 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %4)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %26 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_2, i64 0, i64 0))\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 1, 0 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca %_IO_FILE*\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store %_IO_FILE* null, %_IO_FILE** %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n store %_IO_FILE* %3, %_IO_FILE** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load %_IO_FILE*, %_IO_FILE** %sv_0.0.reg2mem\n %7 = call i32 @fclose(%_IO_FILE* %sv_0.0.reload)\n %8 = sext i32 %7 to i64\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 2, 0, 3, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 3, 2, 1, 0, 4 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE526_Info_Exposure_Environment_Variables__basic_07-bad", "fun_name": "CWE526_Info_Exposure_Environment_Variables__basic_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_1, i64 0, i64 0))\n %5 = ptrtoint i8* %4 to i64\n %6 = call i64 @FUNC(i64 %5)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_postinc_13-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_fscanf_postinc_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 1, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %.pre = load i64, i64* %sv_0, align 8\n %phitmp = add i64 %.pre, 1\n store i64 %phitmp, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n store i64 %.reload, i64* %sv_0, align 8\n %6 = call i64 @FUNC(i64 %.reload)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 2, 0, 1, 3 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_system_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = ptrtoint i64* %sv_0 to i64\n %8 = add i64 %6, %7\n %9 = inttoptr i64 %8 to i32*\n store i32 2764330, i32* %9, align 4\n br label LBL_2\n LBL_2:\n %10 = call i32 @system(i8* nonnull %1)\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %1, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 (i8*)* @system, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_loop_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %sv_0.0.reload\n %14 = add i64 %storemerge1.reload, %12\n %15 = inttoptr i64 %14 to i8*\n %16 = load i8, i8* %15, align 1\n %17 = inttoptr i64 %13 to i8*\n store i8 %16, i8* %17, align 1\n %18 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %19 = add i64 %sv_0.0.reload, 99\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i64 @FUNC(i64 %sv_0.0.reload)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_min_multiply_12-bad", "fun_name": "CWE191_Integer_Underflow__short_min_multiply_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %. = select i1 %2, i32 -2, i32 -32768\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %sext = mul i32 %., 131072\n %6 = ashr exact i32 %sext, 16\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n %9 = trunc i32 %. to i16\n %10 = icmp ult i16 %9, -16383\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %sext2 = mul i32 %., 131072\n %11 = ashr exact i32 %sext2, 16\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %., { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memcpy_03-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %9)\n %11 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 3, 5, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__char_11-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__char_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i8*\n %rax.0.reg2mem = alloca i64\n %1 = load i8*, i8** %0\n %2 = call i64 @FUNC()\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = load i8, i8* %1, align 1\n %7 = sext i8 %6 to i64\n %8 = and i64 %7, 4294967295\n %9 = call i64 @FUNC(i64 %8)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_memmove_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = load i64, i64* %sv_1, align 8\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i64, i64* %sv_1, align 8\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %11 = inttoptr i64 %9 to i64*\n %12 = call i64* @memmove(i64* nonnull %sv_0, i64* %11, i32 100)\n %13 = call i64 @FUNC(i64* nonnull %sv_0)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_max_multiply_32-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_max_multiply_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC(i64 -2)\n %2 = call i64 @FUNC(i64 40)\n %3 = icmp eq i64 %0, %2\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_square_08-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_square_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %sext = mul i64 %9, 4294967296\n %10 = ashr exact i64 %sext, 32\n %11 = mul nsw i64 %10, %10\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_05-bad", "fun_name": "CWE401_Memory_Leak__struct_twoIntsStruct_realloc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_1 to i32))\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = ptrtoint i64* %2 to i64\n %6 = bitcast i64* %2 to i32*\n store i32 0, i32* %6, align 4\n %7 = add i64 %5, 4\n %8 = inttoptr i64 %7 to i32*\n store i32 0, i32* %8, align 4\n %9 = call i64 @FUNC(i64 %5)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 0, 2, 1 }\n uselistorder i64* null, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_15-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_15_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 50)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* %4, i8* nonnull %6, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE506_Embedded_Malicious_Code__file_transfer_connect_socket_17-bad", "fun_name": "CWE506_Embedded_Malicious_Code__file_transfer_connect_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %rsp.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = ptrtoint i64* %sv_2 to i64\n store i64 %0, i64* %rsp.0.reg2mem\n br label LBL_1\n LBL_1:\n %rsp.0.reload = load i64, i64* %rsp.0.reg2mem\n %2 = add i64 %rsp.0.reload, -4096\n %3 = icmp eq i64 %2, %1\n %4 = icmp eq i1 %3, false\n store i64 %2, i64* %rsp.0.reg2mem\n br i1 %4, label LBL_1, label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %8 = icmp eq %_IO_FILE* %7, null\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = call i8* @fgets(i8* nonnull %6, i32 65535, %_IO_FILE* nonnull %7)\n %10 = icmp eq i8* %9, null\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i64 0, i64* %sv_1, align 8\n br label LBL_5\n LBL_5:\n %13 = call i32 @fclose(%_IO_FILE* nonnull %7)\n br label LBL_6\n LBL_6:\n %14 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %14, -1\n br i1 %cond, label LBL_10, label LBL_7\n LBL_7:\n %15 = bitcast i64* %sv_0 to %sockaddr*\n %16 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %17 = call i16 @htons(i16 27015)\n %18 = call i32 @connect(i32 %14, %sockaddr* nonnull %15, i32 16)\n %19 = icmp eq i32 %18, -1\n br i1 %19, label LBL_9, label LBL_8\n LBL_8:\n %20 = call i32 @strlen(i8* nonnull %6)\n %21 = call i32 @send(i32 %14, i64* nonnull %sv_1, i32 %20, i32 0)\n %22 = call i32 @strlen(i8* nonnull %6)\n br label LBL_9\n LBL_9:\n %23 = call i32 @close(i32 %14)\n br label LBL_10\n LBL_10:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %5, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %14, { 3, 1, 2, 0 }\n uselistorder i8* %6, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 2, 1, 0 }\n uselistorder i64* %rsp.0.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.2.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n store i32 -1, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_17, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_7, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_7, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_7, label LBL_5\n LBL_5:\n %16 = call i32 @recv(i32 %14, i64* nonnull %sv_1, i32 13, i32 0)\n %17 = add i32 %16, 1\n %18 = icmp ult i32 %17, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %18, label LBL_8, label LBL_6\n LBL_6:\n %19 = sext i32 %16 to i64\n %20 = add i64 %0, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %5)\n %27 = call i32 @close(i32 %14)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_9:\n store i32 -1, i32* %sv_0.2.reg2mem\n br i1 %6, label LBL_17, label LBL_10\n LBL_10:\n %28 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %29 = call i16 @htons(i16 27015)\n %30 = bitcast i64* %sv_2 to %sockaddr*\n %31 = call i32 @bind(i32 %5, %sockaddr* nonnull %30, i32 16)\n %32 = icmp eq i32 %31, -1\n br i1 %32, label LBL_15, label LBL_11\n LBL_11:\n %33 = call i32 @listen(i32 %5, i32 5)\n %34 = icmp eq i32 %33, -1\n br i1 %34, label LBL_15, label LBL_12\n LBL_12:\n %35 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %36 = icmp eq i32 %35, -1\n br i1 %36, label LBL_15, label LBL_13\n LBL_13:\n %37 = call i32 @recv(i32 %35, i64* nonnull %sv_1, i32 13, i32 0)\n %38 = add i32 %37, 1\n %39 = icmp ult i32 %38, 2\n store i32 -1, i32* %sv_0.1.ph.reg2mem\n br i1 %39, label LBL_16, label LBL_14\n LBL_14:\n %40 = sext i32 %37 to i64\n %41 = add i64 %0, -22\n %42 = add i64 %41, %40\n %43 = inttoptr i64 %42 to i8*\n store i8 0, i8* %43, align 1\n %44 = bitcast i64* %sv_1 to i8*\n %45 = call i32 @atoi(i8* nonnull %44)\n store i32 %45, i32* %sv_0.1.ph.reg2mem\n br label LBL_16\n LBL_15:\n %46 = call i32 @close(i32 %5)\n store i32 -1, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_16:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %47 = call i32 @close(i32 %5)\n %48 = call i32 @close(i32 %35)\n store i32 %sv_0.1.ph.reload, i32* %sv_0.2.reg2mem\n br label LBL_17\n LBL_17:\n %sv_0.2.reload = load i32, i32* %sv_0.2.reg2mem\n %49 = call i64 @FUNC()\n %50 = trunc i64 %49 to i32\n %51 = icmp eq i32 %50, 0\n %52 = icmp eq i32 %sv_0.2.reload, 0\n br i1 %51, label LBL_21, label LBL_18\n LBL_18:\n br i1 %52, label LBL_20, label LBL_19\n LBL_19:\n %53 = urem i32 100, %sv_0.2.reload\n %54 = zext i32 %53 to i64\n %55 = call i64 @FUNC(i64 %54)\n br label LBL_24\n LBL_20:\n %56 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n br label LBL_24\n LBL_21:\n br i1 %52, label LBL_23, label LBL_22\n LBL_22:\n %57 = urem i32 100, %sv_0.2.reload\n %58 = zext i32 %57 to i64\n %59 = call i64 @FUNC(i64 %58)\n br label LBL_24\n LBL_23:\n %60 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_0 to i64))\n br label LBL_24\n LBL_24:\n %61 = call i64 @FUNC(i64 40)\n %62 = icmp eq i64 %1, %61\n store i64 0, i64* %rax.0.reg2mem\n br i1 %62, label LBL_26, label LBL_25\n LBL_25:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_26\n LBL_26:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %52, { 1, 0 }\n uselistorder i32 %sv_0.2.reload, { 1, 0, 2 }\n uselistorder i32 %37, { 1, 0 }\n uselistorder i32 %16, { 1, 0 }\n uselistorder i1 %6, { 1, 0 }\n uselistorder i32 %5, { 9, 0, 6, 7, 8, 2, 1, 5, 4, 3, 10 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 0, 4, 1, 2, 5, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.2.reg2mem, { 0, 6, 3, 1, 5, 4, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 4, 6, 7, 8, 0, 3, 5, 10, 11, 12, 1, 9 }\n uselistorder label LBL_17, { 4, 2, 0, 5, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__binary_if_13-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__binary_if_13_bad", "llvm_ir_function": "define i64 @FUNC(i64 %arg1, i64 %arg2, i64 %arg3) local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* inttoptr (i64 8348 to i32*), align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @llvm.trap()\n unreachable\n LBL_2:\n %3 = zext i32 %0 to i64\n ret i64 %3\n\n uselistorder i32 %0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memcpy_01-bad", "fun_name": "CWE126_Buffer_Overread__malloc_char_memcpy_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 50)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = add i64 %4, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %10)\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i32 @socket(i32 2, i32 1, i32 6)\n %4 = icmp eq i32 %3, -1\n br i1 %4, label LBL_11, label LBL_1\n LBL_1:\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %6 = call i16 @htons(i16 27015)\n %7 = bitcast i64* %sv_1 to %sockaddr*\n %8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_9, label LBL_2\n LBL_2:\n %10 = call i32 @listen(i32 %3, i32 5)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_9, label LBL_3\n LBL_3:\n %12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_9, label LBL_4\n LBL_4:\n %14 = sext i32 %2 to i64\n %15 = ptrtoint i64* %sv_2 to i64\n %16 = add i64 %14, %15\n %17 = inttoptr i64 %16 to i64*\n %18 = sub i32 99, %2\n %19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)\n %20 = add i32 %19, 1\n %21 = icmp ult i32 %20, 2\n br i1 %21, label LBL_10, label LBL_5\n LBL_5:\n %22 = sext i32 %19 to i64\n %23 = add i64 %16, %22\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = call i8* @strchr(i8* nonnull %1, i32 13)\n %26 = icmp eq i8* %25, null\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %25, align 1\n br label LBL_7\n LBL_7:\n %27 = call i8* @strchr(i8* nonnull %1, i32 10)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_10, label LBL_8\n LBL_8:\n store i8 0, i8* %27, align 1\n br label LBL_10\n LBL_9:\n %29 = call i32 @close(i32 %3)\n br label LBL_11\n LBL_10:\n %30 = call i32 @close(i32 %3)\n %31 = call i32 @close(i32 %12)\n br label LBL_11\n LBL_11:\n store i64 0, i64* %sv_0, align 8\n %32 = bitcast i64* %sv_0 to i8*\n %33 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %32, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_2)\n %34 = ptrtoint i64* %sv_0 to i64\n %35 = call i64 @FUNC(i64 %34)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %19, { 1, 0 }\n uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 2, 0, 5, 4, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder label LBL_11, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_ncpy_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = bitcast i64* %1 to i8*\n store i8* %2, i8** %sv_1, align 8\n %3 = icmp eq i64* %1, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = load i8*, i8** %sv_1, align 8\n %10 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %11 = bitcast i64* %sv_0 to i8*\n %12 = call i32 @strlen(i8* nonnull %11)\n %13 = call i8* @strncpy(i8* nonnull %11, i8* %9, i32 %12)\n %14 = call i64 @FUNC(i64* nonnull %sv_0)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 99, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_preinc_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge.in = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge.in, -1\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = add i32 %storemerge.in, 1\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fscanf_08-bad", "fun_name": "CWE369_Divide_by_Zero__float_fscanf_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %sv_0 = alloca i32, align 4\n %3 = call i64 @FUNC(i64 40)\n %4 = call i128 @FUNC(i128 %2, i128 %2)\n %5 = call i64 @FUNC(i128 %4)\n %6 = trunc i64 %5 to i32\n store i32 %6, i32* %sv_0, align 4\n %7 = call i64 @FUNC()\n %8 = trunc i64 %7 to i32\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n %10 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %11 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %12 = call i64 @FUNC()\n %13 = trunc i64 %12 to i32\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = load i32, i32* %sv_0, align 4\n %16 = call i128 @__asm_movss.1(i32 %15)\n %17 = call i128 @FUNC(i128 %1, i128 %1)\n %18 = call i128 @FUNC(i128 %16)\n %19 = call i128 @FUNC(i64 4636737291354636288)\n %20 = call i128 @FUNC(i128 %19, i128 %18)\n %21 = call i32 @FUNC(i128 %20)\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n br label LBL_4\n LBL_4:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %3, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 0, 1 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__CWE129_connect_socket_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %4, -20\n %6 = inttoptr i64 %5 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_2\n LBL_2:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 -20, { 1, 0 }\n uselistorder i32 5, { 1, 0, 2, 3, 4, 5, 6, 7 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_fprintf_04-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_fprintf_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = load %_IO_FILE*, %_IO_FILE** @gv_2, align 8\n %24 = call i32 (%_IO_FILE*, i8*, ...) @fprintf(%_IO_FILE* %23, i8* nonnull %1)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_6, { 4, 3, 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 11)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memcpy(i64* %11, i64* nonnull %sv_1, i32 %10)\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %11)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int_malloc_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 4)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = icmp eq i64* %0, null\n store i64 5, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %5 = bitcast i64* %0 to i32*\n store i32 5, i32* %5, align 4\n %6 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_snprintf_14-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_snprintf_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_7, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = sext i32 %5 to i64\n %7 = sub nsw i64 100, %6\n %8 = icmp ult i64 %7, 2\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %10 = sub i32 100, %5\n %11 = ptrtoint i64* %sv_1 to i64\n %12 = add i64 %6, %11\n %13 = inttoptr i64 %12 to i8*\n %14 = call i8* @fgets(i8* %13, i32 %10, %_IO_FILE* %9)\n %15 = icmp eq i8* %14, null\n br i1 %15, label LBL_6, label LBL_3\n LBL_3:\n %16 = call i32 @strlen(i8* nonnull %1)\n %17 = icmp eq i32 %16, 0\n br i1 %17, label LBL_7, label LBL_4\n LBL_4:\n %18 = sext i32 %16 to i64\n %19 = add i64 %11, -1\n %20 = add i64 %19, %18\n %21 = inttoptr i64 %20 to i8*\n %22 = load i8, i8* %21, align 1\n %23 = icmp eq i8 %22, 10\n %24 = icmp eq i1 %23, false\n br i1 %24, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %21, align 1\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %26 = load i32, i32* @gv_2, align 4\n %27 = icmp eq i32 %26, 5\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_9, label LBL_8\n LBL_8:\n store i64 0, i64* %sv_0, align 8\n %29 = bitcast i64* %sv_0 to i8*\n %30 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %29, i32 99, i8* nonnull %1)\n %31 = ptrtoint i64* %sv_0 to i64\n %32 = call i64 @FUNC(i64 %31)\n br label LBL_9\n LBL_9:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %11, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_system_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8388 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 7955998172649846063, i64* %sv_0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 27422013814697007, i64* %6, align 8\n br label LBL_3\n LBL_3:\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 @system(i8* nonnull %7)\n %9 = icmp eq i32 %8, 0\n %10 = icmp slt i32 %8, 0\n %11 = icmp eq i1 %10, false\n %12 = icmp eq i1 %9, false\n %13 = icmp eq i1 %11, %12\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %8, { 1, 0 }\n uselistorder i64* %sv_0, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_memcpy_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_2 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 100)\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memcpy(i64* %9, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_2 to i32))\n %11 = load i64, i64* %9, align 8\n %12 = call i64 @FUNC(i64 %11)\n call void @free(i64* %9)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 200)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n %4 = call i32* @wmemset(i32* %3, i32 65, i32 49)\n %5 = ptrtoint i64* %0 to i64\n %6 = add i64 %5, 196\n %7 = inttoptr i64 %6 to i32*\n store i32 0, i32* %7, align 4\n %8 = call i32 @wcslen(i32* %3)\n %9 = add i32 %8, 1\n %10 = call i64* @calloc(i32 %9, i32 4)\n %11 = icmp eq i64* %10, null\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %13 = bitcast i64* %10 to i32*\n %14 = call i32* @wcscpy(i32* %13, i32* %3)\n %15 = ptrtoint i64* %10 to i64\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %10)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %10, { 1, 0, 3, 2 }\n uselistorder i32* %3, { 1, 0, 2 }\n uselistorder i64* %0, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__char_calloc_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_5, label LBL_1\n LBL_1:\n %2 = call i64* @calloc(i32 100, i32 1)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %5 = ptrtoint i64* %2 to i64\n store i64 7453010373643542593, i64* %2, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC(i64 %5)\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @free(i64* nonnull %2)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %2, { 0, 1, 3, 2 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* null, { 1, 2, 0 }\n uselistorder i64* (i32, i32)* @calloc, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %7 = and i64 %6, -16\n store i64 %7, i64* %sv_1, align 8\n br label LBL_3\n LBL_3:\n %8 = ptrtoint i64* %sv_2 to i64\n %9 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = add i64 %8, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = mul i64 %storemerge1.reload, 8\n %12 = load i64, i64* %sv_1, align 8\n %13 = add i64 %12, %11\n %14 = add i64 %10, %11\n %15 = inttoptr i64 %14 to i64*\n %16 = load i64, i64* %15, align 8\n %17 = inttoptr i64 %13 to i64*\n store i64 %16, i64* %17, align 8\n %18 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %18, 100\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %19 = load i64, i64* %sv_1, align 8\n %20 = inttoptr i64 %19 to i64*\n %21 = load i64, i64* %20, align 8\n %22 = call i64 @FUNC(i64 %21)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__struct_twoIntsStruct_calloc_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = call i64 @FUNC(i64 40)\n store i32* null, i32** %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i32** %sv_0 to i64\n %5 = add i64 %4, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %6 = and i64 %5, -16\n %7 = inttoptr i64 %6 to i32*\n store i32* %7, i32** %sv_0, align 8\n store i32 0, i32* %7, align 16\n %8 = load i32*, i32** %sv_0, align 8\n %9 = ptrtoint i32* %8 to i64\n %10 = add i64 %9, 4\n %11 = inttoptr i64 %10 to i32*\n store i32 0, i32* %11, align 4\n %12 = load i32*, i32** %sv_0, align 8\n %13 = ptrtoint i32* %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_2\n LBL_2:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_0, { 4, 3, 2, 0, 1 }\n uselistorder i64 (i64)* @printStructLine, { 3, 2, 1, 0 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_1 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n uselistorder i32* @gv_0, { 5, 4, 0, 3, 1, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memmove_17-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_memmove_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = add i64 %4, -8\n %phitmp.le = inttoptr i64 %8 to i64*\n %9 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* %phitmp.le, i32 100)\n %11 = call i64 @FUNC(i64* nonnull %sv_0)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i32 99, { 1, 0 }\n uselistorder i32 100, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__sizeof_double_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC()\n %1 = call i64* @malloc(i32 8)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = call i128 @FUNC(i64 9098483789791991595)\n %5 = call i64 @__asm_movsd.1(i128 %4)\n store i64 %5, i64* %1, align 8\n %6 = call i128 @FUNC(i64 %5)\n %7 = call i64 @FUNC()\n call void @free(i64* %1)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 ()* @printDoubleLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_multiply_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %.reg2mem = alloca i32\n %sv_0.1.ph.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.ph.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.ph.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.ph.reload = load i32, i32* %sv_0.1.ph.reg2mem\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i32 %sv_0.1.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_7\n LBL_7:\n %.reload = load i32, i32* %.reg2mem\n %23 = icmp eq i32 %.reload, 5\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n %24 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_13\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %25 = icmp slt i32 %sv_0.1.reload, 0\n %26 = icmp eq i1 %25, false\n br i1 %26, label LBL_13, label LBL_10\n LBL_10:\n %27 = icmp slt i32 %sv_0.1.reload, -1073741823\n br i1 %27, label LBL_12, label LBL_11\n LBL_11:\n %28 = mul i32 %sv_0.1.reload, 2\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n br label LBL_13\n LBL_12:\n %31 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_13\n LBL_13:\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 2, 0, 1 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_fscanf_sub_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = load i32, i32* %sv_0, align 4\n %9 = icmp eq i32 %8, 0\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = add i32 %8, -1\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_6\n LBL_5:\n %13 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_listen_socket_17-bad", "fun_name": "CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_listen_socket_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge9.reg2mem = alloca i64\n %sv_0.047.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.047.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to %sockaddr*\n %4 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %3, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = add i64 %15, -22\n %17 = bitcast i64* %sv_1 to i8*\n %18 = sext i32 %12 to i64\n %19 = add i64 %16, %18\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = call i32 @atoi(i8* nonnull %17)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.047.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.047.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.047.reload = load i32, i32* %sv_0.047.reg2mem\n %25 = mul i32 %sv_0.047.reload, 4\n %26 = call i64* @malloc(i32 %25)\n %27 = icmp eq i64* %26, null\n %28 = icmp eq i1 %27, false\n br i1 %28, label LBL_9, label LBL_10\n LBL_9:\n %29 = ptrtoint i64* %26 to i64\n %30 = sext i32 %sv_0.047.reload to i64\n %31 = icmp eq i32 %sv_0.047.reload, 0\n store i64 0, i64* %storemerge9.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_10:\n call void @exit(i32 -1)\n unreachable\n LBL_11:\n %storemerge9.reload = load i64, i64* %storemerge9.reg2mem\n %32 = mul i64 %storemerge9.reload, 4\n %33 = add i64 %32, %29\n %34 = inttoptr i64 %33 to i32*\n store i32 0, i32* %34, align 4\n %35 = add nuw i64 %storemerge9.reload, 1\n %36 = icmp ult i64 %35, %30\n store i64 %35, i64* %storemerge9.reg2mem\n br i1 %36, label LBL_11, label LBL_12\n LBL_12:\n %37 = bitcast i64* %26 to i32*\n %38 = load i32, i32* %37, align 4\n %39 = zext i32 %38 to i64\n %40 = call i64 @FUNC(i64 %39)\n call void @free(i64* %26)\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %26, { 0, 1, 3, 2 }\n uselistorder i32 %sv_0.047.reload, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.047.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64* %storemerge9.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 7, 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_11, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_memmove_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_1, align 8\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %.pre = inttoptr i64 %3 to i64*\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i64* @memset(i64* %.pre, i32 65, i32 49)\n %8 = add i64 %3, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n br label LBL_2\n LBL_2:\n %10 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %11 = call i32 @strlen(i8* %10)\n %12 = call i64* @memmove(i64* nonnull %sv_0, i64* %.pre, i32 %11)\n %13 = call i64 @FUNC(i64 %3)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %1, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 3, 2, 0, 4 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %spec.select = select i1 %2, i32 -1, i32 99\n %3 = call i64* @malloc(i32 %spec.select)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %6 = ptrtoint i64* %3 to i64\n %7 = add nsw i32 %spec.select, -1\n %8 = call i64* @memset(i64* %3, i32 65, i32 %7)\n %9 = sext i32 %7 to i64\n %10 = add i64 %9, %6\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = call i64 @FUNC(i64 %6)\n call void @free(i64* %3)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %6, { 1, 0 }\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n uselistorder i32 -1, { 2, 3, 1, 4, 5, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE427_Uncontrolled_Search_Path_Element__char_console_07-bad", "fun_name": "CWE427_Uncontrolled_Search_Path_Element__char_console_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i1\n %rax.0.reg2mem = alloca i64\n %1 = load i1, i1* %0\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n store i64 263206486352, i64* %sv_1, align 8\n %3 = ptrtoint i64* %sv_0 to i64\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 29)\n %5 = select i1 %1, i64 -232, i64 232\n %6 = add i64 %5, %3\n %7 = inttoptr i64 %6 to i16*\n store i16 0, i16* %7, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 5\n %11 = icmp eq i1 %10, false\n br i1 %11, label LBL_7, label LBL_1\n LBL_1:\n %12 = call i32 @strlen(i8* nonnull %8)\n %13 = sext i32 %12 to i64\n %14 = sub nsw i64 250, %13\n %15 = icmp ult i64 %14, 2\n br i1 %15, label LBL_7, label LBL_2\n LBL_2:\n %16 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %17 = sub i32 250, %12\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %13, %18\n %20 = inttoptr i64 %19 to i8*\n %21 = call i8* @fgets(i8* %20, i32 %17, %_IO_FILE* %16)\n %22 = icmp eq i8* %21, null\n br i1 %22, label LBL_6, label LBL_3\n LBL_3:\n %23 = call i32 @strlen(i8* nonnull %8)\n %24 = icmp eq i32 %23, 0\n br i1 %24, label LBL_7, label LBL_4\n LBL_4:\n %25 = sext i32 %23 to i64\n %26 = add i64 %18, -1\n %27 = add i64 %26, %25\n %28 = inttoptr i64 %27 to i8*\n %29 = load i8, i8* %28, align 1\n %30 = icmp eq i8 %29, 10\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %28, align 1\n br label LBL_7\n LBL_6:\n %32 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %20, align 1\n br label LBL_7\n LBL_7:\n %33 = call i32 @putenv(i8* nonnull %8)\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %2, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %18, { 1, 0 }\n uselistorder i8* %8, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_max_multiply_12-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_max_multiply_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %. = select i1 %2, i64 2, i64 9223372036854775807\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i64 %., 2\n %7 = call i64 @FUNC(i64 %6)\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n br i1 %2, label LBL_3, label LBL_4\n LBL_3:\n %8 = mul i64 %., 2\n %9 = call i64 @FUNC(i64 %8)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %10 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_fscanf_sub_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp eq i16 %3, -32768\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i16 %3, -1\n %6 = sext i16 %5 to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_3\n LBL_2:\n %9 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_cpy_14-bad", "fun_name": "CWE127_Buffer_Underread__char_declare_cpy_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = bitcast i8** %sv_1 to i8*\n store i8* %5, i8** %sv_1, align 8\n br label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %7 = load i8*, i8** %sv_1, align 8\n %8 = bitcast i64* %sv_0 to i8*\n %9 = call i8* @strcpy(i8* nonnull %8, i8* %7)\n %10 = call i64 @FUNC(i64* nonnull %sv_0)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memmove_14-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 11)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memmove(i64* %11, i64* nonnull %sv_1, i32 %10)\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %11)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_calloc_16-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = ptrtoint i32** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -401\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i32*\n store i32* %4, i32** %sv_0, align 8\n store i32 5, i32* %4, align 16\n %5 = load i32*, i32** %sv_0, align 8\n %6 = load i32, i32* %5, align 4\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32** %sv_0, { 2, 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_07-bad", "fun_name": "CWE369_Divide_by_Zero__int_connect_socket_modulo_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = urem i32 100, %sv_0.1.reload\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_8\n LBL_8:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %0, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_rand_square_11-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 32, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n store i32 %10, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n %14 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %15 = trunc i32 %sv_0.0.reload to i8\n %16 = sub i8 0, %15\n %17 = icmp slt i8 %16, 0\n %18 = icmp eq i1 %17, false\n %19 = zext i8 %16 to i32\n %20 = select i1 %18, i32 %19, i32 %sv_0.0.reload\n %21 = trunc i32 %20 to i8\n %22 = icmp ult i8 %21, 12\n br i1 %22, label LBL_5, label LBL_6\n LBL_5:\n %23 = urem i32 %sv_0.0.reload, 256\n %narrow = mul i32 %sv_0.0.reload, 16777216\n %sext2 = mul i32 %narrow, %23\n %24 = ashr exact i32 %sext2, 24\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n store i64 %26, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %27 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n store i64 %27, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 3, 2, 0, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_divide_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 14)\n ret i64 %0\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 11)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = sext i32 %9 to i64\n %11 = add nsw i64 %10, 1\n %12 = icmp eq i64 %11, 0\n br i1 %12, label LBL_7, label LBL_5\n LBL_5:\n %13 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_6\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %sv_0.0.reload\n %15 = add i64 %storemerge1.reload, %13\n %16 = inttoptr i64 %15 to i8*\n %17 = load i8, i8* %16, align 1\n %18 = inttoptr i64 %14 to i8*\n store i8 %17, i8* %18, align 1\n %19 = add nuw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %19, %11\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %20 = call i64 @FUNC(i64 %sv_0.0.reload)\n %21 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %21)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %sv_0.0.reload, { 1, 0, 2 }\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_memmove_13-bad", "fun_name": "CWE124_Buffer_Underwrite__char_declare_memmove_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %sv_1 to i64\n store i64 %5, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = load i64, i64* %sv_1, align 8\n %8 = inttoptr i64 %7 to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_0, i32 100)\n %10 = load i64, i64* %sv_1, align 8\n %11 = add i64 %10, 99\n %12 = inttoptr i64 %11 to i8*\n store i8 0, i8* %12, align 1\n %13 = load i64, i64* %sv_1, align 8\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_postdec_31-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = icmp eq i64 %3, -9223372036854775808\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = add i64 %3, -1\n %6 = call i64 @FUNC(i64 %5)\n br label LBL_3\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = load i32, i32* inttoptr (i64 20500 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = load i32, i32* @gv_1, align 4\n %30 = icmp eq i32 %29, 5\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %31 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_17\n LBL_11:\n %32 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %33 = icmp eq i32 %32, 1\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_17, label LBL_12\n LBL_12:\n %35 = load i64, i64* %sv_1, align 8\n %36 = trunc i64 %35 to i32\n %37 = icmp sgt i32 %36, 9999\n br i1 %37, label LBL_17, label LBL_13\n LBL_13:\n %38 = and i64 %35, 4294967295\n %39 = icmp eq i64 %38, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %39, label LBL_16, label LBL_14\n LBL_14:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %40 = add i32 %storemerge5.reload, 1\n %41 = sext i32 %40 to i64\n %42 = icmp sgt i64 %38, %41\n store i32 %40, i32* %storemerge5.reg2mem\n br i1 %42, label LBL_14, label LBL_15\n LBL_15:\n %phitmp = zext i32 %40 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_16\n LBL_16:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %43 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_17\n LBL_17:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_19, label LBL_18\n LBL_18:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_19\n LBL_19:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %40, { 1, 0, 2 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_16, { 1, 0 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__short_connect_socket_07-bad", "fun_name": "CWE197_Numeric_Truncation_Error__short_connect_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 7, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -16\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %sext = mul i32 %21, 65536\n %22 = ashr exact i32 %sext, 16\n store i32 %22, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext2 = mul i32 %sv_0.1.reload, 16777216\n %24 = ashr exact i32 %sext2, 24\n %25 = zext i32 %24 to i64\n %26 = call i64 @FUNC(i64 %25)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_struct_alloca_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge1.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %5 = mul i64 %storemerge1.reload, 8\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n store i32 1, i32* %7, align 4\n %8 = add i64 %6, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 1, i32* %9, align 4\n %10 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %10, 100\n store i64 %10, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %11 = call i64 @FUNC(i64 %1)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %1, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printStructLine, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fscanf_02-bad", "fun_name": "CWE617_Reachable_Assertion__fscanf_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %3 = load i32, i32* %sv_0, align 4\n %4 = icmp sgt i32 %3, 5\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gv_3, i64 0, i64 0), i32 36, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @gv_4, i64 0, i64 0))\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n %3 = zext i32 %0 to i64\n store i64 %3, i64* %rax.0.reg2mem\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 40)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %8 = mul i64 %indvars.iv5.reload, 4\n %9 = add i64 %8, %5\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_4, label LBL_3\n LBL_4:\n %11 = add i64 %5, 28\n %12 = inttoptr i64 %11 to i32*\n store i32 1, i32* %12, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 4\n %14 = add i64 %13, %5\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n call void @free(i64* %4)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2, 5, 4, 7, 6 }\n uselistorder void (i32)* @exit, { 2, 0, 1, 3, 4 }\n uselistorder i32 -1, { 1, 2, 0, 3, 5, 4, 6 }\n uselistorder i64* (i32)* @malloc, { 2, 0, 3, 1, 4 }\n uselistorder i32* @gv_0, { 6, 0, 5, 1, 4, 2, 3 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_connect_socket_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.04.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n store i32 %5, i32* %sv_0.04.reg2mem\n br i1 %7, label LBL_5, label LBL_1\n LBL_1:\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %10 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %11 = call i16 @htons(i16 27015)\n %12 = call i32 @connect(i32 %6, %sockaddr* nonnull %8, i32 16)\n %13 = icmp eq i32 %12, -1\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %13, label LBL_4, label LBL_2\n LBL_2:\n %14 = call i32 @recv(i32 %6, i64* nonnull %sv_1, i32 19, i32 0)\n %15 = add i32 %14, 1\n %16 = icmp ult i32 %15, 2\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = ptrtoint i64* %sv_3 to i64\n %18 = add i64 %17, -32\n %19 = bitcast i64* %sv_1 to i8*\n %20 = sext i32 %14 to i64\n %21 = add i64 %18, %20\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = call double @atof(i8* nonnull %19)\n %24 = fptrunc double %23 to float\n %25 = bitcast float %24 to i32\n %26 = sext i32 %25 to i128\n %27 = call i128 @FUNC(i128 %26)\n %28 = call i64 @FUNC(i128 %27)\n %29 = trunc i64 %28 to i32\n store i32 %29, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %30 = call i32 @close(i32 %6)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.04.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.04.reload = load i32, i32* %sv_0.04.reg2mem\n %31 = load i128, i128* @gv_1, align 8\n %32 = call i128 @__asm_movss.1(i32 %sv_0.04.reload)\n %33 = call i128 @__asm_movss.1(i32 2147483647)\n %34 = call i128 @FUNC(i128 %32, i128 %33)\n %35 = call i128 @FUNC(i128 %34)\n call void @FUNC(i128 %35, i128 %31)\n %36 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_2 to i64))\n %37 = call i64 @FUNC(i64 40)\n %38 = icmp eq i64 %2, %37\n store i64 0, i64* %rax.0.reg2mem\n br i1 %38, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %6, { 2, 0, 1, 3 }\n uselistorder i32 %5, { 2, 1, 0 }\n uselistorder i64* %sv_2, { 2, 1, 0 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.04.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_memcpy_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_0.LBL_3_crit_edge, label LBL_2\n LBL_1:\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %5 = ptrtoint i64* %sv_1 to i64\n %6 = add i64 %5, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n store i64 %5, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %8 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 %9)\n %11 = call i64 @FUNC(i64 %.pre-phi.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 4, 2, 3, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_partial_init_08-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_array_malloc_partial_init_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.1.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %xmm0.04.reg2mem = alloca i128\n %indvars.iv6.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = ptrtoint i64* %0 to i64\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %xmm0.04.reload = load i128, i128* %xmm0.04.reg2mem\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %7 = mul i64 %indvars.iv6.reload, 8\n %8 = add i64 %7, %3\n %9 = call i128 @FUNC(i128 %xmm0.04.reload, i128 %xmm0.04.reload)\n %10 = trunc i64 %indvars.iv6.reload to i32\n %11 = call i128 @FUNC(i32 %10)\n %12 = call i64 @FUNC(i128 %11)\n %13 = inttoptr i64 %8 to i64*\n store i64 %12, i64* %13, align 8\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 5\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i128 %11, i128* %xmm0.04.reg2mem\n br i1 %exitcond8, label LBL_4, label LBL_3\n LBL_4:\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n store i64 0, i64* %indvars.iv.reg2mem\n store i64 %14, i64* %rax.1.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %17 = mul i64 %indvars.iv.reload, 8\n %18 = add i64 %17, %3\n %19 = inttoptr i64 %18 to i64*\n %20 = load i64, i64* %19, align 8\n %21 = call i128 @FUNC(i64 %20)\n %22 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n store i64 %22, i64* %rax.1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %rax.1.reload = load i64, i64* %rax.1.reg2mem\n ret i64 %rax.1.reload\n\n uselistorder i128 %xmm0.04.reload, { 1, 0 }\n uselistorder i64* %0, { 1, 0 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i128* %xmm0.04.reg2mem, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n uselistorder label LBL_5, { 1, 0 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int_12-bad", "fun_name": "CWE476_NULL_Pointer_Dereference__int_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 5, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %sv_0. = select i1 %3, i32* %sv_0, i32* null\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = load i32, i32* %sv_0., align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_5\n LBL_2:\n %10 = icmp eq i32* %sv_0., null\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = load i32, i32* %sv_0., align 4\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_5\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_0 to i64))\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0., { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_12-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_struct_memcpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n store i64* %4, i64** %sv_0.0.in.reg2mem\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %8 = icmp eq i64* %7, null\n %9 = icmp eq i1 %8, false\n store i64* %7, i64** %sv_0.0.in.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n %10 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.in.reload = load i64*, i64** %sv_0.0.in.reg2mem\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_6\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = mul i64 %storemerge1.reload, 8\n %12 = add i64 %11, %10\n %13 = add i64 %12, -816\n %14 = inttoptr i64 %13 to i32*\n store i32 0, i32* %14, align 8\n %15 = add i64 %12, -812\n %16 = inttoptr i64 %15 to i32*\n store i32 0, i32* %16, align 4\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %sv_0.0 = ptrtoint i64* %sv_0.0.in.reload to i64\n %18 = call i64* @memcpy(i64* %sv_0.0.in.reload, i64* nonnull %sv_1, i32 ptrtoint (i32* @gv_0 to i32))\n %19 = call i64 @FUNC(i64 %sv_0.0)\n call void @free(i64* %sv_0.0.in.reload)\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.in.reload, { 2, 1, 0 }\n uselistorder i64** %sv_0.0.in.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i32 ptrtoint (i32* @gv_0 to i32), { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_postdec_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 4294967293)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printHexCharLine, { 3, 2, 1, 0 }\n uselistorder i64 4294967293, { 1, 0 }\n uselistorder i32* @gv_0, { 4, 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_char_07-bad", "fun_name": "CWE415_Double_Free__malloc_free_char_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n call void @free(i64* %3)\n %.pre = load i32, i32* @gv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %6 = zext i32 %.reload to i64\n %7 = icmp eq i32 %.reload, 5\n %8 = icmp eq i1 %7, false\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* null, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_postinc_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 3)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 3, { 1, 0 }\n uselistorder i32* @gv_0, { 6, 0, 5, 1, 4, 2, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__listen_socket_memcpy_31-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__listen_socket_memcpy_31_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.01013.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %sv_4 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_4 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = call i32 @socket(i32 2, i32 1, i32 6)\n %3 = icmp eq i32 %2, -1\n store i32 0, i32* %sv_0.01013.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)\n store i64 2, i64* %sv_3, align 8\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_3 to %sockaddr*\n %7 = call i32 @bind(i32 %2, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_7, label LBL_2\n LBL_2:\n %9 = call i32 @listen(i32 %2, i32 5)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @accept(i32 %2, %sockaddr* null, i32* null)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @recv(i32 %11, i64* nonnull %sv_2, i32 7, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -112\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_2 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n %.off = add i32 %21, 32768\n %22 = icmp ult i32 %.off, 65536\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %22, label LBL_6, label LBL_8\n LBL_6:\n %sext5 = mul i32 %21, 65536\n %23 = ashr exact i32 %sext5, 16\n store i32 %23, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %24 = call i32 @close(i32 %2)\n store i32 0, i32* %sv_0.01013.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %25 = call i32 @close(i32 %2)\n %26 = call i32 @close(i32 %11)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.01013.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.01013.reload = load i32, i32* %sv_0.01013.reg2mem\n %27 = trunc i32 %sv_0.01013.reload to i16\n store i64 0, i64* %sv_2, align 8\n %28 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %29 = icmp sgt i16 %27, 99\n br i1 %29, label LBL_11, label LBL_10\n LBL_10:\n %30 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.01013.reload)\n %31 = sext i32 %sv_0.01013.reload to i64\n %32 = add i64 %0, -112\n %33 = add i64 %32, %31\n %34 = inttoptr i64 %33 to i8*\n store i8 0, i8* %34, align 1\n br label LBL_11\n LBL_11:\n %35 = call i64 @FUNC(i64* nonnull %sv_2)\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %1, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.01013.reload, { 1, 2, 0 }\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %2, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_3, { 0, 2, 1 }\n uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32* %sv_0.01013.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0 }\n uselistorder label LBL_8, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memmove_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64* %4, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %11 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %12 = bitcast i64* %sv_1 to i8*\n %13 = call i32 @strlen(i8* nonnull %12)\n %14 = call i64* @memmove(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 %13)\n %15 = ptrtoint i64* %sv_1 to i64\n %16 = call i64 @FUNC(i64 %15)\n call void @free(i64* %sv_0.0.reload)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 3, 0, 1, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_multiply_08-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_multiply_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_5, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = trunc i64 %9 to i32\n %11 = icmp slt i32 %10, 1\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n %12 = mul i64 %9, 2\n %13 = and i64 %12, 4294967294\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_5\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n %spec.store.select = select i1 %3, i32* null, i32* getelementptr inbounds ([43 x i32], [43 x i32]* @gv_1, i64 0, i64 0)\n store i32* %spec.store.select, i32** %sv_0, align 8\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_2:\n %5 = ptrtoint i32** %sv_0 to i64\n %6 = call i32 @wcslen(i32* %spec.store.select)\n %7 = sext i32 %6 to i64\n %8 = mul i64 %7, 4\n %9 = add nsw i64 %8, 27\n %10 = udiv i64 %9, 16\n %11 = mul i64 %10, 16\n %12 = and i64 %11, -4096\n %13 = and i64 %11, 4080\n %14 = add i64 %5, 15\n %15 = sub i64 %14, %13\n %16 = sub i64 %15, %12\n %17 = and i64 %16, -16\n %18 = load i32*, i32** %sv_0, align 8\n %19 = inttoptr i64 %17 to i32*\n %20 = call i32* @wcscpy(i32* %19, i32* %18)\n %21 = call i64 @FUNC(i64 %17)\n br label LBL_3\n LBL_3:\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %17, { 1, 0 }\n uselistorder i64 %11, { 1, 0 }\n uselistorder i32** %sv_0, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_declare_loop_14-bad", "fun_name": "CWE124_Buffer_Underwrite__char_declare_loop_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %1 = load i64, i64* %0\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %4 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %7 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %6, i64 %1, i64 %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n store i64 0, i64* %sv_1, align 8\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %spec.select\n %11 = add i64 %storemerge1.reload, %9\n %12 = inttoptr i64 %11 to i8*\n %13 = load i8, i8* %12, align 1\n %14 = inttoptr i64 %10 to i8*\n store i8 %13, i8* %14, align 1\n %15 = load i64, i64* %sv_1, align 8\n %16 = add i64 %15, 1\n store i64 %16, i64* %sv_1, align 8\n %17 = icmp ult i64 %16, 100\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %17, label LBL_1, label LBL_2\n LBL_2:\n %18 = add i64 %spec.select, 99\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = call i64 @FUNC(i64 %spec.select)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %2, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %16, { 0, 2, 1 }\n uselistorder i64 %storemerge1.reload, { 1, 0 }\n uselistorder i64 %spec.select, { 2, 1, 0 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_memmove_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %5, align 8\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = add i32 %7, 1\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_1, i32 %8)\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memmove_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 400)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 50)\n %5 = call i64* @memmove(i64* %1, i64* nonnull %sv_0, i32 400)\n %6 = bitcast i64* %1 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_loop_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_3, label LBL_1\n LBL_1:\n %7 = ptrtoint i64* %sv_1 to i64\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %7\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge1.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = add nuw i64 %storemerge1.reload, 1\n %16 = icmp ult i64 %15, %8\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %16, label LBL_2, label LBL_3\n LBL_3:\n %17 = call i64 @FUNC(i64* nonnull %sv_0)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32 %5, { 1, 0 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 0, 3, 1, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 5, 4, 3, 2, 1, 0, 6 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_13-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 50)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %9, i32 99)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = add i64 %11, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %11)\n %15 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %15)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_square_08-bad", "fun_name": "CWE190_Integer_Overflow__int64_t_fscanf_square_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i128, align 8\n %0 = call i64 @FUNC(i64 40)\n store i128 0, i128* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i128* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 0)\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_calloc_04-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @calloc(i32 20, i32 1)\n %1 = icmp eq i64* %0, null\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %3 = add i64 %2, 8\n %4 = inttoptr i64 %3 to i16*\n store i16 25978, i16* %4, align 2\n %5 = add i64 %2, 10\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n %7 = call i64 @FUNC(i64 %2)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %2, { 0, 2, 1 }\n uselistorder i64* %0, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_calloc_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)))\n %3 = and i64 %2, -16\n store i64 %3, i64* %sv_0, align 8\n %4 = inttoptr i64 %3 to i64*\n store i64 5, i64* %4, align 16\n %5 = load i64, i64* %sv_0, align 8\n %6 = inttoptr i64 %5 to i64*\n %7 = load i64, i64* %6, align 8\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i64 5, { 2, 3, 0, 4, 1, 5 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_listen_socket_system_13-bad", "fun_name": "CWE78_OS_Command_Injection__char_listen_socket_system_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* inttoptr (i64 8364 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = call i32 @system(i8* nonnull %1)\n %36 = icmp eq i32 %35, 0\n br i1 %36, label LBL_14, label LBL_13\n LBL_13:\n %37 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_14:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_connect_socket_modulo_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 2)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32* @gv_0, { 4, 3, 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_short_32-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_short_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.058.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.058.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.058.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.058.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.058.reload = load i32, i32* %sv_0.058.reg2mem\n %sext = mul i32 %sv_0.058.reload, 65536\n %25 = ashr exact i32 %sext, 16\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.058.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_add_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_4:\n %9 = load i16, i16* %sv_0, align 2\n %10 = icmp eq i16 %9, 32767\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = add i16 %9, 1\n %12 = sext i16 %11 to i64\n %13 = and i64 %12, 4294967295\n %14 = call i64 @FUNC(i64 %13)\n br label LBL_7\n LBL_6:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_7:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 11)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %7 = bitcast i64* %sv_1 to i8*\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = add i32 %8, 1\n %10 = inttoptr i64 %sv_0.0.reload to i64*\n %11 = call i64* @memcpy(i64* %10, i64* nonnull %sv_1, i32 %9)\n %12 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %10)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_multiply_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64 @FUNC(i64 4)\n ret i64 %0\n\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_add_12-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_rand_add_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 2, i32* %storemerge1.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n store i32 %storemerge.in, i32* %storemerge1.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge1.reload = load i32, i32* %storemerge1.reg2mem\n %14 = call i64 @FUNC()\n %15 = trunc i64 %14 to i32\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_4, label LBL_3\n LBL_3:\n %17 = add i32 %storemerge1.reload, 1\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %20 = icmp eq i32 %storemerge1.reload, -1\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n %21 = add i32 %storemerge1.reload, 1\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %24, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i32* %storemerge1.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printUnsignedLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__short_rand_postdec_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = call i32 @rand()\n %5 = mul i32 %4, 32768\n %6 = call i32 @rand()\n %7 = xor i32 %6, %5\n %8 = sext i1 %2 to i32\n %storemerge2.in = xor i32 %7, %8\n %9 = trunc i32 %storemerge2.in to i16\n %10 = icmp eq i16 %9, -32768\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n %sext3 = mul i32 %storemerge2.in, 65536\n %sext = add i32 %sext3, -65536\n %11 = ashr exact i32 %sext, 16\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %14, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_max_add_08-bad", "fun_name": "CWE190_Integer_Overflow__int_max_add_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n %spec.select = select i1 %5, i64 1, i64 2147483648\n %6 = call i64 @FUNC(i64 %spec.select)\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_min_sub_12-bad", "fun_name": "CWE191_Integer_Underflow__char_min_sub_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n %. = select i1 %2, i32 -2, i32 -128\n %3 = call i64 @FUNC()\n %4 = trunc i64 %3 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_2, label LBL_1\n LBL_1:\n %6 = mul i32 %., 16777216\n %sext = add i32 %6, -16777216\n %7 = ashr exact i32 %sext, 24\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_2:\n br i1 %2, label LBL_3, label LBL_4\n LBL_3:\n %10 = mul i32 %., 16777216\n %sext2 = add i32 %10, -16777216\n %11 = ashr exact i32 %sext2, 24\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n store i64 %13, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_ncpy_12-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_ncpy_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.in.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 100)\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %7, -8\n store i64 %11, i64* %.in.reg2mem\n br label LBL_7\n LBL_4:\n %12 = bitcast i64* %4 to i8*\n store i8* %12, i8** %sv_1, align 8\n %13 = icmp eq i64* %4, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %15 = call i64* @memset(i64* %4, i32 65, i32 99)\n %16 = ptrtoint i64* %4 to i64\n %17 = add i64 %16, 99\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = load i8*, i8** %sv_1, align 8\n %20 = ptrtoint i8* %19 to i64\n store i64 %20, i64* %.in.reg2mem\n br label LBL_7\n LBL_7:\n %.in.reload = load i64, i64* %.in.reg2mem\n %21 = inttoptr i64 %.in.reload to i8*\n %22 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %23 = bitcast i64* %sv_0 to i8*\n %24 = call i32 @strlen(i8* nonnull %23)\n %25 = call i8* @strncpy(i8* nonnull %23, i8* %21, i32 %24)\n %26 = call i64 @FUNC(i64* nonnull %sv_0)\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 5, 6, 1, 3, 4 }\n uselistorder i64* %.in.reg2mem, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 1, 0, 3 }\n uselistorder i32 99, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_postinc_08-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_postinc_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i32, i32* %sv_0, align 4\n %10 = add i32 %9, 1\n store i32 %10, i32* %sv_0, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n br label LBL_4\n LBL_4:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 1, 3, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__listen_socket_for_loop_11-bad", "fun_name": "CWE400_Resource_Exhaustion__listen_socket_for_loop_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_12, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = sext i32 %sv_0.1.reload to i64\n %32 = icmp eq i32 %sv_0.1.reload, 0\n store i64 0, i64* %storemerge7.reg2mem\n br i1 %32, label LBL_12, label LBL_11\n LBL_11:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %33 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_0 to i64))\n %34 = add nuw i64 %storemerge7.reload, 1\n %35 = icmp ult i64 %34, %31\n store i64 %34, i64* %storemerge7.reg2mem\n br i1 %35, label LBL_11, label LBL_12\n LBL_12:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 1, 0 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i64* %storemerge7.reg2mem, { 2, 0, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i64 ()* @globalReturnsTrue, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_rand_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = call i128 @__asm_movss.1(i32 1073741824)\n %6 = call i64 @FUNC(i128 %5)\n %7 = trunc i64 %6 to i32\n %8 = call i128 @FUNC(i128 %1, i128 %1)\n %9 = call i128 @__asm_cvtss2sd.2(i32 %7)\n %10 = call i128 @FUNC(i64 4636737291354636288)\n %11 = call i128 @FUNC(i128 %10, i128 %9)\n %12 = call i32 @FUNC(i128 %11)\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n ret i64 %14\n\n uselistorder i128 %2, { 1, 0 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i32 1073741824, { 2, 3, 0, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE688_Function_Call_With_Incorrect_Variable_or_Reference_as_Argument__basic_12-bad", "fun_name": "CWE688_Function_Call_With_Incorrect_Variable_or_Reference_as_Argument__basic_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = bitcast i64* %sv_0 to i8*\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i8* inttoptr (i64 5 to i8*))\n %6 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_3\n LBL_2:\n %7 = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64 5)\n %8 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_3\n LBL_3:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8*, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n %spec.store.select = select i1 %2, i8* null, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @gv_1, i64 0, i64 0)\n store i8* %spec.store.select, i8** %sv_0, align 8\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = ptrtoint i8** %sv_0 to i64\n %4 = call i32 @strlen(i8* %spec.store.select)\n %5 = sext i32 %4 to i64\n %6 = add nsw i64 %5, 24\n %7 = udiv i64 %6, 16\n %8 = mul i64 %7, 16\n %9 = and i64 %8, -4096\n %10 = and i64 %8, 4080\n %11 = add i64 %3, 15\n %12 = sub i64 %11, %10\n %13 = sub i64 %12, %9\n %14 = and i64 %13, -16\n %15 = load i8*, i8** %sv_0, align 8\n %16 = inttoptr i64 %14 to i8*\n %17 = call i8* @strcpy(i8* %16, i8* %15)\n %18 = call i64 @FUNC(i64 %14)\n br label LBL_2\n LBL_2:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %14, { 1, 0 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8** %sv_0, { 2, 0, 1 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64 16, { 0, 4, 1, 5, 2, 6, 3, 7 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_square_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 4)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__long_realloc_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 8)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = icmp eq i64* %0, null\n %or.cond = or i1 %4, %3\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %5 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n uselistorder i64* null, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE194_Unexpected_Sign_Extension__fgets_strncpy_05-bad", "fun_name": "CWE194_Unexpected_Sign_Extension__fgets_strncpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_2, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_2 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 8, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n %sext = mul i32 %7, 65536\n %8 = ashr exact i32 %sext, 16\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n store i64 0, i64* %sv_2, align 8\n %10 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %11 = trunc i32 %sv_0.0.reload to i16\n %12 = icmp sgt i16 %11, 99\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = bitcast i64* %sv_2 to i8*\n %15 = bitcast i64* %sv_1 to i8*\n %16 = call i8* @strncpy(i8* nonnull %14, i8* nonnull %15, i32 %sv_0.0.reload)\n %17 = sext i32 %sv_0.0.reload to i64\n %18 = add i64 %13, -112\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n br label LBL_6\n LBL_6:\n %21 = ptrtoint i64* %sv_2 to i64\n %22 = call i64 @FUNC(i64 %21)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.reload, { 1, 2, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1, 4 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i8 0, { 1, 2, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_3 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %4, label LBL_6, label LBL_1\n LBL_1:\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %6, label LBL_6, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %12, label LBL_5, label LBL_3\n LBL_3:\n %13 = call i32 @recv(i32 %5, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n %16 = sext i32 %13 to i64\n %17 = add i64 %0, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %5)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_1, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_11, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n store i64 0, i64* %sv_2, align 8\n %26 = icmp slt i32 %sv_0.1.reload, 0\n br i1 %26, label LBL_10, label LBL_8\n LBL_8:\n %27 = sext i32 %sv_0.1.reload to i64\n %28 = mul i64 %27, 4\n %29 = add i64 %0, -64\n %30 = add i64 %28, %29\n %31 = inttoptr i64 %30 to i32*\n store i32 1, i32* %31, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_9\n LBL_9:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %32 = mul i64 %indvars.iv.reload, 4\n %33 = add i64 %32, %29\n %34 = inttoptr i64 %33 to i32*\n %35 = load i32, i32* %34, align 4\n %36 = zext i32 %35 to i64\n %37 = call i64 @FUNC(i64 %36)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_11, label LBL_9\n LBL_10:\n %38 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_2 to i64))\n br label LBL_11\n LBL_11:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %1, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32 %5, { 2, 0, 1, 3 }\n uselistorder i64 %0, { 1, 0 }\n uselistorder i64* %sv_2, { 2, 0, 3, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 -1, { 3, 2, 4, 0, 5, 1 }\n uselistorder label LBL_11, { 1, 0, 2 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_struct_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n store i64 1, i64* %sv_0, align 8\n %8 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_4\n LBL_4:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 0, 2, 1, 3 }\n uselistorder i64 (i64*)* @printStructLine, { 5, 4, 3, 2, 1, 0 }\n uselistorder i64 ()* @globalReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %2 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %3 = call i64* @memmove(i64* nonnull %sv_0, i64* nonnull %sv_1, i32 100)\n %4 = call i64 @FUNC(i64* nonnull %sv_0)\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 0, 2, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_int_alloca_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 400)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %8 = mul i64 %storemerge1.reload, 4\n %9 = add i64 %8, %4\n %10 = inttoptr i64 %9 to i32*\n store i32 5, i32* %10, align 4\n %11 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %11, 100\n store i64 %11, i64* %storemerge1.reg2mem\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %12 = inttoptr i64 %sv_0.0.reload to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %16)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memmove_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 400)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %8 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 50)\n %9 = inttoptr i64 %sv_0.0.reload to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_1, i32 400)\n %11 = inttoptr i64 %sv_0.0.reload to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n call void @free(i64* %9)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 400, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_char_08-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_listen_socket_to_char_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %sext = mul i32 %sv_0.1.reload, 16777216\n %28 = ashr exact i32 %sext, 24\n %29 = zext i32 %28 to i64\n %30 = call i64 @FUNC(i64 %29)\n %31 = call i64 @FUNC(i64 40)\n %32 = icmp eq i64 %0, %31\n store i64 0, i64* %rax.0.reg2mem\n br i1 %32, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = call i64 @FUNC()\n %6 = call i64* @memset(i64* %1, i32 65, i32 49)\n %7 = ptrtoint i64* %1 to i64\n %8 = add i64 %7, 49\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64 0, i64* %sv_0, align 8\n %10 = call i32 @strlen(i8* %4)\n %11 = call i64* @memmove(i64* nonnull %sv_0, i64* %1, i32 %10)\n %12 = call i64 @FUNC(i64 %7)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 2, 3, 5, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_multiply_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = call i64 @FUNC(i64 4)\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 4, 3, 5, 7, 6, 8 }\n uselistorder i32* @gv_0, { 6, 0, 5, 4, 3, 1, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_postinc_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_8, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = icmp eq i32 %sv_0.0.ph.reload, 2147483647\n br i1 %10, label LBL_7, label LBL_6\n LBL_6:\n %11 = add i32 %sv_0.0.ph.reload, 1\n %12 = zext i32 %11 to i64\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_8\n LBL_7:\n %14 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_3 to i64))\n br label LBL_8\n LBL_8:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_8, { 1, 2, 3, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_10-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_1 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i32 @atoi(i8* nonnull %4)\n store i32 %7, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br label LBL_4\n LBL_4:\n %.pr = load i32, i32* @gv_0, align 4\n %9 = icmp eq i32 %.pr, 0\n br i1 %9, label LBL_9, label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %10 = icmp slt i32 %sv_0.0.ph.reload, 0\n br i1 %10, label LBL_8, label LBL_6\n LBL_6:\n %11 = ptrtoint i64* %sv_2 to i64\n %12 = sext i32 %sv_0.0.ph.reload to i64\n %13 = mul i64 %12, 4\n %14 = add i64 %11, -64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i32*\n store i32 1, i32* %16, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %17 = mul i64 %indvars.iv.reload, 4\n %18 = add i64 %17, %14\n %19 = inttoptr i64 %18 to i32*\n %20 = load i32, i32* %19, align 4\n %21 = zext i32 %20 to i64\n %22 = call i64 @FUNC(i64 %21)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %23 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_3 to i64))\n br label LBL_9\n LBL_9:\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0.ph.reload, { 1, 0 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 0, 3, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_connect_socket_square_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0810.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.0810.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.0810.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %sv_0.0.off = add i32 %19, 46339\n %21 = icmp ugt i32 %sv_0.0.off, 92678\n store i32 %19, i32* %sv_0.0810.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0810.reload = load i32, i32* %sv_0.0810.reg2mem\n %22 = mul i32 %sv_0.0810.reload, %sv_0.0810.reload\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.0810.reload, { 1, 0 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0810.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_sub_08-bad", "fun_name": "CWE191_Integer_Underflow__int64_t_fscanf_sub_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = load i64, i64* %sv_0, align 8\n %10 = add i64 %9, -1\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE681_Incorrect_Conversion_Between_Numeric_Types__doubleNaN2int_14-bad", "fun_name": "CWE681_Incorrect_Conversion_Between_Numeric_Types__doubleNaN2int_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call i128 @FUNC(i128 %1, i128 %1)\n %7 = call i64 @FUNC(i128 %6)\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @fgets(i8* nonnull %9, i32 256, %_IO_FILE* %8)\n %11 = icmp eq i8* %10, null\n br i1 %11, label LBL_3, label LBL_2\n LBL_2:\n %12 = call double @atof(i8* nonnull %9)\n %13 = fptrunc double %12 to float\n %14 = bitcast float %13 to i32\n %15 = sext i32 %14 to i128\n %16 = call i64 @FUNC(i128 %15)\n store i64 %16, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %17 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %18 = call i128 @__asm_movq.1(i64 %sv_0.0.reload)\n %19 = trunc i128 %18 to i64\n %20 = bitcast i64 %19 to double\n %21 = call double @sqrt(double %20)\n %22 = fptrunc double %21 to float\n %23 = bitcast float %22 to i32\n %24 = sext i32 %23 to i128\n %25 = call i32 @FUNC(i128 %24)\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n br label LBL_5\n LBL_5:\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %2, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fgets_06-bad", "fun_name": "CWE617_Reachable_Assertion__fgets_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = bitcast i64* %sv_0 to i8*\n %3 = call i8* @fgets(i8* nonnull %2, i32 14, %_IO_FILE* %1)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %2)\n %phitmp = icmp sgt i32 %5, 5\n br i1 %phitmp, label LBL_4, label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_3:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([127 x i8], [127 x i8]* @gv_3, i64 0, i64 0), i32 53, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @gv_4, i64 0, i64 0))\n br label LBL_4\n LBL_4:\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_fgets_to_short_17-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_fgets_to_short_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_1, align 8\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i8* @fgets(i8* nonnull %1, i32 14, %_IO_FILE* %2)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = call i32 @atoi(i8* nonnull %1)\n %phitmp = mul i32 %5, 65536\n %phitmp3 = ashr exact i32 %phitmp, 16\n %phitmp4 = zext i32 %phitmp3 to i64\n store i64 %phitmp4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_2:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %7 = call i64 @FUNC(i64 %sv_0.0.reload)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_realloc_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %1, label LBL_4, label LBL_1\n LBL_1:\n %2 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_1 to i32))\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %2, align 8\n %5 = call i64 @FUNC(i64 5)\n store i64* %2, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 0\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n store i64 %8, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_add_15-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = urem i32 %0, 2\n %2 = icmp eq i32 %1, 0\n %3 = call i32 @rand()\n %4 = mul i32 %3, 1073741824\n %5 = call i32 @rand()\n %6 = mul i32 %5, 32768\n %7 = xor i32 %6, %4\n %8 = call i32 @rand()\n %9 = xor i32 %7, %8\n %10 = sext i1 %2 to i32\n %storemerge1.in = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge1.in, -1\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = add i32 %storemerge1.in, 1\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %15, i64* %storemerge.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i32 %storemerge1.in, { 1, 0 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fgets_08-bad", "fun_name": "CWE617_Reachable_Assertion__fgets_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n %phitmp = icmp sgt i32 %8, 5\n br i1 %phitmp, label LBL_5, label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_4\n LBL_4:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([127 x i8], [127 x i8]* @gv_3, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @gv_4, i64 0, i64 0))\n br label LBL_5\n LBL_5:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_4, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_11-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 11)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memcpy(i64* %11, i64* nonnull %sv_1, i32 %10)\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %11)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i32 66)\n %1 = call i32 @close(i32 %0)\n %2 = sext i32 %1 to i64\n ret i64 %2\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_memmove_13-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_declare_memmove_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %4 = icmp eq i32 %3, 5\n %5 = icmp eq i1 %4, false\n %6 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %5, i64 %1, i64 %6\n %7 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %7, i64 0, i64 100)\n %8 = inttoptr i64 %spec.select to i64*\n %9 = call i64* @memmove(i64* %8, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_0 to i32))\n %10 = load i64, i64* %8, align 8\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %2, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n %spec.select = select i1 %1, i32 -1, i32 99\n %2 = call i64* @malloc(i32 %spec.select)\n %3 = icmp eq i64* %2, null\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %5 = ptrtoint i64* %2 to i64\n %6 = add nsw i32 %spec.select, -1\n %7 = call i64* @memset(i64* %2, i32 65, i32 %6)\n %8 = sext i32 %6 to i64\n %9 = add i64 %8, %5\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %5)\n call void @free(i64* %2)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64 %5, { 1, 0 }\n uselistorder i64* %2, { 0, 1, 3, 2 }\n uselistorder i32 %spec.select, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n uselistorder i32 -1, { 2, 3, 1, 4, 5, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_fscanf_multiply_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n %3 = load i64, i64* %sv_0, align 8\n %4 = icmp slt i64 %3, 1\n br i1 %4, label LBL_4, label LBL_1\n LBL_1:\n %5 = icmp sgt i64 %3, 4611686018427387902\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = mul i64 %3, 2\n %7 = call i64 @FUNC(i64 %6)\n br label LBL_4\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_4\n LBL_4:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder label LBL_4, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__connect_socket_13-bad", "fun_name": "CWE617_Reachable_Assertion__connect_socket_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8608 to i32*), align 32\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_1 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_0, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n br i1 %14, label LBL_4, label LBL_5\n LBL_4:\n %15 = call i32 @close(i32 %4)\n br label LBL_6\n LBL_5:\n %16 = ptrtoint i64* %sv_2 to i64\n %17 = sext i32 %12 to i64\n %18 = add i64 %16, -22\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n store i8 0, i8* %20, align 1\n %21 = bitcast i64* %sv_0 to i8*\n %22 = call i32 @atoi(i8* nonnull %21)\n %23 = call i32 @close(i32 %4)\n %24 = icmp sgt i32 %22, 5\n br i1 %24, label LBL_7, label LBL_6\n LBL_6:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @gv_2, i64 0, i64 0), i32 112, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @gv_3, i64 0, i64 0))\n br label LBL_7\n LBL_7:\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 5, { 1, 0 }\n uselistorder label LBL_6, { 3, 2, 0, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fputs_05-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_fputs_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %3 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_2, i64 0, i64 0), %_IO_FILE* %2)\n %4 = sext i32 %3 to i64\n %5 = icmp eq i32 %3, 0\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_3 to i64))\n store i64 %7, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_char_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = call i64 @FUNC()\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, 0\n store i64 %8, i64* %rax.0.reg2mem\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %11)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_ncpy_31-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 11)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = ptrtoint i64* %1 to i64\n store i64 4702111234474983745, i64* %sv_0, align 8\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i32 @strlen(i8* nonnull %6)\n %8 = add i32 %7, 1\n %9 = call i8* @strncpy(i8* %4, i8* nonnull %6, i32 %8)\n %10 = call i64 @FUNC(i64 %5)\n call void @free(i64* %1)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 0, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* %4, i8* nonnull %6, i32 99)\n %8 = ptrtoint i64* %1 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %4, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_predec_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n br i1 %30, label LBL_13, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = icmp eq i32 %sv_0.1.reload, -2147483648\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n %32 = add i32 %sv_0.1.reload, -1\n %33 = zext i32 %32 to i64\n %34 = call i64 @FUNC(i64 %33)\n br label LBL_13\n LBL_12:\n %35 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_13\n LBL_13:\n %36 = call i64 @FUNC(i64 40)\n %37 = icmp eq i64 %0, %36\n store i64 0, i64* %rax.0.reg2mem\n br i1 %37, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_05-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 10)\n %4 = bitcast i64* %3 to i8*\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i8* %4, i8** %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %7 = bitcast i64* %sv_1 to i8*\n %8 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %7)\n %9 = ptrtoint i8* %sv_0.0.reload to i64\n %10 = call i64 @FUNC(i64 %9)\n %11 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %11)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_07-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 10)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 4702111234474983745, i64* %sv_1, align 8\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i32 @strlen(i8* nonnull %8)\n %10 = add i32 %9, 1\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = call i64* @memcpy(i64* %11, i64* nonnull %sv_1, i32 %10)\n %13 = call i64 @FUNC(i64 %sv_0.0.reload)\n call void @free(i64* %11)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_loop_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 99)\n %6 = add i64 %4, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = sext i32 %10 to i64\n %12 = icmp eq i32 %10, 0\n %.pre = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %13 = add i64 %storemerge1.reload, %4\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge1.reload, %.pre\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw i64 %storemerge1.reload, 1\n %19 = icmp ult i64 %18, %11\n store i64 %18, i64* %storemerge1.reg2mem\n br i1 %19, label LBL_3, label LBL_4\n LBL_4:\n %20 = call i64 @FUNC(i64 %.pre)\n call void @free(i64* %1)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %.pre, { 1, 0 }\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder i64* %storemerge1.reg2mem, { 2, 0, 1 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 2, 3, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE135_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i8*\n %sv_0 = alloca i8*, align 8\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i8* null, i8** %.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 50)\n %5 = bitcast i64* %4 to i8*\n store i8* %5, i8** %sv_0, align 8\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = call i64* @memset(i64* %4, i32 65, i32 49)\n %9 = ptrtoint i64* %4 to i64\n %10 = add i64 %9, 49\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = load i8*, i8** %sv_0, align 8\n store i8* %12, i8** %.reg2mem\n br label LBL_5\n LBL_5:\n %13 = call i64 @FUNC()\n %14 = trunc i64 %13 to i32\n %15 = icmp eq i32 %14, 0\n store i64 %13, i64* %rax.0.reg2mem\n br i1 %15, label LBL_9, label LBL_6\n LBL_6:\n %.reload = load i8*, i8** %.reg2mem\n %16 = call i32 @strlen(i8* %.reload)\n %17 = add i32 %16, 1\n %18 = call i64* @calloc(i32 %17, i32 1)\n %19 = icmp eq i64* %18, null\n %20 = icmp eq i1 %19, false\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %21 = bitcast i64* %18 to i8*\n %22 = call i8* @strcpy(i8* %21, i8* %.reload)\n %23 = ptrtoint i64* %18 to i64\n %24 = call i64 @FUNC(i64 %23)\n call void @free(i64* %18)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %18, { 1, 0, 3, 2 }\n uselistorder i8** %.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_no_init_01-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %indvars.iv5.reg2mem\n br label LBL_1\n LBL_1:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %2 = mul i64 %indvars.iv5.reload, 4\n %3 = add i64 %2, %1\n %4 = inttoptr i64 %3 to i32*\n %5 = trunc i64 %indvars.iv5.reload to i32\n store i32 %5, i32* %4, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_2, label LBL_1\n LBL_2:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %6 = mul i64 %indvars.iv.reload, 4\n %7 = add i64 %6, %1\n %8 = inttoptr i64 %7 to i32*\n %9 = load i32, i32* %8, align 4\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv5.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE843_Type_Confusion__char_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n unreachable\n LBL_2:\n %4 = call i64 @FUNC(i64 8)\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_snprintf_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = add i64 %1, 49\n %3 = inttoptr i64 %2 to i8*\n %4 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n store i8 0, i8* %3, align 1\n %5 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_0, align 8\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %7, i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %9 = call i64 @FUNC(i64 %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 3, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__empty_block_08-bad", "fun_name": "CWE398_Poor_Code_Quality__empty_block_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 %0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_14-bad", "fun_name": "CWE606_Unchecked_Loop_Condition__char_connect_socket_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = load i32, i32* @gv_1, align 4\n %30 = icmp eq i32 %29, 5\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_15, label LBL_10\n LBL_10:\n %32 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %33 = icmp eq i32 %32, 1\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_15, label LBL_11\n LBL_11:\n %35 = load i64, i64* %sv_1, align 8\n %36 = and i64 %35, 4294967295\n %37 = icmp eq i64 %36, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %37, label LBL_14, label LBL_12\n LBL_12:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %38 = add i32 %storemerge5.reload, 1\n %39 = sext i32 %38 to i64\n %40 = icmp sgt i64 %36, %39\n store i32 %38, i32* %storemerge5.reg2mem\n br i1 %40, label LBL_12, label LBL_13\n LBL_13:\n %phitmp = zext i32 %38 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_14\n LBL_14:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %41 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_15\n LBL_15:\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %38, { 1, 0, 2 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 -1, { 1, 0 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__fopen_08-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %4 = call i32 @fclose(%_IO_FILE* %3)\n br label LBL_2\n LBL_2:\n %5 = call i64 @FUNC()\n %6 = trunc i64 %5 to i32\n %7 = icmp eq i32 %6, 0\n store i64 %5, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_multiply_01-bad", "fun_name": "CWE190_Integer_Overflow__short_fscanf_multiply_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %2 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i16* nonnull %sv_0)\n %3 = load i16, i16* %sv_0, align 2\n %4 = icmp slt i16 %3, 1\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = mul i16 %3, 2\n %6 = sext i16 %5 to i64\n %7 = and i64 %6, 4294967294\n %8 = call i64 @FUNC(i64 %7)\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16* %sv_0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_multiply_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %2, label LBL_1, label LBL_2\n LBL_1:\n %3 = call i64 @FUNC(i64 4)\n store i64 %3, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 4, 3, 5, 7, 6, 8 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_rand_sub_13-bad", "fun_name": "CWE191_Integer_Underflow__int_rand_sub_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8336 to i32*), align 16\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i64 4294967295, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = mul i32 %6, 1073741824\n %8 = call i32 @rand()\n %9 = mul i32 %8, 32768\n %10 = xor i32 %9, %7\n %11 = call i32 @rand()\n %12 = xor i32 %10, %11\n %13 = sext i1 %5 to i32\n %storemerge.in = xor i32 %12, %13\n %phitmp = add i32 %storemerge.in, -1\n %phitmp1 = zext i32 %phitmp to i64\n store i64 %phitmp1, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %14 = call i64 @FUNC(i64 %sv_0.0.reload)\n ret i64 %14\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_10-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n %3 = ptrtoint i64* %sv_1 to i64\n %4 = add i64 %3, -17\n %5 = and i64 %4, -16\n %sv_2.0 = select i1 %2, i64 0, i64 %5\n store i64 0, i64* %sv_0, align 8\n %6 = inttoptr i64 %sv_2.0 to i64*\n %7 = call i64* @memcpy(i64* %6, i64* nonnull %sv_0, i32 40)\n %8 = inttoptr i64 %sv_2.0 to i32*\n %9 = load i32, i32* %8, align 16\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_07-bad", "fun_name": "CWE369_Divide_by_Zero__int_listen_socket_modulo_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 -1, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %28 = load i32, i32* @gv_0, align 4\n %29 = icmp eq i32 %28, 5\n %30 = icmp eq i1 %29, false\n br i1 %30, label LBL_11, label LBL_10\n LBL_10:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %31 = urem i32 100, %sv_0.1.reload\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64 40)\n %35 = icmp eq i64 %0, %34\n store i64 0, i64* %rax.0.reg2mem\n br i1 %35, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 3, 4, 5, 6, 0, 7, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_08-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = trunc i64 %0 to i32\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_5, label LBL_2\n LBL_2:\n %spec.select = select i1 %5, i32 0, i32 20\n %6 = call i64* @malloc(i32 %spec.select)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %9 = ptrtoint i64* %6 to i64\n %10 = bitcast i64* %6 to i32*\n store i32 1819043176, i32* %10, align 4\n %11 = add i64 %9, 4\n %12 = inttoptr i64 %11 to i16*\n store i16 111, i16* %12, align 2\n %13 = call i64 @FUNC(i64 %9)\n call void @free(i64* %6)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_5:\n %14 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %6, { 0, 1, 3, 2 }\n uselistorder i1 %5, { 1, 0 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder void (i64*)* @free, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 3, 2, 1, 0, 4 }\n uselistorder i32 -1, { 0, 1, 4, 2, 3, 7, 5, 6 }\n uselistorder i64* (i32)* @malloc, { 3, 2, 1, 0, 4 }\n uselistorder i32 20, { 1, 0 }\n uselistorder i64 ()* @staticReturnsTrue, { 5, 4, 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_listen_socket_modulo_32-bad", "fun_name": "CWE369_Divide_by_Zero__int_listen_socket_modulo_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.058.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 -1, i32* %sv_0.058.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 -1, i32* %sv_0.058.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.058.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.058.reload = load i32, i32* %sv_0.058.reg2mem\n %25 = urem i32 100, %sv_0.058.reload\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n %28 = call i64 @FUNC(i64 40)\n %29 = icmp eq i64 %0, %28\n store i64 0, i64* %rax.0.reg2mem\n br i1 %29, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.058.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 -1, { 1, 2, 3, 4, 5, 0, 6 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__CWE839_listen_socket_06-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %12, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n br label LBL_11\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i64 0, i64* %sv_2, align 8\n %25 = icmp ugt i32 %sv_0.0.ph.reload, 9\n br i1 %25, label LBL_11, label LBL_9\n LBL_9:\n %26 = sext i32 %sv_0.0.ph.reload to i64\n %27 = mul i64 %26, 4\n %28 = add i64 %12, -64\n %29 = add i64 %27, %28\n %30 = inttoptr i64 %29 to i32*\n store i32 1, i32* %30, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_10\n LBL_10:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %31 = mul i64 %indvars.iv.reload, 4\n %32 = add i64 %31, %28\n %33 = inttoptr i64 %32 to i32*\n %34 = load i32, i32* %33, align 4\n %35 = zext i32 %34 to i64\n %36 = call i64 @FUNC(i64 %35)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_12, label LBL_10\n LBL_11:\n %37 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_12\n LBL_12:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 3, 0, 1, 4, 2 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 2, 3, 4, 5, 1, 6, 7, 8, 9 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_12, { 1, 0 }\n uselistorder label LBL_11, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_04-bad", "fun_name": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_listen_socket_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.08.reg2mem = alloca i8*\n %sv_0.09.reg2mem = alloca i8*\n %.reg2mem = alloca i8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_13, label LBL_3\n LBL_3:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_11, label LBL_4\n LBL_4:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_11, label LBL_5\n LBL_5:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_11, label LBL_6\n LBL_6:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %1 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_12, label LBL_7\n LBL_7:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %4, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %28, align 1\n br label LBL_9\n LBL_9:\n %30 = call i8* @strchr(i8* nonnull %4, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_12, label LBL_10\n LBL_10:\n store i8 0, i8* %30, align 1\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %6)\n br label LBL_13\n LBL_12:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_13\n LBL_13:\n %35 = load i8, i8* %4, align 1\n %36 = icmp eq i8 %35, 0\n %37 = icmp eq i1 %36, false\n store i8 %35, i8* %.reg2mem\n store i8* %4, i8** %sv_0.09.reg2mem\n store i8* %4, i8** %sv_0.08.reg2mem\n br i1 %37, label LBL_14, label LBL_17\n LBL_14:\n %sv_0.09.reload = load i8*, i8** %sv_0.09.reg2mem\n %.reload = load i8, i8* %.reg2mem\n %38 = icmp eq i8 %.reload, 83\n %39 = icmp eq i1 %38, false\n br i1 %39, label LBL_16, label LBL_15\n LBL_15:\n %40 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_0 to i64))\n store i8* %sv_0.09.reload, i8** %sv_0.08.reg2mem\n br label LBL_17\n LBL_16:\n %41 = ptrtoint i8* %sv_0.09.reload to i64\n %42 = add i64 %41, 1\n %43 = inttoptr i64 %42 to i8*\n %44 = load i8, i8* %43, align 1\n %45 = icmp eq i8 %44, 0\n %46 = icmp eq i1 %45, false\n store i8 %44, i8* %.reg2mem\n store i8* %43, i8** %sv_0.09.reg2mem\n store i8* %43, i8** %sv_0.08.reg2mem\n br i1 %46, label LBL_14, label LBL_17\n LBL_17:\n %sv_0.08.reload = load i8*, i8** %sv_0.08.reg2mem\n %47 = bitcast i8* %sv_0.08.reload to i64*\n call void @free(i64* %47)\n %48 = call i64 @FUNC(i64 40)\n %49 = icmp eq i64 %0, %48\n store i64 0, i64* %rax.0.reg2mem\n br i1 %49, label LBL_19, label LBL_18\n LBL_18:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_19\n LBL_19:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.09.reload, { 1, 0 }\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %4, { 0, 1, 2, 3, 4, 6, 5 }\n uselistorder i64* %1, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i8* %.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.09.reg2mem, { 2, 0, 1 }\n uselistorder i8** %sv_0.08.reg2mem, { 0, 1, 3, 2 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i8 0, { 1, 0, 2, 3, 4, 5, 6 }\n uselistorder label LBL_17, { 0, 2, 1 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_13, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_fwrite_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge23.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = icmp eq %_IO_FILE* %0, null\n %2 = icmp eq i1 %1, false\n store i64 0, i64* %storemerge23.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %3 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %0)\n %4 = icmp eq i32 %3, 50\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %storemerge23.reload = load i64, i64* %storemerge23.reg2mem\n %5 = add nuw nsw i64 %storemerge23.reload, 1\n %6 = icmp ult i64 %5, 20\n store i64 %5, i64* %storemerge23.reg2mem\n br i1 %6, label LBL_2, label LBL_5\n LBL_5:\n %7 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %8 = sext i32 %7 to i64\n ret i64 %8\n\n uselistorder %_IO_FILE* %0, { 1, 0, 2 }\n uselistorder i64* %storemerge23.reg2mem, { 2, 0, 1 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 7, 6, 5, 4, 3, 2, 1, 0, 8 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 3, 2, 0, 1, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE617_Reachable_Assertion__fscanf_07-bad", "fun_name": "CWE617_Reachable_Assertion__fscanf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* %sv_0, align 4\n %6 = icmp sgt i32 %.pr, 5\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @__assert_fail(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gv_4, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @gv_5, i64 0, i64 0))\n br label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder i32 5, { 2, 0, 1 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_popen_12-bad", "fun_name": "CWE426_Untrusted_Search_Path__char_popen_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = ptrtoint i64* %sv_0 to i64\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %5 = bitcast i64* %sv_0 to i32*\n store i32 757101420, i32* %5, align 8\n %6 = or i64 %4, 4\n %7 = inttoptr i64 %6 to i16*\n store i16 24940, i16* %7, align 4\n %8 = or i64 %4, 6\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 2\n br label LBL_3\n LBL_2:\n store i64 7955998172649846063, i64* %sv_0, align 8\n %10 = add i64 %4, 8\n %11 = inttoptr i64 %10 to i64*\n store i64 27422013814697007, i64* %11, align 8\n br label LBL_3\n LBL_3:\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call %_IO_FILE* @popen(i8* nonnull %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0))\n %14 = icmp eq %_IO_FILE* %13, null\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = call i32 @pclose(%_IO_FILE* nonnull %13)\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %4, { 2, 0, 1 }\n uselistorder i64* %sv_0, { 3, 0, 1, 2, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_snprintf_07-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_snprintf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %4, i32 93, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_2, i64 0, i64 0))\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC(i64 40)\n %7 = icmp eq i64 %0, %6\n store i64 0, i64* %rax.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE570_Expression_Always_False__static_five_01-bad", "fun_name": "CWE570_Expression_Always_False__static_five_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n store i64 5, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([13 x i8]* @gv_1 to i64))\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__char_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_1, i64 0, i64 0), i8** %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n br label LBL_2\n LBL_2:\n %3 = load i32, i32* @gv_3, align 4\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = load i8, i8* %sv_0.0.reload, align 1\n %6 = sext i8 %5 to i64\n %7 = and i64 %6, 4294967295\n %8 = call i64 @FUNC(i64 %7)\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_07-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = bitcast i64* %sv_2 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_12, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_12, label LBL_2\n LBL_2:\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_1 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_10, label LBL_3\n LBL_3:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_10, label LBL_4\n LBL_4:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_10, label LBL_5\n LBL_5:\n %17 = sext i32 %5 to i64\n %18 = ptrtoint i64* %sv_2 to i64\n %19 = add i64 %17, %18\n %20 = inttoptr i64 %19 to i64*\n %21 = sub i32 99, %5\n %22 = call i32 @recv(i32 %15, i64* %20, i32 %21, i32 0)\n %23 = add i32 %22, 1\n %24 = icmp ult i32 %23, 2\n br i1 %24, label LBL_11, label LBL_6\n LBL_6:\n %25 = sext i32 %22 to i64\n %26 = add i64 %19, %25\n %27 = inttoptr i64 %26 to i8*\n store i8 0, i8* %27, align 1\n %28 = call i8* @strchr(i8* nonnull %1, i32 13)\n %29 = icmp eq i8* %28, null\n br i1 %29, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %28, align 1\n br label LBL_8\n LBL_8:\n %30 = call i8* @strchr(i8* nonnull %1, i32 10)\n %31 = icmp eq i8* %30, null\n br i1 %31, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %30, align 1\n br label LBL_11\n LBL_10:\n %32 = call i32 @close(i32 %6)\n br label LBL_12\n LBL_11:\n %33 = call i32 @close(i32 %6)\n %34 = call i32 @close(i32 %15)\n br label LBL_12\n LBL_12:\n %35 = load i32, i32* @gv_0, align 4\n %36 = icmp eq i32 %35, 5\n %37 = icmp eq i1 %36, false\n br i1 %37, label LBL_14, label LBL_13\n LBL_13:\n store i64 0, i64* %sv_0, align 8\n %38 = bitcast i64* %sv_0 to i8*\n %39 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %38, i32 99, i8* nonnull %1)\n %40 = call i64 @FUNC(i64* nonnull %sv_0)\n br label LBL_14\n LBL_14:\n %41 = call i64 @FUNC(i64 40)\n %42 = icmp eq i64 %0, %41\n store i64 0, i64* %rax.0.reg2mem\n br i1 %42, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %22, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 99, { 1, 0 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_12, { 2, 1, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE510_Trapdoor__network_listen_07-bad", "fun_name": "CWE510_Trapdoor__network_listen_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_7, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n br i1 %5, label LBL_7, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %7 = call i16 @htons(i16 30000)\n %8 = bitcast i64* %sv_0 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_4, label LBL_5\n LBL_4:\n %13 = call i32 @close(i32 %4)\n br label LBL_7\n LBL_5:\n %14 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %15 = call i32 @close(i32 %4)\n %16 = icmp eq i32 %14, -1\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n %17 = call i32 @close(i32 %14)\n br label LBL_7\n LBL_7:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %14, { 1, 0 }\n uselistorder i32 %4, { 4, 1, 0, 2, 3, 5 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder i32 5, { 1, 0, 2 }\n uselistorder label LBL_7, { 2, 3, 1, 0, 4 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_printf_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_6, label LBL_1\n LBL_1:\n %6 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %7 = sub i32 100, %2\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = add i64 %3, %8\n %10 = inttoptr i64 %9 to i8*\n %11 = call i8* @fgets(i8* %10, i32 %7, %_IO_FILE* %6)\n %12 = icmp eq i8* %11, null\n br i1 %12, label LBL_5, label LBL_2\n LBL_2:\n %13 = call i32 @strlen(i8* nonnull %1)\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = sext i32 %13 to i64\n %16 = add i64 %8, -1\n %17 = add i64 %16, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = icmp eq i8 %19, 10\n %21 = icmp eq i1 %20, false\n br i1 %21, label LBL_6, label LBL_4\n LBL_4:\n store i8 0, i8* %18, align 1\n br label LBL_6\n LBL_5:\n %22 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_1 to i64))\n store i8 0, i8* %10, align 1\n br label LBL_6\n LBL_6:\n %23 = call i32 @puts(i8* nonnull %1)\n %24 = call i64 @FUNC(i64 40)\n %25 = icmp eq i64 %0, %24\n store i64 0, i64* %rax.0.reg2mem\n br i1 %25, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %8, { 1, 0 }\n uselistorder i8* %1, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 0 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder i32 (i8*)* @strlen, { 2, 0, 3, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_for_loop_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i8* @fgets(i8* nonnull %4, i32 14, %_IO_FILE* %3)\n %6 = icmp eq i8* %5, null\n br i1 %6, label LBL_2, label LBL_3\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_3:\n %8 = call i32 @atoi(i8* nonnull %4)\n %9 = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %9, 0\n %sv_1.0.off = add i32 %8, -1\n %11 = icmp ugt i32 %sv_1.0.off, 19\n %12 = or i1 %11, %10\n br i1 %12, label LBL_6, label LBL_4\n LBL_4:\n %13 = sext i32 %8 to i64\n store i64 0, i64* %storemerge5.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %14 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_3 to i64))\n %15 = add nuw i64 %storemerge5.reload, 1\n %16 = icmp ult i64 %15, %13\n store i64 %15, i64* %storemerge5.reg2mem\n br i1 %16, label LBL_5, label LBL_6\n LBL_6:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %8, { 1, 0 }\n uselistorder i64* %storemerge5.reg2mem, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 3, 0, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_6, { 0, 3, 1, 2 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 26, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @strtoul(i8* nonnull %5, i8** null, i32 0)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_2 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 5\n %12 = icmp eq i1 %11, false\n br i1 %12, label LBL_10, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %sv_0.0.off = add i32 %sv_0.0.reload, -6\n %13 = icmp ult i32 %sv_0.0.off, 94\n br i1 %13, label LBL_6, label LBL_9\n LBL_6:\n %14 = call i64* @malloc(i32 %sv_0.0.reload)\n %15 = icmp eq i64* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @exit(i32 -1)\n unreachable\n LBL_8:\n %17 = ptrtoint i64* %14 to i64\n %18 = bitcast i64* %14 to i32*\n store i32 1819043176, i32* %18, align 4\n %19 = add i64 %17, 4\n %20 = inttoptr i64 %19 to i16*\n store i16 111, i16* %20, align 2\n %21 = call i64 @FUNC(i64 %17)\n call void @free(i64* %14)\n br label LBL_10\n LBL_9:\n %22 = call i64 @FUNC(i64 ptrtoint ([64 x i8]* @gv_3 to i64))\n br label LBL_10\n LBL_10:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %14, { 0, 1, 3, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32 (i8*, i8**, i32)* @strtoul, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge35.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i32 @strlen(i8* %4)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_12.preheader, label LBL_3\n LBL_3:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_9, label LBL_4\n LBL_4:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_9, label LBL_5\n LBL_5:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %4, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_7, label LBL_6\n LBL_6:\n store i8 0, i8* %24, align 1\n br label LBL_7\n LBL_7:\n %26 = call i8* @strchr(i8* nonnull %4, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n store i8 0, i8* %26, align 1\n br label LBL_9\n LBL_9:\n %28 = call i32 @close(i32 %6)\n br label LBL_12.preheader\n LBL_10:\n %storemerge35.reload = load i64, i64* %storemerge35.reg2mem\n %29 = add i64 %storemerge35.reload, %39\n %30 = inttoptr i64 %29 to i8*\n %31 = load i8, i8* %30, align 1\n %32 = icmp eq i8 %31, 83\n %33 = icmp eq i1 %32, false\n br i1 %33, label LBL_12, label LBL_11\n LBL_11:\n %34 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n br label LBL_14\n LBL_12:\n %35 = add nuw i64 %storemerge35.reload, 1\n %36 = call i32 @strlen(i8* %4)\n %37 = sext i32 %36 to i64\n %38 = icmp ult i64 %35, %37\n store i64 %35, i64* %storemerge35.reg2mem\n br i1 %38, label LBL_10, label LBL_14\n LBL_13:\n %39 = ptrtoint i64* %1 to i64\n %40 = call i32 @strlen(i8* nonnull %4)\n %41 = icmp eq i32 %40, 0\n store i64 0, i64* %storemerge35.reg2mem\n br i1 %41, label LBL_14, label LBL_10\n LBL_14:\n call void @free(i64* %1)\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %0, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %4, { 0, 3, 1, 2, 5, 4 }\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge35.reg2mem, { 1, 2, 0 }\n uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 0, 2, 1, 3 }\n uselistorder i32 -1, { 1, 0, 2 }\n uselistorder label LBL_14, { 2, 0, 1 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_multiply_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_6, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = icmp slt i64 %6, 0\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = icmp slt i64 %6, -4611686018427387903\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n %10 = mul i64 %6, 2\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_6\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_6, { 1, 2, 3, 4, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_loop_03-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = ptrtoint i64* %1 to i64\n %7 = add i64 %6, 49\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %4)\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_5, label LBL_3\n LBL_3:\n %11 = sext i32 %9 to i64\n %12 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %13 = add i64 %storemerge2.reload, %6\n %14 = inttoptr i64 %13 to i8*\n %15 = load i8, i8* %14, align 1\n %16 = add i64 %storemerge2.reload, %12\n %17 = inttoptr i64 %16 to i8*\n store i8 %15, i8* %17, align 1\n %18 = add nuw i64 %storemerge2.reload, 1\n %19 = icmp ult i64 %18, %11\n store i64 %18, i64* %storemerge2.reg2mem\n br i1 %19, label LBL_4, label LBL_5\n LBL_5:\n %20 = call i64 @FUNC(i64 %6)\n call void @free(i64* %1)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i32 %9, { 1, 0 }\n uselistorder i64 %6, { 1, 0, 2 }\n uselistorder i64* %1, { 0, 1, 2, 4, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i32 20, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i32 0, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %3 = load i32, i32* @gv_2, align 4\n %4 = icmp eq i32 %3, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %4, label LBL_8, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %5 = icmp ult i32 %sv_0.0.reload, 6\n br i1 %5, label LBL_7, label LBL_4\n LBL_4:\n %6 = call i64* @malloc(i32 %sv_0.0.reload)\n %7 = icmp eq i64* %6, null\n %8 = icmp eq i1 %7, false\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %9 = ptrtoint i64* %6 to i64\n %10 = bitcast i64* %6 to i32*\n store i32 1819043176, i32* %10, align 4\n %11 = add i64 %9, 4\n %12 = inttoptr i64 %11 to i16*\n store i16 111, i16* %12, align 2\n %13 = call i64 @FUNC(i64 %9)\n call void @free(i64* %6)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_7:\n %14 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_3 to i64))\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %6, { 0, 1, 3, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fscanf_10-bad", "fun_name": "CWE369_Divide_by_Zero__float_fscanf_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %sv_0 = alloca i32, align 4\n %3 = call i64 @FUNC(i64 40)\n %4 = call i128 @FUNC(i128 %2, i128 %2)\n %5 = call i64 @FUNC(i128 %4)\n %6 = trunc i64 %5 to i32\n store i32 %6, i32* %sv_0, align 4\n %7 = load i32, i32* @gv_0, align 4\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_3, label LBL_1\n LBL_1:\n %9 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %10 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %.pr, 0\n br i1 %11, label LBL_3, label LBL_2\n LBL_2:\n %12 = load i32, i32* %sv_0, align 4\n %13 = call i128 @__asm_movss.1(i32 %12)\n %14 = call i128 @FUNC(i128 %1, i128 %1)\n %15 = call i128 @FUNC(i128 %13)\n %16 = call i128 @FUNC(i64 4636737291354636288)\n %17 = call i128 @FUNC(i128 %16, i128 %15)\n %18 = call i32 @FUNC(i128 %17)\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n br label LBL_3\n LBL_3:\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %3, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 2, 0, 1 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_loop_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = ptrtoint i64* %4 to i64\n %8 = bitcast i64* %4 to i8*\n store i8 0, i8* %8, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %10 = ptrtoint i64* %sv_1 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_6\n LBL_6:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = add i64 %storemerge1.reload, %sv_0.0.reload\n %12 = add i64 %storemerge1.reload, %10\n %13 = inttoptr i64 %12 to i8*\n %14 = load i8, i8* %13, align 1\n %15 = inttoptr i64 %11 to i8*\n store i8 %14, i8* %15, align 1\n %16 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %16, 100\n store i64 %16, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_6\n LBL_7:\n %17 = add i64 %sv_0.0.reload, 99\n %18 = inttoptr i64 %17 to i8*\n store i8 0, i8* %18, align 1\n %19 = call i64 @FUNC(i64 %sv_0.0.reload)\n %20 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %20)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %sv_0.0.reload, { 1, 2, 0, 3 }\n uselistorder i64* %4, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int_11-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 400)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = call i64 @FUNC()\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, 0\n store i64 %8, i64* %rax.0.reg2mem\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %11)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @globalReturnsFalse, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__connect_socket_fwrite_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge2.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = icmp eq %_IO_FILE* %0, null\n %2 = icmp eq i1 %1, false\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %3 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %0)\n %4 = icmp eq i32 %3, 50\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %5 = add nuw nsw i64 %storemerge2.reload, 1\n %6 = icmp ult i64 %5, 20\n store i64 %5, i64* %storemerge2.reg2mem\n br i1 %6, label LBL_2, label LBL_5\n LBL_5:\n %7 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %8 = sext i32 %7 to i64\n ret i64 %8\n\n uselistorder %_IO_FILE* %0, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 7, 6, 5, 4, 3, 2, 1, 0, 8 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 3, 2, 1, 0, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int64_t_loop_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_4\n LBL_2:\n %4 = call i64* @malloc(i32 ptrtoint (i32* @gv_2 to i32))\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n store i64 %5, i64* %sv_0.0.reg2mem\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %8 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %9 = bitcast i64* %sv_1 to i8*\n call void @FUNC(i8* nonnull %9, i64 0, i64 100)\n %10 = add i64 %8, -816\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_5\n LBL_5:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %11 = mul i64 %storemerge1.reload, 8\n %12 = add i64 %11, %sv_0.0.reload\n %13 = add i64 %10, %11\n %14 = inttoptr i64 %13 to i64*\n %15 = load i64, i64* %14, align 8\n %16 = inttoptr i64 %12 to i64*\n store i64 %15, i64* %16, align 8\n %17 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %17, 100\n store i64 %17, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %18 = inttoptr i64 %sv_0.0.reload to i64*\n %19 = load i64, i64* %18, align 8\n %20 = call i64 @FUNC(i64 %19)\n call void @free(i64* %18)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_fscanf_square_05-bad", "fun_name": "CWE190_Integer_Overflow__unsigned_int_fscanf_square_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 0, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i32, i32* %sv_0, align 4\n %7 = mul i32 %6, %6\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n br label LBL_3\n LBL_3:\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0, { 1, 2, 0 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_snprintf_14-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_snprintf_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %sv_0.0.reload, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i64* nonnull %sv_1)\n %7 = ptrtoint i8* %sv_0.0.reload to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__short_fscanf_square_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i16, align 2\n %0 = call i64 @FUNC(i64 40)\n store i16 0, i16* %sv_0, align 2\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 %1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i16* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = icmp eq i32 %.reload, 5\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i16, i16* %sv_0, align 2\n %9 = sub i16 0, %8\n %10 = icmp slt i16 %9, 0\n %11 = icmp eq i1 %10, false\n %.v = select i1 %11, i16 %9, i16 %8\n %12 = icmp ult i16 %.v, 182\n br i1 %12, label LBL_5, label LBL_6\n LBL_5:\n %13 = mul i16 %8, %8\n %14 = sext i16 %13 to i64\n %15 = and i64 %14, 4294967295\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_7\n LBL_6:\n %17 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_7:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i16 %8, { 1, 0, 2, 3 }\n uselistorder i16* %sv_0, { 1, 0, 2 }\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_no_init_16-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 80)\n %1 = ptrtoint i64* %0 to i64\n %2 = icmp eq i64* %0, null\n %3 = icmp eq i1 %2, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %4 = mul i64 %indvars.iv5.reload, 8\n %5 = add i64 %4, %1\n %6 = inttoptr i64 %5 to i32*\n %7 = trunc i64 %indvars.iv5.reload to i32\n store i32 %7, i32* %6, align 4\n %8 = add i64 %5, 4\n %9 = inttoptr i64 %8 to i32*\n store i32 %7, i32* %9, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond7, label LBL_3, label LBL_2\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %10 = mul i64 %indvars.iv.reload, 8\n %11 = add i64 %10, %1\n %12 = inttoptr i64 %11 to i32*\n %13 = load i32, i32* %12, align 4\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n %16 = add i64 %11, 4\n %17 = inttoptr i64 %16 to i32*\n %18 = load i32, i32* %17, align 4\n %19 = zext i32 %18 to i64\n %20 = call i64 @FUNC(i64 %19)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n ret i64 %20\n\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 10, { 1, 0, 3, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_07-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = load i32, i32* @gv_0, align 4\n %24 = icmp eq i32 %23, 5\n %25 = icmp eq i1 %24, false\n br i1 %25, label LBL_15, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = call i64* @malloc(i32 40)\n %27 = ptrtoint i64* %26 to i64\n %28 = icmp eq i64* %26, null\n %29 = icmp eq i1 %28, false\n store i64 0, i64* %indvars.iv6.reg2mem\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 -1)\n unreachable\n LBL_9:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %30 = mul i64 %indvars.iv6.reload, 4\n %31 = add i64 %30, %27\n %32 = inttoptr i64 %31 to i32*\n store i32 0, i32* %32, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n br i1 %exitcond8, label LBL_10, label LBL_9\n LBL_10:\n %33 = icmp slt i32 %sv_0.1.reload, 0\n br i1 %33, label LBL_13, label LBL_11\n LBL_11:\n %34 = sext i32 %sv_0.1.reload to i64\n %35 = mul i64 %34, 4\n %36 = add i64 %35, %27\n %37 = inttoptr i64 %36 to i32*\n store i32 1, i32* %37, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_12\n LBL_12:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %38 = mul i64 %indvars.iv.reload, 4\n %39 = add i64 %38, %27\n %40 = inttoptr i64 %39 to i32*\n %41 = load i32, i32* %40, align 4\n %42 = zext i32 %41 to i64\n %43 = call i64 @FUNC(i64 %42)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_14, label LBL_12\n LBL_13:\n %44 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_2 to i64))\n br label LBL_14\n LBL_14:\n call void @free(i64* %26)\n br label LBL_15\n LBL_15:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %27, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv6.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i64 10, { 1, 0 }\n uselistorder i32 -1, { 6, 3, 2, 4, 0, 5, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_malloc_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @malloc(i32 8)\n %1 = icmp eq i64* %0, null\n store i64 1, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %0, align 8\n %2 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64 5, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memmove_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n %6 = add i64 %2, -609\n %7 = and i64 %6, -16\n %sv_2.0 = select i1 %5, i64 %1, i64 %7\n %8 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %8, i64 0, i64 50)\n %9 = inttoptr i64 %sv_2.0 to i64*\n %10 = call i64* @memmove(i64* %9, i64* nonnull %sv_0, i32 400)\n %11 = inttoptr i64 %sv_2.0 to i32*\n %12 = load i32, i32* %11, align 4\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %3, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_fwrite_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n %sv_0.0.off = add i32 %sv_0.0.reload, -1\n %13 = icmp ugt i32 %sv_0.0.off, 19\n %or.cond = or i1 %13, %12\n br i1 %or.cond, label LBL_12, label LBL_5\n LBL_5:\n %14 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @gv_2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0))\n %15 = icmp eq %_IO_FILE* %14, null\n %16 = icmp eq i1 %15, false\n br i1 %16, label LBL_6, label LBL_7\n LBL_6:\n %17 = sext i32 %sv_0.0.reload to i64\n store i64 0, i64* %storemerge5.reg2mem\n br label LBL_8\n LBL_7:\n call void @exit(i32 1)\n unreachable\n LBL_8:\n %18 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_4 to i64*), i32 1, i32 50, %_IO_FILE* %14)\n %19 = icmp eq i32 %18, 50\n br i1 %19, label LBL_10, label LBL_9\n LBL_9:\n call void @exit(i32 1)\n unreachable\n LBL_10:\n %storemerge5.reload = load i64, i64* %storemerge5.reg2mem\n %20 = add nuw i64 %storemerge5.reload, 1\n %21 = icmp ult i64 %20, %17\n store i64 %20, i64* %storemerge5.reg2mem\n br i1 %21, label LBL_8, label LBL_11\n LBL_11:\n %22 = call i32 @fclose(%_IO_FILE* nonnull %14)\n br label LBL_12\n LBL_12:\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %0, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_14, label LBL_13\n LBL_13:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_14\n LBL_14:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %14, { 1, 0, 2 }\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %storemerge5.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n uselistorder i32 -1, { 4, 0, 1, 5, 2, 3 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__CWE839_listen_socket_13-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n br i1 %2, label LBL_7, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = ptrtoint i64* %sv_3 to i64\n %13 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %14 = add i32 %13, 1\n %15 = icmp ult i32 %14, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %15, label LBL_8, label LBL_5\n LBL_5:\n %16 = sext i32 %13 to i64\n %17 = add i64 %12, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_6:\n %22 = call i32 @close(i32 %1)\n br label LBL_7\n LBL_7:\n store i64 0, i64* %sv_2, align 8\n br label LBL_10\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n store i64 0, i64* %sv_2, align 8\n %25 = icmp ugt i32 %sv_0.0.ph.reload, 9\n br i1 %25, label LBL_10, label LBL_9\n LBL_9:\n %26 = sext i32 %sv_0.0.ph.reload to i64\n %27 = mul i64 %26, 4\n %28 = add i64 %12, -64\n %29 = add i64 %28, %27\n %30 = inttoptr i64 %29 to i32*\n %31 = load i32, i32* %30, align 4\n %32 = zext i32 %31 to i64\n %33 = call i64 @FUNC(i64 %32)\n br label LBL_11\n LBL_10:\n %34 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_0 to i64))\n br label LBL_11\n LBL_11:\n %35 = call i64 @FUNC(i64 40)\n %36 = icmp eq i64 %0, %35\n store i64 0, i64* %rax.0.reg2mem\n br i1 %36, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i64 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 3, 0, 1, 4, 2 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 5, { 0, 2, 1, 3 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 2, 3, 4, 5, 1, 6, 7, 8, 9 }\n uselistorder label LBL_10, { 1, 0 }\n uselistorder label LBL_8, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memcpy_03-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %3 = and i64 %2, -16\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 100)\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memcpy(i64* %5, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %7 = load i64, i64* %5, align 16\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__long_17-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge2.reg2mem = alloca i32\n %sv_0.0.reg2mem = alloca i64\n store i32 0, i32* %storemerge2.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge2.reload = load i32, i32* %storemerge2.reg2mem\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %0 = add nuw nsw i32 %storemerge2.reload, 1\n %exitcond = icmp eq i32 %0, 2\n store i64 5, i64* %sv_0.0.reg2mem\n store i32 %0, i32* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %1 = call i64 @FUNC(i64 %sv_0.0.reload)\n ret i64 %1\n\n uselistorder i64* %sv_0.0.reg2mem, { 1, 0 }\n uselistorder i32* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64 (i64)* @printLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__open_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_1, i64 0, i64 0), i32 66)\n %5 = call i32 @close(i32 %4)\n %6 = sext i32 %5 to i64\n store i64 %6, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE476_NULL_Pointer_Dereference__int_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i32*\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %1 = load i32*, i32** %0\n %2 = call i64 @FUNC(i64 40)\n %3 = load i32, i32* @gv_0, align 4\n %4 = icmp eq i32 %3, 5\n store i64 5, i64* %.reg2mem\n br i1 %4, label LBL_3, label LBL_1\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n %.pre = load i32, i32* @gv_0, align 4\n %phitmp = icmp eq i32 %.pre, 5\n %phitmp2 = icmp eq i1 %phitmp, false\n br i1 %phitmp2, label LBL_4, label LBL_1.LBL_3_crit_edge\n LBL_2:\n %.pre4 = load i32, i32* %1, align 4\n %phitmp5 = zext i32 %.pre4 to i64\n store i64 %phitmp5, i64* %.reg2mem\n br label LBL_3\n LBL_3:\n %.reload = load i64, i64* %.reg2mem\n %6 = call i64 @FUNC(i64 %.reload)\n br label LBL_4\n LBL_4:\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %2, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_connect_socket_execlp_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = ptrtoint i64* %sv_0 to i64\n %5 = add i64 %3, %4\n %6 = inttoptr i64 %5 to i32*\n store i32 2764330, i32* %6, align 4\n %7 = call i32 (i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 (i8*, i8*, ...)* @execlp, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_declare_partial_init_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv6.reg2mem = alloca i64\n %indvars.iv9.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %indvars.iv9.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv9.reload = load i64, i64* %indvars.iv9.reg2mem\n %5 = mul i64 %indvars.iv9.reload, 4\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i32*\n %8 = trunc i64 %indvars.iv9.reload to i32\n store i32 %8, i32* %7, align 4\n %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9.reload, 1\n %exitcond11 = icmp eq i64 %indvars.iv.next10, 5\n store i64 %indvars.iv.next10, i64* %indvars.iv9.reg2mem\n br i1 %exitcond11, label LBL_2, label LBL_1\n LBL_2:\n store i64 0, i64* %indvars.iv6.reg2mem\n br label LBL_3\n LBL_3:\n %indvars.iv6.reload = load i64, i64* %indvars.iv6.reg2mem\n %9 = mul i64 %indvars.iv6.reload, 4\n %10 = add i64 %9, %1\n %11 = inttoptr i64 %10 to i32*\n %12 = trunc i64 %indvars.iv6.reload to i32\n store i32 %12, i32* %11, align 4\n %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6.reload, 1\n %exitcond8 = icmp eq i64 %indvars.iv.next7, 10\n store i64 %indvars.iv.next7, i64* %indvars.iv6.reg2mem\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %exitcond8, label LBL_4, label LBL_3\n LBL_4:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 4\n %14 = add i64 %13, %1\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_5, label LBL_4\n LBL_5:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv9.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv6.reg2mem, { 1, 0, 2 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE415_Double_Free__malloc_free_int64_t_32-bad", "fun_name": "CWE415_Double_Free__malloc_free_int64_t_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 ptrtoint (i32* @gv_0 to i32))\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n call void @free(i64* %1)\n call void @free(i64* %1)\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__fopen_10-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = load i32, i32* @gv_2, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = icmp eq %_IO_FILE* %0, null\n br i1 %3, label LBL_3, label LBL_2\n LBL_2:\n %4 = call i32 @fclose(%_IO_FILE* nonnull %0)\n br label LBL_3\n LBL_3:\n %5 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %6 = ptrtoint %_IO_FILE* %5 to i64\n %7 = icmp eq %_IO_FILE* %5, null\n store i64 %6, i64* %rax.0.reg2mem\n br i1 %7, label LBL_5, label LBL_4\n LBL_4:\n %8 = call i32 @fclose(%_IO_FILE* nonnull %5)\n %9 = sext i32 %8 to i64\n store i64 %9, i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder %_IO_FILE* %0, { 1, 0 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 2, 3, 1, 0, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 2, 0, 1, 3, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_no_init_07-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__double_array_declare_no_init_07_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %5 = mul i64 %indvars.iv.reload, 8\n %6 = add i64 %5, %1\n %7 = inttoptr i64 %6 to i64*\n %8 = load i64, i64* %7, align 8\n %9 = call i128 @FUNC(i64 %8)\n %10 = call i64 @FUNC()\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memmove_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64 0, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 40)\n %4 = ptrtoint i64* %3 to i64\n %5 = icmp eq i64* %3, null\n %6 = icmp eq i1 %5, false\n store i64 %4, i64* %sv_0.0.reg2mem\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n store i64 0, i64* %sv_1, align 8\n %7 = inttoptr i64 %sv_0.0.reload to i64*\n %8 = call i64* @memmove(i64* %7, i64* nonnull %sv_1, i32 40)\n %9 = inttoptr i64 %sv_0.0.reload to i32*\n %10 = load i32, i32* %9, align 4\n %11 = zext i32 %10 to i64\n %12 = call i64 @FUNC(i64 %11)\n call void @free(i64* %7)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 40, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_system_01-bad", "fun_name": "CWE426_Untrusted_Search_Path__char_system_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 757101420, i64* %sv_0, align 8\n %1 = ptrtoint i64* %sv_0 to i64\n %2 = or i64 %1, 4\n %3 = inttoptr i64 %2 to i16*\n store i16 24940, i16* %3, align 4\n %4 = or i64 %1, 6\n %5 = inttoptr i64 %4 to i8*\n store i8 0, i8* %5, align 2\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i32 @system(i8* nonnull %6)\n %8 = icmp eq i32 %7, 0\n %9 = icmp slt i32 %7, 0\n %10 = icmp eq i1 %9, false\n %11 = icmp eq i1 %8, false\n %12 = icmp eq i1 %10, %11\n br i1 %12, label LBL_2, label LBL_1\n LBL_1:\n %13 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %7, { 1, 0 }\n uselistorder i64* %sv_0, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_fscanf_sub_10-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = load i32, i32* @gv_3, align 4\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i64, i64* %sv_0, align 8\n %9 = icmp eq i64 %8, -9223372036854775808\n br i1 %9, label LBL_6, label LBL_5\n LBL_5:\n %10 = add i64 %8, -1\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_7\n LBL_6:\n %12 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_5 to i64))\n br label LBL_7\n LBL_7:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_alloca_06-bad", "fun_name": "CWE590_Free_Memory_Not_on_Heap__free_char_alloca_06_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64 @FUNC(i64 %3)\n call void @free(i64* %4)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_32-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = ptrtoint i64* %sv_1 to i64\n %2 = bitcast i64* %sv_1 to i8*\n store i8 0, i8* %2, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = load i64, i64* %sv_0, align 8\n store i64 %4, i64* %sv_1, align 8\n %5 = add i64 %1, 8\n %6 = inttoptr i64 %5 to i64*\n %7 = add i64 %1, 16\n %8 = inttoptr i64 %7 to i64*\n %9 = add i64 %1, 24\n %10 = inttoptr i64 %9 to i64*\n %11 = add i64 %1, 32\n %12 = inttoptr i64 %11 to i64*\n %13 = add i64 %1, 40\n %14 = inttoptr i64 %13 to i64*\n %15 = add i64 %1, 48\n %16 = inttoptr i64 %15 to i64*\n %17 = add i64 %1, 56\n %18 = inttoptr i64 %17 to i64*\n %19 = add i64 %1, 64\n %20 = inttoptr i64 %19 to i64*\n %21 = add i64 %1, 72\n %22 = inttoptr i64 %21 to i64*\n %23 = add i64 %1, 80\n %24 = inttoptr i64 %23 to i64*\n %25 = add i64 %1, 88\n %26 = inttoptr i64 %25 to i64*\n %27 = add i64 %1, 96\n %28 = inttoptr i64 %27 to i32*\n %29 = add i64 %1, 99\n %30 = inttoptr i64 %29 to i8*\n store i8 0, i8* %30, align 1\n %31 = call i64 @FUNC(i64 %1)\n %32 = call i64 @FUNC(i64 40)\n %33 = icmp eq i64 %0, %32\n store i64 0, i64* %rax.0.reg2mem\n br i1 %33, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %1, { 13, 12, 0, 8, 1, 11, 2, 3, 4, 5, 6, 7, 9, 10 }\n uselistorder i64* %sv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_listen_socket_preinc_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 3)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printIntLine, { 3, 2, 1, 0 }\n uselistorder i64 3, { 1, 0 }\n uselistorder i32 5, { 0, 1, 2, 3, 5, 4, 6, 8, 7, 9 }\n uselistorder i32* @gv_0, { 5, 0, 4, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__double_pointer_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_5\n LBL_2:\n %3 = call i64* @malloc(i32 8)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i128 @FUNC(i64 4617315517961601024)\n %8 = call i64 @__asm_movsd.1(i128 %7)\n store i64 %8, i64* %3, align 8\n store i64 %6, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %9 = load i32, i32* @gv_2, align 4\n %10 = icmp eq i32 %9, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_7, label LBL_6\n LBL_6:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = inttoptr i64 %sv_0.0.reload to i64*\n %12 = load i64, i64* %11, align 8\n %13 = call i128 @FUNC(i64 %12)\n %14 = call i64 @FUNC()\n store i64 %14, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i32* @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_cpy_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %sv_2 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_2 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = add i64 %3, 99\n %8 = inttoptr i64 %7 to i8*\n store i8 0, i8* %8, align 1\n %9 = call i64 @FUNC()\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 0\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %13 = load i8*, i8** %sv_1, align 8\n %14 = ptrtoint i8* %13 to i64\n %15 = bitcast i8** %sv_2 to i64*\n store i64 %14, i64* %15, align 8\n br label LBL_3\n LBL_3:\n %16 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %17 = load i8*, i8** %sv_2, align 8\n %18 = bitcast i64* %sv_0 to i8*\n %19 = call i8* @strcpy(i8* nonnull %18, i8* %17)\n %20 = ptrtoint i64* %sv_0 to i64\n %21 = call i64 @FUNC(i64 %20)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %1, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %3, { 1, 0, 2 }\n uselistorder i8** %sv_2, { 2, 0, 1 }\n uselistorder i64* %sv_0, { 2, 0, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__int64_t_realloc_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @realloc(i64* null, i32 8)\n %2 = icmp eq i64* %1, null\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n store i64 5, i64* %1, align 8\n %3 = call i64 @FUNC(i64 5)\n call void @free(i64* nonnull %1)\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC(i64 40)\n %5 = icmp eq i64 %0, %4\n store i64 0, i64* %rax.0.reg2mem\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_snprintf_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8364 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i8* null, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %sv_0.0.reload, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %12)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 1, 0 }\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cpy_05-bad", "fun_name": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 50)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i8*\n store i8 0, i8* %6, align 1\n store i8* %6, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @strcpy(i8* %sv_0.0.reload, i8* nonnull %8)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %12)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_connect_socket_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv8.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_6, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 -1, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_6, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_2 to %sockaddr*\n %10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %11, label LBL_5, label LBL_3\n LBL_3:\n %12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 -1, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_5, label LBL_4\n LBL_4:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %22 = call i32 @close(i32 %4)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_6\n LBL_6:\n %23 = call i64 @FUNC()\n %24 = trunc i64 %23 to i32\n %25 = icmp eq i32 %24, 0\n br i1 %25, label LBL_15, label LBL_7\n LBL_7:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %26 = call i64* @malloc(i32 40)\n %27 = ptrtoint i64* %26 to i64\n %28 = icmp eq i64* %26, null\n %29 = icmp eq i1 %28, false\n store i64 0, i64* %indvars.iv8.reg2mem\n br i1 %29, label LBL_9, label LBL_8\n LBL_8:\n call void @exit(i32 -1)\n unreachable\n LBL_9:\n %indvars.iv8.reload = load i64, i64* %indvars.iv8.reg2mem\n %30 = mul i64 %indvars.iv8.reload, 4\n %31 = add i64 %30, %27\n %32 = inttoptr i64 %31 to i32*\n store i32 0, i32* %32, align 4\n %indvars.iv.next9 = add nuw nsw i64 %indvars.iv8.reload, 1\n %exitcond10 = icmp eq i64 %indvars.iv.next9, 10\n store i64 %indvars.iv.next9, i64* %indvars.iv8.reg2mem\n br i1 %exitcond10, label LBL_10, label LBL_9\n LBL_10:\n %33 = icmp ugt i32 %sv_0.1.reload, 9\n br i1 %33, label LBL_13, label LBL_11\n LBL_11:\n %34 = sext i32 %sv_0.1.reload to i64\n %35 = mul i64 %34, 4\n %36 = add i64 %35, %27\n %37 = inttoptr i64 %36 to i32*\n store i32 1, i32* %37, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_12\n LBL_12:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %38 = mul i64 %indvars.iv.reload, 4\n %39 = add i64 %38, %27\n %40 = inttoptr i64 %39 to i32*\n %41 = load i32, i32* %40, align 4\n %42 = zext i32 %41 to i64\n %43 = call i64 @FUNC(i64 %42)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_14, label LBL_12\n LBL_13:\n %44 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_1 to i64))\n br label LBL_14\n LBL_14:\n call void @free(i64* %26)\n br label LBL_15\n LBL_15:\n %45 = call i64 @FUNC(i64 40)\n %46 = icmp eq i64 %0, %45\n store i64 0, i64* %rax.0.reg2mem\n br i1 %46, label LBL_17, label LBL_16\n LBL_16:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_17\n LBL_17:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %27, { 1, 0, 2 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %4, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64* %indvars.iv8.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_14, { 1, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_6, { 1, 0, 2 }\n uselistorder label LBL_5, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_multiply_05-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_multiply_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_4, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = trunc i64 %6 to i32\n %8 = icmp slt i32 %7, 1\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n %9 = mul i64 %6, 2\n %10 = and i64 %9, 4294967294\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_4\n LBL_4:\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_4, { 1, 2, 3, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_loop_11-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_loop_11_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_2, label LBL_1\n LBL_1:\n %7 = inttoptr i64 %3 to i64*\n %8 = call i64* @memset(i64* %7, i32 65, i32 99)\n %9 = add i64 %3, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_2\n LBL_2:\n %11 = inttoptr i64 %3 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = call i32 @strlen(i8* %11)\n store i64 0, i64* %sv_1, align 8\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_5, label LBL_3\n LBL_3:\n %14 = sext i32 %12 to i64\n %15 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = add i64 %storemerge2.reload, %3\n %17 = inttoptr i64 %16 to i8*\n %18 = load i8, i8* %17, align 1\n %19 = add i64 %storemerge2.reload, %15\n %20 = inttoptr i64 %19 to i8*\n store i8 %18, i8* %20, align 1\n %21 = load i64, i64* %sv_1, align 8\n %22 = add i64 %21, 1\n store i64 %22, i64* %sv_1, align 8\n %23 = icmp ult i64 %22, %14\n store i64 %22, i64* %storemerge2.reg2mem\n br i1 %23, label LBL_4, label LBL_5\n LBL_5:\n %24 = call i64 @FUNC(i64 %3)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %1, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %22, { 0, 2, 1 }\n uselistorder i64 %storemerge2.reload, { 1, 0 }\n uselistorder i32 %12, { 1, 0 }\n uselistorder i64 %3, { 1, 0, 4, 2, 3 }\n uselistorder i64* %sv_1, { 1, 2, 0, 3 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cpy_06-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strcpy(i8* %4, i8* nonnull %6)\n %8 = ptrtoint i64* %1 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE690_NULL_Deref_From_Return__char_realloc_14-bad", "fun_name": "CWE690_NULL_Deref_From_Return__char_realloc_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64* @realloc(i64* null, i32 20)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = zext i32 %1 to i64\n %3 = icmp eq i32 %1, 5\n %4 = icmp eq i1 %3, false\n store i64 %2, i64* %rax.0.reg2mem\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %0 to i64\n store i64 7596553777019711049, i64* %0, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i16*\n store i16 25978, i16* %7, align 2\n %8 = add i64 %5, 10\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = call i64 @FUNC(i64 %5)\n call void @free(i64* %0)\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_snprintf_34-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_alloca_snprintf_34_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = inttoptr i64 %3 to i8*\n store i8* %8, i8** %sv_1, align 8\n store i64 0, i64* %sv_0, align 8\n %9 = call i32 @strlen(i8* %8)\n %10 = bitcast i64* %sv_0 to i8*\n %11 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %10, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_0, i64 0, i64 0), i8* %8)\n %12 = call i64 @FUNC(i64 %3)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %1, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %8, { 1, 0, 2 }\n uselistorder i64 %3, { 0, 3, 2, 1 }\n uselistorder i8** %sv_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__unsigned_int_rand_postinc_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge2.reg2mem = alloca i64\n %0 = call i32 @rand()\n %1 = call i32 @rand()\n %2 = call i32 @rand()\n %3 = call i32 @rand()\n %4 = urem i32 %0, 2\n %5 = icmp eq i32 %4, 0\n %6 = mul i32 %1, 1073741824\n %7 = mul i32 %2, 32768\n %8 = xor i32 %7, %6\n %9 = xor i32 %8, %3\n %10 = sext i1 %5 to i32\n %storemerge4.in.le = xor i32 %9, %10\n %11 = icmp eq i32 %storemerge4.in.le, -1\n br i1 %11, label LBL_2, label LBL_1\n LBL_1:\n %12 = add i32 %storemerge4.in.le, 1\n %13 = zext i32 %12 to i64\n %14 = call i64 @FUNC(i64 %13)\n store i64 %14, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n store i64 %15, i64* %storemerge2.reg2mem\n br label LBL_3\n LBL_3:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n ret i64 %storemerge2.reload\n\n uselistorder i32 %storemerge4.in.le, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memcpy_17-bad", "fun_name": "CWE126_Buffer_Overread__malloc_char_memcpy_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 50)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = ptrtoint i64* %1 to i64\n %5 = call i64* @memset(i64* %1, i32 65, i32 49)\n %6 = add i64 %4, 49\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 @strlen(i8* nonnull %9)\n %11 = call i64* @memcpy(i64* nonnull %sv_0, i64* %1, i32 %10)\n %12 = call i64 @FUNC(i64* nonnull %sv_0)\n call void @free(i64* %1)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 1, 0, 2, 4, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncat_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = bitcast i64* %3 to i8*\n store i8 0, i8* %6, align 1\n store i8* %6, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %8 = bitcast i64* %sv_1 to i8*\n %9 = call i8* @strncat(i8* %sv_0.0.reload, i8* nonnull %8, i32 100)\n %10 = ptrtoint i8* %sv_0.0.reload to i64\n %11 = call i64 @FUNC(i64 %10)\n %12 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %12)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 1, 0 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncat, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i32 100, { 0, 1, 3, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__unsigned_int_rand_sub_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i32 0, i32* %sv_0.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i32 @rand()\n %3 = urem i32 %2, 2\n %4 = icmp eq i32 %3, 0\n %5 = call i32 @rand()\n %6 = mul i32 %5, 1073741824\n %7 = call i32 @rand()\n %8 = mul i32 %7, 32768\n %9 = xor i32 %8, %6\n %10 = call i32 @rand()\n %11 = xor i32 %9, %10\n %12 = sext i1 %4 to i32\n %storemerge.in = xor i32 %11, %12\n store i32 %storemerge.in, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %13 = load i32, i32* @gv_1, align 4\n %14 = icmp eq i32 %13, 0\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %15, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %16 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n %17 = add i32 %sv_0.0.reload, -1\n %18 = zext i32 %17 to i64\n %19 = call i64 @FUNC(i64 %18)\n store i64 %19, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %20 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_3 to i64))\n store i64 %20, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE252_Unchecked_Return_Value__char_fread_12-bad", "fun_name": "CWE252_Unchecked_Return_Value__char_fread_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp ne i32 %2, 0\n store i64 0, i64* %sv_0, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 @fread(i64* nonnull %sv_0, i32 1, i32 99, %_IO_FILE* %4)\n %6 = icmp eq i32 %5, 99\n %or.cond = or i1 %3, %6\n br i1 %or.cond, label LBL_2, label LBL_1\n LBL_1:\n %7 = call i64 @FUNC(i64 ptrtoint ([14 x i8]* @gv_1 to i64))\n br label LBL_2\n LBL_2:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_postinc_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = load i32, i32* @gv_2, align 4\n %7 = icmp eq i32 %6, 5\n br i1 %7, label LBL_4, label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_4:\n %9 = load i64, i64* %sv_0, align 8\n %10 = trunc i64 %9 to i32\n %11 = icmp eq i32 %10, 2147483647\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = mul i64 %9, 4294967296\n %sext = add i64 %12, 4294967296\n %13 = ashr exact i64 %sext, 32\n store i64 %13, i64* %sv_0, align 8\n %14 = and i64 %13, 4294967295\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_7\n LBL_6:\n %16 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_7:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %0, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memcpy_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 400)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 50)\n %5 = call i64* @memcpy(i64* %1, i64* nonnull %sv_0, i32 400)\n %6 = bitcast i64* %1 to i32*\n %7 = load i32, i32* %6, align 4\n %8 = zext i32 %7 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv5.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_10, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_10, label LBL_2\n LBL_2:\n %6 = call i64* @malloc(i32 40)\n %7 = ptrtoint i64* %6 to i64\n %8 = icmp eq i64* %6, null\n %9 = icmp eq i1 %8, false\n store i64 0, i64* %indvars.iv5.reg2mem\n br i1 %9, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %indvars.iv5.reload = load i64, i64* %indvars.iv5.reg2mem\n %10 = mul i64 %indvars.iv5.reload, 4\n %11 = add i64 %10, %7\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5.reload, 1\n %exitcond7 = icmp eq i64 %indvars.iv.next6, 10\n store i64 %indvars.iv.next6, i64* %indvars.iv5.reg2mem\n br i1 %exitcond7, label LBL_5, label LBL_4\n LBL_5:\n %13 = load i32, i32* %sv_0, align 4\n %14 = icmp ugt i32 %13, 9\n br i1 %14, label LBL_8, label LBL_6\n LBL_6:\n %15 = sext i32 %13 to i64\n %16 = mul i64 %15, 4\n %17 = add i64 %16, %7\n %18 = inttoptr i64 %17 to i32*\n store i32 1, i32* %18, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_7\n LBL_7:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %19 = mul i64 %indvars.iv.reload, 4\n %20 = add i64 %19, %7\n %21 = inttoptr i64 %20 to i32*\n %22 = load i32, i32* %21, align 4\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_7\n LBL_8:\n %25 = call i64 @FUNC(i64 ptrtoint ([36 x i8]* @gv_3 to i64))\n br label LBL_9\n LBL_9:\n call void @free(i64* %6)\n br label LBL_10\n LBL_10:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %13, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 0, 2 }\n uselistorder i64* %indvars.iv5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder %_IO_FILE** @gv_1, { 2, 1, 0 }\n uselistorder label LBL_10, { 1, 2, 0 }\n uselistorder label LBL_9, { 1, 0 }\n uselistorder label LBL_4, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fgets_multiply_17-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = bitcast i64* %sv_0 to i8*\n store i64 0, i64* %sv_0, align 8\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i8* @fgets(i8* nonnull %1, i32 14, %_IO_FILE* %2)\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_1, label LBL_2\n LBL_1:\n %5 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n br label LBL_6\n LBL_2:\n %6 = call i32 @atoi(i8* nonnull %1)\n %7 = icmp slt i32 %6, 1\n br i1 %7, label LBL_6, label LBL_3\n LBL_3:\n %8 = icmp sgt i32 %6, 1073741822\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %9 = mul i32 %6, 2\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n br label LBL_6\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %0, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %6, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder label LBL_6, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int_malloc_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call i64* @malloc(i32 400)\n %1 = icmp eq i64* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %3 = bitcast i64* %0 to i32*\n store i32 5, i32* %3, align 4\n %4 = call i64 @FUNC(i64 5)\n call void @free(i64* %0)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__char_type_overrun_memcpy_08-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__char_type_overrun_memcpy_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n %5 = call i64* @memcpy(i64* nonnull %sv_0, i64* bitcast ([32 x i8]* @gv_0 to i64*), i32 32)\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = call i64 @FUNC(i64 %6)\n %8 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_0 to i64))\n br label LBL_2\n LBL_2:\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder [32 x i8]* @gv_0, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_dest_char_cpy_09-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @malloc(i32 100)\n %2 = icmp eq i64* %1, null\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 -1)\n unreachable\n LBL_2:\n %4 = bitcast i64* %1 to i8*\n store i8 0, i8* %4, align 1\n %5 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strcpy(i8* %4, i8* nonnull %6)\n %8 = ptrtoint i64* %1 to i64\n %9 = call i64 @FUNC(i64 %8)\n call void @free(i64* %1)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %1, { 0, 1, 3, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_printf_07-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_0, i32 0, i32 16)\n store i64 2, i64* %sv_0, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_0 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = load i32, i32* @gv_0, align 4\n %30 = icmp eq i32 %29, 5\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_11, label LBL_10\n LBL_10:\n %32 = call i32 @puts(i8* nonnull %1)\n br label LBL_11\n LBL_11:\n %33 = call i64 @FUNC(i64 40)\n %34 = icmp eq i64 %0, %33\n store i64 0, i64* %rax.0.reg2mem\n br i1 %34, label LBL_13, label LBL_12\n LBL_12:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_13\n LBL_13:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 3, 0, 1, 2 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 1 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_file_snprintf_15-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = bitcast i64* %sv_1 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = sub i32 100, %2\n %9 = ptrtoint i64* %sv_1 to i64\n %10 = add i64 %3, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %8, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n store i64 0, i64* %sv_0, align 8\n %17 = bitcast i64* %sv_0 to i8*\n %18 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %17, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_3, i64 0, i64 0), i64* nonnull %sv_1)\n %19 = ptrtoint i64* %sv_0 to i64\n %20 = call i64 @FUNC(i64 %19)\n %21 = call i64 @FUNC(i64 40)\n %22 = icmp eq i64 %0, %21\n store i64 0, i64* %rax.0.reg2mem\n br i1 %22, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 0, 2 }\n uselistorder i8* (i8*, i32, %_IO_FILE*)* @fgets, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_ncat_10-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = bitcast i64* %sv_2 to i8*\n store i8 0, i8* %4, align 8\n store i8* %4, i8** %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %5 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @strncat(i8* %sv_0.0.reload, i8* nonnull %6, i32 100)\n %8 = ptrtoint i8* %sv_0.0.reload to i64\n %9 = call i64 @FUNC(i64 %8)\n %10 = call i64 @FUNC(i64 40)\n %11 = icmp eq i64 %0, %10\n store i64 0, i64* %rax.0.reg2mem\n br i1 %11, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_preinc_32-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @rand()\n %2 = urem i32 %1, 2\n %3 = icmp eq i32 %2, 0\n %4 = call i32 @rand()\n %5 = zext i32 %4 to i64\n %6 = mul i64 %5, 1152921504606846976\n %7 = call i32 @rand()\n %8 = zext i32 %7 to i64\n %9 = mul i64 %8, 35184372088832\n %10 = call i32 @rand()\n %11 = sext i32 %10 to i64\n %12 = mul i64 %11, 1073741824\n %13 = call i32 @rand()\n %14 = sext i32 %13 to i64\n %15 = mul i64 %14, 32768\n %16 = call i32 @rand()\n %17 = sext i32 %16 to i64\n %18 = sext i1 %3 to i64\n %19 = xor i64 %6, %18\n %20 = xor i64 %19, %9\n %21 = xor i64 %20, %12\n %22 = xor i64 %21, %15\n %storemerge = xor i64 %22, %17\n %23 = icmp eq i64 %storemerge, 9223372036854775807\n br i1 %23, label LBL_2, label LBL_1\n LBL_1:\n %24 = add i64 %storemerge, 1\n %25 = call i64 @FUNC(i64 %24)\n br label LBL_3\n LBL_2:\n %26 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge, { 1, 0 }\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_for_loop_12-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge16.reg2mem = alloca i64\n %storemerge7.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = call i64 @FUNC()\n %2 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %3 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = load i32, i32* %sv_0, align 4\n %.off = add i32 %7, -1\n %8 = icmp ugt i32 %.off, 19\n br i1 %6, label LBL_3, label LBL_1\n LBL_1:\n store i64 0, i64* %storemerge7.reg2mem\n br i1 %8, label LBL_5, label LBL_2\n LBL_2:\n %storemerge7.reload = load i64, i64* %storemerge7.reg2mem\n %9 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %10 = add nuw i64 %storemerge7.reload, 1\n %11 = load i32, i32* %sv_0, align 4\n %12 = sext i32 %11 to i64\n %13 = icmp ult i64 %10, %12\n store i64 %10, i64* %storemerge7.reg2mem\n br i1 %13, label LBL_2, label LBL_5\n LBL_3:\n store i64 0, i64* %storemerge16.reg2mem\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %storemerge16.reload = load i64, i64* %storemerge16.reg2mem\n %14 = call i64 @FUNC(i64 ptrtoint ([6 x i8]* @gv_2 to i64))\n %15 = add nuw i64 %storemerge16.reload, 1\n %16 = load i32, i32* %sv_0, align 4\n %17 = sext i32 %16 to i64\n %18 = icmp ult i64 %15, %17\n store i64 %15, i64* %storemerge16.reg2mem\n br i1 %18, label LBL_4, label LBL_5\n LBL_5:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %8, { 1, 0 }\n uselistorder i32* %sv_0, { 1, 3, 2, 0, 4 }\n uselistorder i64* %storemerge7.reg2mem, { 2, 0, 1 }\n uselistorder i64* %storemerge16.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 2, 0, 3 }\n uselistorder label LBL_4, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fgets_divide_14-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = load i32, i32* @gv_2, align 4\n %11 = icmp eq i32 %10, 5\n br i1 %11, label LBL_6, label LBL_5\n LBL_5:\n %12 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))\n br label LBL_9\n LBL_6:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = icmp eq i32 %sv_0.0.reload, 0\n br i1 %13, label LBL_8, label LBL_7\n LBL_7:\n %14 = udiv i32 100, %sv_0.0.reload\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n br label LBL_9\n LBL_8:\n %17 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_4 to i64))\n br label LBL_9\n LBL_9:\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fscanf_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %1 = load i128, i128* %0\n %2 = load i128, i128* %0\n %3 = call i128 @FUNC(i128 %2, i128 %2)\n %4 = call i64 @FUNC(i128 %3)\n %5 = call i64 @FUNC()\n %6 = call i128 @__asm_movss.1(i32 1073741824)\n %7 = call i64 @FUNC(i128 %6)\n %storemerge1 = trunc i64 %7 to i32\n %8 = call i64 @FUNC()\n %9 = call i128 @FUNC(i128 %1, i128 %1)\n %10 = call i128 @__asm_cvtss2sd.2(i32 %storemerge1)\n %11 = call i128 @FUNC(i64 4636737291354636288)\n %12 = call i128 @FUNC(i128 %11, i128 %10)\n %13 = call i32 @FUNC(i128 %12)\n %14 = zext i32 %13 to i64\n %15 = call i64 @FUNC(i64 %14)\n ret i64 %15\n\n uselistorder i128 %2, { 1, 0 }\n uselistorder i128* %0, { 1, 0 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n uselistorder i128 (i32)* @__asm_movss.1, { 0, 3, 1, 2 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__char_alloca_loop_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = ptrtoint i64* %sv_1 to i64\n %3 = call i64 @FUNC(i64 40)\n %4 = add i64 %2, -97\n %5 = and i64 %4, -16\n %6 = inttoptr i64 %5 to i64*\n %7 = call i64* @memset(i64* %6, i32 65, i32 99)\n %8 = add i64 %5, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = load i32, i32* @gv_0, align 4\n %11 = icmp eq i32 %10, 0\n %spec.select = select i1 %11, i64 %1, i64 %5\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %13 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %14 = add i64 %storemerge1.reload, %spec.select\n %15 = add i64 %storemerge1.reload, %13\n %16 = inttoptr i64 %15 to i8*\n %17 = load i8, i8* %16, align 1\n %18 = inttoptr i64 %14 to i8*\n store i8 %17, i8* %18, align 1\n %19 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %19, 100\n store i64 %19, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %20 = add i64 %spec.select, 99\n %21 = inttoptr i64 %20 to i8*\n store i8 0, i8* %21, align 1\n %22 = call i64 @FUNC(i64 %spec.select)\n %23 = call i64 @FUNC(i64 40)\n %24 = icmp eq i64 %3, %23\n store i64 0, i64* %rax.0.reg2mem\n br i1 %24, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %spec.select, { 2, 1, 0 }\n uselistorder i64 %5, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_cpy_02-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8* %4, i8** %sv_1, align 8\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memset(i64* %5, i32 65, i32 99)\n %7 = load i8*, i8** %sv_1, align 8\n %8 = ptrtoint i8* %7 to i64\n %9 = add i64 %8, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = load i8*, i8** %sv_1, align 8\n %12 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 199)\n %13 = bitcast i64* %sv_0 to i8*\n %14 = call i8* @strcpy(i8* nonnull %13, i8* %11)\n %15 = call i64 @FUNC(i64* nonnull %sv_0)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %1, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8** %sv_1, { 3, 2, 1, 0 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 1, 0, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_multiply_08-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.1.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %3, label LBL_9, label LBL_1\n LBL_1:\n %4 = call i32 @socket(i32 2, i32 1, i32 6)\n %5 = icmp eq i32 %4, -1\n store i32 0, i32* %sv_0.1.reg2mem\n br i1 %5, label LBL_9, label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %7 = call i16 @htons(i16 27015)\n %8 = bitcast i64* %sv_2 to %sockaddr*\n %9 = call i32 @bind(i32 %4, %sockaddr* nonnull %8, i32 16)\n %10 = icmp eq i32 %9, -1\n br i1 %10, label LBL_7, label LBL_3\n LBL_3:\n %11 = call i32 @listen(i32 %4, i32 5)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_7, label LBL_4\n LBL_4:\n %13 = call i32 @accept(i32 %4, %sockaddr* null, i32* null)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = call i32 @recv(i32 %13, i64* nonnull %sv_1, i32 13, i32 0)\n %16 = add i32 %15, 1\n %17 = icmp ult i32 %16, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %17, label LBL_8, label LBL_6\n LBL_6:\n %18 = ptrtoint i64* %sv_3 to i64\n %19 = sext i32 %15 to i64\n %20 = add i64 %18, -22\n %21 = add i64 %20, %19\n %22 = inttoptr i64 %21 to i8*\n store i8 0, i8* %22, align 1\n %23 = bitcast i64* %sv_1 to i8*\n %24 = call i32 @atoi(i8* nonnull %23)\n store i32 %24, i32* %sv_0.0.ph.reg2mem\n br label LBL_8\n LBL_7:\n %25 = call i32 @close(i32 %4)\n store i32 0, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_8:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %26 = call i32 @close(i32 %4)\n %27 = call i32 @close(i32 %13)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem\n br label LBL_9\n LBL_9:\n %sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem\n %28 = call i64 @FUNC()\n %29 = trunc i64 %28 to i32\n %30 = icmp eq i32 %29, 0\n %31 = icmp slt i32 %sv_0.1.reload, 0\n %32 = icmp eq i1 %31, false\n %or.cond = or i1 %32, %30\n br i1 %or.cond, label LBL_13, label LBL_10\n LBL_10:\n %33 = icmp slt i32 %sv_0.1.reload, -1073741823\n br i1 %33, label LBL_12, label LBL_11\n LBL_11:\n %34 = mul i32 %sv_0.1.reload, 2\n %35 = zext i32 %34 to i64\n %36 = call i64 @FUNC(i64 %35)\n br label LBL_13\n LBL_12:\n %37 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_0 to i64))\n br label LBL_13\n LBL_13:\n %38 = call i64 @FUNC(i64 40)\n %39 = icmp eq i64 %0, %38\n store i64 0, i64* %rax.0.reg2mem\n br i1 %39, label LBL_15, label LBL_14\n LBL_14:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_15\n LBL_15:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %sv_0.1.reload, { 2, 0, 1 }\n uselistorder i32 %15, { 1, 0 }\n uselistorder i32 %4, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.1.reg2mem, { 0, 3, 2, 1, 4 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder label LBL_9, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_environment_execl_13-bad", "fun_name": "CWE78_OS_Command_Injection__char_environment_execl_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = load i32, i32* inttoptr (i64 8352 to i32*), align 32\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = sext i32 %5 to i64\n %9 = ptrtoint i64* %sv_0 to i64\n %10 = add i64 %8, %9\n %11 = inttoptr i64 %10 to i8*\n %12 = sub i32 99, %5\n %13 = call i8* @strncat(i8* %11, i8* nonnull %6, i32 %12)\n br label LBL_3\n LBL_3:\n %14 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_1, i64 0, i64 0))\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__malloc_char_memmove_14-bad", "fun_name": "CWE127_Buffer_Underread__malloc_char_memmove_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %7 = ptrtoint i64* %4 to i64\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n %11 = add i64 %7, -8\n %phitmp = inttoptr i64 %11 to i64*\n store i64* %phitmp, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %13 = call i64* @memmove(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 100)\n %14 = call i64 @FUNC(i64* nonnull %sv_1)\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %4, { 0, 2, 1 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_loop_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 100)\n %5 = ptrtoint i64* %4 to i64\n %6 = icmp eq i64* %4, null\n %7 = icmp eq i1 %6, false\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %8 = call i64* @memset(i64* %4, i32 65, i32 99)\n %9 = add i64 %5, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n br label LBL_7\n LBL_4:\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n call void @exit(i32 -1)\n unreachable\n LBL_6:\n %11 = call i64* @memset(i64* %4, i32 65, i32 99)\n %12 = add i64 %5, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n br label LBL_7\n LBL_7:\n %14 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %15 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_8\n LBL_8:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %16 = add i64 %storemerge2.reload, %5\n %17 = add i64 %storemerge2.reload, %15\n %18 = inttoptr i64 %17 to i8*\n %19 = load i8, i8* %18, align 1\n %20 = inttoptr i64 %16 to i8*\n store i8 %19, i8* %20, align 1\n %21 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %21, 100\n store i64 %21, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_9, label LBL_8\n LBL_9:\n %22 = add i64 %5, 99\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i64 @FUNC(i64 %5)\n %25 = call i64 @FUNC(i64 40)\n %26 = icmp eq i64 %0, %25\n store i64 0, i64* %rax.0.reg2mem\n br i1 %26, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i1 %7, { 1, 0 }\n uselistorder i64 %5, { 2, 1, 0, 4, 3 }\n uselistorder i64* %4, { 1, 0, 2, 3 }\n uselistorder i64* %sv_0, { 1, 0 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 0, 2, 1, 3 }\n uselistorder i32 99, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_struct_13-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_0, align 8\n br label LBL_2\n LBL_2:\n %4 = call i64 @FUNC(i64* nonnull %sv_0)\n %5 = call i64 @FUNC(i64 40)\n %6 = icmp eq i64 %0, %5\n store i64 0, i64* %rax.0.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_08-bad", "fun_name": "CWE127_Buffer_Underread__char_declare_memmove_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 99)\n %2 = call i64 @FUNC()\n %3 = trunc i64 %2 to i32\n %4 = icmp eq i32 %3, 0\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = ptrtoint i64* %sv_1 to i64\n store i64 %5, i64* %sv_1, align 8\n br label LBL_2\n LBL_2:\n %6 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %7 = load i64, i64* %sv_1, align 8\n %8 = inttoptr i64 %7 to i64*\n %9 = call i64* @memmove(i64* nonnull %sv_0, i64* %8, i32 100)\n %10 = call i64 @FUNC(i64* nonnull %sv_0)\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_declare_memmove_14-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i64\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %1 = load i64, i64* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 5\n %6 = icmp eq i1 %5, false\n %7 = ptrtoint i64* %sv_1 to i64\n %spec.select = select i1 %6, i64 %1, i64 %7\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = inttoptr i64 %spec.select to i64*\n %10 = call i64* @memmove(i64* nonnull %sv_0, i64* %9, i32 100)\n %11 = ptrtoint i64* %sv_0 to i64\n %12 = call i64 @FUNC(i64 %11)\n %13 = call i64 @FUNC(i64 40)\n %14 = icmp eq i64 %2, %13\n store i64 0, i64* %rax.0.reg2mem\n br i1 %14, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i64* %sv_0, { 2, 0, 1 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 3, 2, 0, 1, 4 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_loop_32-bad", "fun_name": "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_loop_32_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -17\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i8*\n store i8 0, i8* %4, align 16\n store i64 %3, i64* %sv_1, align 8\n store i64 4702111234474983745, i64* %sv_0, align 8\n %5 = bitcast i64* %sv_0 to i8*\n %6 = call i32 @strlen(i8* nonnull %5)\n %7 = sext i32 %6 to i64\n %8 = add nsw i64 %7, 1\n %9 = icmp eq i64 %8, 0\n br i1 %9, label LBL_3, label LBL_1\n LBL_1:\n %10 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge2.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %11 = add i64 %storemerge2.reload, %3\n %12 = add i64 %storemerge2.reload, %10\n %13 = inttoptr i64 %12 to i8*\n %14 = load i8, i8* %13, align 1\n %15 = inttoptr i64 %11 to i8*\n store i8 %14, i8* %15, align 1\n %16 = add nuw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %16, %8\n store i64 %16, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_3, label LBL_2\n LBL_3:\n %17 = call i64 @FUNC(i64 %3)\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %1, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge2.reload, { 0, 2, 1 }\n uselistorder i64 %3, { 1, 0, 2, 3 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE606_Unchecked_Loop_Condition__char_connect_socket_14-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.lcssa.reg2mem = alloca i64\n %storemerge5.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_3, align 8\n %1 = bitcast i64* %sv_3 to i8*\n %2 = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %2, 5\n %4 = icmp eq i1 %3, false\n br i1 %4, label LBL_9, label LBL_1\n LBL_1:\n %5 = call i32 @strlen(i8* nonnull %1)\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %cond = icmp eq i32 %6, -1\n br i1 %cond, label LBL_9, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_1, i64 0, i64 0))\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @connect(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_8, label LBL_3\n LBL_3:\n %13 = sext i32 %5 to i64\n %14 = ptrtoint i64* %sv_3 to i64\n %15 = add i64 %13, %14\n %16 = inttoptr i64 %15 to i64*\n %17 = sub i32 99, %5\n %18 = call i32 @recv(i32 %6, i64* %16, i32 %17, i32 0)\n %19 = add i32 %18, 1\n %20 = icmp ult i32 %19, 2\n br i1 %20, label LBL_8, label LBL_4\n LBL_4:\n %21 = sext i32 %18 to i64\n %22 = add i64 %15, %21\n %23 = inttoptr i64 %22 to i8*\n store i8 0, i8* %23, align 1\n %24 = call i8* @strchr(i8* nonnull %1, i32 13)\n %25 = icmp eq i8* %24, null\n br i1 %25, label LBL_6, label LBL_5\n LBL_5:\n store i8 0, i8* %24, align 1\n br label LBL_6\n LBL_6:\n %26 = call i8* @strchr(i8* nonnull %1, i32 10)\n %27 = icmp eq i8* %26, null\n br i1 %27, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %26, align 1\n br label LBL_8\n LBL_8:\n %28 = call i32 @close(i32 %6)\n br label LBL_9\n LBL_9:\n %29 = load i32, i32* @gv_0, align 4\n %30 = icmp eq i32 %29, 5\n %31 = icmp eq i1 %30, false\n br i1 %31, label LBL_16, label LBL_10\n LBL_10:\n %32 = call i32 (i8*, i8*, ...) @sscanf(i8* nonnull %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_1)\n %33 = icmp eq i32 %32, 1\n %34 = icmp eq i1 %33, false\n br i1 %34, label LBL_16, label LBL_11\n LBL_11:\n %35 = load i64, i64* %sv_1, align 8\n %36 = trunc i64 %35 to i32\n %37 = icmp sgt i32 %36, 9999\n br i1 %37, label LBL_16, label LBL_12\n LBL_12:\n %38 = and i64 %35, 4294967295\n %39 = icmp eq i64 %38, 0\n store i32 0, i32* %storemerge5.reg2mem\n store i64 0, i64* %sv_0.0.lcssa.reg2mem\n br i1 %39, label LBL_15, label LBL_13\n LBL_13:\n %storemerge5.reload = load i32, i32* %storemerge5.reg2mem\n %40 = add i32 %storemerge5.reload, 1\n %41 = sext i32 %40 to i64\n %42 = icmp sgt i64 %38, %41\n store i32 %40, i32* %storemerge5.reg2mem\n br i1 %42, label LBL_13, label LBL_14\n LBL_14:\n %phitmp = zext i32 %40 to i64\n store i64 %phitmp, i64* %sv_0.0.lcssa.reg2mem\n br label LBL_15\n LBL_15:\n %sv_0.0.lcssa.reload = load i64, i64* %sv_0.0.lcssa.reg2mem\n %43 = call i64 @FUNC(i64 %sv_0.0.lcssa.reload)\n br label LBL_16\n LBL_16:\n %44 = call i64 @FUNC(i64 40)\n %45 = icmp eq i64 %0, %44\n store i64 0, i64* %rax.0.reg2mem\n br i1 %45, label LBL_18, label LBL_17\n LBL_17:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_18\n LBL_18:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %40, { 1, 0, 2 }\n uselistorder i32 %18, { 1, 0 }\n uselistorder i32 %6, { 3, 1, 2, 0 }\n uselistorder i8* %1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i64* %sv_1, { 1, 0 }\n uselistorder i32* %storemerge5.reg2mem, { 2, 0, 1 }\n uselistorder i64* %sv_0.0.lcssa.reg2mem, { 0, 2, 1 }\n uselistorder i32 (i32)* @close, { 1, 0, 2 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 -1, { 2, 0, 3, 1 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_15, { 1, 0 }\n uselistorder label LBL_13, { 1, 0 }\n uselistorder label LBL_9, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE135_15-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8*, align 8\n %0 = ptrtoint i8** %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @gv_0, i64 0, i64 0), i8** %sv_0, align 8\n %2 = call i32 @strlen(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @gv_0, i64 0, i64 0))\n %3 = sext i32 %2 to i64\n %4 = add nsw i64 %3, 24\n %5 = udiv i64 %4, 16\n %6 = mul i64 %5, 16\n %7 = and i64 %6, -4096\n %8 = and i64 %6, 4080\n %9 = add i64 %0, 15\n %10 = sub i64 %9, %8\n %11 = sub i64 %10, %7\n %12 = and i64 %11, -16\n %13 = load i8*, i8** %sv_0, align 8\n %14 = inttoptr i64 %12 to i8*\n %15 = call i8* @strcpy(i8* %14, i8* %13)\n %16 = call i64 @FUNC(i64 %12)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %12, { 1, 0 }\n uselistorder i64 %6, { 1, 0 }\n uselistorder i8** %sv_0, { 2, 1, 0 }\n uselistorder i8* (i8*, i8*)* @strcpy, { 1, 0, 2 }\n uselistorder i64 16, { 0, 4, 1, 5, 2, 6, 3, 7 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_environment_printf_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_0, i64 0, i64 0))\n %4 = icmp eq i8* %3, null\n br i1 %4, label LBL_2, label LBL_1\n LBL_1:\n %5 = sext i32 %2 to i64\n %6 = ptrtoint i64* %sv_0 to i64\n %7 = add i64 %5, %6\n %8 = inttoptr i64 %7 to i8*\n %9 = sub i32 99, %2\n %10 = call i8* @strncat(i8* %8, i8* nonnull %3, i32 %9)\n br label LBL_2\n LBL_2:\n %11 = call i32 @puts(i8* nonnull %1)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE127_Buffer_Underread__char_alloca_loop_02-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge1.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -97\n %3 = and i64 %2, -16\n %4 = inttoptr i64 %3 to i64*\n %5 = call i64* @memset(i64* %4, i32 65, i32 99)\n %6 = add i64 %3, 99\n %7 = inttoptr i64 %6 to i8*\n store i8 0, i8* %7, align 1\n %8 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %9 = ptrtoint i64* %sv_0 to i64\n store i64 0, i64* %storemerge1.reg2mem\n br label LBL_1\n LBL_1:\n %storemerge1.reload = load i64, i64* %storemerge1.reg2mem\n %10 = add i64 %storemerge1.reload, %3\n %11 = inttoptr i64 %10 to i8*\n %12 = load i8, i8* %11, align 1\n %13 = add i64 %storemerge1.reload, %9\n %14 = inttoptr i64 %13 to i8*\n store i8 %12, i8* %14, align 1\n %15 = add nuw nsw i64 %storemerge1.reload, 1\n %exitcond = icmp eq i64 %15, 100\n store i64 %15, i64* %storemerge1.reg2mem\n br i1 %exitcond, label LBL_2, label LBL_1\n LBL_2:\n %16 = call i64 @FUNC(i64* nonnull %sv_0)\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %storemerge1.reload, { 0, 2, 1 }\n uselistorder i64 %3, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 0, 2, 1 }\n uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE426_Untrusted_Search_Path__char_system_07-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_0 to i64\n store i64 7955998172649846063, i64* %sv_0, align 8\n %5 = add i64 %4, 8\n %6 = inttoptr i64 %5 to i64*\n store i64 27422013814697007, i64* %6, align 8\n br label LBL_3\n LBL_3:\n %7 = bitcast i64* %sv_0 to i8*\n %8 = call i32 @system(i8* nonnull %7)\n %9 = icmp eq i32 %8, 0\n %10 = icmp slt i32 %8, 0\n %11 = icmp eq i1 %10, false\n %12 = icmp eq i1 %9, false\n %13 = icmp eq i1 %11, %12\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n %14 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_2 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_5:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %8, { 1, 0 }\n uselistorder i64* %sv_0, { 2, 1, 0, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE590_Free_Memory_Not_on_Heap__free_char_alloca_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %sv_0.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8376 to i32*), align 8\n %1 = icmp eq i32 %0, 5\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_4, label LBL_3\n LBL_3:\n %6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %7 = ptrtoint i64* %3 to i64\n %8 = call i64* @memset(i64* %3, i32 65, i32 99)\n %9 = add i64 %7, 99\n %10 = inttoptr i64 %9 to i8*\n store i8 0, i8* %10, align 1\n store i64 %7, i64* %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %11 = call i64 @FUNC(i64 %sv_0.0.reload)\n %12 = inttoptr i64 %sv_0.0.reload to i64*\n call void @free(i64* %12)\n ret i64 ptrtoint (i32* @1 to i64)\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fscanf_fwrite_13-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge23.reg2mem = alloca i64\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = icmp eq %_IO_FILE* %0, null\n %2 = icmp eq i1 %1, false\n store i64 0, i64* %storemerge23.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %3 = call i32 @fwrite(i64* bitcast ([51 x i8]* @gv_2 to i64*), i32 1, i32 50, %_IO_FILE* %0)\n %4 = icmp eq i32 %3, 50\n br i1 %4, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 1)\n unreachable\n LBL_4:\n %storemerge23.reload = load i64, i64* %storemerge23.reg2mem\n %5 = add nuw nsw i64 %storemerge23.reload, 1\n %6 = icmp ult i64 %5, 20\n store i64 %5, i64* %storemerge23.reg2mem\n br i1 %6, label LBL_2, label LBL_5\n LBL_5:\n %7 = call i32 @fclose(%_IO_FILE* nonnull %0)\n %8 = sext i32 %7 to i64\n ret i64 %8\n\n uselistorder %_IO_FILE* %0, { 1, 0, 2 }\n uselistorder i64* %storemerge23.reg2mem, { 2, 0, 1 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i64*, i32, i32, %_IO_FILE*)* @fwrite, { 3, 2, 1, 0, 4 }\n uselistorder void (i32)* @exit, { 7, 6, 5, 4, 3, 2, 1, 0, 8 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 2, 0, 1, 3, 4 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_connect_socket_postdec_09-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.045.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.045.reg2mem\n br i1 %2, label LBL_5, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))\n %5 = call i16 @htons(i16 27015)\n %6 = bitcast i64* %sv_2 to %sockaddr*\n %7 = call i32 @connect(i32 %1, %sockaddr* nonnull %6, i32 16)\n %8 = icmp eq i32 %7, -1\n br i1 %8, label LBL_3, label LBL_2\n LBL_2:\n %9 = call i32 @recv(i32 %1, i64* nonnull %sv_1, i32 13, i32 0)\n %10 = add i32 %9, 1\n %11 = icmp ult i32 %10, 2\n br i1 %11, label LBL_3, label LBL_4\n LBL_3:\n %12 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.045.reg2mem\n br label LBL_5\n LBL_4:\n %13 = ptrtoint i64* %sv_3 to i64\n %14 = sext i32 %9 to i64\n %15 = add i64 %13, -22\n %16 = add i64 %15, %14\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = bitcast i64* %sv_1 to i8*\n %19 = call i32 @atoi(i8* nonnull %18)\n %20 = call i32 @close(i32 %1)\n %21 = icmp eq i32 %19, -2147483648\n store i32 %19, i32* %sv_0.045.reg2mem\n br i1 %21, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.045.reload = load i32, i32* %sv_0.045.reg2mem\n %22 = add i32 %sv_0.045.reload, -1\n %23 = zext i32 %22 to i64\n %24 = call i64 @FUNC(i64 %23)\n br label LBL_7\n LBL_6:\n %25 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_1 to i64))\n br label LBL_7\n LBL_7:\n %26 = call i64 @FUNC(i64 40)\n %27 = icmp eq i64 %0, %26\n store i64 0, i64* %rax.0.reg2mem\n br i1 %27, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %9, { 1, 0 }\n uselistorder i32 %1, { 3, 0, 1, 2, 4 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.045.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 3, 0, 2, 1, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_connect_socket_snprintf_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_1, align 8\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %5 = ptrtoint i64* %sv_1 to i64\n store i64 8247343692658534758, i64* %sv_1, align 8\n %6 = add i64 %5, 8\n %7 = inttoptr i64 %6 to i64*\n store i64 32777976880262761, i64* %7, align 8\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC()\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, 0\n br i1 %10, label LBL_5, label LBL_4\n LBL_4:\n %11 = bitcast i64* %sv_1 to i8*\n store i64 0, i64* %sv_0, align 8\n %12 = bitcast i64* %sv_0 to i8*\n %13 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %12, i32 99, i8* nonnull %11)\n %14 = ptrtoint i64* %sv_0 to i64\n %15 = call i64 @FUNC(i64 %14)\n br label LBL_5\n LBL_5:\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 2, 0, 1, 3 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_partial_init_05-bad", "fun_name": "CWE457_Use_of_Uninitialized_Variable__int_array_alloca_partial_init_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %indvars.iv4.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_0 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, -33\n %3 = and i64 %2, -16\n %4 = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %4, 0\n store i64 0, i64* %indvars.iv4.reg2mem\n br i1 %5, label LBL_4, label LBL_1\n LBL_1:\n %indvars.iv4.reload = load i64, i64* %indvars.iv4.reg2mem\n %6 = mul i64 %indvars.iv4.reload, 4\n %7 = add i64 %6, %3\n %8 = inttoptr i64 %7 to i32*\n %9 = trunc i64 %indvars.iv4.reload to i32\n store i32 %9, i32* %8, align 4\n %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4.reload, 1\n %exitcond6 = icmp eq i64 %indvars.iv.next5, 5\n store i64 %indvars.iv.next5, i64* %indvars.iv4.reg2mem\n br i1 %exitcond6, label LBL_2, label LBL_1\n LBL_2:\n %.pr = load i32, i32* @gv_0, align 4\n %10 = icmp eq i32 %.pr, 0\n store i64 0, i64* %indvars.iv.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %11 = mul i64 %indvars.iv.reload, 4\n %12 = add i64 %11, %3\n %13 = inttoptr i64 %12 to i32*\n %14 = load i32, i32* %13, align 4\n %15 = zext i32 %14 to i64\n %16 = call i64 @FUNC(i64 %15)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_4, label LBL_3\n LBL_4:\n %17 = call i64 @FUNC(i64 40)\n %18 = icmp eq i64 %1, %17\n store i64 0, i64* %rax.0.reg2mem\n br i1 %18, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %indvars.iv4.reg2mem, { 2, 0, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_4, { 0, 2, 1 }\n uselistorder label LBL_3, { 1, 0 }\n uselistorder label LBL_1, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE398_Poor_Code_Quality__empty_if_13-bad", "fun_name": "CWE398_Poor_Code_Quality__empty_if_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* inttoptr (i64 8380 to i32*), align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n %4 = call i32 @rand()\n %5 = srem i32 %4, 3\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([26 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 ptrtoint ([17 x i8]* @gv_1 to i64))\n store i64 %8, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE253_Incorrect_Check_of_Function_Return_Value__char_sscanf_13-bad", "fun_name": "CWE253_Incorrect_Check_of_Function_Return_Value__char_sscanf_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8364 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n %4 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @gv_1, i64 0, i64 0))\n %5 = icmp eq i32 %4, 0\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_3, label LBL_2\n LBL_2:\n %7 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n br label LBL_3\n LBL_3:\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__char_fscanf_square_11-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i8, align 1\n %0 = call i64 @FUNC(i64 40)\n store i8 32, i8* %sv_0, align 1\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i8* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %6 = call i64 @FUNC()\n %7 = trunc i64 %6 to i32\n %8 = icmp eq i32 %7, 0\n br i1 %8, label LBL_6, label LBL_3\n LBL_3:\n %9 = load i8, i8* %sv_0, align 1\n %10 = sub i8 0, %9\n %11 = icmp slt i8 %10, 0\n %12 = icmp eq i1 %11, false\n %.v = select i1 %12, i8 %10, i8 %9\n %13 = icmp ult i8 %.v, 12\n br i1 %13, label LBL_4, label LBL_5\n LBL_4:\n %14 = mul i8 %9, %9\n %15 = sext i8 %14 to i64\n %16 = and i64 %15, 4294967295\n %17 = call i64 @FUNC(i64 %16)\n br label LBL_6\n LBL_5:\n %18 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8 %9, { 1, 0, 2, 3 }\n uselistorder i8* %sv_0, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 4, 5, 0 }\n uselistorder %_IO_FILE** @gv_0, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE563_Unused_Variable__unused_value_char_05-bad", "fun_name": "CWE563_Unused_Variable__unused_value_char_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_2, label LBL_1\n LBL_1:\n %2 = call i64 @FUNC(i64 90)\n store i64 %2, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE400_Resource_Exhaustion__fgets_sleep_08-bad", "fun_name": "CWE400_Resource_Exhaustion__fgets_sleep_08_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n store i32 -1, i32* %sv_0.0.reg2mem\n br i1 %3, label LBL_4, label LBL_1\n LBL_1:\n store i64 0, i64* %sv_1, align 8\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = bitcast i64* %sv_1 to i8*\n %6 = call i8* @fgets(i8* nonnull %5, i32 14, %_IO_FILE* %4)\n %7 = icmp eq i8* %6, null\n br i1 %7, label LBL_3, label LBL_2\n LBL_2:\n %8 = call i32 @atoi(i8* nonnull %5)\n store i32 %8, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_3:\n %9 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %10 = call i64 @FUNC()\n %11 = trunc i64 %10 to i32\n %12 = icmp eq i32 %11, 0\n br i1 %12, label LBL_6, label LBL_5\n LBL_5:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %13 = call i32 @usleep(i32 %sv_0.0.reload)\n %14 = call i64 @FUNC(i64 ptrtoint ([29 x i8]* @gv_2 to i64))\n br label LBL_6\n LBL_6:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1, 3 }\n uselistorder i64 ()* @staticReturnsTrue, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_05-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %indvars.iv.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i32 7, i32* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))\n store i32 -1, i32* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %4 = load i32, i32* @gv_2, align 4\n %5 = icmp eq i32 %4, 0\n br i1 %5, label LBL_7, label LBL_3\n LBL_3:\n %sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem\n %6 = icmp slt i32 %sv_0.0.reload, 0\n br i1 %6, label LBL_6, label LBL_4\n LBL_4:\n %7 = ptrtoint i64* %sv_1 to i64\n %8 = sext i32 %sv_0.0.reload to i64\n %9 = mul i64 %8, 4\n %10 = add i64 %7, -48\n %11 = add i64 %9, %10\n %12 = inttoptr i64 %11 to i32*\n store i32 1, i32* %12, align 4\n store i64 0, i64* %indvars.iv.reg2mem\n br label LBL_5\n LBL_5:\n %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem\n %13 = mul i64 %indvars.iv.reload, 4\n %14 = add i64 %13, %10\n %15 = inttoptr i64 %14 to i32*\n %16 = load i32, i32* %15, align 4\n %17 = zext i32 %16 to i64\n %18 = call i64 @FUNC(i64 %17)\n %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1\n %exitcond = icmp eq i64 %indvars.iv.next, 10\n store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem\n br i1 %exitcond, label LBL_7, label LBL_5\n LBL_6:\n %19 = call i64 @FUNC(i64 ptrtoint ([32 x i8]* @gv_3 to i64))\n br label LBL_7\n LBL_7:\n %20 = call i64 @FUNC(i64 40)\n %21 = icmp eq i64 %0, %20\n store i64 0, i64* %rax.0.reg2mem\n br i1 %21, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %indvars.iv.reg2mem, { 1, 0, 2 }\n uselistorder i32 -1, { 0, 2, 3, 8, 9, 10, 1, 11, 5, 7, 12, 13, 14, 4, 15, 6 }\n uselistorder i32* @gv_0, { 1, 0 }\n uselistorder label LBL_7, { 1, 0, 2 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_05-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_2, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_14, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_2 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = call i32 @socket(i32 2, i32 1, i32 6)\n %6 = icmp eq i32 %5, -1\n br i1 %6, label LBL_12, label LBL_2\n LBL_2:\n %7 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)\n store i64 2, i64* %sv_1, align 8\n %8 = call i16 @htons(i16 27015)\n %9 = bitcast i64* %sv_1 to %sockaddr*\n %10 = call i32 @bind(i32 %5, %sockaddr* nonnull %9, i32 16)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_10, label LBL_3\n LBL_3:\n %12 = call i32 @listen(i32 %5, i32 5)\n %13 = icmp eq i32 %12, -1\n br i1 %13, label LBL_10, label LBL_4\n LBL_4:\n %14 = call i32 @accept(i32 %5, %sockaddr* null, i32* null)\n %15 = icmp eq i32 %14, -1\n br i1 %15, label LBL_10, label LBL_5\n LBL_5:\n %16 = sext i32 %4 to i64\n %17 = ptrtoint i64* %sv_2 to i64\n %18 = add i64 %16, %17\n %19 = inttoptr i64 %18 to i64*\n %20 = sub i32 99, %4\n %21 = call i32 @recv(i32 %14, i64* %19, i32 %20, i32 0)\n %22 = add i32 %21, 1\n %23 = icmp ult i32 %22, 2\n br i1 %23, label LBL_11, label LBL_6\n LBL_6:\n %24 = sext i32 %21 to i64\n %25 = add i64 %18, %24\n %26 = inttoptr i64 %25 to i8*\n store i8 0, i8* %26, align 1\n %27 = call i8* @strchr(i8* nonnull %3, i32 13)\n %28 = icmp eq i8* %27, null\n br i1 %28, label LBL_8, label LBL_7\n LBL_7:\n store i8 0, i8* %27, align 1\n br label LBL_8\n LBL_8:\n %29 = call i8* @strchr(i8* nonnull %3, i32 10)\n %30 = icmp eq i8* %29, null\n br i1 %30, label LBL_11, label LBL_9\n LBL_9:\n store i8 0, i8* %29, align 1\n br label LBL_11\n LBL_10:\n %31 = call i32 @close(i32 %5)\n br label LBL_12\n LBL_11:\n %32 = call i32 @close(i32 %5)\n %33 = call i32 @close(i32 %14)\n br label LBL_12\n LBL_12:\n %.pr = load i32, i32* @gv_0, align 4\n %34 = icmp eq i32 %.pr, 0\n br i1 %34, label LBL_14, label LBL_13\n LBL_13:\n store i64 0, i64* %sv_0, align 8\n %35 = bitcast i64* %sv_0 to i8*\n %36 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %35, i32 99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_2)\n %37 = ptrtoint i64* %sv_0 to i64\n %38 = call i64 @FUNC(i64 %37)\n br label LBL_14\n LBL_14:\n %39 = call i64 @FUNC(i64 40)\n %40 = icmp eq i64 %0, %39\n store i64 0, i64* %rax.0.reg2mem\n br i1 %40, label LBL_16, label LBL_15\n LBL_15:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_16\n LBL_16:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %21, { 1, 0 }\n uselistorder i32 %5, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_1, { 0, 2, 1 }\n uselistorder i64* %sv_0, { 1, 0, 2 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i8* (i8*, i32)* @strchr, { 3, 2, 1, 0, 4 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, i32)* @listen, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder label LBL_14, { 1, 2, 0 }\n uselistorder label LBL_12, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_fgets_01-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.0.in.reg2mem = alloca i64\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %6 = bitcast i64* %sv_1 to i8*\n %7 = call i8* @fgets(i8* nonnull %6, i32 20, %_IO_FILE* %5)\n %8 = icmp eq i8* %7, null\n br i1 %8, label LBL_2, label LBL_1\n LBL_1:\n %9 = call double @atof(i8* nonnull %6)\n %10 = fptrunc double %9 to float\n %11 = bitcast float %10 to i32\n %12 = sext i32 %11 to i128\n %13 = call i128 @FUNC(i128 %12)\n %14 = call i64 @FUNC(i128 %13)\n store i64 %14, i64* %sv_0.0.in.reg2mem\n br label LBL_3\n LBL_2:\n %15 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))\n store i64 %4, i64* %sv_0.0.in.reg2mem\n br label LBL_3\n LBL_3:\n %sv_0.0.in.reload = load i64, i64* %sv_0.0.in.reg2mem\n %sv_0.0 = trunc i64 %sv_0.0.in.reload to i32\n %16 = call i128 @__asm_movss.1(i32 %sv_0.0)\n %17 = call i128 @__asm_movss.1(i32 2147483647)\n %18 = call i128 @FUNC(i128 %16, i128 %17)\n %19 = call i128 @__asm_cvtss2sd.2(i128 %18)\n %20 = load i128, i128* @gv_2, align 8\n call void @FUNC(i128 %19, i128 %20)\n br i1 %8, label LBL_5, label LBL_4\n LBL_4:\n %21 = call i128 @FUNC(i128 %17, i128 %17)\n %22 = call i128 @FUNC(i32 %sv_0.0)\n %23 = call i128 @FUNC(i64 4636737291354636288)\n %24 = call i128 @FUNC(i128 %23, i128 %22)\n %25 = call i32 @FUNC(i128 %24)\n %26 = zext i32 %25 to i64\n %27 = call i64 @FUNC(i64 %26)\n br label LBL_6\n LBL_5:\n %28 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_3 to i64))\n br label LBL_6\n LBL_6:\n %29 = call i64 @FUNC(i64 40)\n %30 = icmp eq i64 %2, %29\n store i64 0, i64* %rax.0.reg2mem\n br i1 %30, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %17, { 1, 0, 2 }\n uselistorder i32 %sv_0.0, { 1, 0 }\n uselistorder i64* %sv_0.0.in.reg2mem, { 0, 2, 1 }\n uselistorder i64 (i64)* @printIntLine, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_fscanf_sub_05-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n br label LBL_2\n LBL_2:\n %5 = load i32, i32* @gv_3, align 4\n %6 = icmp eq i32 %5, 0\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))\n br label LBL_7\n LBL_4:\n %8 = load i64, i64* %sv_0, align 8\n %9 = trunc i64 %8 to i32\n %10 = icmp eq i32 %9, -2147483648\n br i1 %10, label LBL_6, label LBL_5\n LBL_5:\n %11 = add i64 %8, 4294967295\n %12 = and i64 %11, 4294967295\n %13 = call i64 @FUNC(i64 %12)\n br label LBL_7\n LBL_6:\n %14 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_5 to i64))\n br label LBL_7\n LBL_7:\n %15 = call i64 @FUNC(i64 40)\n %16 = icmp eq i64 %0, %15\n store i64 0, i64* %rax.0.reg2mem\n br i1 %16, label LBL_9, label LBL_8\n LBL_8:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_9\n LBL_9:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 0, 2 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__char_rand_sub_12-bad", "fun_name": "CWE191_Integer_Underflow__char_rand_sub_12_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge4.reg2mem = alloca i32\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i32 -2, i32* %storemerge4.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i32 @rand()\n %4 = urem i32 %3, 2\n %5 = icmp eq i32 %4, 0\n %6 = call i32 @rand()\n %7 = call i32 @rand()\n %8 = call i32 @rand()\n %9 = sext i1 %5 to i32\n %storemerge = xor i32 %8, %9\n %sext = mul i32 %storemerge, 16777216\n %10 = ashr exact i32 %sext, 24\n store i32 %10, i32* %storemerge4.reg2mem\n br label LBL_2\n LBL_2:\n %storemerge4.reload = load i32, i32* %storemerge4.reg2mem\n %11 = call i64 @FUNC()\n %12 = trunc i64 %11 to i32\n %13 = icmp eq i32 %12, 0\n br i1 %13, label LBL_4, label LBL_3\n LBL_3:\n %14 = mul i32 %storemerge4.reload, 16777216\n %sext2 = add i32 %14, -16777216\n %15 = ashr exact i32 %sext2, 24\n %16 = zext i32 %15 to i64\n %17 = call i64 @FUNC(i64 %16)\n store i64 %17, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_4:\n %18 = trunc i32 %storemerge4.reload to i8\n %19 = icmp eq i8 %18, -128\n br i1 %19, label LBL_6, label LBL_5\n LBL_5:\n %20 = mul i32 %storemerge4.reload, 16777216\n %sext3 = add i32 %20, -16777216\n %21 = ashr exact i32 %sext3, 24\n %22 = zext i32 %21 to i64\n %23 = call i64 @FUNC(i64 %22)\n store i64 %23, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_0 to i64))\n store i64 %24, i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %storemerge4.reload, { 2, 0, 1 }\n uselistorder i32* %storemerge4.reg2mem, { 0, 2, 1 }\n uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }\n uselistorder i64 (i64)* @printHexCharLine, { 1, 0 }\n uselistorder i64 ()* @globalReturnsTrueOrFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_memcpy_04-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = ptrtoint i64* %sv_1 to i64\n %1 = call i64 @FUNC(i64 40)\n %2 = add i64 %0, add (i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 4095)), i64 15), i64 add (i64 sub (i64 0, i64 and (i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), i64 -4096)), i64 -416))\n %3 = and i64 %2, -16\n %4 = bitcast i64* %sv_0 to i8*\n call void @FUNC(i8* nonnull %4, i64 0, i64 100)\n %5 = inttoptr i64 %3 to i64*\n %6 = call i64* @memcpy(i64* %5, i64* nonnull %sv_0, i32 ptrtoint (i32* @gv_1 to i32))\n %7 = load i64, i64* %5, align 16\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %1, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 1, 0 }\n uselistorder i64* (i64*, i64*, i32)* @memcpy, { 1, 0, 2 }\n uselistorder i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 ptrtoint ([12 x i8]* @gv_0 to i64), i64 15) to i128), i128 16) to i64) to i128), i128 16) to i64), { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__CWE131_memcpy_12-good", "fun_name": "goodG2B", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64 @FUNC()\n %2 = trunc i64 %1 to i32\n %3 = icmp eq i32 %2, 0\n %4 = call i64* @malloc(i32 40)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %3, label LBL_3, label LBL_1\n LBL_1:\n br i1 %6, label LBL_5, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n br i1 %6, label LBL_5, label LBL_4\n LBL_4:\n call void @exit(i32 -1)\n unreachable\n LBL_5:\n store i64 0, i64* %sv_0, align 8\n %7 = call i64* @memcpy(i64* %4, i64* nonnull %sv_0, i32 40)\n %8 = bitcast i64* %4 to i32*\n %9 = load i32, i32* %8, align 4\n %10 = zext i32 %9 to i64\n %11 = call i64 @FUNC(i64 %10)\n call void @free(i64* %4)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i1 %6, { 1, 0 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i32 40, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int_fscanf_postinc_05-bad", "fun_name": "CWE190_Integer_Overflow__int_fscanf_postinc_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_3, label LBL_1\n LBL_1:\n %3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)\n %.pr = load i32, i32* @gv_0, align 4\n %5 = icmp eq i32 %.pr, 0\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n %6 = load i64, i64* %sv_0, align 8\n %7 = mul i64 %6, 4294967296\n %sext = add i64 %7, 4294967296\n %8 = ashr exact i64 %sext, 32\n store i64 %8, i64* %sv_0, align 8\n %9 = and i64 %8, 4294967295\n %10 = call i64 @FUNC(i64 %9)\n br label LBL_3\n LBL_3:\n %11 = call i64 @FUNC(i64 40)\n %12 = icmp eq i64 %0, %11\n store i64 0, i64* %rax.0.reg2mem\n br i1 %12, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_0, { 1, 2, 0, 3 }\n uselistorder %_IO_FILE** @gv_1, { 1, 0 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int_listen_socket_predec_02-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0368.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i32 @socket(i32 2, i32 1, i32 6)\n %2 = icmp eq i32 %1, -1\n store i32 0, i32* %sv_0.0368.reg2mem\n br i1 %2, label LBL_8, label LBL_1\n LBL_1:\n %3 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %4 = call i16 @htons(i16 27015)\n %5 = bitcast i64* %sv_2 to %sockaddr*\n %6 = call i32 @bind(i32 %1, %sockaddr* nonnull %5, i32 16)\n %7 = icmp eq i32 %6, -1\n br i1 %7, label LBL_6, label LBL_2\n LBL_2:\n %8 = call i32 @listen(i32 %1, i32 5)\n %9 = icmp eq i32 %8, -1\n br i1 %9, label LBL_6, label LBL_3\n LBL_3:\n %10 = call i32 @accept(i32 %1, %sockaddr* null, i32* null)\n %11 = icmp eq i32 %10, -1\n br i1 %11, label LBL_6, label LBL_4\n LBL_4:\n %12 = call i32 @recv(i32 %10, i64* nonnull %sv_1, i32 13, i32 0)\n %13 = add i32 %12, 1\n %14 = icmp ult i32 %13, 2\n store i32 0, i32* %sv_0.0.ph.reg2mem\n br i1 %14, label LBL_7, label LBL_5\n LBL_5:\n %15 = ptrtoint i64* %sv_3 to i64\n %16 = sext i32 %12 to i64\n %17 = add i64 %15, -22\n %18 = add i64 %17, %16\n %19 = inttoptr i64 %18 to i8*\n store i8 0, i8* %19, align 1\n %20 = bitcast i64* %sv_1 to i8*\n %21 = call i32 @atoi(i8* nonnull %20)\n store i32 %21, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %22 = call i32 @close(i32 %1)\n store i32 0, i32* %sv_0.0368.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %23 = call i32 @close(i32 %1)\n %24 = call i32 @close(i32 %10)\n %25 = icmp eq i32 %sv_0.0.ph.reload, -2147483648\n store i32 %sv_0.0.ph.reload, i32* %sv_0.0368.reg2mem\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %sv_0.0368.reload = load i32, i32* %sv_0.0368.reg2mem\n %26 = add i32 %sv_0.0368.reload, -1\n %27 = zext i32 %26 to i64\n %28 = call i64 @FUNC(i64 %27)\n br label LBL_10\n LBL_9:\n %29 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_0 to i64))\n br label LBL_10\n LBL_10:\n %30 = call i64 @FUNC(i64 40)\n %31 = icmp eq i64 %0, %30\n store i64 0, i64* %rax.0.reg2mem\n br i1 %31, label LBL_12, label LBL_11\n LBL_11:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_12\n LBL_12:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %12, { 1, 0 }\n uselistorder i32 %1, { 4, 0, 1, 2, 3, 5 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.0368.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32)* @bind, { 1, 0, 2 }\n uselistorder i16 (i16)* @htons, { 1, 0, 2 }\n uselistorder i32 (i32, i32, i32)* @socket, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n uselistorder label LBL_7, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_04-bad", "fun_name": "CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_04_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0))\n %1 = ptrtoint %_IO_FILE* %0 to i64\n ret i64 %1\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__int_fscanf_modulo_13-bad", "fun_name": "CWE369_Divide_by_Zero__int_fscanf_modulo_13_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i32\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 8340 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i32 -1, i32* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n store i32 %.pre, i32* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i32, i32* %.reg2mem\n %6 = urem i32 100, %.reload\n %7 = zext i32 %6 to i64\n %8 = call i64 @FUNC(i64 %7)\n %9 = call i64 @FUNC(i64 40)\n %10 = icmp eq i64 %0, %9\n store i64 0, i64* %rax.0.reg2mem\n br i1 %10, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE78_OS_Command_Injection__char_file_execl_17-bad", "fun_name": "CWE78_OS_Command_Injection__char_file_execl_17_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 2126700, i64* %sv_0, align 8\n %1 = bitcast i64* %sv_0 to i8*\n %2 = call i32 @strlen(i8* nonnull %1)\n %3 = sext i32 %2 to i64\n %4 = sub nsw i64 100, %3\n %5 = icmp ult i64 %4, 2\n br i1 %5, label LBL_5, label LBL_1\n LBL_1:\n %6 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @gv_0, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @gv_1, i64 0, i64 0))\n %7 = icmp eq %_IO_FILE* %6, null\n br i1 %7, label LBL_5, label LBL_2\n LBL_2:\n %8 = ptrtoint i64* %sv_0 to i64\n %9 = sub i32 100, %2\n %10 = add i64 %3, %8\n %11 = inttoptr i64 %10 to i8*\n %12 = call i8* @fgets(i8* %11, i32 %9, %_IO_FILE* nonnull %6)\n %13 = icmp eq i8* %12, null\n %14 = icmp eq i1 %13, false\n br i1 %14, label LBL_4, label LBL_3\n LBL_3:\n %15 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %11, align 1\n br label LBL_4\n LBL_4:\n %16 = call i32 @fclose(%_IO_FILE* nonnull %6)\n br label LBL_5\n LBL_5:\n %17 = call i32 (i8*, i8*, ...) @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @gv_3, i64 0, i64 0))\n %18 = call i64 @FUNC(i64 40)\n %19 = icmp eq i64 %0, %18\n store i64 0, i64* %rax.0.reg2mem\n br i1 %19, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder label LBL_5, { 2, 1, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE401_Memory_Leak__int64_t_realloc_07-good", "fun_name": "goodB2G1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %storemerge.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %.reg2mem = alloca i32\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 5\n %2 = icmp eq i1 %1, false\n store i32 %0, i32* %.reg2mem\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @realloc(i64* null, i32 ptrtoint (i32* @gv_1 to i32))\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n store i64 5, i64* %3, align 8\n %6 = call i64 @FUNC(i64 5)\n %.pr = load i32, i32* @gv_0, align 4\n store i32 %.pr, i32* %.reg2mem\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %.reload = load i32, i32* %.reg2mem\n %7 = icmp eq i32 %.reload, 5\n br i1 %7, label LBL_6, label LBL_5\n LBL_5:\n %8 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_2 to i64))\n store i64 %8, i64* %storemerge.reg2mem\n br label LBL_7\n LBL_6:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n call void @free(i64* %sv_0.0.reload)\n store i64 ptrtoint (i32* @1 to i64), i64* %storemerge.reg2mem\n br label LBL_7\n LBL_7:\n %storemerge.reload = load i64, i64* %storemerge.reg2mem\n ret i64 %storemerge.reload\n\n uselistorder i32* %.reg2mem, { 0, 2, 1 }\n uselistorder i64** %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64* %storemerge.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE190_Integer_Overflow__int64_t_rand_postinc_07-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = zext i32 %0 to i64\n %2 = icmp eq i32 %0, 5\n %3 = icmp eq i1 %2, false\n store i64 %1, i64* %rax.0.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = call i64 @FUNC(i64 3)\n store i64 %4, i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 (i64)* @printLongLongLine, { 3, 2, 1, 0 }\n uselistorder i64 3, { 1, 0 }\n uselistorder i32* @gv_0, { 6, 0, 5, 1, 4, 2, 3 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE124_Buffer_Underwrite__malloc_char_ncpy_05-bad", "fun_name": "CWE124_Buffer_Underwrite__malloc_char_ncpy_05_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i8* null, i8** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n %10 = add i64 %6, -8\n %11 = inttoptr i64 %10 to i8*\n store i8* %11, i8** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %13 = bitcast i64* %sv_1 to i8*\n %14 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %13, i32 99)\n %15 = ptrtoint i8* %sv_0.0.reload to i64\n %16 = add i64 %15, 99\n %17 = inttoptr i64 %16 to i8*\n store i8 0, i8* %17, align 1\n %18 = call i64 @FUNC(i64 %15)\n %19 = call i64 @FUNC(i64 40)\n %20 = icmp eq i64 %0, %19\n store i64 0, i64* %rax.0.reg2mem\n br i1 %20, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 2, 1 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE377_Insecure_Temporary_File__char_tmpnam_02-bad", "fun_name": "CWE377_Insecure_Temporary_File__char_tmpnam_02_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.in.reg2mem = alloca i64\n %0 = call i8* @tmpnam(i8* null)\n %1 = icmp eq i8* %0, null\n %2 = icmp eq i1 %1, false\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n call void @exit(i32 1)\n unreachable\n LBL_2:\n %3 = ptrtoint i8* %0 to i64\n %4 = call i64 @FUNC(i64 %3)\n %5 = call i32 (i8*, i32, ...) @open(i8* %0, i32 66)\n %6 = icmp eq i32 %5, -1\n store i64 -1, i64* %rax.0.in.reg2mem\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n %7 = call i64 @FUNC(i64 ptrtoint ([45 x i8]* @gv_0 to i64))\n %8 = call i32 @close(i32 %5)\n %phitmp = sext i32 %8 to i64\n store i64 %phitmp, i64* %rax.0.in.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.in.reload = load i64, i64* %rax.0.in.reg2mem\n ret i64 %rax.0.in.reload\n\n uselistorder i8* %0, { 1, 0, 2 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_listenSocket_04-good", "fun_name": "goodB2G2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.036.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n store i32 %5, i32* %sv_0.036.reg2mem\n br i1 %7, label LBL_8, label LBL_1\n LBL_1:\n %8 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_2\n LBL_2:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_6, label LBL_4\n LBL_4:\n %17 = call i32 @recv(i32 %15, i64* nonnull %sv_1, i32 19, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %19, label LBL_7, label LBL_5\n LBL_5:\n %20 = ptrtoint i64* %sv_3 to i64\n %21 = sext i32 %17 to i64\n %22 = add i64 %20, -32\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = bitcast i64* %sv_1 to i8*\n %26 = call double @atof(i8* nonnull %25)\n %27 = fptrunc double %26 to float\n %28 = bitcast float %27 to i32\n %29 = sext i32 %28 to i128\n %30 = call i128 @FUNC(i128 %29)\n %31 = call i64 @FUNC(i128 %30)\n %32 = trunc i64 %31 to i32\n store i32 %32, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %33 = call i32 @close(i32 %6)\n store i32 %5, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %34 = call i32 @close(i32 %6)\n %35 = call i32 @close(i32 %15)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.036.reload = load i32, i32* %sv_0.036.reg2mem\n %36 = call i128 @__asm_movss.1(i32 %sv_0.036.reload)\n %37 = call i128 @__asm_movss.1(i32 2147483647)\n %38 = call i128 @FUNC(i128 %36, i128 %37)\n %39 = call i128 @FUNC(i128 %38)\n %40 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %39, i128 %40)\n %41 = call i128 @FUNC(i128 %37, i128 %37)\n %42 = call i128 @__asm_cvtss2sd.2(i32 %sv_0.036.reload)\n %43 = call i128 @FUNC(i64 4636737291354636288)\n %44 = call i128 @FUNC(i128 %43, i128 %42)\n %45 = call i32 @FUNC(i128 %44)\n %46 = zext i32 %45 to i64\n %47 = call i64 @FUNC(i64 %46)\n %48 = call i64 @FUNC(i64 40)\n %49 = icmp eq i64 %2, %48\n store i64 0, i64* %rax.0.reg2mem\n br i1 %49, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i128 %37, { 1, 0, 2 }\n uselistorder i32 %sv_0.036.reload, { 1, 0 }\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i32 %5, { 1, 2, 0 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.036.reg2mem, { 0, 3, 2, 1 }\n uselistorder i128* @gv_0, { 1, 0 }\n uselistorder i32 (i32)* @close, { 5, 4, 0, 3, 2, 1, 6 }\n uselistorder double (i8*)* @atof, { 1, 0, 2 }\n uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }\n uselistorder i32 (i32, %sockaddr*, i32*)* @accept, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__malloc_char_memmove_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n store i64* null, i64** %sv_0.0.reg2mem\n br i1 %2, label LBL_4, label LBL_1\n LBL_1:\n %3 = call i64* @malloc(i32 100)\n %4 = icmp eq i64* %3, null\n %5 = icmp eq i1 %4, false\n br i1 %5, label LBL_3, label LBL_2\n LBL_2:\n call void @exit(i32 -1)\n unreachable\n LBL_3:\n %6 = ptrtoint i64* %3 to i64\n %7 = call i64* @memset(i64* %3, i32 65, i32 99)\n %8 = add i64 %6, 99\n %9 = inttoptr i64 %8 to i8*\n store i8 0, i8* %9, align 1\n store i64* %3, i64** %sv_0.0.reg2mem\n br label LBL_4\n LBL_4:\n %sv_0.0.reload = load i64*, i64** %sv_0.0.reg2mem\n %10 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %11 = bitcast i64* %sv_1 to i8*\n %12 = call i32 @strlen(i8* nonnull %11)\n %13 = call i64* @memmove(i64* nonnull %sv_1, i64* %sv_0.0.reload, i32 %12)\n %14 = ptrtoint i64* %sv_1 to i64\n %15 = call i64 @FUNC(i64 %14)\n call void @free(i64* %sv_0.0.reload)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_6, label LBL_5\n LBL_5:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_6\n LBL_6:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %3, { 0, 1, 3, 2 }\n uselistorder i64* %sv_1, { 3, 0, 1, 2 }\n uselistorder void (i64*)* @free, { 1, 0, 2 }\n uselistorder i64* (i64*, i64*, i32)* @memmove, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2, 3, 4 }\n uselistorder i32 99, { 0, 1, 3, 2 }\n uselistorder void (i32)* @exit, { 1, 0, 2 }\n uselistorder i64* (i32)* @malloc, { 1, 0, 2 }\n uselistorder i64* null, { 2, 0, 3, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE675_Duplicate_Operations_on_Resource__freopen_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %0 = load i32, i32* @gv_0, align 4\n %1 = icmp eq i32 %0, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %1, label LBL_3, label LBL_1\n LBL_1:\n %2 = call %_IO_FILE* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @gv_1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0))\n %.pr = load i32, i32* @gv_0, align 4\n %3 = icmp eq i32 %.pr, 0\n store i64 0, i64* %rax.0.reg2mem\n br i1 %3, label LBL_3, label LBL_2\n LBL_2:\n %4 = call i32 @fclose(%_IO_FILE* %2)\n %5 = sext i32 %4 to i64\n store i64 %5, i64* %rax.0.reg2mem\n br label LBL_3\n LBL_3:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1 }\n uselistorder i32 (%_IO_FILE*)* @fclose, { 1, 2, 3, 0, 4 }\n uselistorder %_IO_FILE* (i8*, i8*)* @fopen, { 1, 0, 2 }\n uselistorder i32* @gv_0, { 0, 4, 3, 2, 1 }\n uselistorder label LBL_3, { 1, 2, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_snprintf_10-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.pre-phi.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_0.LBL_3_crit_edge, label LBL_2\n LBL_1:\n %.pre = ptrtoint i64* %sv_1 to i64\n store i64 %.pre, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_2:\n %3 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 49)\n %4 = ptrtoint i64* %sv_1 to i64\n %5 = add i64 %4, 49\n %6 = inttoptr i64 %5 to i8*\n store i8 0, i8* %6, align 1\n store i64 %4, i64* %.pre-phi.reg2mem\n br label LBL_3\n LBL_3:\n %7 = bitcast i64* %sv_1 to i8*\n %.pre-phi.reload = load i64, i64* %.pre-phi.reg2mem\n store i64 0, i64* %sv_0, align 8\n %8 = call i32 @strlen(i8* nonnull %7)\n %9 = bitcast i64* %sv_0 to i8*\n %10 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %9, i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i64* nonnull %sv_1)\n %11 = call i64 @FUNC(i64 %.pre-phi.reload)\n %12 = call i64 @FUNC(i64 40)\n %13 = icmp eq i64 %0, %12\n store i64 0, i64* %rax.0.reg2mem\n br i1 %13, label LBL_5, label LBL_4\n LBL_4:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_5\n LBL_5:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 4, 2, 3, 0 }\n uselistorder i32 (i8*, i32, i8*, ...)* @snprintf, { 1, 0, 2 }\n uselistorder i32 (i8*)* @strlen, { 1, 0, 2 }\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }\n uselistorder label LBL_3, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE122_Heap_Based_Buffer_Overflow__c_CWE805_char_ncpy_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i8*\n %sv_1 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i8* null, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_2:\n %4 = call i64* @malloc(i32 100)\n %5 = icmp eq i64* %4, null\n %6 = icmp eq i1 %5, false\n br i1 %6, label LBL_4, label LBL_3\n LBL_3:\n call void @exit(i32 -1)\n unreachable\n LBL_4:\n %7 = bitcast i64* %4 to i8*\n store i8 0, i8* %7, align 1\n store i8* %7, i8** %sv_0.0.reg2mem\n br label LBL_5\n LBL_5:\n %sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem\n %8 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)\n %9 = bitcast i64* %sv_1 to i8*\n %10 = call i8* @strncpy(i8* %sv_0.0.reload, i8* nonnull %9, i32 99)\n %11 = ptrtoint i8* %sv_0.0.reload to i64\n %12 = add i64 %11, 99\n %13 = inttoptr i64 %12 to i8*\n store i8 0, i8* %13, align 1\n %14 = call i64 @FUNC(i64 %11)\n %15 = bitcast i8* %sv_0.0.reload to i64*\n call void @free(i64* %15)\n %16 = call i64 @FUNC(i64 40)\n %17 = icmp eq i64 %0, %16\n store i64 0, i64* %rax.0.reg2mem\n br i1 %17, label LBL_7, label LBL_6\n LBL_6:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_7\n LBL_7:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i8* %sv_0.0.reload, { 2, 0, 1 }\n uselistorder i64* %4, { 1, 0 }\n uselistorder i8** %sv_0.0.reg2mem, { 0, 2, 1 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE195_Signed_to_Unsigned_Conversion_Error__fgets_strncpy_05-good", "fun_name": "goodG2B2", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n %spec.store.select = select i1 %2, i32 -1, i32 99\n store i64 0, i64* %sv_1, align 8\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 65, i32 99)\n %4 = ptrtoint i64* %sv_2 to i64\n %5 = bitcast i64* %sv_1 to i8*\n %6 = bitcast i64* %sv_0 to i8*\n %7 = call i8* @strncpy(i8* nonnull %5, i8* nonnull %6, i32 %spec.store.select)\n %8 = sext i32 %spec.store.select to i64\n %9 = add i64 %4, -112\n %10 = add i64 %9, %8\n %11 = inttoptr i64 %10 to i8*\n store i8 0, i8* %11, align 1\n %12 = ptrtoint i64* %sv_1 to i64\n %13 = call i64 @FUNC(i64 %12)\n %14 = call i64 @FUNC(i64 40)\n %15 = icmp eq i64 %0, %14\n store i64 0, i64* %rax.0.reg2mem\n br i1 %15, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %sv_1, { 1, 0, 2 }\n uselistorder i8* (i8*, i8*, i32)* @strncpy, { 1, 0, 2 }\n uselistorder i32 99, { 2, 1, 3, 0 }\n uselistorder i32 -1, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE126_Buffer_Overread__char_declare_memcpy_01-bad", "fun_name": "CWE126_Buffer_Overread__char_declare_memcpy_01_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = call i64* @memset(i64* nonnull %sv_2, i32 65, i32 49)\n %2 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)\n %3 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)\n %4 = bitcast i64* %sv_0 to i8*\n %5 = call i32 @strlen(i8* nonnull %4)\n %6 = call i64* @memcpy(i64* nonnull %sv_0, i64* nonnull %sv_2, i32 %5)\n %7 = call i64 @FUNC(i64* nonnull %sv_0)\n %8 = call i64 @FUNC(i64 40)\n %9 = icmp eq i64 %0, %8\n store i64 0, i64* %rax.0.reg2mem\n br i1 %9, label LBL_2, label LBL_1\n LBL_1:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_2\n LBL_2:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* (i64*, i32, i32)* @memset, { 1, 2, 0, 3 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_loop_13-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %storemerge2.reg2mem = alloca i64\n %storemerge13.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n %1 = load i32, i32* inttoptr (i64 8360 to i32*), align 8\n %2 = icmp eq i32 %1, 5\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n br label LBL_3\n LBL_2:\n %4 = ptrtoint i64* %sv_1 to i64\n store i64 %4, i64* %sv_0.0.reg2mem\n br label LBL_3\n LBL_3:\n %5 = ptrtoint i64* %sv_2 to i64\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %6 = add i64 %5, -816\n %7 = add i64 %5, -812\n store i64 0, i64* %storemerge13.reg2mem\n br label LBL_4\n LBL_4:\n %storemerge13.reload = load i64, i64* %storemerge13.reg2mem\n %8 = mul i64 %storemerge13.reload, 8\n %9 = add i64 %8, %6\n %10 = inttoptr i64 %9 to i32*\n store i32 0, i32* %10, align 8\n %11 = add i64 %7, %8\n %12 = inttoptr i64 %11 to i32*\n store i32 0, i32* %12, align 4\n %13 = add nuw nsw i64 %storemerge13.reload, 1\n %exitcond4 = icmp eq i64 %13, 100\n store i64 %13, i64* %storemerge13.reg2mem\n store i64 0, i64* %storemerge2.reg2mem\n br i1 %exitcond4, label LBL_5, label LBL_4\n LBL_5:\n %storemerge2.reload = load i64, i64* %storemerge2.reg2mem\n %14 = mul i64 %storemerge2.reload, 8\n %15 = add i64 %14, %sv_0.0.reload\n %16 = add i64 %14, %6\n %17 = inttoptr i64 %16 to i64*\n %18 = load i64, i64* %17, align 8\n %19 = inttoptr i64 %15 to i64*\n store i64 %18, i64* %19, align 8\n %20 = add nuw nsw i64 %storemerge2.reload, 1\n %exitcond = icmp eq i64 %20, 100\n store i64 %20, i64* %storemerge2.reg2mem\n br i1 %exitcond, label LBL_6, label LBL_5\n LBL_6:\n %21 = call i64 @FUNC(i64 %sv_0.0.reload)\n %22 = call i64 @FUNC(i64 40)\n %23 = icmp eq i64 %0, %22\n store i64 0, i64* %rax.0.reg2mem\n br i1 %23, label LBL_8, label LBL_7\n LBL_7:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_8\n LBL_8:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %14, { 1, 0 }\n uselistorder i64 %8, { 1, 0 }\n uselistorder i64* %storemerge13.reg2mem, { 1, 0, 2 }\n uselistorder i64* %storemerge2.reg2mem, { 2, 0, 1 }\n uselistorder label LBL_5, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE191_Integer_Underflow__int64_t_rand_multiply_08-good", "fun_name": "goodG2B1", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0.0.reg2mem = alloca i64\n %0 = call i64 @FUNC()\n %1 = trunc i64 %0 to i32\n %2 = icmp eq i32 %1, 0\n store i64 -2, i64* %sv_0.0.reg2mem\n br i1 %2, label LBL_2, label LBL_1\n LBL_1:\n %3 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_0 to i64))\n store i64 0, i64* %sv_0.0.reg2mem\n br label LBL_2\n LBL_2:\n %sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem\n %4 = call i64 @FUNC()\n %5 = trunc i64 %4 to i32\n %6 = icmp eq i32 %5, 0\n %7 = icmp slt i64 %sv_0.0.reload, 0\n %8 = icmp eq i1 %7, false\n %or.cond = or i1 %8, %6\n store i64 %4, i64* %rax.0.reg2mem\n br i1 %or.cond, label LBL_4, label LBL_3\n LBL_3:\n %9 = mul i64 %sv_0.0.reload, 2\n %10 = call i64 @FUNC(i64 %9)\n store i64 %10, i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %sv_0.0.reload, { 1, 0 }\n uselistorder i64* %sv_0.0.reg2mem, { 0, 2, 1 }\n uselistorder i64 ()* @staticReturnsFalse, { 1, 0 }\n uselistorder label LBL_2, { 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE369_Divide_by_Zero__float_listenSocket_16-good", "fun_name": "goodB2G", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %0 = alloca i128\n %rax.0.reg2mem = alloca i64\n %sv_0.036.reg2mem = alloca i32\n %sv_0.0.ph.reg2mem = alloca i32\n %1 = load i128, i128* %0\n %sv_1 = alloca i64, align 8\n %sv_2 = alloca i64, align 8\n %sv_3 = alloca i64, align 8\n %2 = call i64 @FUNC(i64 40)\n %3 = call i128 @FUNC(i128 %1, i128 %1)\n %4 = call i64 @FUNC(i128 %3)\n %5 = trunc i64 %4 to i32\n %6 = call i32 @socket(i32 2, i32 1, i32 6)\n %7 = icmp eq i32 %6, -1\n store i32 %5, i32* %sv_0.036.reg2mem\n br i1 %7, label LBL_8, label LBL_1\n LBL_1:\n %8 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)\n store i64 2, i64* %sv_2, align 8\n %9 = call i16 @htons(i16 27015)\n %10 = bitcast i64* %sv_2 to %sockaddr*\n %11 = call i32 @bind(i32 %6, %sockaddr* nonnull %10, i32 16)\n %12 = icmp eq i32 %11, -1\n br i1 %12, label LBL_6, label LBL_2\n LBL_2:\n %13 = call i32 @listen(i32 %6, i32 5)\n %14 = icmp eq i32 %13, -1\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = call i32 @accept(i32 %6, %sockaddr* null, i32* null)\n %16 = icmp eq i32 %15, -1\n br i1 %16, label LBL_6, label LBL_4\n LBL_4:\n %17 = call i32 @recv(i32 %15, i64* nonnull %sv_1, i32 19, i32 0)\n %18 = add i32 %17, 1\n %19 = icmp ult i32 %18, 2\n store i32 %5, i32* %sv_0.0.ph.reg2mem\n br i1 %19, label LBL_7, label LBL_5\n LBL_5:\n %20 = ptrtoint i64* %sv_3 to i64\n %21 = sext i32 %17 to i64\n %22 = add i64 %20, -32\n %23 = add i64 %22, %21\n %24 = inttoptr i64 %23 to i8*\n store i8 0, i8* %24, align 1\n %25 = bitcast i64* %sv_1 to i8*\n %26 = call double @atof(i8* nonnull %25)\n %27 = fptrunc double %26 to float\n %28 = bitcast float %27 to i32\n %29 = sext i32 %28 to i128\n %30 = call i128 @FUNC(i128 %29)\n %31 = call i64 @FUNC(i128 %30)\n %32 = trunc i64 %31 to i32\n store i32 %32, i32* %sv_0.0.ph.reg2mem\n br label LBL_7\n LBL_6:\n %33 = call i32 @close(i32 %6)\n store i32 %5, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_7:\n %sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem\n %34 = call i32 @close(i32 %6)\n %35 = call i32 @close(i32 %15)\n store i32 %sv_0.0.ph.reload, i32* %sv_0.036.reg2mem\n br label LBL_8\n LBL_8:\n %sv_0.036.reload = load i32, i32* %sv_0.036.reg2mem\n %36 = call i128 @__asm_movss.1(i32 %sv_0.036.reload)\n %37 = call i128 @__asm_movss.1(i32 2147483647)\n %38 = call i128 @FUNC(i128 %36, i128 %37)\n %39 = call i128 @FUNC(i128 %38)\n %40 = load i128, i128* @gv_0, align 8\n call void @FUNC(i128 %39, i128 %40)\n %41 = call i64 @FUNC(i64 ptrtoint ([38 x i8]* @gv_1 to i64))\n %42 = call i64 @FUNC(i64 40)\n %43 = icmp eq i64 %2, %42\n store i64 0, i64* %rax.0.reg2mem\n br i1 %43, label LBL_10, label LBL_9\n LBL_9:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_10\n LBL_10:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i32 %17, { 1, 0 }\n uselistorder i32 %6, { 4, 0, 1, 2, 3, 5 }\n uselistorder i32 %5, { 1, 2, 0 }\n uselistorder i64* %sv_2, { 0, 2, 1 }\n uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 2, 1 }\n uselistorder i32* %sv_0.036.reg2mem, { 0, 3, 2, 1 }\n uselistorder i32 (i32)* @close, { 2, 1, 0, 3 }\n uselistorder label LBL_8, { 2, 1, 0 }\n }", "label": "0" }, { "dataset": "juliet-test-suite-c", "file": "CWE134_Uncontrolled_Format_String__char_console_printf_10-bad", "fun_name": "CWE134_Uncontrolled_Format_String__char_console_printf_10_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %sv_0 = alloca i64, align 8\n %0 = call i64 @FUNC(i64 40)\n store i64 0, i64* %sv_0, align 8\n %1 = load i32, i32* @gv_0, align 4\n %2 = icmp eq i32 %1, 0\n br i1 %2, label LBL_9, label LBL_1\n LBL_1:\n %3 = bitcast i64* %sv_0 to i8*\n %4 = call i32 @strlen(i8* nonnull %3)\n %5 = sext i32 %4 to i64\n %6 = sub nsw i64 100, %5\n %7 = icmp ult i64 %6, 2\n br i1 %7, label LBL_7, label LBL_2\n LBL_2:\n %8 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8\n %9 = sub i32 100, %4\n %10 = ptrtoint i64* %sv_0 to i64\n %11 = add i64 %5, %10\n %12 = inttoptr i64 %11 to i8*\n %13 = call i8* @fgets(i8* %12, i32 %9, %_IO_FILE* %8)\n %14 = icmp eq i8* %13, null\n br i1 %14, label LBL_6, label LBL_3\n LBL_3:\n %15 = call i32 @strlen(i8* nonnull %3)\n %16 = icmp eq i32 %15, 0\n br i1 %16, label LBL_7, label LBL_4\n LBL_4:\n %17 = sext i32 %15 to i64\n %18 = add i64 %10, -1\n %19 = add i64 %18, %17\n %20 = inttoptr i64 %19 to i8*\n %21 = load i8, i8* %20, align 1\n %22 = icmp eq i8 %21, 10\n %23 = icmp eq i1 %22, false\n br i1 %23, label LBL_7, label LBL_5\n LBL_5:\n store i8 0, i8* %20, align 1\n br label LBL_7\n LBL_6:\n %24 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_2 to i64))\n store i8 0, i8* %12, align 1\n br label LBL_7\n LBL_7:\n %.pr = load i32, i32* @gv_0, align 4\n %25 = icmp eq i32 %.pr, 0\n br i1 %25, label LBL_9, label LBL_8\n LBL_8:\n %26 = call i32 (i8*, ...) @printf(i8* nonnull %3)\n br label LBL_9\n LBL_9:\n %27 = call i64 @FUNC(i64 40)\n %28 = icmp eq i64 %0, %27\n store i64 0, i64* %rax.0.reg2mem\n br i1 %28, label LBL_11, label LBL_10\n LBL_10:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_11\n LBL_11:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64 %10, { 1, 0 }\n uselistorder i8* %3, { 1, 0, 2 }\n uselistorder i8 0, { 1, 2, 3, 0 }\n uselistorder label LBL_9, { 1, 2, 0 }\n }", "label": "1" }, { "dataset": "juliet-test-suite-c", "file": "CWE197_Numeric_Truncation_Error__int_fscanf_to_char_14-bad", "fun_name": "CWE197_Numeric_Truncation_Error__int_fscanf_to_char_14_bad", "llvm_ir_function": "define i64 @FUNC() local_unnamed_addr {\n LBL_0:\n %rax.0.reg2mem = alloca i64\n %.reg2mem = alloca i64\n %sv_0 = alloca i32, align 4\n %0 = call i64 @FUNC(i64 40)\n store i32 -1, i32* %sv_0, align 4\n %1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4\n %2 = icmp eq i32 %1, 5\n %3 = icmp eq i1 %2, false\n store i64 4294967295, i64* %.reg2mem\n br i1 %3, label LBL_2, label LBL_1\n LBL_1:\n %4 = load %_IO_FILE*, %_IO_FILE** @gv_0, align 8\n %5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_1, i64 0, i64 0), i32* nonnull %sv_0)\n %.pre = load i32, i32* %sv_0, align 4\n %phitmp = mul i32 %.pre, 16777216\n %phitmp1 = ashr exact i32 %phitmp, 24\n %phitmp2 = zext i32 %phitmp1 to i64\n store i64 %phitmp2, i64* %.reg2mem\n br label LBL_2\n LBL_2:\n %.reload = load i64, i64* %.reg2mem\n %6 = call i64 @FUNC(i64 %.reload)\n %7 = call i64 @FUNC(i64 40)\n %8 = icmp eq i64 %0, %7\n store i64 0, i64* %rax.0.reg2mem\n br i1 %8, label LBL_4, label LBL_3\n LBL_3:\n call void @__stack_chk_fail()\n store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem\n br label LBL_4\n LBL_4:\n %rax.0.reload = load i64, i64* %rax.0.reg2mem\n ret i64 %rax.0.reload\n\n uselistorder i64* %.reg2mem, { 0, 2, 1 }\n }", "label": "1" } ]