xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x6a() {
  Assert_real((isascii(106)),
              "/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",
              535, ("isascii should be 1 for j"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x6a>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x217,%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 = [26 x i8] c"isascii should be 1 for j\00"
define void @t_isascii_0x6a() {
%1 = call i32 @isascii(i32 106)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isascii should be 1 for j\00"
define void @t_isascii_0x6a() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
unsigned int getlong(FILE *pcl) {
  int ch1, ch2, ch3, ch4;
  ch1 = getc(pcl);
  ch2 = getc(pcl);
  ch3 = getc(pcl);
  ch4 = getc(pcl);
  return ((ch1 << 24) | (ch2 << 16) | (ch3 << 8) | ch4);
}


x86 assembly (clang, -O0):
<getlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlong>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x18,%r14d
shl    $0x10,%ebp
or     %r14d,%ebp
shl    $0x8,%r15d
or     %r15d,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getlong(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = call i32 @getc(i32* %9)
store i32 %10, i32* %4
%11 = load i32*, i32** %2
%12 = call i32 @getc(i32* %11)
store i32 %12, i32* %5
%13 = load i32*, i32** %2
%14 = call i32 @getc(i32* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = shl i32 %15, 24
%17 = load i32, i32* %4
%18 = shl i32 %17, 16
%19 = or i32 %16, %18
%20 = load i32, i32* %5
%21 = shl i32 %20, 8
%22 = or i32 %19, %21
%23 = load i32, i32* %6
%24 = or i32 %22, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @getlong(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = tail call i32 @getc(i32* %0)
%5 = tail call i32 @getc(i32* %0)
%6 = shl i32 %2, 24
%7 = shl i32 %3, 16
%8 = or i32 %7, %6
%9 = shl i32 %4, 8
%10 = or i32 %8, %9
%11 = or i32 %10, %5
ret i32 %11
}
int is_ivybridge(unsigned short pciid) {
  return ((pciid) == 0x0152 || (pciid) == 0x0162 || (pciid) == 0x0156 ||
          (pciid) == 0x0166 || (pciid) == 0x015a || (pciid) == 0x016a);
}


x86 assembly (clang, -O0):
<is_ivybridge>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x152,%ecx
mov    %al,-0x3(%rbp)
je     1183 <is_ivybridge+0x83>
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x162,%ecx
mov    %al,-0x3(%rbp)
je     1183 <is_ivybridge+0x83>
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x156,%ecx
mov    %al,-0x3(%rbp)
je     1183 <is_ivybridge+0x83>
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x166,%ecx
mov    %al,-0x3(%rbp)
je     1183 <is_ivybridge+0x83>
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x15a,%ecx
mov    %al,-0x3(%rbp)
je     1183 <is_ivybridge+0x83>
movzwl -0x2(%rbp),%eax
cmp    $0x16a,%eax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ivybridge>:
lea    -0x152(%rdi),%ecx
rol    $0xe,%cx
cmp    $0x6,%cx
jae    111f <is_ivybridge+0x1f>
mov    $0x1,%eax
mov    $0x37,%edx
bt     %ecx,%edx
jb     112d <is_ivybridge+0x2d>
movzwl %di,%ecx
xor    %eax,%eax
cmp    $0x16a,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_ivybridge(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp eq i32 %4, 338
br i1 %5, label %26, label %6
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = icmp eq i32 %8, 354
br i1 %9, label %26, label %10
10: ; preds = %6
%11 = load i16, i16* %2
%12 = zext i16 %11 to i32
%13 = icmp eq i32 %12, 342
br i1 %13, label %26, label %14
14: ; preds = %10
%15 = load i16, i16* %2
%16 = zext i16 %15 to i32
%17 = icmp eq i32 %16, 358
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = load i16, i16* %2
%20 = zext i16 %19 to i32
%21 = icmp eq i32 %20, 346
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i16, i16* %2
%24 = zext i16 %23 to i32
%25 = icmp eq i32 %24, 362
br label %26
26: ; preds = %22, %18, %14, %10, %6, %1
%27 = phi i1 [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %25, %22 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @is_ivybridge(i16 zeroext %0) {
%2 = add i16 %0, -338
%3 = tail call i16 @llvm.fshl.i16(i16 %2, i16 %2, i16 14)
%4 = icmp ult i16 %3, 6
br i1 %4, label %8, label %5
5: ; preds = %8, %1
%6 = icmp eq i16 %0, 362
%7 = zext i1 %6 to i32
br label %13
8: ; preds = %1
%9 = trunc i16 %3 to i8
%10 = lshr i8 55, %9
%11 = and i8 %10, 1
%12 = icmp eq i8 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %8, %5
%14 = phi i32 [ %7, %5 ], [ 1, %8 ]
ret i32 %14
}
int false5() {
  static int test = 0;
  int a = 56;
  a *= test;
  test++;
  return a;
}


x86 assembly (clang, -O0):
<false5>:
push   %rbp
mov    %rsp,%rbp
movl   $0x38,-0x4(%rbp)
mov    0x2f13(%rip),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2f06(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2efd(%rip)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<false5>:
mov    0x2f1e(%rip),%ecx
imul   $0x38,%ecx,%eax
add    $0x1,%ecx
mov    %ecx,0x2f12(%rip)
ret

LLVM IR (-O0):
@false5.test = internal global i32 0
define i32 @false5() {
%1 = alloca i32
store i32 56, i32* %1
%2 = load i32, i32* @false5.test
%3 = load i32, i32* %1
%4 = mul nsw i32 %3, %2
store i32 %4, i32* %1
%5 = load i32, i32* @false5.test
%6 = add nsw i32 %5, 1
store i32 %6, i32* @false5.test
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@false5.test = internal unnamed_addr global i32 0
define i32 @false5() {
%1 = load i32, i32* @false5.test
%2 = mul nsw i32 %1, 56
%3 = add nsw i32 %1, 1
store i32 %3, i32* @false5.test
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ japi_drawarc(int, int, int, int, int, int, int);
void j_drawarc(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5,
               int arg6) {
  japi_drawarc(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}


x86 assembly (clang, -O0):
<j_drawarc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <japi_drawarc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_drawarc>:
jmp    1030 <japi_drawarc@plt>

LLVM IR (-O0):
define void @j_drawarc(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = load i32, i32* %14
%22 = call i32 @japi_drawarc(i32 %15, i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @j_drawarc(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @japi_drawarc(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *rbuf, size_t size) {
  void *tmp = realloc(rbuf, size);
  if (tmp != NULL) {
    return tmp;
  } else {
    fprintf(stderr, "Error: could not allocate memory");
    printf("Error: could not allocate memory");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1176 <xrealloc+0x36>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1050 <realloc@plt>
test   %rax,%rax
je     114d <xrealloc+0xd>
pop    %rbx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rbx
mov    %rbx,%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Error: could not allocate memory\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %5
ret i8* %12
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Error: could not allocate memory\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
ret i8* %3
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 -1)
unreachable
}
void RTVfsIoStrmToFile(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @i2c_stop() {
ret void
}
void swapval(int x, int y) {
  int tmp;
  tmp = x;
  x = y;
  y = tmp;
}


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

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

LLVM IR (-O0):
define void @swapval(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @swapval(i32 %0, i32 %1) {
ret void
}
run(s, a, b, c, d) char *s, *a, *b, *c, *d;
{
  char buf[1024];
  sprintf(buf, s, a, b, c, d);
  system(buf);
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x430(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rbx
sub    $0x400,%rsp
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @run(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca [1024 x i8]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i8*, i8** %11
%19 = call i32 (i8*, i8*, ...) @sprintf(i8* %13, i8* %14, i8* %15, i8* %16, i8* %17, i8* %18)
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %20)
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @run(i8* nocapture %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca [1024 x i8]
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) %0, i8* %1, i8* %2, i8* %3, i8* %4)
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %7)
ret i32 undef
}
/* Type definitions */
struct timeval {
  unsigned long tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void ir_usleep(unsigned long usec) {
  struct timeval tv;
  tv.tv_sec = usec / 1000000;
  tv.tv_usec = (usec % 1000000);
  (void)select(0, NULL, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<ir_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ir_usleep>:
sub    $0x18,%rsp
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdi,%rax
mul    %rcx
shr    $0x12,%rdx
mov    %rdx,0x8(%rsp)
imul   $0xf4240,%rdx,%rax
sub    %rax,%rdi
mov    %rdi,0x10(%rsp)
lea    0x8(%rsp),%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @ir_usleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timeval
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = urem i64 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 %8, i64* %9
%10 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @ir_usleep(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = udiv i64 %0, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = urem i64 %0, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 %6, i64* %7
%8 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
unsigned long long rdtsc(void) {
  unsigned long long res;
  asm volatile("rdtsc" : "=A"(res));
  return res;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ crt0();
int /*<<< orphan*/ main();
__attribute__((section(".after_vectors"))) void ResetISR(void) {
  crt0();
  main();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<ResetISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <crt0@plt>
mov    $0x0,%al
call   1040 <main@plt>
jmp    1132 <ResetISR+0x12>

x86 assembly (clang, -O2):
<ResetISR>:
push   %rax
xor    %eax,%eax
call   1030 <crt0@plt>
xor    %eax,%eax
call   1040 <main@plt>
nop
jmp    1130 <ResetISR+0x10>

LLVM IR (-O0):
define void @ResetISR() section ".after_vectors" {
%1 = call i32 (...) @crt0()
%2 = call i32 (...) @main()
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define void @ResetISR() section ".after_vectors" {
%1 = tail call i32 (...) @crt0()
%2 = tail call i32 (...) @main()
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char **argv) {
  fprintf(stderr,
          "usage: %s [-n N] [-m M] [-c] [-g gangs] [-v vector_length] [-h]\n",
          argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xecc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"usage: %s [-n N] [-m M] [-c] [-g gangs] [-v vector_length] [-h]\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"usage: %s [-n N] [-m M] [-c] [-g gangs] [-v vector_length] [-h]\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
int IsRight(char c) { return c == ')'; }


x86 assembly (clang, -O0):
<IsRight>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x29,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsRight>:
xor    %eax,%eax
cmp    $0x29,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @IsRight(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 41
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @IsRight(i8 signext %0) {
%2 = icmp eq i8 %0, 41
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int f221(int *);
int f222(int *p) { return f221(p); }


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

x86 assembly (clang, -O2):
<f222>:
jmp    1030 <f221@plt>

LLVM IR (-O0):
define i32 @f222(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f221(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @f222(i32* %0) {
%2 = tail call i32 @f221(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
void cipher_global_init() { OpenSSL_add_all_algorithms(); }


x86 assembly (clang, -O0):
<cipher_global_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OpenSSL_add_all_algorithms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cipher_global_init>:
xor    %eax,%eax
jmp    1030 <OpenSSL_add_all_algorithms@plt>

LLVM IR (-O0):
define void @cipher_global_init() {
%1 = call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}

LLVM IR (-O2):
define void @cipher_global_init() {
%1 = tail call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EAGAIN;
int /*<<< orphan*/ errno;
int _fork() {
  errno = EAGAIN;
  return -1;
}


x86 assembly (clang, -O0):
<_fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ecc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fork>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EAGAIN = global i32 0
@errno = global i32 0
define i32 @_fork() {
%1 = load i32, i32* @EAGAIN
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EAGAIN = global i32 0
@errno = global i32 0
define i32 @_fork() {
%1 = load i32, i32* @EAGAIN
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) {
  int foo = 1;
  int notfoo = 0;
  if (!!foo) {
    printf("\n\n This is not not foo, foo is 1 so not foo is 0 and not not foo "
           "is 1\n\n");
  }
  if (!!notfoo) {
    printf("\n\n This is not not notfoo, notfoo is 0 so not foo is 1 and not "
           "not foo is 0\n\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <main+0x2c>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1152 <main+0x42>
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [72 x i8] c"\0A\0A This is not not foo, foo is 1 so not foo is 0 and not not foo is 1\0A\0A\00"
@.str.1 = [78 x i8] c"\0A\0A This is not not notfoo, notfoo is 0 so not foo is 1 and not not foo is 0\0A\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@str = [71 x i8] c"\0A\0A This is not not foo, foo is 1 so not foo is 0 and not not foo is 1\0A\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daemonize();
int /*<<< orphan*/ init_task();
int mtnd();
int /*<<< orphan*/ mtnd_init();
int /*<<< orphan*/ parse(int, char **);
int /*<<< orphan*/ set_sig_handler();
int main(int argc, char *argv[]) {
  mtnd_init();
  set_sig_handler();
  parse(argc, argv);
  daemonize();
  init_task();
  return (mtnd());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <mtnd_init@plt>
mov    $0x0,%al
call   1050 <set_sig_handler@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <parse@plt>
mov    $0x0,%al
call   1030 <daemonize@plt>
mov    $0x0,%al
call   1070 <init_task@plt>
mov    $0x0,%al
call   1040 <mtnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1060 <mtnd_init@plt>
xor    %eax,%eax
call   1050 <set_sig_handler@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1080 <parse@plt>
xor    %eax,%eax
call   1030 <daemonize@plt>
xor    %eax,%eax
call   1070 <init_task@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mtnd@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @mtnd_init()
%7 = call i32 (...) @set_sig_handler()
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @parse(i32 %8, i8** %9)
%11 = call i32 (...) @daemonize()
%12 = call i32 (...) @init_task()
%13 = call i32 (...) @mtnd()
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @mtnd_init()
%4 = tail call i32 (...) @set_sig_handler()
%5 = tail call i32 @parse(i32 %0, i8** %1)
%6 = tail call i32 (...) @daemonize()
%7 = tail call i32 (...) @init_task()
%8 = tail call i32 (...) @mtnd()
ret i32 %8
}
void prune_arrblk_ne_CAT(int *x) {
  int *y = x + 10;
  if (x != y) {
    x[5] = 1;
  }
}


x86 assembly (clang, -O0):
<prune_arrblk_ne_CAT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x28,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     112d <prune_arrblk_ne_CAT+0x2d>
mov    -0x8(%rbp),%rax
movl   $0x1,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<prune_arrblk_ne_CAT>:
movl   $0x1,0x14(%rdi)
ret

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

LLVM IR (-O2):
define void @prune_arrblk_ne_CAT(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
store i32 1, i32* %2
ret void
}
__attribute__((always_)) unsigned char _xtest(void) {
  unsigned char out;
  __asm__ volatile(".byte 0x0f, 0x01, 0xd6; setnz %0" : "=r"(out)::"memory");
  return out;
}


x86 assembly (clang, -O0):
<_xtest>:
push   %rbp
mov    %rsp,%rbp
xtest
setne  %al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xtest>:
xtest
setne  %al
ret

LLVM IR (-O0):
define zeroext i8 @_xtest() {
%1 = alloca i8
%2 = call i8 asm sideeffect ".byte 0x0f, 0x01, 0xd6; setnz $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
store i8 %2, i8* %1
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @_xtest() {
%1 = tail call i8 asm sideeffect ".byte 0x0f, 0x01, 0xd6; setnz $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i8 %1
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_read_end(int);
void read_one_meg_end(void) {
  ssize_t n;
  init_test();
  n = log_read_end(1048576);
  basic_test(n == 1048576);
  cleanup_test();
}


x86 assembly (clang, -O0):
<read_one_meg_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x100000,%edi
call   1040 <log_read_end@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x100000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1050 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_one_meg_end>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x100000,%edi
call   1040 <log_read_end@plt>
xor    %edi,%edi
cmp    $0x100000,%eax
sete   %dil
call   1030 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cleanup_test@plt>

LLVM IR (-O0):
define void @read_one_meg_end() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_read_end(i32 1048576)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1048576
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @read_one_meg_end() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_read_end(i32 1048576)
%3 = icmp eq i32 %2, 1048576
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int EMACPHYRead(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ EMACPHYWrite(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                int);
void EMACPHYPowerOn(uint32_t ui32Base, uint8_t ui8PhyAddr) {
  EMACPHYWrite(ui32Base, ui8PhyAddr, 0x00000000,
               (EMACPHYRead(ui32Base, ui8PhyAddr, 0x00000000) & ~0x00000800) |
                   0x00001000);
}


x86 assembly (clang, -O0):
<EMACPHYPowerOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <EMACPHYRead@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%ecx
and    $0xfffff7ff,%ecx
or     $0x1000,%ecx
xor    %edx,%edx
call   1040 <EMACPHYWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACPHYPowerOn>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edx,%edx
call   1030 <EMACPHYRead@plt>
and    $0xffffe7ff,%eax
lea    0x1000(%rax),%ecx
mov    %ebp,%edi
mov    %ebx,%esi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <EMACPHYWrite@plt>

LLVM IR (-O0):
define void @EMACPHYPowerOn(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @EMACPHYRead(i32 %7, i32 %8, i32 0)
%10 = and i32 %9, -2049
%11 = or i32 %10, 4096
%12 = call i32 @EMACPHYWrite(i32 %5, i32 %6, i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
define void @EMACPHYPowerOn(i32 %0, i32 %1) {
%3 = tail call i32 @EMACPHYRead(i32 %0, i32 %1, i32 0)
%4 = and i32 %3, -6145
%5 = or i32 %4, 4096
%6 = tail call i32 @EMACPHYWrite(i32 %0, i32 %1, i32 0, i32 %5)
ret void
}
void makesix_ptr(int *a) { *a = 6; }


x86 assembly (clang, -O0):
<makesix_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x6,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<makesix_ptr>:
movl   $0x6,(%rdi)
ret

LLVM IR (-O0):
define void @makesix_ptr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 6, i32* %3
ret void
}

LLVM IR (-O2):
define void @makesix_ptr(i32* nocapture writeonly %0) {
store i32 6, i32* %0
ret void
}
double f4_cb_send_pre_double_double_float(double (*cb)(double, double, float)) {
  float r = 55.0;
  return cb(8.25, 9.25, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_double_double_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  0xf04(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm2
movsd  0xede(%rip),%xmm0
movsd  0xede(%rip),%xmm1
call   *%rax
movsd  0xec4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_double_double_float>:
push   %rax
movsd  0xef7(%rip),%xmm0
movsd  0xef7(%rip),%xmm1
movss  0xeff(%rip),%xmm2
call   *%rdi
addsd  0xeed(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_double_double_float(double (double, double, float)* %0) {
%2 = alloca double (double, double, float)*
%3 = alloca float
store double (double, double, float)* %0, double (double, double, float)** %2
store float 5.500000e+01, float* %3
%4 = load double (double, double, float)*, double (double, double, float)** %2
%5 = load float, float* %3
%6 = call double %4(double 8.250000e+00, double 9.250000e+00, float %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_double_double_float(double (double, double, float)* nocapture %0) {
%2 = tail call double %0(double 8.250000e+00, double 9.250000e+00, float 5.500000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ chargerArmeInventaire();
int /*<<< orphan*/ chargerArmureInventaire();
int /*<<< orphan*/ chargerCleInventaire();
int /*<<< orphan*/ chargerPotionInventaire();
int /*<<< orphan*/ chargerTekInventaire();
int /*<<< orphan*/ chargerTresorInventaire();
void chargerInventaire(void) {
  chargerCleInventaire();
  chargerTekInventaire();
  chargerArmureInventaire();
  chargerArmeInventaire();
  chargerTresorInventaire();
  chargerPotionInventaire();
}


x86 assembly (clang, -O0):
<chargerInventaire>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <chargerCleInventaire@plt>
mov    $0x0,%al
call   1070 <chargerTekInventaire@plt>
mov    $0x0,%al
call   1060 <chargerArmureInventaire@plt>
mov    $0x0,%al
call   1040 <chargerArmeInventaire@plt>
mov    $0x0,%al
call   1050 <chargerTresorInventaire@plt>
mov    $0x0,%al
call   1080 <chargerPotionInventaire@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chargerInventaire>:
push   %rax
xor    %eax,%eax
call   1030 <chargerCleInventaire@plt>
xor    %eax,%eax
call   1070 <chargerTekInventaire@plt>
xor    %eax,%eax
call   1060 <chargerArmureInventaire@plt>
xor    %eax,%eax
call   1040 <chargerArmeInventaire@plt>
xor    %eax,%eax
call   1050 <chargerTresorInventaire@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <chargerPotionInventaire@plt>

LLVM IR (-O0):
define void @chargerInventaire() {
%1 = call i32 (...) @chargerCleInventaire()
%2 = call i32 (...) @chargerTekInventaire()
%3 = call i32 (...) @chargerArmureInventaire()
%4 = call i32 (...) @chargerArmeInventaire()
%5 = call i32 (...) @chargerTresorInventaire()
%6 = call i32 (...) @chargerPotionInventaire()
ret void
}

LLVM IR (-O2):
define void @chargerInventaire() {
%1 = tail call i32 (...) @chargerCleInventaire()
%2 = tail call i32 (...) @chargerTekInventaire()
%3 = tail call i32 (...) @chargerArmureInventaire()
%4 = tail call i32 (...) @chargerArmeInventaire()
%5 = tail call i32 (...) @chargerTresorInventaire()
%6 = tail call i32 (...) @chargerPotionInventaire()
ret void
}
int okn_tsm_rot_x_by(struct okn_tsm *t, struct okn_vec3f *v, float x) {
  return 1;
}


x86 assembly (clang, -O0):
<okn_tsm_rot_x_by>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.okn_tsm = type opaque
%struct.okn_vec3f = type opaque
define i32 @okn_tsm_rot_x_by(%struct.okn_tsm* %0, %struct.okn_vec3f* %1, float %2) {
%4 = alloca %struct.okn_tsm*
%5 = alloca %struct.okn_vec3f*
%6 = alloca float
store %struct.okn_tsm* %0, %struct.okn_tsm** %4
store %struct.okn_vec3f* %1, %struct.okn_vec3f** %5
store float %2, float* %6
ret i32 1
}

LLVM IR (-O2):
%struct.okn_tsm = type opaque
%struct.okn_vec3f = type opaque
define i32 @okn_tsm_rot_x_by(%struct.okn_tsm* nocapture readnone %0, %struct.okn_vec3f* nocapture readnone %1, float %2) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ UART4_RX_TX_DriverIRQHandler();
__attribute__((weak)) void UART4_RX_TX_IRQHandler(void) {
  UART4_RX_TX_DriverIRQHandler();
}


x86 assembly (clang, -O0):
<UART4_RX_TX_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <UART4_RX_TX_DriverIRQHandler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART4_RX_TX_IRQHandler>:
xor    %eax,%eax
jmp    1030 <UART4_RX_TX_DriverIRQHandler@plt>

LLVM IR (-O0):
define weak void @UART4_RX_TX_IRQHandler() {
%1 = call i32 (...) @UART4_RX_TX_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @UART4_RX_TX_IRQHandler() {
%1 = tail call i32 (...) @UART4_RX_TX_DriverIRQHandler()
ret void
}
void foo_1_2_2_2_2_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_2_1_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ picosat_set_verbosity(int);
void btor_picosat_enable_verbosity(void) { picosat_set_verbosity(1); }


x86 assembly (clang, -O0):
<btor_picosat_enable_verbosity>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <picosat_set_verbosity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<btor_picosat_enable_verbosity>:
mov    $0x1,%edi
jmp    1030 <picosat_set_verbosity@plt>

LLVM IR (-O0):
define void @btor_picosat_enable_verbosity() {
%1 = call i32 @picosat_set_verbosity(i32 1)
ret void
}

LLVM IR (-O2):
define void @btor_picosat_enable_verbosity() {
%1 = tail call i32 @picosat_set_verbosity(i32 1)
ret void
}
int roundInt(double a) {
  if (a >= 0)
    return (int)(a + 0.5);
  else
    return (int)(a - 0.5);
}


x86 assembly (clang, -O0):
<roundInt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <roundInt+0x34>
movsd  0xedd(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    114c <roundInt+0x4c>
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundInt>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setb   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @roundInt(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 5.000000e-01
%9 = fptosi double %8 to i32
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fsub double %11, 5.000000e-01
%13 = fptosi double %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @roundInt(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Variables and functions */
char *getLine();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *s;
  s = getLine();
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getLine@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getLine@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @getLine()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_double_vector(double *v) { free((char *)v); }


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

x86 assembly (clang, -O2):
<free_double_vector>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_double_vector(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = bitcast double* %3 to i8*
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
define void @free_double_vector(double* nocapture %0) {
%2 = bitcast double* %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  int *x;
  x = (int *)malloc(4);
  *x = 7654;
  ++*x;
  return *x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1de6,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0x1de7,(%rax)
mov    $0x1de7,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 7654, i32* %5
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 7655, i32* %2
ret i32 7655
}
int lg3ff_init(struct hid_device *hdev) { return -1; }


x86 assembly (clang, -O0):
<lg3ff_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.hid_device = type opaque
define i32 @lg3ff_init(%struct.hid_device* %0) {
%2 = alloca %struct.hid_device*
store %struct.hid_device* %0, %struct.hid_device** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.hid_device = type opaque
define i32 @lg3ff_init(%struct.hid_device* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ checkError(char *);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ triangle();
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  triangle();
  glFlush();
  checkError("display");
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <triangle@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
lea    0xe99(%rip),%rdi
call   1060 <checkError@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1040 <triangle@plt>
xor    %eax,%eax
call   1050 <glFlush@plt>
lea    0xe9c(%rip),%rdi
pop    %rax
jmp    1060 <checkError@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@.str = [8 x i8] c"display\00"
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 (...) @triangle()
%4 = call i32 (...) @glFlush()
%5 = call i32 @checkError(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@.str = [8 x i8] c"display\00"
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 (...) @triangle()
%4 = tail call i32 (...) @glFlush()
%5 = tail call i32 @checkError(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_clojure_comment_entities();
int /*<<< orphan*/ test_clojure_comments();
void all_clojure_tests() {
  test_clojure_comments();
  test_clojure_comment_entities();
}


x86 assembly (clang, -O0):
<all_clojure_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_clojure_comments@plt>
mov    $0x0,%al
call   1030 <test_clojure_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_clojure_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_clojure_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_clojure_comment_entities@plt>

LLVM IR (-O0):
define void @all_clojure_tests() {
%1 = call i32 (...) @test_clojure_comments()
%2 = call i32 (...) @test_clojure_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_clojure_tests() {
%1 = tail call i32 (...) @test_clojure_comments()
%2 = tail call i32 (...) @test_clojure_comment_entities()
ret void
}