xunge/DecIR huggingface dataset:
/* Variables and functions */
float roundf(float);
float rounddenom(float x, int denom) {
  return roundf(x * denom) / ((float)denom);
}


x86 assembly (clang, -O0):
<rounddenom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
call   1030 <roundf@plt>
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rounddenom>:
push   %rax
cvtsi2ss %edi,%xmm1
movss  %xmm1,0x4(%rsp)
mulss  %xmm1,%xmm0
call   1030 <roundf@plt>
divss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rounddenom(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = fmul float %5, %7
%9 = call float @llvm.round.f32(float %8)
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to float
%12 = fdiv float %9, %11
ret float %12
}

LLVM IR (-O2):
define float @rounddenom(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = fmul float %3, %0
%5 = tail call float @llvm.round.f32(float %4)
%6 = fdiv float %5, %3
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ BUFSIZ;
int /*<<< orphan*/ _IOFBF;
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void setbuf(FILE *fp, char *buf) {
  setvbuf(fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
}


x86 assembly (clang, -O0):
<setbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <setbuf+0x3c>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1158 <setbuf+0x48>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    0x2e6e(%rip),%rax
mov    (%rax),%ecx
call   1030 <setvbuf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbuf>:
test   %rsi,%rsi
jne    111e <setbuf+0xe>
mov    0x2ecc(%rip),%rax
jmp    1125 <setbuf+0x15>
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@_IOFBF = global i32 0
@_IONBF = global i32 0
@BUFSIZ = global i32 0
define void @setbuf(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* @_IOFBF
br label %13
11: ; preds = %2
%12 = load i32, i32* @_IONBF
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
%15 = load i32, i32* @BUFSIZ
%16 = call i32 @setvbuf(i32* %5, i8* %6, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@_IOFBF = global i32 0
@_IONBF = global i32 0
@BUFSIZ = global i32 0
define void @setbuf(i32* nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = load i32, i32* @_IOFBF
%5 = load i32, i32* @_IONBF
%6 = select i1 %3, i32 %5, i32 %4
%7 = load i32, i32* @BUFSIZ
%8 = tail call i32 @setvbuf(i32* %0, i8* %1, i32 %6, i32 %7)
ret void
}
/* Type definitions */
struct processor {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ processor_pc_increment(struct processor *, int);
void PxNOP(struct processor *p) {
  processor_pc_increment(p, 1);
  return;
}


x86 assembly (clang, -O0):
<PxNOP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <processor_pc_increment@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PxNOP>:
mov    $0x1,%esi
jmp    1030 <processor_pc_increment@plt>

LLVM IR (-O0):
%struct.processor = type { i32 }
define void @PxNOP(%struct.processor* %0) {
%2 = alloca %struct.processor*
store %struct.processor* %0, %struct.processor** %2
%3 = load %struct.processor*, %struct.processor** %2
%4 = call i32 @processor_pc_increment(%struct.processor* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.processor = type { i32 }
define void @PxNOP(%struct.processor* %0) {
%2 = tail call i32 @processor_pc_increment(%struct.processor* %0, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *libc__IO_proc_open(char const *, char const *);
int /*<<< orphan*/ watch_log(char *, char const *);
FILE *_IO_proc_open(const char *command, const char *type) {
  watch_log("exec %s\n", command);
  return libc__IO_proc_open(command, type);
}


x86 assembly (clang, -O0):
<_IO_proc_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1040 <watch_log@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <libc__IO_proc_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_IO_proc_open>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <watch_log@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <libc__IO_proc_open@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"exec %s\0A\00"
define i32* @_IO_proc_open(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32* @libc__IO_proc_open(i8* %7, i8* %8)
ret i32* %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"exec %s\0A\00"
define i32* @_IO_proc_open(i8* %0, i8* %1) {
%3 = tail call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32* @libc__IO_proc_open(i8* %0, i8* %1)
ret i32* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int calc_cross_time(int, int, int);
int get_time_slot(int /*<<< orphan*/);
int roadmap_line_speed_get_cross_time_at(int line, int against_dir,
                                         time_t at_time) {
  int time_slot;
  time_slot = get_time_slot(at_time);
  return calc_cross_time(line, time_slot, against_dir);
}


x86 assembly (clang, -O0):
<roadmap_line_speed_get_cross_time_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <get_time_slot@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <calc_cross_time@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_line_speed_get_cross_time_at>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%edi
call   1040 <get_time_slot@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <calc_cross_time@plt>

LLVM IR (-O0):
define i32 @roadmap_line_speed_get_cross_time_at(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @get_time_slot(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = call i32 @calc_cross_time(i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @roadmap_line_speed_get_cross_time_at(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @get_time_slot(i32 %2)
%5 = tail call i32 @calc_cross_time(i32 %0, i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x1c() {
  Assert_real((isascii(28)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              145, ("isascii should be 1 for 0x1c"));
}


x86 assembly (clang, -O0):
<t_isascii_0x1c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x91,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x1c>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x91,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x1c\00"
define void @t_isascii_0x1c() {
%1 = call i32 @isascii(i32 28)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x1c\00"
define void @t_isascii_0x1c() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
main() {
  char *m = "Hola mundo!";
  puts(m);
  *m = 'B';
  puts(m);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
movb   $0x42,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hola mundo!\00"
define i32 @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @puts(i8* %2)
%4 = load i8*, i8** %1
store i8 66, i8* %4
%5 = load i8*, i8** %1
%6 = call i32 @puts(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hola mundo!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void FORWARD(int FORWARD_SPEED, int FORWARD_RANGE) {}


x86 assembly (clang, -O0):
<FORWARD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FORWARD>:
ret

LLVM IR (-O0):
define void @FORWARD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @FORWARD(i32 %0, i32 %1) {
ret void
}
int isspace(int c) {
  return (c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v');
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isspace+0x4d>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isspace+0x4d>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isspace+0x4d>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isspace+0x4d>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    1117 <isspace+0x17>
mov    $0x1,%eax
mov    $0x1b,%edx
bt     %ecx,%edx
jb     111f <isspace+0x1f>
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 12
br i1 %4, label %17, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 10
br i1 %7, label %17, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 13
br i1 %10, label %17, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 9
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 11
br label %17
17: ; preds = %14, %11, %8, %5, %1
%18 = phi i1 [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 5
br i1 %3, label %7, label %4
4: ; preds = %7, %1
%5 = icmp eq i32 %0, 11
%6 = zext i1 %5 to i32
br label %12
7: ; preds = %1
%8 = trunc i32 %2 to i8
%9 = lshr i8 27, %8
%10 = and i8 %9, 1
%11 = icmp eq i8 %10, 0
br i1 %11, label %4, label %12
12: ; preds = %7, %4
%13 = phi i32 [ %6, %4 ], [ 1, %7 ]
ret i32 %13
}
void fd108(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  p014A:
    goto p014A;
    goto a;
  a:
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd108>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd108+0x7>

x86 assembly (clang, -O2):
<fd108>:
jmp    1100 <fd108>

LLVM IR (-O0):
define void @fd108(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; No predecessors!
%25 = load i32, i32* %2
%26 = zext i32 %25 to i64
br label %27
27: ; preds = %27, %24
br label %27
28: ; No predecessors!
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
br label %31
31: ; preds = %31, %28
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; preds = %42
br label %42
43: ; No predecessors!
%44 = load i32, i32* %2
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %46, %43
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd108(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_184() {
  Assert_real((isqrt(184) == 13),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              925, ("Integer square root of 184 should be 13"));
}


x86 assembly (clang, -O0):
<t_sqrt_184>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8,%edi
call   1030 <isqrt@plt>
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x39d,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_184>:
push   %rax
mov    $0xb8,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x39d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 184 should be 13\00"
define void @t_sqrt_184() {
%1 = call i32 @isqrt(i32 184)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 184 should be 13\00"
define void @t_sqrt_184() {
%1 = tail call i32 @isqrt(i32 184)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void f43(void) {
  ({
    a:
      ({ 0; });
      goto a;
      ({ 0; });
      0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f43>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1104 <f43+0x4>

x86 assembly (clang, -O2):
<f43>:
jmp    1100 <f43>

LLVM IR (-O0):
define void @f43() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %3, %0
store i32 0, i32* %1
%4 = load i32, i32* %1
br label %3
}

LLVM IR (-O2):
define void @f43() {
br label %1
1: ; preds = %1, %0
br label %1
}
void signals_init(void) {}


x86 assembly (clang, -O0):
<signals_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signals_init>:
ret

LLVM IR (-O0):
define void @signals_init() {
ret void
}

LLVM IR (-O2):
define void @signals_init() {
ret void
}
void display_close() {}


x86 assembly (clang, -O0):
<display_close>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_close>:
ret

LLVM IR (-O0):
define void @display_close() {
ret void
}

LLVM IR (-O2):
define void @display_close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ random_buffer(void *, int);
int random_int() {
  int i;
  random_buffer((void *)&i, (int)sizeof(int));
  return i;
}


x86 assembly (clang, -O0):
<random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <random_buffer@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <random_buffer@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_int() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @random_buffer(i8* %2, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @random_int() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @random_buffer(i8* %2, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
void modpath(char *s) {
  while (*s) {
    if (*s == '/') {
      *s = '\\';
    }
    s++;
  }
}


x86 assembly (clang, -O0):
<modpath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <modpath+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    112c <modpath+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x5c,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <modpath+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<modpath>:
jmp    1117 <modpath+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5c,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2f,%al
je     1110 <modpath+0x10>
test   %al,%al
jne    1113 <modpath+0x13>
ret

LLVM IR (-O0):
define void @modpath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %14, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 47
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = load i8*, i8** %2
store i8 92, i8* %13
br label %14
14: ; preds = %12, %7
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
br label %3
17: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @modpath(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 47, label %5
]
5: ; preds = %2
store i8 92, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delayUs(int);
void delayMs(unsigned int t) {
  while (t--) {
    delayUs(245);
    delayUs(245);
    delayUs(245);
    delayUs(245);
  }
}


x86 assembly (clang, -O0):
<delayMs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     115c <delayMs+0x4c>
mov    $0xf5,%edi
call   1030 <delayUs@plt>
mov    $0xf5,%edi
call   1030 <delayUs@plt>
mov    $0xf5,%edi
call   1030 <delayUs@plt>
mov    $0xf5,%edi
call   1030 <delayUs@plt>
jmp    111b <delayMs+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayMs>:
push   %rbx
test   %edi,%edi
je     114d <delayMs+0x3d>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xf5,%edi
call   1030 <delayUs@plt>
mov    $0xf5,%edi
call   1030 <delayUs@plt>
mov    $0xf5,%edi
call   1030 <delayUs@plt>
mov    $0xf5,%edi
call   1030 <delayUs@plt>
add    $0xffffffff,%ebx
jne    1120 <delayMs+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delayMs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = call i32 @delayUs(i32 245)
%9 = call i32 @delayUs(i32 245)
%10 = call i32 @delayUs(i32 245)
%11 = call i32 @delayUs(i32 245)
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delayMs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = tail call i32 @delayUs(i32 245)
%7 = tail call i32 @delayUs(i32 245)
%8 = tail call i32 @delayUs(i32 245)
%9 = tail call i32 @delayUs(i32 245)
%10 = icmp eq i32 %5, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
ret void
}
void Nullize(char *string, int size) {
  int i = 0;
  for (i = 0; i < size; i++) {
    string[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<Nullize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <Nullize+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <Nullize+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Nullize>:
test   %esi,%esi
jle    1122 <Nullize+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @Nullize(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @Nullize(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sqlite3GenericFree(void *);
void sqlite3_free(void *p) {
  if (p)
    sqlite3GenericFree(p);
}


x86 assembly (clang, -O0):
<sqlite3_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <sqlite3_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <sqlite3GenericFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3_free>:
test   %rdi,%rdi
je     111a <sqlite3_free+0xa>
jmp    1030 <sqlite3GenericFree@plt>
ret

LLVM IR (-O0):
define void @sqlite3_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @sqlite3GenericFree(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @sqlite3_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sqlite3GenericFree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
void f0(long long x) { printf("f0: %lld\n", x); }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"f0: %lld\0A\00"
define void @f0(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"f0: %lld\0A\00"
define void @f0(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
double EvalAngDist_alpha0_0plus_0plus_14032_L0(double);
double funcAngDist_alpha0_0plus_0plus_14032_L0(double *x, double *par) {
  double result;
  result = par[0] * EvalAngDist_alpha0_0plus_0plus_14032_L0(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngDist_alpha0_0plus_0plus_14032_L0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngDist_alpha0_0plus_0plus_14032_L0@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngDist_alpha0_0plus_0plus_14032_L0>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngDist_alpha0_0plus_0plus_14032_L0@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngDist_alpha0_0plus_0plus_14032_L0(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngDist_alpha0_0plus_0plus_14032_L0(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngDist_alpha0_0plus_0plus_14032_L0(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngDist_alpha0_0plus_0plus_14032_L0(double %4)
%6 = fmul double %3, %5
ret double %6
}
int do_355() { return 355; }


x86 assembly (clang, -O0):
<do_355>:
push   %rbp
mov    %rsp,%rbp
mov    $0x163,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_355>:
mov    $0x163,%eax
ret

LLVM IR (-O0):
define i32 @do_355() {
ret i32 355
}

LLVM IR (-O2):
define i32 @do_355() {
ret i32 355
}
/* Variables and functions */
scalar_t__ isalpha(char);
scalar_t__ isdigit(char);
unsigned hextoint(char c) {
  if (isalpha(c)) {
    return (c & 0x1f) + 9;
  }
  if (isdigit(c)) {
    return c & 0xf;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<hextoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     1153 <hextoint+0x33>
movsbl -0x5(%rbp),%eax
and    $0x1f,%eax
add    $0x9,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <hextoint+0x5c>
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1175 <hextoint+0x55>
movsbl -0x5(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <hextoint+0x5c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hextoint>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
test   %rax,%rax
je     1135 <hextoint+0x15>
and    $0x1f,%bl
add    $0x9,%bl
jmp    1145 <hextoint+0x25>
movsbl %bl,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     114a <hextoint+0x2a>
and    $0xf,%bl
movzbl %bl,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hextoint(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalpha(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = and i32 %9, 31
%11 = add nsw i32 %10, 9
store i32 %11, i32* %2
br label %21
12: ; preds = %1
%13 = load i8, i8* %3
%14 = call i64 @isdigit(i8 signext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = and i32 %18, 15
store i32 %19, i32* %2
br label %21
20: ; preds = %12
store i32 -1, i32* %2
br label %21
21: ; preds = %20, %16, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @hextoint(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = and i8 %0, 31
%6 = add nuw nsw i8 %5, 9
%7 = zext i8 %6 to i32
br label %14
8: ; preds = %1
%9 = tail call i64 @isdigit(i8 signext %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = and i8 %0, 15
%13 = zext i8 %12 to i32
br label %14
14: ; preds = %8, %11, %4
%15 = phi i32 [ %7, %4 ], [ %13, %11 ], [ -1, %8 ]
ret i32 %15
}
void blank_init_data() {}


x86 assembly (clang, -O0):
<blank_init_data>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blank_init_data>:
ret

LLVM IR (-O0):
define void @blank_init_data() {
ret void
}

LLVM IR (-O2):
define void @blank_init_data() {
ret void
}
/* Type definitions */
struct cpufreq_affected_cpus {
  int dummy;
};

/* Variables and functions */
struct cpufreq_affected_cpus *sysfs_get_affected_cpus(unsigned int);
struct cpufreq_affected_cpus *cpufreq_get_affected_cpus(unsigned int cpu) {
  return sysfs_get_affected_cpus(cpu);
}


x86 assembly (clang, -O0):
<cpufreq_get_affected_cpus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sysfs_get_affected_cpus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpufreq_get_affected_cpus>:
jmp    1030 <sysfs_get_affected_cpus@plt>

LLVM IR (-O0):
%struct.cpufreq_affected_cpus = type { i32 }
define %struct.cpufreq_affected_cpus* @cpufreq_get_affected_cpus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.cpufreq_affected_cpus* @sysfs_get_affected_cpus(i32 %3)
ret %struct.cpufreq_affected_cpus* %4
}

LLVM IR (-O2):
%struct.cpufreq_affected_cpus = type { i32 }
define %struct.cpufreq_affected_cpus* @cpufreq_get_affected_cpus(i32 %0) {
%2 = tail call %struct.cpufreq_affected_cpus* @sysfs_get_affected_cpus(i32 %0)
ret %struct.cpufreq_affected_cpus* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  if (4 < 5) {
    scanf("%d", &a);
    printf("%d", 4 - a);
  } else
    printf("%d", 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x4,%esi
sub    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0x4,%esi
sub    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = sub nsw i32 4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sub nsw i32 4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void rom_init() {}


x86 assembly (clang, -O0):
<rom_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rom_init>:
ret

LLVM IR (-O0):
define void @rom_init() {
ret void
}

LLVM IR (-O2):
define void @rom_init() {
ret void
}
/* Variables and functions */
void *test_round(void *arg) {
  intptr_t ret = 0;
  for (int i = 0; i < 10000; i++) {
    int rm;
  }
  return (void *)ret;
}


x86 assembly (clang, -O0):
<test_round>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jge    1137 <test_round+0x37>
jmp    1129 <test_round+0x29>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <test_round+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_round>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @test_round(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i64 0, i64* %3
store i32 0, i32* %4
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 10000
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %6
13: ; preds = %6
%14 = load i64, i64* %3
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @test_round(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ do_test();
int main(void) {
  do_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <do_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <do_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @do_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_test()
ret i32 0
}
adrx0adrx1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((((short *)10000000)[x0]) <= (((short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movswl (%rax,%rcx,2),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114d <adrx0adrx1+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <adrx0adrx1+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adrx1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx,%rcx,1),%dx
setle  %al
ret

LLVM IR (-O0):
define i32 @adrx0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = load i32, i32* %11
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %22
%24 = load i16, i16* %23
%25 = sext i16 %24 to i32
%26 = icmp sle i32 %20, %25
br i1 %26, label %27, label %28
27: ; preds = %6
store i32 1, i32* %7
br label %29
28: ; preds = %6
store i32 0, i32* %7
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %7
ret i32 %30
}

LLVM IR (-O2):
define i32 @adrx0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %10
%12 = load i16, i16* %11
%13 = icmp sle i16 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
size_t fwrite(int *, int, int, int /*<<< orphan*/ *);
void write_int(FILE *fp, int i) {
  size_t written = fwrite(&i, sizeof(i), 1, fp);
  if (written != 1) {
    exit(10);
  }
}


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
je     115f <write_int+0x3f>
mov    $0xa,%edi
call   1030 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
cmp    $0x1,%rax
jne    1144 <write_int+0x24>
pop    %rax
ret
mov    $0xa,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @write_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i64 @fwrite(i32* %4, i32 4, i32 1, i32* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = icmp ne i64 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @exit(i32 10)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @write_int(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
%5 = icmp eq i64 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @exit(i32 10)
unreachable
8: ; preds = %2
ret void
}
int tohex(int nib) {
  if (nib < 10)
    return '0' + nib;
  else
    return 'a' + nib - 10;
}


x86 assembly (clang, -O0):
<tohex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <tohex+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <tohex+0x2b>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tohex>:
lea    0x57(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tohex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 48, %7
store i32 %8, i32* %2
br label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add nsw i32 97, %10
%12 = sub nsw i32 %11, 10
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @tohex(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = select i1 %2, i32 48, i32 87
%4 = add nsw i32 %3, %0
ret i32 %4
}
int fun131() { return 131; }


x86 assembly (clang, -O0):
<fun131>:
push   %rbp
mov    %rsp,%rbp
mov    $0x83,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun131>:
mov    $0x83,%eax
ret

LLVM IR (-O0):
define i32 @fun131() {
ret i32 131
}

LLVM IR (-O2):
define i32 @fun131() {
ret i32 131
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int main(void) {
  char hello[] = "Hello World!";
  char *str_p = hello;
  uint8_t l_count = 0;
  uint8_t o_count = 0;
  uint8_t else_count = 0;
  do {
    switch (*str_p) {
    case 'o':
      o_count++;
      break;
    case 'l':
      l_count++;
      break;
    default:
      else_count++;
    }
    ++str_p;
  } while (*str_p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xee7(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x11(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x30(%rbp)
sub    $0x6c,%eax
je     117c <main+0x7c>
jmp    115d <main+0x5d>
mov    -0x30(%rbp),%eax
sub    $0x6f,%eax
jne    118a <main+0x8a>
jmp    116e <main+0x6e>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1193 <main+0x93>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1193 <main+0x93>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1145 <main+0x45>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
@__const.main.hello = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [13 x i8]* %2 to i8*
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
store i8* %8, i8** %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %9
9: ; preds = %25, %0
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
switch i32 %12, label %19 [
i32 111, label %13
i32 108, label %16
]
13: ; preds = %9
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %22
16: ; preds = %9
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %22
19: ; preds = %9
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %22
22: ; preds = %19, %16, %13
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %25
25: ; preds = %22
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = icmp ne i8 %27, 0
br i1 %28, label %9, label %29
29: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct termios {
  int c_lflag;
};

/* Variables and functions */
int ECHO;
int ICANON;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void turnOnLineBuffering() {
  struct termios termiosStruct;
  tcgetattr(STDIN_FILENO, &termiosStruct);
  termiosStruct.c_lflag |= (ICANON | ECHO);
  tcsetattr(STDIN_FILENO, TCSANOW, &termiosStruct);
}


x86 assembly (clang, -O0):
<turnOnLineBuffering>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <tcgetattr@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    0x2e96(%rip),%rcx
or     (%rcx),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnOnLineBuffering>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <tcgetattr@plt>
mov    0x2e89(%rip),%rax
mov    0x2e9a(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
or     %ecx,(%rsp)
mov    (%rbx),%edi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdx
call   1040 <tcsetattr@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@ICANON = global i32 0
@ECHO = global i32 0
@TCSANOW = global i32 0
define void @turnOnLineBuffering() {
%1 = alloca %struct.termios
%2 = load i32, i32* @STDIN_FILENO
%3 = call i32 @tcgetattr(i32 %2, %struct.termios* %1)
%4 = load i32, i32* @ICANON
%5 = load i32, i32* @ECHO
%6 = or i32 %4, %5
%7 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = or i32 %8, %6
store i32 %9, i32* %7
%10 = load i32, i32* @STDIN_FILENO
%11 = load i32, i32* @TCSANOW
%12 = call i32 @tcsetattr(i32 %10, i32 %11, %struct.termios* %1)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@ICANON = global i32 0
@ECHO = global i32 0
@TCSANOW = global i32 0
define void @turnOnLineBuffering() {
%1 = alloca %struct.termios
%2 = bitcast %struct.termios* %1 to i8*
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @tcgetattr(i32 %3, %struct.termios* %1)
%5 = load i32, i32* @ICANON
%6 = load i32, i32* @ECHO
%7 = or i32 %6, %5
%8 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = or i32 %7, %9
store i32 %10, i32* %8
%11 = load i32, i32* @STDIN_FILENO
%12 = load i32, i32* @TCSANOW
%13 = call i32 @tcsetattr(i32 %11, i32 %12, %struct.termios* %1)
ret void
}
void g_dataset_id_set_data_full() {}


x86 assembly (clang, -O0):
<g_dataset_id_set_data_full>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_dataset_id_set_data_full>:
ret

LLVM IR (-O0):
define void @g_dataset_id_set_data_full() {
ret void
}

LLVM IR (-O2):
define void @g_dataset_id_set_data_full() {
ret void
}