xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int compare(const void *px, const void *py) {
  int64_t x = *(int64_t *)px;
  int64_t y = *(int64_t *)py;
  if (x > y)
    return +1;
  if (x < y)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    113c <compare+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115d <compare+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1156 <compare+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <compare+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setl   %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int ml_gcd(int n1, int n2) {
  int r;
  while (1) {
    r = n1 % n2;
    if (r == 0)
      return n2;
    n1 = n2;
    n2 = r;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ml_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1123 <ml_gcd+0x23>
mov    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <ml_gcd+0xa>

x86 assembly (clang, -O2):
<ml_gcd>:
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
mov    %edx,%edi
cltd
idiv   %edi
test   %edx,%edx
jne    1110 <ml_gcd+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ml_gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %6, %3 ]
%5 = phi i32 [ %0, %2 ], [ %4, %3 ]
%6 = srem i32 %5, %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int __parse_common(void *, int *, int *, char *);
int parse_common_flags(void *data) {
  static int flags_offset;
  static int flags_size;
  return __parse_common(data, &flags_size, &flags_offset, "common_flags");
}


x86 assembly (clang, -O0):
<parse_common_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f09(%rip),%rsi
lea    0x2efe(%rip),%rdx
lea    0xecb(%rip),%rcx
call   1030 <__parse_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_common_flags>:
lea    0x2f19(%rip),%rsi
lea    0x2f0e(%rip),%rdx
lea    0xedb(%rip),%rcx
jmp    1030 <__parse_common@plt>

LLVM IR (-O0):
@parse_common_flags.flags_offset = internal global i32 0
@parse_common_flags.flags_size = internal global i32 0
@.str = [13 x i8] c"common_flags\00"
define i32 @parse_common_flags(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__parse_common(i8* %3, i32* @parse_common_flags.flags_size, i32* @parse_common_flags.flags_offset, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@parse_common_flags.flags_offset = internal global i32 0
@parse_common_flags.flags_size = internal global i32 0
@.str = [13 x i8] c"common_flags\00"
define i32 @parse_common_flags(i8* %0) {
%2 = tail call i32 @__parse_common(i8* %0, i32* @parse_common_flags.flags_size, i32* @parse_common_flags.flags_offset, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ c2_data_read(int);
int /*<<< orphan*/ wait_ready();
uint8_t fpdat_read(void) {
  wait_ready();
  return c2_data_read(1);
}


x86 assembly (clang, -O0):
<fpdat_read>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wait_ready@plt>
mov    $0x1,%edi
call   1040 <c2_data_read@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpdat_read>:
push   %rax
xor    %eax,%eax
call   1030 <wait_ready@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <c2_data_read@plt>

LLVM IR (-O0):
define i32 @fpdat_read() {
%1 = call i32 (...) @wait_ready()
%2 = call i32 @c2_data_read(i32 1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @fpdat_read() {
%1 = tail call i32 (...) @wait_ready()
%2 = tail call i32 @c2_data_read(i32 1)
ret i32 %2
}
/* Variables and functions */
char *_get_line(int, int /*<<< orphan*/);
char *fd_get_line(int fd) { return _get_line(fd, 0); }


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

x86 assembly (clang, -O2):
<fd_get_line>:
xor    %esi,%esi
jmp    1030 <_get_line@plt>

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

LLVM IR (-O2):
define i8* @fd_get_line(i32 %0) {
%2 = tail call i8* @_get_line(i32 %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void setNonBlocking(int fd) {
  int flags = fcntl(fd, F_GETFL, 0);
  fcntl(fd, F_SETFL, flags | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<setNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setNonBlocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @setNonBlocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i32 %7, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @setNonBlocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  uint64_t foo = 303;
  uint64_t bar = 0303;
  printf("foo: %llu\n", foo);
  printf("bar: %llu\n", bar);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12f,-0x8(%rbp)
movl   $0xc3,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x12f,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0xc3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"foo: %llu\0A\00"
@.str.1 = [11 x i8] c"bar: %llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 303, i32* %2
store i32 195, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"foo: %llu\0A\00"
@.str.1 = [11 x i8] c"bar: %llu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 303)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 195)
ret i32 0
}
error(error_text) char error_text[];
{
  printf("Runtime Error.\n%s.\nExecution Terminated.\n", error_text);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Runtime Error.\0A%s.\0AExecution Terminated.\0A\00"
define i32 @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %3)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Runtime Error.\0A%s.\0AExecution Terminated.\0A\00"
define i32 @error(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void @exit(i32 1)
unreachable
}
__attribute__((always_)) void *SDL_AtomicGetPtr(void **a) {
  void *value = *a;
  __asm__ __volatile__("" : : : "memory");
  return value;
}


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

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

LLVM IR (-O0):
define i8* @SDL_AtomicGetPtr(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @SDL_AtomicGetPtr(i8** nocapture %0) {
%2 = load i8*, i8** %0
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int true_val, false_val;
  true_val = (10 > 2);
  false_val = (10 == 2);
  printf("true = %d; false = %d \n", true_val, false_val);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"true = %d; false = %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned int stream_hash(uint32_t const dest_addr, const uint32_t dest_port) {
  uint32_t x = dest_addr ^ dest_port;
  x ^= x >> 16;
  return (x ^ (x >> 8)) & 0xff;
}


x86 assembly (clang, -O0):
<stream_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
xor    %ecx,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stream_hash>:
xor    %esi,%edi
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @stream_hash(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 = load i32, i32* %4
%8 = xor i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = ashr i32 %9, 16
%11 = load i32, i32* %5
%12 = xor i32 %11, %10
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32, i32* %5
%15 = ashr i32 %14, 8
%16 = xor i32 %13, %15
%17 = and i32 %16, 255
ret i32 %17
}

LLVM IR (-O2):
define i32 @stream_hash(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = ashr i32 %3, 16
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 8
%7 = xor i32 %6, %5
%8 = and i32 %7, 255
ret i32 %8
}
/* Variables and functions */
int lsmErrorBkpt(int rc) { return rc; }


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

x86 assembly (clang, -O2):
<lsmErrorBkpt>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @lsmErrorBkpt(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ bgMagenta(char *);
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
void cmBgMagenta(char *str) { printColor(bgMagenta(str)); }


x86 assembly (clang, -O0):
<cmBgMagenta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bgMagenta@plt>
mov    %eax,%edi
call   1040 <printColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmBgMagenta>:
push   %rax
call   1030 <bgMagenta@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <printColor@plt>

LLVM IR (-O0):
define void @cmBgMagenta(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @bgMagenta(i8* %3)
%5 = call i32 @printColor(i32 %4)
ret void
}

LLVM IR (-O2):
define void @cmBgMagenta(i8* %0) {
%2 = tail call i32 @bgMagenta(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
void tchk_tracesrefchook_free(void *hook) { return; }


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

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

LLVM IR (-O0):
define void @tchk_tracesrefchook_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @tchk_tracesrefchook_free(i8* nocapture %0) {
ret void
}
int main() { int arr[3] = {1, 2.0, 4}; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xef3(%rip),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [3 x i32] [i32 1, i32 2, i32 4]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
void *calloc(int, size_t);
void *nvme_malloc(const char *tag, size_t size, unsigned align,
                  uint64_t *phys_addr) {
  void *buf = calloc(1, size);
  *phys_addr = (uint64_t)buf;
  return buf;
}


x86 assembly (clang, -O0):
<nvme_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvme_malloc>:
push   %rbx
mov    %rcx,%rbx
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @nvme_malloc(i8* %0, i64 %1, i32 %2, i64* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64*
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i64* %3, i64** %8
%10 = load i64, i64* %6
%11 = call i8* @calloc(i32 1, i64 %10)
store i8* %11, i8** %9
%12 = load i8*, i8** %9
%13 = ptrtoint i8* %12 to i64
%14 = load i64*, i64** %8
store i64 %13, i64* %14
%15 = load i8*, i8** %9
ret i8* %15
}

LLVM IR (-O2):
define i8* @nvme_malloc(i8* nocapture readnone %0, i64 %1, i32 %2, i64* nocapture writeonly %3) {
%5 = tail call i8* @calloc(i32 1, i64 %1)
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %3
ret i8* %5
}
int f() { return ((int)foo$$1()); }


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

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
jmp    1030 <foo$$1@plt>

LLVM IR (-O0):
define i32 @f() {
%1 = call i32 (...) @"foo$$1"()
ret i32 %1
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 (...) @"foo$$1"()
ret i32 %1
}
void memory_dump(void) {}


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

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

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

LLVM IR (-O2):
define void @memory_dump() {
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int askQuestionString(char *value, char *q) {
  printf("%s : ", q);
  scanf("%[^\t\n]s", value);
  printf("%s\n", value);
  while (getchar() != '\n')
    ;
  return 0;
}


x86 assembly (clang, -O0):
<askQuestionString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1188 <askQuestionString+0x58>
jmp    1170 <askQuestionString+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<askQuestionString>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1160 <askQuestionString+0x30>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s : \00"
@.str.1 = [8 x i8] c"%[^\09\0A]s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @askQuestionString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %15, %2
%12 = call signext i8 (...) @getchar()
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %11
br label %11
16: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s : \00"
@.str.1 = [8 x i8] c"%[^\09\0A]s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @askQuestionString(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %6, %2
%7 = tail call signext i8 (...) @getchar()
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %6
9: ; preds = %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ StudentModel_removeStudentSubject(char *, char *);
void Controller_removeStudentSubject(char studentNumber[], char subjectName[]) {
  StudentModel_removeStudentSubject(studentNumber, subjectName);
  return;
}


x86 assembly (clang, -O0):
<Controller_removeStudentSubject>:
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 <StudentModel_removeStudentSubject@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Controller_removeStudentSubject>:
jmp    1030 <StudentModel_removeStudentSubject@plt>

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

LLVM IR (-O2):
define void @Controller_removeStudentSubject(i8* %0, i8* %1) {
%3 = tail call i32 @StudentModel_removeStudentSubject(i8* %0, i8* %1)
ret void
}
int fun390() { return 390; }


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

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

LLVM IR (-O0):
define i32 @fun390() {
ret i32 390
}

LLVM IR (-O2):
define i32 @fun390() {
ret i32 390
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int baz(void) {
  int c;
  if (!foo())
    goto failure;
  if (!bar())
    goto failure;
  return 0;
failure:
  return 1;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x0,%eax
jne    113d <baz+0x1d>
jmp    115e <baz+0x3e>
mov    $0x0,%al
call   1030 <bar@plt>
cmp    $0x0,%eax
jne    1152 <baz+0x32>
jmp    115e <baz+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <baz+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <foo@plt>
test   %eax,%eax
je     1139 <baz+0x19>
xor    %eax,%eax
call   1030 <bar@plt>
test   %eax,%eax
jne    113e <baz+0x1e>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @baz() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @bar()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ terminal_writehexdigits(int);
void terminal_writehex(uint32_t val) {
  terminal_writehexdigits((val & 0xFF000000) >> 24);
  terminal_writehexdigits((val & 0x00FF0000) >> 16);
  terminal_writehexdigits((val & 0x0000FF00) >> 8);
  terminal_writehexdigits((val & 0x000000FF));
}


x86 assembly (clang, -O0):
<terminal_writehex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff000000,%edi
shr    $0x18,%edi
call   1030 <terminal_writehexdigits@plt>
mov    -0x4(%rbp),%edi
and    $0xff0000,%edi
sar    $0x10,%edi
call   1030 <terminal_writehexdigits@plt>
mov    -0x4(%rbp),%edi
and    $0xff00,%edi
sar    $0x8,%edi
call   1030 <terminal_writehexdigits@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <terminal_writehexdigits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_writehex>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x18,%eax
mov    %eax,%edi
call   1030 <terminal_writehexdigits@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <terminal_writehexdigits@plt>
movzbl %bh,%edi
call   1030 <terminal_writehexdigits@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <terminal_writehexdigits@plt>

LLVM IR (-O0):
define void @terminal_writehex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = call i32 @terminal_writehexdigits(i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, 16711680
%9 = ashr i32 %8, 16
%10 = call i32 @terminal_writehexdigits(i32 %9)
%11 = load i32, i32* %2
%12 = and i32 %11, 65280
%13 = ashr i32 %12, 8
%14 = call i32 @terminal_writehexdigits(i32 %13)
%15 = load i32, i32* %2
%16 = and i32 %15, 255
%17 = call i32 @terminal_writehexdigits(i32 %16)
ret void
}

LLVM IR (-O2):
define void @terminal_writehex(i32 %0) {
%2 = lshr i32 %0, 24
%3 = tail call i32 @terminal_writehexdigits(i32 %2)
%4 = lshr i32 %0, 16
%5 = and i32 %4, 255
%6 = tail call i32 @terminal_writehexdigits(i32 %5)
%7 = lshr i32 %0, 8
%8 = and i32 %7, 255
%9 = tail call i32 @terminal_writehexdigits(i32 %8)
%10 = and i32 %0, 255
%11 = tail call i32 @terminal_writehexdigits(i32 %10)
ret void
}
void get_real_move(int *data1, int *data2, int *row, int *col) {
  *col = 0;
  while (data1[*col] == data2[*col])
    (*col)++;
  *row = data1[*col];
}


x86 assembly (clang, -O0):
<get_real_move>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
movslq (%rdx),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1150 <get_real_move+0x50>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    111e <get_real_move+0x1e>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_real_move>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,(%rcx)
mov    (%rdi,%rax,4),%r8d
lea    0x1(%rax),%r9
cmp    (%rsi,%rax,4),%r8d
mov    %r9,%rax
je     1110 <get_real_move+0x10>
mov    %r8d,(%rdx)
ret

LLVM IR (-O0):
define void @get_real_move(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
store i32 0, i32* %9
br label %10
10: ; preds = %24, %4
%11 = load i32*, i32** %5
%12 = load i32*, i32** %8
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %6
%18 = load i32*, i32** %8
%19 = load i32, i32* %18
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %17, i64 %20
%22 = load i32, i32* %21
%23 = icmp eq i32 %16, %22
br i1 %23, label %24, label %28
24: ; preds = %10
%25 = load i32*, i32** %8
%26 = load i32, i32* %25
%27 = add nsw i32 %26, 1
store i32 %27, i32* %25
br label %10
28: ; preds = %10
%29 = load i32*, i32** %5
%30 = load i32*, i32** %8
%31 = load i32, i32* %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %29, i64 %32
%34 = load i32, i32* %33
%35 = load i32*, i32** %7
store i32 %34, i32* %35
ret void
}

LLVM IR (-O2):
define void @get_real_move(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
br label %5
5: ; preds = %5, %4
%6 = phi i64 [ %13, %5 ], [ 0, %4 ]
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = getelementptr inbounds i32, i32* %0, i64 %6
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %1, i64 %6
%11 = load i32, i32* %10
%12 = icmp eq i32 %9, %11
%13 = add nuw i64 %6, 1
br i1 %12, label %5, label %14
14: ; preds = %5
store i32 %9, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_comma_op(void) {
  test("321", "main(){int i=3; while (i) printf(\"%d\", i), i=i-1;}");
}


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

x86 assembly (clang, -O2):
<TEST_comma_op>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"321\00"
@.str.1 = [51 x i8] c"main(){int i=3; while (i) printf(\22%d\22, i), i=i-1;}\00"
define void @TEST_comma_op() {
%1 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"321\00"
@.str.1 = [51 x i8] c"main(){int i=3; while (i) printf(\22%d\22, i), i=i-1;}\00"
define void @TEST_comma_op() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int search(int *, int /*<<< orphan*/, int, int);
int test_found() {
  int input[] = {6, 7, 8, 9, 10, 1, 2, 3, 4, 5};
  return 1 == search(input, 0, 9, 7) && 7 == search(input, 0, 9, 3);
}


x86 assembly (clang, -O0):
<test_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x7,%ecx
call   1030 <search@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x31(%rbp)
jne    118a <test_found+0x6a>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x3,%ecx
call   1030 <search@plt>
mov    %eax,%ecx
mov    $0x7,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_found>:
push   %rbx
sub    $0x30,%rsp
mov    0xf04(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x7,%ecx
call   1030 <search@plt>
cmp    $0x1,%eax
jne    116f <test_found+0x5f>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x3,%ecx
call   1030 <search@plt>
xor    %ebx,%ebx
cmp    $0x7,%eax
sete   %bl
mov    %ebx,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_found.input = [10 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10, i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @test_found() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 0, i32 9, i32 7)
%5 = icmp eq i32 1, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call i32 @search(i32* %7, i32 0, i32 9, i32 3)
%9 = icmp eq i32 7, %8
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test_found.input = [10 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10, i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @test_found() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 0, i32 9, i32 7)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @search(i32* %3, i32 0, i32 9, i32 3)
%8 = icmp eq i32 %7, 7
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %0
%11 = phi i32 [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
signed short int signedshortint_ignoring_unsignedint(signed short int x,
                                                     unsigned int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshortint_ignoring_unsignedint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedshortint_ignoring_unsignedint>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @signedshortint_ignoring_unsignedint(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshortint_ignoring_unsignedint(i16 returned signext %0, i32 %1) {
ret i16 %0
}
/* Type definitions */
struct radix_tree_root {
  int dummy;
};

/* Variables and functions */
void *rst_insert(struct radix_tree_root *, unsigned long, void *);
int radix_tree_insert(struct radix_tree_root *tree, unsigned long index,
                      void *item) {
  void *ret;
  ret = rst_insert(tree, index, item);
  if (ret == NULL)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<radix_tree_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <rst_insert@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1150 <radix_tree_insert+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1157 <radix_tree_insert+0x47>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_tree_insert>:
push   %rax
call   1030 <rst_insert@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.radix_tree_root = type { i32 }
define i32 @radix_tree_insert(%struct.radix_tree_root* %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.radix_tree_root*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
store %struct.radix_tree_root* %0, %struct.radix_tree_root** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
%9 = load %struct.radix_tree_root*, %struct.radix_tree_root** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = call i8* @rst_insert(%struct.radix_tree_root* %9, i64 %10, i8* %11)
store i8* %12, i8** %8
%13 = load i8*, i8** %8
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 0, i32* %4
br label %17
16: ; preds = %3
store i32 -1, i32* %4
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
%struct.radix_tree_root = type { i32 }
define i32 @radix_tree_insert(%struct.radix_tree_root* %0, i64 %1, i8* %2) {
%4 = tail call i8* @rst_insert(%struct.radix_tree_root* %0, i64 %1, i8* %2)
%5 = icmp ne i8* %4, null
%6 = sext i1 %5 to i32
ret i32 %6
}
int centeredDecagonal(int num) { return 5 * num * num + 5 * num + 1; }


x86 assembly (clang, -O0):
<centeredDecagonal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x5,-0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   $0x5,-0x4(%rbp),%ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<centeredDecagonal>:
lea    (%rdi,%rdi,4),%eax
imul   %eax,%edi
add    %edi,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @centeredDecagonal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 5, %3
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = load i32, i32* %2
%8 = mul nsw i32 5, %7
%9 = add nsw i32 %6, %8
%10 = add nsw i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @centeredDecagonal(i32 %0) {
%2 = mul nsw i32 %0, 5
%3 = mul nsw i32 %2, %0
%4 = add i32 %2, 1
%5 = add i32 %4, %3
ret i32 %5
}
/* Variables and functions */
double RAND_MAX;
double random();
double randfloat(void) { return (random() + .5) / (RAND_MAX + 1.0); }


x86 assembly (clang, -O0):
<randfloat>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
movsd  0xee5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xed1(%rip),%xmm1
mov    0x2eb2(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randfloat>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
addsd  0xee0(%rip),%xmm0
mov    0x2ec1(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @randfloat() {
%1 = call double (...) @random()
%2 = fadd double %1, 5.000000e-01
%3 = load double, double* @RAND_MAX
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @randfloat() {
%1 = tail call double (...) @random()
%2 = fadd double %1, 5.000000e-01
%3 = load double, double* @RAND_MAX
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %2, %4
ret double %5
}
/* Variables and functions */
scalar_t__ tolower(unsigned char);
int CompareChar(char a, char b) {
  return tolower((unsigned char)a) == tolower((unsigned char)b);
}


x86 assembly (clang, -O0):
<CompareChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
mov    %rax,-0x10(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <tolower@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompareChar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
movzbl %dil,%edi
call   1030 <tolower@plt>
mov    %rax,%rbx
movzbl %bpl,%edi
call   1030 <tolower@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CompareChar(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i64 @tolower(i8 zeroext %5)
%7 = load i8, i8* %4
%8 = call i64 @tolower(i8 zeroext %7)
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @CompareChar(i8 signext %0, i8 signext %1) {
%3 = tail call i64 @tolower(i8 zeroext %0)
%4 = tail call i64 @tolower(i8 zeroext %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t USBLPMLinkStateGet(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  return ((*((volatile uint16_t *)(ui32Base + 0x00000360))) & 0x0000000F);
}


x86 assembly (clang, -O0):
<USBLPMLinkStateGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x360,%eax
cltq
mov    (%rax),%eax
and    $0xf,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBLPMLinkStateGet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x360(%rax),%eax
and    $0xf,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @USBLPMLinkStateGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074069504
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 864
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 15
ret i32 %12
}

LLVM IR (-O2):
define i32 @USBLPMLinkStateGet(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 864
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 15
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fizzbuzz(unsigned long);
void main_operation(unsigned long int *const i) {
  fizzbuzz(*i + 1);
  *i = *i + 1;
}


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

x86 assembly (clang, -O2):
<main_operation>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
add    $0x1,%rdi
call   1030 <fizzbuzz@plt>
addq   $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @main_operation(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = add i64 %4, 1
%6 = call i32 @fizzbuzz(i64 %5)
%7 = load i64*, i64** %2
%8 = load i64, i64* %7
%9 = add i64 %8, 1
%10 = load i64*, i64** %2
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @main_operation(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = add i64 %2, 1
%4 = tail call i32 @fizzbuzz(i64 %3)
%5 = load i64, i64* %0
%6 = add i64 %5, 1
store i64 %6, i64* %0
ret void
}
/* Variables and functions */
double getPeriod();
double period(void) { return ((getPeriod() * 271.e-3)); }


x86 assembly (clang, -O0):
<period>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getPeriod@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<period>:
push   %rax
xor    %eax,%eax
call   1030 <getPeriod@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @period() {
%1 = call double (...) @getPeriod()
%2 = fmul double %1, 2.710000e-01
ret double %2
}

LLVM IR (-O2):
define double @period() {
%1 = tail call double (...) @getPeriod()
%2 = fmul double %1, 2.710000e-01
ret double %2
}
void pstore_log(const char *msg) {}


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

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

LLVM IR (-O0):
define void @pstore_log(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @pstore_log(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x75() {
  Assert_real((isdigit(117) == 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_isdigit.c",
              590, ("isdigit should be 0 for u"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x75>:
push   %rax
mov    $0x75,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x24e,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for u\00"
define void @t_isdigit_0x75() {
%1 = call i64 @isdigit(i32 117)
%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 590, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for u\00"
define void @t_isdigit_0x75() {
%1 = tail call i64 @isdigit(i32 117)
%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 590, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ARGBCopyAlphaRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBCopyAlphaRow_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XSetIMValues() {
  printf("XSetIMValues called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"XSetIMValues called\0A\00"
define i32 @XSetIMValues() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"XSetIMValues called\00"
define i32 @XSetIMValues() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ function_with_leak5();
void use_function_with_leak5() { function_with_leak5(); }


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

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

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

LLVM IR (-O2):
define void @use_function_with_leak5() {
%1 = tail call i32 (...) @function_with_leak5()
ret void
}