xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ check(char *);
int main(void) {
  check("12345");
  check("hello12");
  check("0002");
  check("10dbd");
  check("0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <check@plt>
lea    0xed4(%rip),%rdi
call   1030 <check@plt>
lea    0xed0(%rip),%rdi
call   1030 <check@plt>
lea    0xec9(%rip),%rdi
call   1030 <check@plt>
lea    0xec3(%rip),%rdi
call   1030 <check@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <check@plt>
lea    0xee2(%rip),%rdi
call   1030 <check@plt>
lea    0xede(%rip),%rdi
call   1030 <check@plt>
lea    0xed7(%rip),%rdi
call   1030 <check@plt>
lea    0xed1(%rip),%rdi
call   1030 <check@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"12345\00"
@.str.1 = [8 x i8] c"hello12\00"
@.str.2 = [5 x i8] c"0002\00"
@.str.3 = [6 x i8] c"10dbd\00"
@.str.4 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @check(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @check(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @check(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @check(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @check(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
@.str.1 = [8 x i8] c"hello12\00"
@.str.2 = [5 x i8] c"0002\00"
@.str.3 = [6 x i8] c"10dbd\00"
@.str.4 = [2 x i8] c"0\00"
define i32 @main() {
%1 = tail call i32 @check(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @check(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @check(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @check(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @check(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}
void cset_test_atomic_close(volatile int *gate) {
  asm volatile("mov %[unlock], %[gate]\n"
               : [gate] "=m"(*gate)
               : [unlock] "r"(0));
}


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

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

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

LLVM IR (-O2):
define void @cset_test_atomic_close(i32* %0) {
tail call void asm sideeffect "mov $1, $0\0A", "=*m,r,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 0)
ret void
}
/* Type definitions */
struct ipr_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *print_device(struct ipr_dev *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int);
int /*<<< orphan*/ printf(char *, char *);
void printf_device(struct ipr_dev *dev, int type) {
  char *buf = print_device(dev, NULL, NULL, type);
  if (buf) {
    printf("%s", buf);
    free(buf);
  }
}


x86 assembly (clang, -O0):
<printf_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1050 <print_device@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117a <printf_device+0x4a>
mov    -0x18(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_device>:
push   %rbx
mov    %esi,%ecx
xor    %esi,%esi
xor    %edx,%edx
call   1050 <print_device@plt>
test   %rax,%rax
je     115c <printf_device+0x2c>
mov    %rax,%rbx
lea    0xeb5(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.ipr_dev = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @printf_device(%struct.ipr_dev* %0, i32 %1) {
%3 = alloca %struct.ipr_dev*
%4 = alloca i32
%5 = alloca i8*
store %struct.ipr_dev* %0, %struct.ipr_dev** %3
store i32 %1, i32* %4
%6 = load %struct.ipr_dev*, %struct.ipr_dev** %3
%7 = load i32, i32* %4
%8 = call i8* @print_device(%struct.ipr_dev* %6, i32* null, i32* null, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %5
%15 = call i32 @free(i8* %14)
br label %16
16: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.ipr_dev = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @printf_device(%struct.ipr_dev* %0, i32 %1) {
%3 = tail call i8* @print_device(%struct.ipr_dev* %0, i32* null, i32* null, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = tail call i32 @free(i8* %3)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
void write_ok(char *buf) {
  buf[0] = 'O';
  buf[1] = 'K';
  buf[2] = '\0';
}


x86 assembly (clang, -O0):
<write_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x4f,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x4b,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ok>:
movw   $0x4b4f,(%rdi)
movb   $0x0,0x2(%rdi)
ret

LLVM IR (-O0):
define void @write_ok(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 79, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 75, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @write_ok(i8* nocapture writeonly %0) {
store i8 79, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 75, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 0, i8* %3
ret void
}
int foo(int **arr, int i) { return (*arr)[i]; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%rax
movslq %esi,%rcx
mov    (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @foo(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** %5
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo(i32** nocapture %0, i32 %1) {
%3 = load i32*, i32** %0
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
char *colliding_convert(int);
int printf(char *, int, char *);
int libeasy_print_integer(int x) {
  return printf("libeasy: "
                "In English, %d is %s\n",
                x, colliding_convert(x));
}


x86 assembly (clang, -O0):
<libeasy_print_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <colliding_convert@plt>
mov    -0x8(%rbp),%esi
mov    %rax,%rdx
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libeasy_print_integer>:
push   %rbx
mov    %edi,%ebx
call   1030 <colliding_convert@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"libeasy: In English, %d is %s\0A\00"
define i32 @libeasy_print_integer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @colliding_convert(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [31 x i8] c"libeasy: In English, %d is %s\0A\00"
define i32 @libeasy_print_integer(i32 %0) {
%2 = tail call i8* @colliding_convert(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %2)
ret i32 %3
}
int get_gcd(int x, int y) {
  if (y == 0) {
    return x;
  }
  return get_gcd(y, x % y);
}


x86 assembly (clang, -O0):
<get_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <get_gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <get_gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <get_gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <get_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <get_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
void symbolTableEnd() {}


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

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

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

LLVM IR (-O2):
define void @symbolTableEnd() {
ret void
}
void __attribute__((weak)) can2_rx0_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<can2_rx0_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<can2_rx0_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.can2_rx0_isr = [13 x i8] c"can2_rx0_isr\00"
define weak void @can2_rx0_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.can2_rx0_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.can2_rx0_isr = [13 x i8] c"can2_rx0_isr\00"
define weak void @can2_rx0_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.can2_rx0_isr, i64 0, i64 0))
ret void
}
int AmBigEndian() {
  long x = 1;
  return !(*((char *)(&x)));
}


x86 assembly (clang, -O0):
<AmBigEndian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
cmpb   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @AmBigEndian() {
%1 = alloca i64
store i64 1, i64* %1
%2 = bitcast i64* %1 to i8*
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @AmBigEndian() {
ret i32 0
}
/* Variables and functions */
scalar_t__ _syscall5(int, void *, void *, void *, void *, void *);
int errno;
int execve(const char *filename, char *const argv[], char *const envp[]) {
  int ret = (int)_syscall5(7, (void *)filename, (void *)argv, (void *)envp,
                           ((void *)0), ((void *)0));
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   1030 <_syscall5@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1169 <execve+0x59>
xor    %ecx,%ecx
sub    -0x24(%rbp),%ecx
mov    0x2e85(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <execve+0x5f>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x7,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <_syscall5@plt>
test   %eax,%eax
js     1130 <execve+0x20>
pop    %rcx
ret
neg    %eax
mov    0x2ea7(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = bitcast i8** %10 to i8*
%12 = load i8**, i8*** %7
%13 = bitcast i8** %12 to i8*
%14 = call i64 @_syscall5(i32 7, i8* %9, i8* %11, i8* %13, i8* null, i8* null)
%15 = trunc i64 %14 to i32
store i32 %15, i32* %8
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %3
%19 = load i32, i32* %8
%20 = sub nsw i32 0, %19
store i32 %20, i32* @errno
store i32 -1, i32* %4
br label %23
21: ; preds = %3
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = bitcast i8** %1 to i8*
%5 = bitcast i8** %2 to i8*
%6 = tail call i64 @_syscall5(i32 7, i8* %0, i8* %4, i8* %5, i8* null, i8* null)
%7 = trunc i64 %6 to i32
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = sub nsw i32 0, %7
store i32 %10, i32* @errno
br label %11
11: ; preds = %3, %9
%12 = phi i32 [ -1, %9 ], [ %7, %3 ]
ret i32 %12
}
/* Variables and functions */
int n(int, int, int);
int w(int year, int month, int day) {
  return (int)((n(year, month, day) % 7 - 621049L % 7 + 7) % 7);
}


x86 assembly (clang, -O0):
<w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <n@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
sub    $0x2,%rax
add    $0x7,%rax
mov    $0x7,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w>:
push   %rax
call   1030 <n@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %eax,%ecx
add    $0x5,%cl
movsbl %cl,%eax
imul   $0xffffff93,%eax,%ecx
shr    $0x8,%ecx
add    %al,%cl
mov    %ecx,%edx
shr    $0x7,%dl
sar    $0x2,%cl
add    %dl,%cl
movzbl %cl,%ecx
lea    0x0(,%rcx,8),%edx
sub    %ecx,%edx
sub    %dl,%al
movsbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @w(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @n(i32 %7, i32 %8, i32 %9)
%11 = srem i32 %10, 7
%12 = sext i32 %11 to i64
%13 = sub nsw i64 %12, 2
%14 = add nsw i64 %13, 7
%15 = srem i64 %14, 7
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @w(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @n(i32 %0, i32 %1, i32 %2)
%5 = srem i32 %4, 7
%6 = trunc i32 %5 to i8
%7 = add nsw i8 %6, 5
%8 = srem i8 %7, 7
%9 = sext i8 %8 to i32
ret i32 %9
}
void tset_show() {}


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

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

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

LLVM IR (-O2):
define void @tset_show() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SCK(int);
int /*<<< orphan*/ SI(int);
void p24stop(void) {
  SI(0);
  SCK(0);
  SCK(1);
  SI(1);
}


x86 assembly (clang, -O0):
<p24stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <SI@plt>
xor    %edi,%edi
call   1030 <SCK@plt>
mov    $0x1,%edi
call   1030 <SCK@plt>
mov    $0x1,%edi
call   1040 <SI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<p24stop>:
push   %rax
xor    %edi,%edi
call   1040 <SI@plt>
xor    %edi,%edi
call   1030 <SCK@plt>
mov    $0x1,%edi
call   1030 <SCK@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <SI@plt>

LLVM IR (-O0):
define void @p24stop() {
%1 = call i32 @SI(i32 0)
%2 = call i32 @SCK(i32 0)
%3 = call i32 @SCK(i32 1)
%4 = call i32 @SI(i32 1)
ret void
}

LLVM IR (-O2):
define void @p24stop() {
%1 = tail call i32 @SI(i32 0)
%2 = tail call i32 @SCK(i32 0)
%3 = tail call i32 @SCK(i32 1)
%4 = tail call i32 @SI(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int fgetc(FILE *stream) { return getc(stream); }


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

x86 assembly (clang, -O2):
<fgetc>:
jmp    1030 <getc@plt>

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

LLVM IR (-O2):
define i32 @fgetc(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           unsigned int, char const *);
int /*<<< orphan*/ print_backtrace(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void log_failed_assert(const char *filename, unsigned int line,
                       const char *msg) {
  fprintf(stderr, "%s.%u: %s\n", filename, line, msg);
  print_backtrace(stderr);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<log_failed_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xe92(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1040 <print_backtrace@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<log_failed_assert>:
push   %rbx
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2e90(%rip),%rbx
mov    (%rbx),%edi
lea    0xea7(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <print_backtrace@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"%s.%u: %s\0A\00"
define void @log_failed_assert(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = load i32, i32* @stderr
%13 = call i32 @print_backtrace(i32 %12)
%14 = load i32, i32* @stderr
%15 = call i32 @fflush(i32 %14)
%16 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"%s.%u: %s\0A\00"
define void @log_failed_assert(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%6 = load i32, i32* @stderr
%7 = tail call i32 @print_backtrace(i32 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fflush(i32 %8)
%10 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ exit_with_error(char *);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void ensure_data_alloc(int32_t *d) {
  if (d == NULL) {
    free(d);
    exit_with_error("Allocation failure!");
  }
}


x86 assembly (clang, -O0):
<ensure_data_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <ensure_data_alloc+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
lea    0xeb9(%rip),%rdi
call   1040 <exit_with_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_data_alloc>:
test   %rdi,%rdi
je     1126 <ensure_data_alloc+0x6>
ret
push   %rax
xor    %edi,%edi
call   1030 <free@plt>
lea    0xecb(%rip),%rdi
pop    %rax
jmp    1040 <exit_with_error@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Allocation failure!\00"
define void @ensure_data_alloc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @free(i32* %6)
%8 = call i32 @exit_with_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Allocation failure!\00"
define void @ensure_data_alloc(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @free(i32* null)
%5 = tail call i32 @exit_with_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCResetSine() {
  long int stat = 99;
  BNCIO(30);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCResetSine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x1e,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCResetSine>:
push   %rax
mov    $0x1e,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCResetSine() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 30)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCResetSine() {
%1 = tail call i32 @BNCIO(i32 30)
ret i64 99
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/cyclone.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/cyclone.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/cyclone.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
int test_imm_9Dint8_mem(signed char *val) {
  return ((*val) & (-0x9D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Dint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff63,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -157
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
long inv_big8_to_int32(const unsigned char *big8) {
  long x;
  x = ((long)big8[0] << 24) | ((long)big8[1] << 16) | ((long)big8[2] << 8) |
      ((long)big8[3]);
  return x;
}


x86 assembly (clang, -O0):
<inv_big8_to_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_big8_to_int32>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @inv_big8_to_int32(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl i64 %7, 24
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl i64 %12, 16
%14 = or i64 %8, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i64
%19 = shl i64 %18, 8
%20 = or i64 %14, %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i64
%25 = or i64 %20, %24
store i64 %25, i64* %3
%26 = load i64, i64* %3
ret i64 %26
}

LLVM IR (-O2):
define i64 @inv_big8_to_int32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 8
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
unsigned int mini_strlen(const char *s) {
  unsigned int len = 0;
  while (s[len] != '\0')
    len++;
  return len;
}


x86 assembly (clang, -O0):
<mini_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1131 <mini_strlen+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mini_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mini_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <mini_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @mini_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int pow(int, int);
int primepow(int n, int p) {
  int j, i, s;
  j = 0;
  s = 0;
  while (j >= 0) {
    ++j;
    i = n / (pow(p, j));
    s = s + i;
    if (i == 0) {
      break;
    }
  }
  return s;
}


x86 assembly (clang, -O0):
<primepow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1178 <primepow+0x68>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1173 <primepow+0x63>
jmp    1178 <primepow+0x68>
jmp    112c <primepow+0x1c>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primepow>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%r15d
xor    %ebp,%ebp
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    %r15d,%eax
cltd
idiv   %ecx
add    %eax,%ebp
add    $0x1,%ebx
test   %eax,%eax
jne    1130 <primepow+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @primepow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %7
br label %8
8: ; preds = %25, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @pow(i32 %15, i32 %16)
%18 = sdiv i32 %14, %17
store i32 %18, i32* %6
%19 = load i32, i32* %7
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %11
br label %26
25: ; preds = %11
br label %8
26: ; preds = %24, %8
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @primepow(i32 %0, i32 %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = phi i32 [ 0, %2 ], [ %9, %3 ]
%6 = add nuw nsw i32 %4, 1
%7 = tail call i32 @pow(i32 %1, i32 %6)
%8 = sdiv i32 %0, %7
%9 = add nsw i32 %8, %5
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ print(int *);
void swap(int *arr, int i, int j) {
  *(arr + i) ^= *(arr + j) ^= *(arr + i) ^= *(arr + j);
  print(arr);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %edx,%rax
movslq %esi,%rcx
mov    (%rdi,%rcx,4),%edx
xor    (%rdi,%rax,4),%edx
mov    %edx,(%rdi,%rcx,4)
xor    (%rdi,%rax,4),%edx
mov    %edx,(%rdi,%rax,4)
xor    %edx,(%rdi,%rcx,4)
jmp    1030 <print@plt>

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = xor i32 %16, %11
store i32 %17, i32* %15
%18 = load i32*, i32** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = xor i32 %22, %17
store i32 %23, i32* %21
%24 = load i32*, i32** %4
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = xor i32 %28, %23
store i32 %29, i32* %27
%30 = load i32*, i32** %4
%31 = call i32 @print(i32* %30)
ret void
}

LLVM IR (-O2):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = xor i32 %9, %6
store i32 %10, i32* %8
%11 = load i32, i32* %5
%12 = xor i32 %11, %10
store i32 %12, i32* %5
%13 = load i32, i32* %8
%14 = xor i32 %13, %12
store i32 %14, i32* %8
%15 = tail call i32 @print(i32* %0)
ret void
}
void h1(void) {}


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

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

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

LLVM IR (-O2):
define void @h1() {
ret void
}
char testBit(unsigned char *A, unsigned int b) {
  return ((A[b / 8] & (1 << (b % 8))) != 0);
}


x86 assembly (clang, -O0):
<testBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBit>:
mov    %esi,%eax
shr    $0x3,%rax
movzbl (%rdi,%rax,1),%eax
and    $0x7,%sil
movzbl %sil,%ecx
bt     %ecx,%eax
setb   %al
ret

LLVM IR (-O0):
define signext i8 @testBit(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 = udiv i32 %6, 8
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = urem i32 %12, 8
%14 = shl i32 1, %13
%15 = and i32 %11, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @testBit(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %9, %7
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i8
ret i8 %12
}
void free_irdeto_guess_tab(void) {}


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

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

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

LLVM IR (-O2):
define void @free_irdeto_guess_tab() {
ret void
}
/* Variables and functions */
double atan2(double, double const);
double arccot(const double x) { return atan2(1.0, (x)); }


x86 assembly (clang, -O0):
<arccot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xed6(%rip),%xmm0
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arccot>:
movaps %xmm0,%xmm1
movsd  0xee5(%rip),%xmm0
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @arccot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @atan2(double 1.000000e+00, double %3)
ret double %4
}

LLVM IR (-O2):
define double @arccot(double %0) {
%2 = tail call double @atan2(double 1.000000e+00, double %0)
ret double %2
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ editor_is_vim(char *);
int editor_is_vim_wrapper(char **av) {
  char *command = av[2];
  if (editor_is_vim(command)) {
    return EXIT_SUCCESS;
  } else {
    return EXIT_FAILURE;
  }
}


x86 assembly (clang, -O0):
<editor_is_vim_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <editor_is_vim@plt>
cmp    $0x0,%rax
je     114c <editor_is_vim_wrapper+0x3c>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <editor_is_vim_wrapper+0x48>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<editor_is_vim_wrapper>:
push   %rax
mov    0x10(%rdi),%rdi
call   1030 <editor_is_vim@plt>
test   %rax,%rax
jne    1128 <editor_is_vim_wrapper+0x18>
mov    0x2eba(%rip),%rax
jmp    112f <editor_is_vim_wrapper+0x1f>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @editor_is_vim_wrapper(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = getelementptr inbounds i8*, i8** %5, i64 2
%7 = load i8*, i8** %6
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i64 @editor_is_vim(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* @EXIT_SUCCESS
store i32 %12, i32* %2
br label %15
13: ; preds = %1
%14 = load i32, i32* @EXIT_FAILURE
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @editor_is_vim_wrapper(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 2
%3 = load i8*, i8** %2
%4 = tail call i64 @editor_is_vim(i8* %3)
%5 = icmp eq i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = load i32, i32* @EXIT_SUCCESS
%8 = select i1 %5, i32 %6, i32 %7
ret i32 %8
}
int acpi_boot_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @acpi_boot_init() {
ret i32 0
}
strcpy(from, to) char *from, *to;
{
  register char *rfrom, *rto;
  rfrom = from;
  rto = to;
  while (*rto++ = *rfrom++)
    ;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114b <strcpy+0x4b>
jmp    111c <strcpy+0x1c>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i32 @strcpy(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 undef
}
/* Variables and functions */
int SEEK_END;
int scalanative_libc_seek_end() { return SEEK_END; }


x86 assembly (clang, -O0):
<scalanative_libc_seek_end>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalanative_libc_seek_end>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i32 @scalanative_libc_seek_end() {
%1 = load i32, i32* @SEEK_END
ret i32 %1
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i32 @scalanative_libc_seek_end() {
%1 = load i32, i32* @SEEK_END
ret i32 %1
}
/* Variables and functions */
float atan2f(float, float);
float libm_atan2f(float x, float y) { return atan2f(x, y); }


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

x86 assembly (clang, -O2):
<libm_atan2f>:
jmp    1030 <atan2f@plt>

LLVM IR (-O0):
define float @libm_atan2f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @atan2f(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @libm_atan2f(float %0, float %1) {
%3 = tail call float @atan2f(float %0, float %1)
ret float %3
}
void putbackch(c, lastch) int c;
int *lastch;
{ *lastch = c; }


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

x86 assembly (clang, -O2):
<putbackch>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @putbackch(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
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @putbackch(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
ret void
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Absyn_signed_int_exp(int, unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_bool_exp(int b, unsigned loc) {
  return ({ Cyc_Absyn_signed_int_exp(b ? 1 : 0, loc); });
}


x86 assembly (clang, -O0):
<Cyc_Absyn_bool_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
xor    %edi,%edi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%edi
mov    -0x8(%rbp),%esi
call   1030 <Cyc_Absyn_signed_int_exp@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_bool_exp>:
push   %rax
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    %eax,%edi
call   1030 <Cyc_Absyn_signed_int_exp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_bool_exp(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
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = load i32, i32* %4
%11 = call i32 @Cyc_Absyn_signed_int_exp(i32 %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to %struct.Cyc_Absyn_Exp*
ret %struct.Cyc_Absyn_Exp* %14
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_bool_exp(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @Cyc_Absyn_signed_int_exp(i32 %4, i32 %1)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.Cyc_Absyn_Exp*
ret %struct.Cyc_Absyn_Exp* %7
}
/* Variables and functions */
int /*<<< orphan*/ gettid();
int /*<<< orphan*/ kill(int /*<<< orphan*/);
void debugret(void) { kill(gettid()); }


x86 assembly (clang, -O0):
<debugret>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gettid@plt>
mov    %eax,%edi
call   1040 <kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<debugret>:
push   %rax
xor    %eax,%eax
call   1030 <gettid@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
define void @debugret() {
%1 = call i32 (...) @gettid()
%2 = call i32 @kill(i32 %1)
ret void
}

LLVM IR (-O2):
define void @debugret() {
%1 = tail call i32 (...) @gettid()
%2 = tail call i32 @kill(i32 %1)
ret void
}
int DRV_PMU_SELFCHECK(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_PMU_SELFCHECK() {
ret i32 0
}
void sbi_init(void) {}


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

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

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

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