#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fail_test(int);
scalar_t__ run(char *);
void test_func() {
  do {
    if (run("test/progs/"
            "func_basic.b"))
      fail_test(81);
    ;
  } while (0);
  do {
    if (run("test/progs/"
            "func_calls_basic.b"))
      fail_test(82);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "func_redecl_err.b"))
      fail_test(83);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "func_unknown_res_type_err.b"))
      fail_test(84);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "func_bad_res_type_err.b"))
      fail_test(85);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "func_unexp_ret_stmt_err.b"))
      fail_test(86);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "func_missing_res_type_err.b"))
      fail_test(87);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "func_missing_ret_stmt_err.b"))
      fail_test(88);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "func_missing_ret_stmt_2_err.b"))
      fail_test(89);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "func_stmt_exceeded_err.b"))
      fail_test(90);
    ;
  } while (0);
}


x86 assembly (clang, -O0):
<test_func>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test_func+0x9>
lea    0xed0(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
je     1149 <test_func+0x29>
mov    $0x51,%edi
call   1030 <fail_test@plt>
jmp    114e <test_func+0x2e>
jmp    1153 <test_func+0x33>
lea    0xebe(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
je     1173 <test_func+0x53>
mov    $0x52,%edi
call   1030 <fail_test@plt>
jmp    1178 <test_func+0x58>
jmp    117d <test_func+0x5d>
lea    0xeb2(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    119d <test_func+0x7d>
mov    $0x53,%edi
call   1030 <fail_test@plt>
jmp    11a2 <test_func+0x82>
jmp    11a7 <test_func+0x87>
lea    0xea5(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    11c7 <test_func+0xa7>
mov    $0x54,%edi
call   1030 <fail_test@plt>
jmp    11cc <test_func+0xac>
jmp    11d1 <test_func+0xb1>
lea    0xea2(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    11f1 <test_func+0xd1>
mov    $0x55,%edi
call   1030 <fail_test@plt>
jmp    11f6 <test_func+0xd6>
jmp    11fb <test_func+0xdb>
lea    0xe9b(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    121b <test_func+0xfb>
mov    $0x56,%edi
call   1030 <fail_test@plt>
jmp    1220 <test_func+0x100>
jmp    1225 <test_func+0x105>
lea    0xe96(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    1245 <test_func+0x125>
mov    $0x57,%edi
call   1030 <fail_test@plt>
jmp    124a <test_func+0x12a>
jmp    124f <test_func+0x12f>
lea    0xe93(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    126f <test_func+0x14f>
mov    $0x58,%edi
call   1030 <fail_test@plt>
jmp    1274 <test_func+0x154>
jmp    1279 <test_func+0x159>
lea    0xe90(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    1299 <test_func+0x179>
mov    $0x59,%edi
call   1030 <fail_test@plt>
jmp    129e <test_func+0x17e>
jmp    12a3 <test_func+0x183>
lea    0xe8f(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    12c3 <test_func+0x1a3>
mov    $0x5a,%edi
call   1030 <fail_test@plt>
jmp    12c8 <test_func+0x1a8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     113c <test_func+0x1c>
mov    $0x51,%edi
call   1030 <fail_test@plt>
lea    0xed5(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     1157 <test_func+0x37>
mov    $0x52,%edi
call   1030 <fail_test@plt>
lea    0xed8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    1172 <test_func+0x52>
mov    $0x53,%edi
call   1030 <fail_test@plt>
lea    0xeda(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    118d <test_func+0x6d>
mov    $0x54,%edi
call   1030 <fail_test@plt>
lea    0xee6(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    11a8 <test_func+0x88>
mov    $0x55,%edi
call   1030 <fail_test@plt>
lea    0xeee(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    11c3 <test_func+0xa3>
mov    $0x56,%edi
call   1030 <fail_test@plt>
lea    0xef8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    11de <test_func+0xbe>
mov    $0x57,%edi
call   1030 <fail_test@plt>
lea    0xf04(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    11f9 <test_func+0xd9>
mov    $0x58,%edi
call   1030 <fail_test@plt>
lea    0xf10(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    1214 <test_func+0xf4>
mov    $0x59,%edi
call   1030 <fail_test@plt>
lea    0xf1e(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     1227 <test_func+0x107>
pop    %rax
ret
mov    $0x5a,%edi
pop    %rax
jmp    1030 <fail_test@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"test/progs/func_basic.b\00"
@.str.1 = [30 x i8] c"test/progs/func_calls_basic.b\00"
@.str.2 = [29 x i8] c"test/progs/func_redecl_err.b\00"
@.str.3 = [39 x i8] c"test/progs/func_unknown_res_type_err.b\00"
@.str.4 = [35 x i8] c"test/progs/func_bad_res_type_err.b\00"
@.str.5 = [37 x i8] c"test/progs/func_unexp_ret_stmt_err.b\00"
@.str.6 = [39 x i8] c"test/progs/func_missing_res_type_err.b\00"
@.str.7 = [39 x i8] c"test/progs/func_missing_ret_stmt_err.b\00"
@.str.8 = [41 x i8] c"test/progs/func_missing_ret_stmt_2_err.b\00"
@.str.9 = [36 x i8] c"test/progs/func_stmt_exceeded_err.b\00"
define void @test_func() {
br label %1
1: ; preds = %0
%2 = call i64 @run(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @fail_test(i32 81)
br label %6
6: ; preds = %4, %1
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
%9 = call i64 @run(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @fail_test(i32 82)
br label %13
13: ; preds = %11, %8
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
%16 = call i64 @run(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = call i32 @fail_test(i32 83)
br label %20
20: ; preds = %18, %15
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21
%23 = call i64 @run(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp ne i64 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = call i32 @fail_test(i32 84)
br label %27
27: ; preds = %25, %22
br label %28
28: ; preds = %27
br label %29
29: ; preds = %28
%30 = call i64 @run(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp ne i64 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = call i32 @fail_test(i32 85)
br label %34
34: ; preds = %32, %29
br label %35
35: ; preds = %34
br label %36
36: ; preds = %35
%37 = call i64 @run(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp ne i64 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %36
%40 = call i32 @fail_test(i32 86)
br label %41
41: ; preds = %39, %36
br label %42
42: ; preds = %41
br label %43
43: ; preds = %42
%44 = call i64 @run(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%45 = icmp ne i64 %44, 0
br i1 %45, label %48, label %46
46: ; preds = %43
%47 = call i32 @fail_test(i32 87)
br label %48
48: ; preds = %46, %43
br label %49
49: ; preds = %48
br label %50
50: ; preds = %49
%51 = call i64 @run(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%52 = icmp ne i64 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %50
%54 = call i32 @fail_test(i32 88)
br label %55
55: ; preds = %53, %50
br label %56
56: ; preds = %55
br label %57
57: ; preds = %56
%58 = call i64 @run(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
%59 = icmp ne i64 %58, 0
br i1 %59, label %62, label %60
60: ; preds = %57
%61 = call i32 @fail_test(i32 89)
br label %62
62: ; preds = %60, %57
br label %63
63: ; preds = %62
br label %64
64: ; preds = %63
%65 = call i64 @run(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0))
%66 = icmp ne i64 %65, 0
br i1 %66, label %69, label %67
67: ; preds = %64
%68 = call i32 @fail_test(i32 90)
br label %69
69: ; preds = %67, %64
br label %70
70: ; preds = %69
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"test/progs/func_basic.b\00"
@.str.1 = [30 x i8] c"test/progs/func_calls_basic.b\00"
@.str.2 = [29 x i8] c"test/progs/func_redecl_err.b\00"
@.str.3 = [39 x i8] c"test/progs/func_unknown_res_type_err.b\00"
@.str.4 = [35 x i8] c"test/progs/func_bad_res_type_err.b\00"
@.str.5 = [37 x i8] c"test/progs/func_unexp_ret_stmt_err.b\00"
@.str.6 = [39 x i8] c"test/progs/func_missing_res_type_err.b\00"
@.str.7 = [39 x i8] c"test/progs/func_missing_ret_stmt_err.b\00"
@.str.8 = [41 x i8] c"test/progs/func_missing_ret_stmt_2_err.b\00"
@.str.9 = [36 x i8] c"test/progs/func_stmt_exceeded_err.b\00"
define void @test_func() {
%1 = tail call i64 @run(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fail_test(i32 81)
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @run(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @fail_test(i32 82)
br label %10
10: ; preds = %8, %5
%11 = tail call i64 @run(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @fail_test(i32 83)
br label %15
15: ; preds = %13, %10
%16 = tail call i64 @run(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 @fail_test(i32 84)
br label %20
20: ; preds = %18, %15
%21 = tail call i64 @run(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = tail call i32 @fail_test(i32 85)
br label %25
25: ; preds = %23, %20
%26 = tail call i64 @run(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = tail call i32 @fail_test(i32 86)
br label %30
30: ; preds = %28, %25
%31 = tail call i64 @run(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = tail call i32 @fail_test(i32 87)
br label %35
35: ; preds = %33, %30
%36 = tail call i64 @run(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = tail call i32 @fail_test(i32 88)
br label %40
40: ; preds = %38, %35
%41 = tail call i64 @run(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = tail call i32 @fail_test(i32 89)
br label %45
45: ; preds = %43, %40
%46 = tail call i64 @run(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = tail call i32 @fail_test(i32 90)
br label %50
50: ; preds = %45, %48
ret void
}