xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ foo(int, int /*<<< orphan*/);
int main() {
  if (!foo(-1, 0))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <foo@plt>
cmp    $0x0,%eax
jne    114b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <foo@plt>
test   %eax,%eax
je     1135 <main+0x15>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 -1, i32 0)
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 -1, i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
struct timespec glb_timespec_now() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  struct timespec ts = {.tv_sec = tv.tv_sec, .tv_nsec = tv.tv_usec * 1000};
  return ts;
}


x86 assembly (clang, -O0):
<glb_timespec_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glb_timespec_now>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%eax
mov    0x4(%rsp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
%struct.timeval = type { i32, i32 }
define i64 @glb_timespec_now() {
%1 = alloca %struct.timespec
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
store i32 %7, i32* %4
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%10 = load i32, i32* %9
store i32 %10, i32* %8
%11 = bitcast %struct.timespec* %1 to i64*
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @glb_timespec_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = zext i32 %8 to i64
%10 = shl nuw i64 %9, 32
%11 = zext i32 %6 to i64
%12 = or i64 %10, %11
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void too_many_inputs(void) {
  printf("Error: too many input files\n");
  cleanup();
  exit(1);
}


x86 assembly (clang, -O0):
<too_many_inputs>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<too_many_inputs>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Error: too many input files\0A\00"
define void @too_many_inputs() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @cleanup()
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"Error: too many input files\00"
define void @too_many_inputs() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @cleanup()
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LoggingStatsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void LoggingStatsUpdated() { UAVObjUpdated(LoggingStatsHandle()); }


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

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

LLVM IR (-O0):
define void @LoggingStatsUpdated() {
%1 = call i32 (...) @LoggingStatsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @LoggingStatsUpdated() {
%1 = tail call i32 (...) @LoggingStatsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int isspace(int);
int sim_isspace(int c) { return ((c < 0) || (c >= 128)) ? 0 : isspace(c); }


x86 assembly (clang, -O0):
<sim_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1132 <sim_isspace+0x22>
cmpl   $0x80,-0x4(%rbp)
jl     113c <sim_isspace+0x2c>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <sim_isspace+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_isspace>:
cmp    $0x7f,%edi
jbe    1118 <sim_isspace+0x8>
xor    %eax,%eax
ret
jmp    1030 <isspace@plt>

LLVM IR (-O0):
define i32 @sim_isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 128
br i1 %7, label %8, label %9
8: ; preds = %5, %1
br label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = call i32 @isspace(i32 %10)
br label %12
12: ; preds = %9, %8
%13 = phi i32 [ 0, %8 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @sim_isspace(i32 %0) {
%2 = icmp ugt i32 %0, 127
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @isspace(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
int main() {
  int i = 0;
  int k = 0;
  while (i <= 10) {
    while (k <= 5) {
      k++;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     114e <main+0x4e>
jmp    1128 <main+0x28>
cmpl   $0x5,-0xc(%rbp)
jg     1140 <main+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <main+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
void d_io_set_destroy() { empty_log("io_set_destroy\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"io_set_destroy\0A\00"
define void @d_io_set_destroy() {
%1 = call i32 @empty_log(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"io_set_destroy\0A\00"
define void @d_io_set_destroy() {
%1 = tail call i32 @empty_log(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
int SysCall2(int EAX__, int EBX__) {
  asm volatile("" ::"a"(EAX__));
  asm volatile("" ::"b"(EBX__));
  asm volatile("int $0x40");
  register int res;
  asm volatile("" : "=a"(res) :);
  return res;
}


x86 assembly (clang, -O0):
<SysCall2>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
int    $0x40
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCall2>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%eax
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SysCall2(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 = call i32 asm sideeffect "", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @SysCall2(i32 %0, i32 %1) {
tail call void asm sideeffect "", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
tail call void asm sideeffect "", "{bx},~{dirflag},~{fpsr},~{flags}"(i32 %1)
tail call void asm sideeffect "int $$0x40", "~{dirflag},~{fpsr},~{flags}"()
%3 = tail call i32 asm sideeffect "", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int mknod(const char *pathname, mode_t mode, dev_t dev) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<mknod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec2(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @mknod(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOENT
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @mknod(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOENT
store i32 %4, i32* @errno
ret i32 -1
}
void rt_free_reqbuf(void *voidhandle) { ; }


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

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

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

LLVM IR (-O2):
define void @rt_free_reqbuf(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
void main() {
  int x, y;
  printf("Enter x y: ");
  scanf("%d %d", &x, &y);
  printf("\n%d + %d =  %d\n", x, y, add(x, y));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <add@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <add@plt>
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Enter x y: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [16 x i8] c"\0A%d + %d = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @add(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Enter x y: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [16 x i8] c"\0A%d + %d = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @add(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] + 914778474UL) ^ 0xffffffffce5d000bUL;
    local1 = 0UL;
    while (local1 < 0UL) {
      state[local1] |= (state[local1] & 31UL) << 4UL;
      local1++;
    }
    output[0UL] = ((state[0UL] + 1047729131UL) << 7UL) |
                  ((state[0UL] + 1047729131UL) >> 57UL);
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x3686696a,%rax
xor    $0xffffffffce5d000b,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1166 <RandomFunc+0x66>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rcx
and    $0x1f,%rcx
shl    $0x4,%rcx
mov    -0x20(%rbp),%rax
or     -0x18(%rbp,%rax,8),%rcx
mov    %rcx,-0x18(%rbp,%rax,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <RandomFunc+0x2b>
mov    -0x18(%rbp),%rcx
add    $0x3e7313eb,%rcx
shl    $0x7,%rcx
mov    -0x18(%rbp),%rax
add    $0x3e7313eb,%rax
shr    $0x39,%rax
or     %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x3686696a,%eax
add    (%rdi),%rax
xor    $0xffffffffce5d000b,%rax
add    $0x3e7313eb,%rax
rol    $0x7,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, 914778474
%11 = xor i64 %10, -832765941
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %16, %2
%14 = load i64, i64* %6
%15 = icmp ult i64 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %13
%17 = load i64, i64* %6
%18 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %17
%19 = load i64, i64* %18
%20 = and i64 %19, 31
%21 = shl i64 %20, 4
%22 = load i64, i64* %6
%23 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %22
%24 = load i64, i64* %23
%25 = or i64 %24, %21
store i64 %25, i64* %23
%26 = load i64, i64* %6
%27 = add i64 %26, 1
store i64 %27, i64* %6
br label %13
28: ; preds = %13
%29 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%30 = load i64, i64* %29
%31 = add i64 %30, 1047729131
%32 = shl i64 %31, 7
%33 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%34 = load i64, i64* %33
%35 = add i64 %34, 1047729131
%36 = lshr i64 %35, 57
%37 = or i64 %32, %36
%38 = load i64*, i64** %4
%39 = getelementptr inbounds i64, i64* %38, i64 0
store i64 %37, i64* %39
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 914778474
%5 = xor i64 %4, -832765941
%6 = add i64 %5, 1047729131
%7 = tail call i64 @llvm.fshl.i64(i64 %6, i64 %6, i64 7)
store i64 %7, i64* %1
ret void
}
int bitXor(int x, int y) {
  int negx = ~x;
  int negy = ~y;
  int bitXor = (~(x & y)) & (~(negx & negy));
  return bitXor;
}


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

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

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

LLVM IR (-O2):
define i32 @bitXor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ nearly_main();
int main(void) {
  nearly_main();
  nearly_main();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nearly_main()
%2 = tail call i32 (...) @nearly_main()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr, "%s: [-l] <n> <min_hd> <min_iso> [<a_len>]\n", argv0);
  fprintf(stderr, "\t-l  Find the longest code\n");
  fprintf(stderr, "\tMAX_N = %d\n", 16);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xee4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xee9(%rip),%rsi
mov    $0x10,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf03(%rip),%rsi
mov    $0x10,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"%s: [-l] <n> <min_hd> <min_iso> [<a_len>]\0A\00"
@.str.1 = [28 x i8] c"\09-l Find the longest code\0A\00"
@.str.2 = [13 x i8] c"\09MAX_N = %d\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"%s: [-l] <n> <min_hd> <min_iso> [<a_len>]\0A\00"
@.str.1 = [28 x i8] c"\09-l Find the longest code\0A\00"
@.str.2 = [13 x i8] c"\09MAX_N = %d\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ beep_init();
void keyer_init(void) { beep_init(); }


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

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

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

LLVM IR (-O2):
define void @keyer_init() {
%1 = tail call i32 (...) @beep_init()
ret void
}
char foo_char(void) {
  _Complex char a = 123 + 45I;
  return __real__ a;
}


x86 assembly (clang, -O0):
<foo_char>:
push   %rbp
mov    %rsp,%rbp
movb   $0x7b,-0x8(%rbp)
movb   $0x2d,-0x7(%rbp)
movsbl -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_char>:
mov    $0x7b,%al
ret

LLVM IR (-O0):
define signext i8 @foo_char() {
%1 = alloca { i8, i8 }
%2 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %1, i32 0, i32 1
store i8 123, i8* %2
store i8 45, i8* %3
%4 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %1, i32 0, i32 0
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @foo_char() {
ret i8 123
}
/* Type definitions */
typedef int /*<<< orphan*/ __be16;

/* Variables and functions */
void *nla_reserve(void **, int, int);
void nla_put_be16(void **ctx, int t, __be16 var) {
  void *data = nla_reserve(ctx, t, sizeof(__be16));
  *(__be16 *)data = var;
}


x86 assembly (clang, -O0):
<nla_put_be16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x4,%edx
call   1030 <nla_reserve@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_be16>:
push   %rbx
mov    %edx,%ebx
mov    $0x4,%edx
call   1030 <nla_reserve@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @nla_put_be16(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8**, i8*** %4
%9 = load i32, i32* %5
%10 = call i8* @nla_reserve(i8** %8, i32 %9, i32 4)
store i8* %10, i8** %7
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = bitcast i8* %12 to i32*
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @nla_put_be16(i8** %0, i32 %1, i32 %2) {
%4 = tail call i8* @nla_reserve(i8** %0, i32 %1, i32 4)
%5 = bitcast i8* %4 to i32*
store i32 %2, i32* %5
ret void
}
int get_power(int q, int m) {
  int q_t;
  int t;
  q_t = q % m;
  t = 1;
  do {
    if ((q_t + 1) % m == 0) {
      return t;
    }
    q_t = (q * q_t) % m;
    t++;
  } while (q_t != q);
  return -1;
}


x86 assembly (clang, -O0):
<get_power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1139 <get_power+0x39>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <get_power+0x63>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    111b <get_power+0x1b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_power>:
mov    %edi,%r8d
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%edi
mov    $0x1,%ecx
nop
lea    0x1(%rdi),%eax
cltd
idiv   %esi
test   %edx,%edx
je     1132 <get_power+0x32>
imul   %r8d,%edi
mov    %edi,%eax
cltd
idiv   %esi
add    $0x1,%ecx
mov    %edx,%edi
cmp    %r8d,%edx
jne    1110 <get_power+0x10>
mov    $0xffffffff,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_power(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
br label %4
4: ; preds = %10, %2
%5 = phi i32 [ %3, %2 ], [ %12, %10 ]
%6 = phi i32 [ 1, %2 ], [ %13, %10 ]
%7 = add nsw i32 %5, 1
%8 = srem i32 %7, %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %4
%11 = mul nsw i32 %5, %0
%12 = srem i32 %11, %1
%13 = add nuw nsw i32 %6, 1
%14 = icmp eq i32 %12, %0
br i1 %14, label %15, label %4
15: ; preds = %10, %4
%16 = phi i32 [ %6, %4 ], [ -1, %10 ]
ret i32 %16
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ sprintf(char *, char *, int);
int system(char *);
void sAlrm() {
  int i = 0;
  char cmd[256];
  sprintf(cmd, "kill -9 %d", getpid());
  i = system(cmd);
  return;
}


x86 assembly (clang, -O0):
<sAlrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x118(%rbp),%rdi
mov    %eax,%edx
lea    0xe99(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <system@plt>
mov    %eax,-0x4(%rbp)
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sAlrm>:
push   %rbx
sub    $0x100,%rsp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeba(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"kill -9 %d\00"
define void @sAlrm() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 (...) @getpid()
%5 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @system(i8* %6)
store i32 %7, i32* %1
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"kill -9 %d\00"
define void @sAlrm() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @getpid()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @system(i8* %2)
ret void
}
int test_imm_B5int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xB5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B5int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 181
%7 = icmp ne i64 %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_B5int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11862016
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_target_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(261, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_target_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x105,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_target_system_to_container>:
mov    $0x105,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_target_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 261, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_target_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 261, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int _write(int fd, char *ptr, int len) {
  if (fd == 1) {
  }
  return -1;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    111d <_write+0x1d>
jmp    111d <_write+0x1d>
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %3
br label %10
10: ; preds = %9, %3
ret i32 -1
}

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ __fake_pread_write(int, void *, size_t, int /*<<< orphan*/,
                                      int);
ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) {
  return (__fake_pread_write(fd, (void *)buf, count, offset, 1));
}


x86 assembly (clang, -O0):
<__libc_pwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <__fake_pread_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_pwrite>:
mov    $0x1,%r8d
jmp    1030 <__fake_pread_write@plt>

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

LLVM IR (-O2):
define i32 @__libc_pwrite(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @__fake_pread_write(i32 %0, i8* %1, i64 %2, i32 %3, i32 1)
ret i32 %5
}
/* Variables and functions */
char *strchr(char const *, int);
char *g_strchr(const char *text, int c) {
  if (text == 0) {
    return 0;
  }
  return strchr(text, c);
}


x86 assembly (clang, -O0):
<g_strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <g_strchr+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1147 <g_strchr+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @g_strchr(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @strchr(i8* %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int mkdir(char const *, int /*<<< orphan*/);
int posix_mkdir(const char *pathname, mode_t mode) {
  return mkdir(pathname, mode);
}


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

x86 assembly (clang, -O2):
<posix_mkdir>:
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define i32 @posix_mkdir(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @mkdir(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strlen(char *);
void print_stat(long bytes, long lines, char *filename) {
  printf("%4li %4li", lines, bytes);
  if (strlen(filename) != 0) {
    printf(" %s", filename);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     116f <print_stat+0x4f>
mov    -0x18(%rbp),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stat>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rdx
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpb   $0x0,(%rbx)
je     114b <print_stat+0x2b>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%4li %4li\00"
@.str.1 = [4 x i8] c" %s\00"
define void @print_stat(i64 %0, i64 %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %1, i64 %0)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %9
9: ; preds = %7, %3
%10 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_set_key_error(int);
int /*<<< orphan*/ fd_nrf8001_set_key_success();
void fd_nrf8001_dispatch_set_key_response(uint8_t status,
                                          uint8_t *response_data
                                          __attribute__((unused)),
                                          uint32_t response_data_length
                                          __attribute__((unused))) {
  if (status != 0x00) {
    fd_nrf8001_set_key_error(status);
    return;
  }
  fd_nrf8001_set_key_success();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <fd_nrf8001_dispatch_set_key_response+0x29>
mov    -0x4(%rbp),%edi
call   1040 <fd_nrf8001_set_key_error@plt>
jmp    1150 <fd_nrf8001_dispatch_set_key_response+0x30>
mov    $0x0,%al
call   1030 <fd_nrf8001_set_key_success@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
test   %edi,%edi
je     1129 <fd_nrf8001_dispatch_set_key_response+0x9>
jmp    1040 <fd_nrf8001_set_key_error@plt>
xor    %eax,%eax
jmp    1030 <fd_nrf8001_set_key_success@plt>

LLVM IR (-O0):
define void @fd_nrf8001_dispatch_set_key_response(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 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @fd_nrf8001_set_key_error(i32 %10)
br label %14
12: ; preds = %3
%13 = call i32 (...) @fd_nrf8001_set_key_success()
br label %14
14: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @fd_nrf8001_dispatch_set_key_response(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fd_nrf8001_set_key_error(i32 %0)
br label %9
7: ; preds = %3
%8 = tail call i32 (...) @fd_nrf8001_set_key_success()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printMessage(char *m, int length) {
  for (size_t i = 0; i < length; i++) {
    printf("%c", m[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jae    1163 <printMessage+0x53>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <printMessage+0x17>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMessage>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <printMessage+0x33>
mov    %rdi,%r14
movslq %esi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printMessage+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printMessage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = icmp ult i64 %7, %9
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %11
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printMessage(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ %14, %8 ], [ 0, %4 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 @putchar(i32 %12)
%14 = add nuw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ OUT(int, unsigned char);
void uartFlush(void) { OUT(0x01, ((unsigned char)(1 << 7))); }


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

x86 assembly (clang, -O2):
<uartFlush>:
mov    $0x1,%edi
mov    $0x80,%esi
jmp    1030 <OUT@plt>

LLVM IR (-O0):
define void @uartFlush() {
%1 = call i32 @OUT(i32 1, i8 zeroext -128)
ret void
}

LLVM IR (-O2):
define void @uartFlush() {
%1 = tail call i32 @OUT(i32 1, i8 zeroext -128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_greaterequal_d(int *, double, double);
int xil_fpo_greaterequal_d(double a, double b) {
  int res_int;
  xip_fpo_greaterequal_d(&res_int, a, b);
  return res_int;
}


x86 assembly (clang, -O0):
<xil_fpo_greaterequal_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x14(%rbp),%rdi
call   1030 <xip_fpo_greaterequal_d@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xil_fpo_greaterequal_d(double %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @xip_fpo_greaterequal_d(i32* %3, double %0, double %1)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ addbc();
int /*<<< orphan*/ ldbc();
void threereg(void) {
  ldbc();
  addbc();
  addbc();
}


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

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

LLVM IR (-O0):
define void @threereg() {
%1 = call i32 (...) @ldbc()
%2 = call i32 (...) @addbc()
%3 = call i32 (...) @addbc()
ret void
}

LLVM IR (-O2):
define void @threereg() {
%1 = tail call i32 (...) @ldbc()
%2 = tail call i32 (...) @addbc()
%3 = tail call i32 (...) @addbc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HTS_error(int, char *);
scalar_t__ realloc(char *, size_t const);
char *HTS_realloc(char *mem, const size_t num, const size_t size) {
  mem = (char *)realloc(mem, num * size);
  if (mem == NULL)
    HTS_error(1, "HTS_realloc: Cannot allocate memory.\n");
  return mem;
}


x86 assembly (clang, -O0):
<HTS_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1166 <HTS_realloc+0x46>
mov    $0x1,%edi
lea    0xe9f(%rip),%rsi
call   1040 <HTS_error@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTS_realloc>:
push   %rbx
imul   %rdx,%rsi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <HTS_realloc+0x23>
lea    0xec7(%rip),%rsi
mov    $0x1,%edi
call   1040 <HTS_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"HTS_realloc: Cannot allocate memory.\0A\00"
define i8* @HTS_realloc(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = mul i64 %8, %9
%11 = call i64 @realloc(i8* %7, i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @HTS_error(i32 1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %3
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
@.str = [38 x i8] c"HTS_realloc: Cannot allocate memory.\0A\00"
define i8* @HTS_realloc(i8* %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i64 @realloc(i8* %0, i64 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @HTS_error(i32 1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
%10 = inttoptr i64 %5 to i8*
ret i8* %10
}