xunge/DecIR huggingface dataset:
/* Variables and functions */
int EINVAL;
scalar_t__ cpufreq_get_hardware_limits(unsigned int, unsigned long *,
                                       unsigned long *);
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
int get_hardware_limits(unsigned int cpu) {
  unsigned long min, max;
  if (cpufreq_get_hardware_limits(cpu, &min, &max))
    return -EINVAL;
  printf("%lu %lu\n", min, max);
  return 0;
}


x86 assembly (clang, -O0):
<get_hardware_limits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <cpufreq_get_hardware_limits@plt>
cmp    $0x0,%rax
je     1158 <get_hardware_limits+0x38>
xor    %eax,%eax
mov    0x2e92(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <get_hardware_limits+0x53>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hardware_limits>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <cpufreq_get_hardware_limits@plt>
test   %rax,%rax
je     1148 <get_hardware_limits+0x28>
mov    0x2ea1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
add    $0x18,%rsp
ret
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rdx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@.str = [9 x i8] c"%lu %lu\0A\00"
define i32 @get_hardware_limits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @cpufreq_get_hardware_limits(i32 %6, i64* %4, i64* %5)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @EINVAL
%11 = sub nsw i32 0, %10
store i32 %11, i32* %2
br label %16
12: ; preds = %1
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %13, i64 %14)
store i32 0, i32* %2
br label %16
16: ; preds = %12, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@EINVAL = global i32 0
@.str = [9 x i8] c"%lu %lu\0A\00"
define i32 @get_hardware_limits(i32 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i64 @cpufreq_get_hardware_limits(i32 %0, i64* %2, i64* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
br label %15
11: ; preds = %1
%12 = load i64, i64* %2
%13 = load i64, i64* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13)
br label %15
15: ; preds = %11, %8
%16 = phi i32 [ %10, %8 ], [ 0, %11 ]
ret i32 %16
}
int main() {
  int score;
  char grade;
  if (score >= 90) {
    grade = 'A';
  }
  if (score >= 80 && score < 90) {
    grade = 'B';
  }
  if (score >= 70 && score < 80) {
    grade = 'C';
  }
  if (score >= 60 && score < 70) {
    grade = 'D';
  }
  if (score >= 50 && score < 60) {
    grade = 'E';
  }
  if (score < 50) {
    grade = 'F';
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5a,-0x8(%rbp)
jl     1119 <main+0x19>
movb   $0x41,-0x9(%rbp)
cmpl   $0x50,-0x8(%rbp)
jl     1131 <main+0x31>
cmpl   $0x5a,-0x8(%rbp)
jge    1131 <main+0x31>
movb   $0x42,-0x9(%rbp)
cmpl   $0x46,-0x8(%rbp)
jl     1149 <main+0x49>
cmpl   $0x50,-0x8(%rbp)
jge    1149 <main+0x49>
movb   $0x43,-0x9(%rbp)
cmpl   $0x3c,-0x8(%rbp)
jl     1161 <main+0x61>
cmpl   $0x46,-0x8(%rbp)
jge    1161 <main+0x61>
movb   $0x44,-0x9(%rbp)
cmpl   $0x32,-0x8(%rbp)
jl     1179 <main+0x79>
cmpl   $0x3c,-0x8(%rbp)
jge    1179 <main+0x79>
movb   $0x45,-0x9(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    1187 <main+0x87>
movb   $0x46,-0x9(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 90
br i1 %5, label %6, label %7
6: ; preds = %0
store i8 65, i8* %3
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 80
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 90
br i1 %12, label %13, label %14
13: ; preds = %10
store i8 66, i8* %3
br label %14
14: ; preds = %13, %10, %7
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 70
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 80
br i1 %19, label %20, label %21
20: ; preds = %17
store i8 67, i8* %3
br label %21
21: ; preds = %20, %17, %14
%22 = load i32, i32* %2
%23 = icmp sge i32 %22, 60
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 70
br i1 %26, label %27, label %28
27: ; preds = %24
store i8 68, i8* %3
br label %28
28: ; preds = %27, %24, %21
%29 = load i32, i32* %2
%30 = icmp sge i32 %29, 50
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i32, i32* %2
%33 = icmp slt i32 %32, 60
br i1 %33, label %34, label %35
34: ; preds = %31
store i8 69, i8* %3
br label %35
35: ; preds = %34, %31, %28
%36 = load i32, i32* %2
%37 = icmp slt i32 %36, 50
br i1 %37, label %38, label %39
38: ; preds = %35
store i8 70, i8* %3
br label %39
39: ; preds = %38, %35
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *bar_create(char *, char *, int /*<<< orphan*/);
char *titlebar_create(char *inpath, char *baseurl) {
  return bar_create(inpath, baseurl, 0);
}


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

x86 assembly (clang, -O2):
<titlebar_create>:
xor    %edx,%edx
jmp    1030 <bar_create@plt>

LLVM IR (-O0):
define i8* @titlebar_create(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 = load i8*, i8** %4
%7 = call i8* @bar_create(i8* %5, i8* %6, i32 0)
ret i8* %7
}

LLVM IR (-O2):
define i8* @titlebar_create(i8* %0, i8* %1) {
%3 = tail call i8* @bar_create(i8* %0, i8* %1, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ from_ascii();
int /*<<< orphan*/ to_ascii();
main(int argc, char *argv[]) {
  if (argc < 2 || argv[1][1] == 'f')
    from_ascii();
  else
    to_ascii();
  exit(0);
}


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)
cmpl   $0x2,-0x8(%rbp)
jl     1165 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x66,%eax
jne    1171 <main+0x41>
mov    $0x0,%al
call   1030 <from_ascii@plt>
jmp    1178 <main+0x48>
mov    $0x0,%al
call   1040 <to_ascii@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1140 <main+0x10>
mov    0x8(%rsi),%rax
cmpb   $0x66,0x1(%rax)
jne    114e <main+0x1e>
xor    %eax,%eax
call   1030 <from_ascii@plt>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1040 <to_ascii@plt>
xor    %edi,%edi
call   1050 <exit@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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %16, label %8
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 102
br i1 %15, label %16, label %18
16: ; preds = %8, %2
%17 = call i32 (...) @from_ascii()
br label %20
18: ; preds = %8
%19 = call i32 (...) @to_ascii()
br label %20
20: ; preds = %18, %16
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 102
br i1 %9, label %10, label %12
10: ; preds = %4, %2
%11 = tail call i32 (...) @from_ascii()
br label %14
12: ; preds = %4
%13 = tail call i32 (...) @to_ascii()
br label %14
14: ; preds = %12, %10
%15 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *s) {
  fprintf(stderr, "USAGE: %s [[-r] priority pids ...] [-g pid]\n", s);
  exit(EXIT_FAILURE);
}


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),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"USAGE: %s [[-r] priority pids ...] [-g pid]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"USAGE: %s [[-r] priority pids ...] [-g pid]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x39() {
  Assert_real((isupper(57) == 0),
              "/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_isupper.c",
              290, ("isupper should be 0 for 9"));
}


x86 assembly (clang, -O0):
<t_isupper_0x39>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x122,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x39>:
push   %rax
mov    $0x39,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x122,%edx
pop    %rax
jmp    1040 <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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for 9\00"
define void @t_isupper_0x39() {
%1 = call i64 @isupper(i32 57)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 290, 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for 9\00"
define void @t_isupper_0x39() {
%1 = tail call i64 @isupper(i32 57)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int frobulate(int);
int bazulate(int a1, int a2) {
  return (a1 + a2) / frobulate(a1) / frobulate(a2);
}


x86 assembly (clang, -O0):
<bazulate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <frobulate@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <frobulate@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bazulate>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
lea    (%rbx,%rdi,1),%ebp
call   1030 <frobulate@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <frobulate@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bazulate(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 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = call i32 @frobulate(i32 %8)
%10 = sdiv i32 %7, %9
%11 = load i32, i32* %4
%12 = call i32 @frobulate(i32 %11)
%13 = sdiv i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @bazulate(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @frobulate(i32 %0)
%5 = sdiv i32 %3, %4
%6 = tail call i32 @frobulate(i32 %1)
%7 = sdiv i32 %5, %6
ret i32 %7
}
void glDeleteBuffers(int n, const unsigned int *buffers) {}


x86 assembly (clang, -O0):
<glDeleteBuffers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glDeleteBuffers(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 @glDeleteBuffers(i32 %0, i32* nocapture %1) {
ret void
}
int test_imm_DEint8_reg(signed char val) {
  return ((val) & (0xDE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DEint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xde,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DEint8_reg>:
test   $0xde,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DEint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 222
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_DEint8_reg(i8 signext %0) {
%2 = and i8 %0, -34
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void tear_down() { remove("testFile"); }


x86 assembly (clang, -O0):
<tear_down>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <remove@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"testFile\00"
define void @tear_down() {
%1 = call i32 @remove(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"testFile\00"
define void @tear_down() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void lcd_write_int16(int16_t in) {
  printf("%s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/"
         "mock/lcd.c",
         19);
}


x86 assembly (clang, -O0):
<lcd_write_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x13,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_write_int16>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x13,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/lcd.c\00"
define void @lcd_write_int16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 19)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/lcd.c\00"
define void @lcd_write_int16(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 19)
ret void
}
void hal_watchdog_tickle(void) {}


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

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

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

LLVM IR (-O2):
define void @hal_watchdog_tickle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doienc(int);
int doia2k() {
  doienc(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<doia2k>:
push   %rax
mov    $0x1,%edi
call   1030 <doienc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @doia2k() {
%1 = call i32 @doienc(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @doia2k() {
%1 = tail call i32 @doienc(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gethash(int);
int /*<<< orphan*/ getnarg(int /*<<< orphan*/);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void luaB_getn(void) { lua_pushnumber(getnarg(gethash(1))); }


x86 assembly (clang, -O0):
<luaB_getn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <gethash@plt>
mov    %eax,%edi
call   1040 <getnarg@plt>
mov    %eax,%edi
call   1030 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaB_getn>:
push   %rax
mov    $0x1,%edi
call   1050 <gethash@plt>
mov    %eax,%edi
call   1040 <getnarg@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @luaB_getn() {
%1 = call i32 @gethash(i32 1)
%2 = call i32 @getnarg(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @luaB_getn() {
%1 = tail call i32 @gethash(i32 1)
%2 = tail call i32 @getnarg(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
unsigned int xstrtoull(char const *, int);
unsigned int xstrtou(const char *str, int b) { return xstrtoull(str, b); }


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

x86 assembly (clang, -O2):
<xstrtou>:
jmp    1030 <xstrtoull@plt>

LLVM IR (-O0):
define i32 @xstrtou(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @xstrtoull(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xstrtou(i8* %0, i32 %1) {
%3 = tail call i32 @xstrtoull(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int strcmp(void const *, void const *);
int diminuto_compare_strings(const void *thisp, const void *thatp) {
  return strcmp(thisp, thatp);
}


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

x86 assembly (clang, -O2):
<diminuto_compare_strings>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @diminuto_compare_strings(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 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @diminuto_compare_strings(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
unsigned int f66(unsigned int x, long int y) {
  return (x << y) + (x >> ((-y) & (8 * 4 - 1)));
}


x86 assembly (clang, -O0):
<f66>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f66>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f66(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub nsw i64 0, %10
%12 = and i64 %11, 31
%13 = trunc i64 %12 to i32
%14 = lshr i32 %9, %13
%15 = add i32 %8, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f66(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
%5 = sub i32 0, %3
%6 = and i32 %5, 31
%7 = lshr i32 %0, %6
%8 = add i32 %7, %4
ret i32 %8
}
int test_imm_A8int64_lowword_mem(long long *val) {
  return ((*val) & (0xA8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A8int64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xa8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A8int64_lowword_mem>:
testb  $0xa8,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A8int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 168
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_A8int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 168
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int execute_oldstat() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_oldstat() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_oldstat() {
ret i32 0
}
/* Variables and functions */
float atan(float);
float get(char *);
int /*<<< orphan*/ printf(char *, float);
void findAtan() {
  float num = get("Enter your number");
  float result = atan(num);
  printf("Result: %f", result);
}


x86 assembly (clang, -O0):
<findAtan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <get@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <atan@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findAtan>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <get@plt>
call   1040 <atan@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Enter your number\00"
@.str.1 = [11 x i8] c"Result: %f\00"
define void @findAtan() {
%1 = alloca float
%2 = alloca float
%3 = call float @get(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store float %3, float* %1
%4 = load float, float* %1
%5 = call float @atan(float %4)
store float %5, float* %2
%6 = load float, float* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter your number\00"
@.str.1 = [11 x i8] c"Result: %f\00"
define void @findAtan() {
%1 = tail call float @get(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call float @atan(float %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %2)
ret void
}
unsigned short inw(unsigned short int port) {
  unsigned short _v;
  __asm__ __volatile__("inw %w1,%0" : "=a"(_v) : "Nd"(port));
  return _v;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
char *volatile_ptr(char *volatile base, unsigned long offset) {
  return base + offset;
}


x86 assembly (clang, -O0):
<volatile_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_ptr>:
mov    %rsi,%rax
mov    %rdi,-0x8(%rsp)
add    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @volatile_ptr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store volatile i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load volatile i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @volatile_ptr(i8* %0, i64 %1) {
%3 = alloca i8*
store volatile i8* %0, i8** %3
%4 = load volatile i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 %1
ret i8* %5
}
int test_imm_6Euint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x6E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Euint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x6e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Euint64_lowword_reg>:
test   $0x6e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Euint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 110
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_6Euint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 110
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int callsite() {}


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

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

LLVM IR (-O0):
define i32 @callsite() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @callsite() {
ret i32 undef
}
int gettimeofday(struct timeval *time, void *z) {
  long __res, dummy;
  __asm__ __volatile__("int $0x80"
                       : "=a"(__res), "=&b"(dummy)
                       : "0"(156), "1"((long)(time)), "c"((long)(z)));
  return (int)__res;
}


x86 assembly (clang, -O0):
<gettimeofday>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x18(%rbp),%rcx
mov    $0x9c,%eax
int    $0x80
mov    %rax,-0x20(%rbp)
mov    %rbx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    $0x9c,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type opaque
define i32 @gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%7 = load %struct.timeval*, %struct.timeval** %3
%8 = ptrtoint %struct.timeval* %7 to i64
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,{cx},~{dirflag},~{fpsr},~{flags}"(i64 156, i64 %8, i64 %10)
%12 = extractvalue { i64, i64 } %11, 0
%13 = extractvalue { i64, i64 } %11, 1
store i64 %12, i64* %5
store i64 %13, i64* %6
%14 = load i64, i64* %5
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
%struct.timeval = type opaque
define i32 @gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = ptrtoint %struct.timeval* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = tail call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,{cx},~{dirflag},~{fpsr},~{flags}"(i64 156, i64 %3, i64 %4)
%6 = extractvalue { i64, i64 } %5, 0
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_segfault_expect_err(void *setup_ctxt) {
  int *foo = NULL;
  printf("  (c) test_segfault\n");
  *foo = 99999;
  return 0;
}


x86 assembly (clang, -O0):
<test_segfault_expect_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x1869f,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_segfault_expect_err>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>

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

LLVM IR (-O2):
@str = [20 x i8] c" (c) test_segfault\00"
define i32 @test_segfault_expect_err(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int a1();
int b(void) { return a1(); }


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

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

LLVM IR (-O0):
define i32 @b() {
%1 = call i32 (...) @a1()
ret i32 %1
}

LLVM IR (-O2):
define i32 @b() {
%1 = tail call i32 (...) @a1()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 1) {
    printf("USAGE: %s\n", argv[0]);
    return -1;
  }
  return 0;
}


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)
cmpl   $0x1,-0x8(%rbp)
je     114f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <main+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x1,%edi
je     1130 <main+0x20>
push   %rax
mov    (%rsi),%rsi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"USAGE: %s\0A\00"
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"USAGE: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ -1, %4 ], [ 0, %2 ]
ret i32 %8
}
void __kernel_sin(void) {}


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

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

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

LLVM IR (-O2):
define void @__kernel_sin() {
ret void
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
void convert_float_to_int8(float sinus, void *buf) {
  *((int8_t *)buf) = (int8_t)(sinus);
}


x86 assembly (clang, -O0):
<convert_float_to_int8>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
cvttss2si -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_float_to_int8>:
cvttss2si %xmm0,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @convert_float_to_int8(float %0, i8* %1) {
%3 = alloca float
%4 = alloca i8*
store float %0, float* %3
store i8* %1, i8** %4
%5 = load float, float* %3
%6 = fptosi float %5 to i64
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i64*
store i64 %6, i64* %8
ret void
}

LLVM IR (-O2):
define void @convert_float_to_int8(float %0, i8* nocapture writeonly %1) {
%3 = fptosi float %0 to i64
%4 = bitcast i8* %1 to i64*
store i64 %3, i64* %4
ret void
}
/* Variables and functions */
int LCR_CMD_PKT_SendPacket(int /*<<< orphan*/);
int LCR_CMD_PKT_SendCommand(void) { return LCR_CMD_PKT_SendPacket(0); }


x86 assembly (clang, -O0):
<LCR_CMD_PKT_SendCommand>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <LCR_CMD_PKT_SendPacket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCR_CMD_PKT_SendCommand>:
xor    %edi,%edi
jmp    1030 <LCR_CMD_PKT_SendPacket@plt>

LLVM IR (-O0):
define i32 @LCR_CMD_PKT_SendCommand() {
%1 = call i32 @LCR_CMD_PKT_SendPacket(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @LCR_CMD_PKT_SendCommand() {
%1 = tail call i32 @LCR_CMD_PKT_SendPacket(i32 0)
ret i32 %1
}
int getDigits(int n) {
  int ans = 0;
  while (n) {
    ans++;
    n /= 10;
  }
  return ans;
}


x86 assembly (clang, -O0):
<getDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <getDigits+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <getDigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDigits>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <getDigits+0x32>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <getDigits+0x10>
ret

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

LLVM IR (-O2):
define i32 @getDigits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = sdiv i32 %5, 10
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ func(int);
int main() {
  func(0);
  func(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <func@plt>
mov    $0x1,%edi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 0)
%2 = tail call i32 @func(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void f1() { exit(1); }


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

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @f1() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ pthread_self();
void tau_trace_entry(int id) {
  printf("%#lx: tau_trace_entry: id = %d\n", pthread_self(), id);
}


x86 assembly (clang, -O0):
<tau_trace_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tau_trace_entry>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"%#lx: tau_trace_entry: id = %d\0A\00"
define void @tau_trace_entry(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pthread_self()
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"%#lx: tau_trace_entry: id = %d\0A\00"
define void @tau_trace_entry(i32 %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addMoreLard();
int /*<<< orphan*/ fact1(int);
int mul(int, int /*<<< orphan*/);
int fact2(int n) {
  addMoreLard();
  if (n == 0)
    return 1;
  else
    return mul(n, fact1(n - 1));
}


x86 assembly (clang, -O0):
<fact2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <addMoreLard@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1158 <fact2+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1176 <fact2+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <fact1@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1050 <mul@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact2>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <addMoreLard@plt>
test   %ebx,%ebx
je     1150 <fact2+0x20>
lea    -0x1(%rbx),%edi
call   1040 <fact1@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1050 <mul@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fact2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @addMoreLard()
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = call i32 @fact1(i32 %11)
%13 = call i32 @mul(i32 %9, i32 %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @fact2(i32 %0) {
%2 = tail call i32 (...) @addMoreLard()
%3 = icmp eq i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @fact1(i32 %5)
%7 = tail call i32 @mul(i32 %0, i32 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ dupmachine(int);
int link_machines(int, int /*<<< orphan*/);
int mkstate(int);
int copysingl(int singl, int num) {
  int copy, i;
  copy = mkstate((256 + 1));
  for (i = 1; i <= num; ++i)
    copy = link_machines(copy, dupmachine(singl));
  return copy;
}


x86 assembly (clang, -O0):
<copysingl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x101,%edi
call   1030 <mkstate@plt>
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1187 <copysingl+0x57>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <dupmachine@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1050 <link_machines@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <copysingl+0x22>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysingl>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
mov    $0x101,%edi
call   1030 <mkstate@plt>
mov    %eax,%ebp
test   %ebx,%ebx
jle    1168 <copysingl+0x38>
nopl   0x0(%rax)
mov    %r14d,%edi
call   1040 <dupmachine@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <link_machines@plt>
mov    %eax,%ebp
add    $0xffffffff,%ebx
jne    1150 <copysingl+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @copysingl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 @mkstate(i32 257)
store i32 %7, i32* %5
store i32 1, i32* %6
br label %8
8: ; preds = %17, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %3
%15 = call i32 @dupmachine(i32 %14)
%16 = call i32 @link_machines(i32 %13, i32 %15)
store i32 %16, i32* %5
br label %17
17: ; preds = %12
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %8
20: ; preds = %8
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @copysingl(i32 %0, i32 %1) {
%3 = tail call i32 @mkstate(i32 257)
%4 = icmp slt i32 %1, 1
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ 1, %2 ]
%7 = phi i32 [ %9, %5 ], [ %3, %2 ]
%8 = tail call i32 @dupmachine(i32 %0)
%9 = tail call i32 @link_machines(i32 %7, i32 %8)
%10 = add nuw i32 %6, 1
%11 = icmp eq i32 %6, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ %3, %2 ], [ %9, %5 ]
ret i32 %13
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ mode;
};
typedef TYPE_1__ XFocusInEvent;

/* Variables and functions */
int get_XFocusInEvent_mode(void *_p) {
  return (int)((XFocusInEvent *)_p)->mode;
}


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

x86 assembly (clang, -O2):
<get_XFocusInEvent_mode>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XFocusInEvent_mode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XFocusInEvent_mode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int admhc_rh_resume(struct admhcd *ahcd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.admhcd = type opaque
define i32 @admhc_rh_resume(%struct.admhcd* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ enough_mem(char *);
char *strdup(char const *);
char *strfilldup(const char *str, const char *fill) {
  char *s;
  if (!str) {
    s = strdup(fill);
  } else {
    s = strdup(str);
  }
  enough_mem(s);
  return s;
}


x86 assembly (clang, -O0):
<strfilldup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114d <strfilldup+0x2d>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    115a <strfilldup+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <enough_mem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strfilldup>:
push   %rbx
test   %rdi,%rdi
jne    1129 <strfilldup+0x9>
mov    %rsi,%rdi
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <enough_mem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strfilldup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %5
br label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i8* @strdup(i8* %12)
store i8* %13, i8** %5
br label %14
14: ; preds = %11, %8
%15 = load i8*, i8** %5
%16 = call i32 @enough_mem(i8* %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @strfilldup(i8* %0, i8* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @strdup(i8* %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @strdup(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %7, %6 ], [ %5, %4 ]
%10 = tail call i32 @enough_mem(i8* %9)
ret i8* %9
}
void RTDbgModSegmentCount(void) {}


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

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

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

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