#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_literal() {
  do {
    if (run("test/progs/"
            "literal_basic.b"))
      fail_test(279);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "literal_int_overflow_pos_err.b"))
      fail_test(280);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "literal_int_overflow_neg_err.b"))
      fail_test(281);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "literal_long_overflow_pos_err.b"))
      fail_test(282);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "literal_long_overflow_neg_err.b"))
      fail_test(283);
    ;
  } while (0);
}


x86 assembly (clang, -O0):
<test_literal>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test_literal+0x9>
lea    0xed0(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
je     1149 <test_literal+0x29>
mov    $0x117,%edi
call   1030 <fail_test@plt>
jmp    114e <test_literal+0x2e>
jmp    1153 <test_literal+0x33>
lea    0xec1(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    1173 <test_literal+0x53>
mov    $0x118,%edi
call   1030 <fail_test@plt>
jmp    1178 <test_literal+0x58>
jmp    117d <test_literal+0x5d>
lea    0xec1(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    119d <test_literal+0x7d>
mov    $0x119,%edi
call   1030 <fail_test@plt>
jmp    11a2 <test_literal+0x82>
jmp    11a7 <test_literal+0x87>
lea    0xec1(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    11c7 <test_literal+0xa7>
mov    $0x11a,%edi
call   1030 <fail_test@plt>
jmp    11cc <test_literal+0xac>
jmp    11d1 <test_literal+0xb1>
lea    0xec2(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    11f1 <test_literal+0xd1>
mov    $0x11b,%edi
call   1030 <fail_test@plt>
jmp    11f6 <test_literal+0xd6>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_literal>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     113c <test_literal+0x1c>
mov    $0x117,%edi
call   1030 <fail_test@plt>
lea    0xed8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    1157 <test_literal+0x37>
mov    $0x118,%edi
call   1030 <fail_test@plt>
lea    0xee7(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    1172 <test_literal+0x52>
mov    $0x119,%edi
call   1030 <fail_test@plt>
lea    0xef6(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
jne    118d <test_literal+0x6d>
mov    $0x11a,%edi
call   1030 <fail_test@plt>
lea    0xf06(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     11a0 <test_literal+0x80>
pop    %rax
ret
mov    $0x11b,%edi
pop    %rax
jmp    1030 <fail_test@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"test/progs/literal_basic.b\00"
@.str.1 = [42 x i8] c"test/progs/literal_int_overflow_pos_err.b\00"
@.str.2 = [42 x i8] c"test/progs/literal_int_overflow_neg_err.b\00"
@.str.3 = [43 x i8] c"test/progs/literal_long_overflow_pos_err.b\00"
@.str.4 = [43 x i8] c"test/progs/literal_long_overflow_neg_err.b\00"
define void @test_literal() {
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 279)
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 ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @fail_test(i32 280)
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 ([42 x i8], [42 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 281)
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 ([43 x i8], [43 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 282)
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 ([43 x i8], [43 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 283)
br label %34
34: ; preds = %32, %29
br label %35
35: ; preds = %34
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"test/progs/literal_basic.b\00"
@.str.1 = [42 x i8] c"test/progs/literal_int_overflow_pos_err.b\00"
@.str.2 = [42 x i8] c"test/progs/literal_int_overflow_neg_err.b\00"
@.str.3 = [43 x i8] c"test/progs/literal_long_overflow_pos_err.b\00"
@.str.4 = [43 x i8] c"test/progs/literal_long_overflow_neg_err.b\00"
define void @test_literal() {
%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 279)
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @run(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @fail_test(i32 280)
br label %10
10: ; preds = %8, %5
%11 = tail call i64 @run(i8* getelementptr inbounds ([42 x i8], [42 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 281)
br label %15
15: ; preds = %13, %10
%16 = tail call i64 @run(i8* getelementptr inbounds ([43 x i8], [43 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 282)
br label %20
20: ; preds = %18, %15
%21 = tail call i64 @run(i8* getelementptr inbounds ([43 x i8], [43 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 283)
br label %25
25: ; preds = %20, %23
ret void
}