#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_rel_vars() {
  do {
    if (run("test/progs/"
            "rel_var_basic.b"))
      fail_test(67);
    ;
  } while (0);
  do {
    if (run("test/progs/"
            "rel_var_multiple_decls.b"))
      fail_test(68);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "rel_var_unknown_type_err.b"))
      fail_test(69);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "rel_var_redecl_err.b"))
      fail_test(70);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "rel_var_redecl_2_err.b"))
      fail_test(71);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "rel_var_redecl_3_err.b"))
      fail_test(72);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "rel_var_redecl_4_err.b"))
      fail_test(73);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "rel_var_redecl_5_err.b"))
      fail_test(74);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "rel_var_name_err.b"))
      fail_test(75);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "rel_var_max_vars_err.b"))
      fail_test(76);
    ;
  } while (0);
}


x86 assembly (clang, -O0):
<test_rel_vars>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test_rel_vars+0x9>
lea    0xed0(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
je     1149 <test_rel_vars+0x29>
mov    $0x43,%edi
call   1030 <fail_test@plt>
jmp    114e <test_rel_vars+0x2e>
jmp    1153 <test_rel_vars+0x33>
lea    0xec1(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
je     1173 <test_rel_vars+0x53>
mov    $0x44,%edi
call   1030 <fail_test@plt>
jmp    1178 <test_rel_vars+0x58>
jmp    117d <test_rel_vars+0x5d>
lea    0xebb(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    119d <test_rel_vars+0x7d>
mov    $0x45,%edi
call   1030 <fail_test@plt>
jmp    11a2 <test_rel_vars+0x82>
jmp    11a7 <test_rel_vars+0x87>
lea    0xeb7(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    11c7 <test_rel_vars+0xa7>
mov    $0x46,%edi
call   1030 <fail_test@plt>
jmp    11cc <test_rel_vars+0xac>
jmp    11d1 <test_rel_vars+0xb1>
lea    0xead(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    11f1 <test_rel_vars+0xd1>
mov    $0x47,%edi
call   1030 <fail_test@plt>
jmp    11f6 <test_rel_vars+0xd6>
jmp    11fb <test_rel_vars+0xdb>
lea    0xea5(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    121b <test_rel_vars+0xfb>
mov    $0x48,%edi
call   1030 <fail_test@plt>
jmp    1220 <test_rel_vars+0x100>
jmp    1225 <test_rel_vars+0x105>
lea    0xe9d(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    1245 <test_rel_vars+0x125>
mov    $0x49,%edi
call   1030 <fail_test@plt>
jmp    124a <test_rel_vars+0x12a>
jmp    124f <test_rel_vars+0x12f>
lea    0xe95(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    126f <test_rel_vars+0x14f>
mov    $0x4a,%edi
call   1030 <fail_test@plt>
jmp    1274 <test_rel_vars+0x154>
jmp    1279 <test_rel_vars+0x159>
lea    0xe8d(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    1299 <test_rel_vars+0x179>
mov    $0x4b,%edi
call   1030 <fail_test@plt>
jmp    129e <test_rel_vars+0x17e>
jmp    12a3 <test_rel_vars+0x183>
lea    0xe81(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    12c3 <test_rel_vars+0x1a3>
mov    $0x4c,%edi
call   1030 <fail_test@plt>
jmp    12c8 <test_rel_vars+0x1a8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rel_vars>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     113c <test_rel_vars+0x1c>
mov    $0x43,%edi
call   1030 <fail_test@plt>
lea    0xed8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     1157 <test_rel_vars+0x37>
mov    $0x44,%edi
call   1030 <fail_test@plt>
lea    0xee1(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    1172 <test_rel_vars+0x52>
mov    $0x45,%edi
call   1030 <fail_test@plt>
lea    0xeec(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    118d <test_rel_vars+0x6d>
mov    $0x46,%edi
call   1030 <fail_test@plt>
lea    0xef1(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    11a8 <test_rel_vars+0x88>
mov    $0x47,%edi
call   1030 <fail_test@plt>
lea    0xef8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    11c3 <test_rel_vars+0xa3>
mov    $0x48,%edi
call   1030 <fail_test@plt>
lea    0xeff(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    11de <test_rel_vars+0xbe>
mov    $0x49,%edi
call   1030 <fail_test@plt>
lea    0xf06(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    11f9 <test_rel_vars+0xd9>
mov    $0x4a,%edi
call   1030 <fail_test@plt>
lea    0xf0d(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    1214 <test_rel_vars+0xf4>
mov    $0x4b,%edi
call   1030 <fail_test@plt>
lea    0xf10(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     1227 <test_rel_vars+0x107>
pop    %rax
ret
mov    $0x4c,%edi
pop    %rax
jmp    1030 <fail_test@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"test/progs/rel_var_basic.b\00"
@.str.1 = [36 x i8] c"test/progs/rel_var_multiple_decls.b\00"
@.str.2 = [38 x i8] c"test/progs/rel_var_unknown_type_err.b\00"
@.str.3 = [32 x i8] c"test/progs/rel_var_redecl_err.b\00"
@.str.4 = [34 x i8] c"test/progs/rel_var_redecl_2_err.b\00"
@.str.5 = [34 x i8] c"test/progs/rel_var_redecl_3_err.b\00"
@.str.6 = [34 x i8] c"test/progs/rel_var_redecl_4_err.b\00"
@.str.7 = [34 x i8] c"test/progs/rel_var_redecl_5_err.b\00"
@.str.8 = [30 x i8] c"test/progs/rel_var_name_err.b\00"
@.str.9 = [34 x i8] c"test/progs/rel_var_max_vars_err.b\00"
define void @test_rel_vars() {
br label %1
1: ; preds = %0
%2 = call i64 @run(i8* getelementptr inbounds ([27 x i8], [27 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 67)
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 ([36 x i8], [36 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 68)
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 ([38 x i8], [38 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 69)
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 ([32 x i8], [32 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 70)
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 ([34 x i8], [34 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 71)
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 ([34 x i8], [34 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 72)
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 ([34 x i8], [34 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 73)
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 ([34 x i8], [34 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 74)
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 ([30 x i8], [30 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 75)
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 ([34 x i8], [34 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 76)
br label %69
69: ; preds = %67, %64
br label %70
70: ; preds = %69
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"test/progs/rel_var_basic.b\00"
@.str.1 = [36 x i8] c"test/progs/rel_var_multiple_decls.b\00"
@.str.2 = [38 x i8] c"test/progs/rel_var_unknown_type_err.b\00"
@.str.3 = [32 x i8] c"test/progs/rel_var_redecl_err.b\00"
@.str.4 = [34 x i8] c"test/progs/rel_var_redecl_2_err.b\00"
@.str.5 = [34 x i8] c"test/progs/rel_var_redecl_3_err.b\00"
@.str.6 = [34 x i8] c"test/progs/rel_var_redecl_4_err.b\00"
@.str.7 = [34 x i8] c"test/progs/rel_var_redecl_5_err.b\00"
@.str.8 = [30 x i8] c"test/progs/rel_var_name_err.b\00"
@.str.9 = [34 x i8] c"test/progs/rel_var_max_vars_err.b\00"
define void @test_rel_vars() {
%1 = tail call i64 @run(i8* getelementptr inbounds ([27 x i8], [27 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 67)
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @run(i8* getelementptr inbounds ([36 x i8], [36 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 68)
br label %10
10: ; preds = %8, %5
%11 = tail call i64 @run(i8* getelementptr inbounds ([38 x i8], [38 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 69)
br label %15
15: ; preds = %13, %10
%16 = tail call i64 @run(i8* getelementptr inbounds ([32 x i8], [32 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 70)
br label %20
20: ; preds = %18, %15
%21 = tail call i64 @run(i8* getelementptr inbounds ([34 x i8], [34 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 71)
br label %25
25: ; preds = %23, %20
%26 = tail call i64 @run(i8* getelementptr inbounds ([34 x i8], [34 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 72)
br label %30
30: ; preds = %28, %25
%31 = tail call i64 @run(i8* getelementptr inbounds ([34 x i8], [34 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 73)
br label %35
35: ; preds = %33, %30
%36 = tail call i64 @run(i8* getelementptr inbounds ([34 x i8], [34 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 74)
br label %40
40: ; preds = %38, %35
%41 = tail call i64 @run(i8* getelementptr inbounds ([30 x i8], [30 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 75)
br label %45
45: ; preds = %43, %40
%46 = tail call i64 @run(i8* getelementptr inbounds ([34 x i8], [34 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 76)
br label %50
50: ; preds = %45, %48
ret void
}