xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
size_t append_hex_exit(uint8_t *dst) {
  dst[0] = 0xb0;
  dst[1] = 0x01;
  dst[2] = 0xb3;
  dst[3] = 0x00;
  dst[4] = 0xcd;
  dst[5] = 0x80;
  return 6;
}


x86 assembly (clang, -O0):
<append_hex_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xb0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0xb3,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0xcd,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x80,0x14(%rax)
mov    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_hex_exit>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movabs $0x80000000cd,%rax
mov    %rax,0x10(%rdi)
mov    $0x6,%eax
ret

LLVM IR (-O0):
define i64 @append_hex_exit(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 176, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 1, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 179, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 0, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32 205, i32* %12
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 5
store i32 128, i32* %14
ret i64 6
}

LLVM IR (-O2):
define i64 @append_hex_exit(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 176, i32 1, i32 179, i32 0>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 205, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 5
store i32 128, i32* %4
ret i64 6
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int creat(char *, int);
int main() {
  int fd;
  mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
  char *filename = "./creat.txt";
  fd = creat(filename, mode);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec0(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea7(%rip),%rcx
or     (%rcx),%eax
mov    0x2e96(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x8(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <creat@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2eae(%rip),%rax
or     (%rax),%esi
mov    0x2e9d(%rip),%rax
or     (%rax),%esi
lea    0xec4(%rip),%rdi
call   1030 <creat@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@.str = [12 x i8] c"./creat.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = load i32, i32* @S_IRUSR
%5 = load i32, i32* @S_IWUSR
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IRGRP
%8 = or i32 %6, %7
%9 = load i32, i32* @S_IROTH
%10 = or i32 %8, %9
store i32 %10, i32* %2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %3
%11 = load i8*, i8** %3
%12 = load i32, i32* %2
%13 = call i32 @creat(i8* %11, i32 %12)
store i32 %13, i32* %1
ret i32 0
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@.str = [12 x i8] c"./creat.txt\00"
define i32 @main() {
%1 = load i32, i32* @S_IRUSR
%2 = load i32, i32* @S_IWUSR
%3 = or i32 %2, %1
%4 = load i32, i32* @S_IRGRP
%5 = or i32 %3, %4
%6 = load i32, i32* @S_IROTH
%7 = or i32 %5, %6
%8 = tail call i32 @creat(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int binary(int *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[7] = {1, 3, 5, 7, 9, 11, 15};
  int num = 11;
  printf("%d\n", binary(a, 0, 6, num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0xb,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%ecx
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <binary@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x6,%edx
mov    $0xb,%ecx
call   1030 <binary@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [7 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 15]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [7 x i32]* %2 to i8*
store i32 11, i32* %3
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @binary(i32* %5, i32 0, i32 6, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 15]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @binary(i32* %3, i32 0, i32 6, i32 11)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int DoVprintf(char const *, char *);
int /*<<< orphan*/ Fail(char *, int, int);
int strlen(char const *);
void DoStrTest(const char *formatstr, char *param, const char *checkstr) {
  int ret;
  ret = DoVprintf(formatstr, param);
  if (ret != strlen(checkstr)) {
    Fail("Expected vprintf to return %d, got %d.\n", strlen(checkstr), ret);
  }
}


x86 assembly (clang, -O0):
<DoStrTest>:
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
call   1040 <DoVprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
je     118a <DoStrTest+0x5a>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
mov    -0x1c(%rbp),%edx
lea    0xe7b(%rip),%rdi
call   1050 <Fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoStrTest>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1040 <DoVprintf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jne    1150 <DoStrTest+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Fail@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Expected vprintf to return %d, got %d.\0A\00"
define void @DoStrTest(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @DoVprintf(i8* %8, i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = icmp ne i32 %11, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = call i32 @strlen(i8* %16)
%18 = load i32, i32* %7
%19 = call i32 @Fail(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
br label %20
20: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Expected vprintf to return %d, got %d.\0A\00"
define void @DoStrTest(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @DoVprintf(i8* %0, i8* %1)
%5 = tail call i32 @strlen(i8* %2)
%6 = icmp eq i32 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 @strlen(i8* %2)
%9 = tail call i32 @Fail(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %4)
br label %10
10: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t SysTickPeriodGet(void) {
  return ((*((volatile unsigned long *)(0xE000E014))) + 1);
}


x86 assembly (clang, -O0):
<SysTickPeriodGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e014,%eax
mov    (%rax),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTickPeriodGet>:
mov    $0xe000e014,%eax
mov    (%rax),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @SysTickPeriodGet() {
%1 = load volatile i64, i64* inttoptr (i64 3758153748 to i64*)
%2 = add i64 %1, 1
ret i64 %2
}

LLVM IR (-O2):
define i64 @SysTickPeriodGet() {
%1 = load volatile i64, i64* inttoptr (i64 3758153748 to i64*)
%2 = add i64 %1, 1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x93() {
  Assert_real((isgraph(147) == 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_isgraph.c",
              740, ("isgraph should be 0 for 0x93"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x93>:
push   %rax
mov    $0x93,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e4,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x93\00"
define void @t_isgraph_0x93() {
%1 = call i64 @isgraph(i32 147)
%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 740, i8* getelementptr inbounds ([29 x i8], [29 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x93\00"
define void @t_isgraph_0x93() {
%1 = tail call i64 @isgraph(i32 147)
%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 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct unrez_forkedfile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int unrez_forkedfile_openat(struct unrez_forkedfile *, int /*<<< orphan*/,
                            char const *);
int unrez_forkedfile_open(struct unrez_forkedfile *forks, const char *path) {
  return unrez_forkedfile_openat(forks, AT_FDCWD, path);
}


x86 assembly (clang, -O0):
<unrez_forkedfile_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <unrez_forkedfile_openat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unrez_forkedfile_open>:
mov    %rsi,%rdx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
jmp    1030 <unrez_forkedfile_openat@plt>

LLVM IR (-O0):
%struct.unrez_forkedfile = type { i32 }
@AT_FDCWD = global i32 0
define i32 @unrez_forkedfile_open(%struct.unrez_forkedfile* %0, i8* %1) {
%3 = alloca %struct.unrez_forkedfile*
%4 = alloca i8*
store %struct.unrez_forkedfile* %0, %struct.unrez_forkedfile** %3
store i8* %1, i8** %4
%5 = load %struct.unrez_forkedfile*, %struct.unrez_forkedfile** %3
%6 = load i32, i32* @AT_FDCWD
%7 = load i8*, i8** %4
%8 = call i32 @unrez_forkedfile_openat(%struct.unrez_forkedfile* %5, i32 %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.unrez_forkedfile = type { i32 }
@AT_FDCWD = global i32 0
define i32 @unrez_forkedfile_open(%struct.unrez_forkedfile* %0, i8* %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = tail call i32 @unrez_forkedfile_openat(%struct.unrez_forkedfile* %0, i32 %3, i8* %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;

/* Variables and functions */
int /*<<< orphan*/ _unsupported();
int pthread_condattr_destroy(pthread_condattr_t *attr) {
  _unsupported();
  return -1;
}


x86 assembly (clang, -O0):
<pthread_condattr_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_condattr_destroy>:
push   %rax
xor    %eax,%eax
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pthread_condattr_destroy(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @_unsupported()
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ max_heapify(int *, int, int);
void build_max_heap(int array[], int array_size) {
  int i;
  for (i = array_size / 2; i >= 1; i--) {
    max_heapify(array, array_size, i);
  }
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1154 <build_max_heap+0x44>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <max_heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <build_max_heap+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1146 <build_max_heap+0x36>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <max_heapify@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_max_heap(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* %4
%7 = sdiv i32 %6, 2
store i32 %7, i32* %5
br label %8
8: ; preds = %16, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 1
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @max_heapify(i32* %12, i32 %13, i32 %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, -1
store i32 %18, i32* %5
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @max_heapify(i32* %0, i32 %1, i32 %7)
%9 = add nsw i32 %7, -1
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void do_exit() { exit(0); }


x86 assembly (clang, -O0):
<do_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<do_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @do_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ optval;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int setSocketNoDelay(int socket) {
  int optval = 1;
  return setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, &optval, sizeof(optval));
}


x86 assembly (clang, -O0):
<setSocketNoDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSocketNoDelay>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @setSocketNoDelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_NODELAY
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @setSocketNoDelay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
int main(void) {
  5 >= 6.0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
double degtorad(double deg) { return deg * 3.14159265358979323846 / 180.; }


x86 assembly (clang, -O0):
<degtorad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degtorad>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @degtorad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @degtorad(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
int HelpItem146(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem146() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ myprintf(char *);
int /*<<< orphan*/ passByCopy(int);
int /*<<< orphan*/ passByPointer(int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int n = 6;
  printf("hello world\n");
  myprintf("hello world again\n");
  passByCopy(n);
  passByPointer(&n);
  printf("n=%d\n", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x6,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
call   1050 <myprintf@plt>
mov    -0x4(%rbp),%edi
call   1060 <passByCopy@plt>
lea    -0x4(%rbp),%rdi
call   1030 <passByPointer@plt>
mov    -0x4(%rbp),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x6,0x4(%rsp)
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
lea    0xe94(%rip),%rdi
call   1060 <myprintf@plt>
mov    $0x6,%edi
call   1070 <passByCopy@plt>
lea    0x4(%rsp),%rdi
call   1040 <passByPointer@plt>
mov    0x4(%rsp),%esi
lea    0xe83(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
@.str.1 = [19 x i8] c"hello world again\0A\00"
@.str.2 = [6 x i8] c"n=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 6, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @myprintf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
%5 = call i32 @passByCopy(i32 %4)
%6 = call i32 @passByPointer(i32* %1)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"hello world again\0A\00"
@.str.2 = [6 x i8] c"n=%d\0A\00"
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @myprintf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @passByCopy(i32 6)
%6 = call i32 @passByPointer(i32* %1)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
double mercLon(double);
double geohashGetXWGS84(double x) { return mercLon(x); }


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

x86 assembly (clang, -O2):
<geohashGetXWGS84>:
jmp    1030 <mercLon@plt>

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

LLVM IR (-O2):
define double @geohashGetXWGS84(double %0) {
%2 = tail call double @mercLon(double %0)
ret double %2
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzCase_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKUP(int /*<<< orphan*/);
void BrzCase_ackup(struct comp *comp, int port) {
  struct BrzCase_ *c = (struct BrzCase_ *)comp;
  SEND_ACKUP(0);
}


x86 assembly (clang, -O0):
<BrzCase_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1030 <SEND_ACKUP@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzCase_ = type { i32 }
define void @BrzCase_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzCase_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzCase_*
store %struct.BrzCase_* %7, %struct.BrzCase_** %5
%8 = call i32 @SEND_ACKUP(i32 0)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzCase_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKUP(i32 0)
ret void
}
void ff_hevc_put_hevc_uni_qpel_v16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_v16_10_sse4() {
ret void
}
long long runcallback(long long (*callback)()) { return callback(); }


x86 assembly (clang, -O0):
<runcallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runcallback>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define i64 @runcallback(i64 (...)* nocapture %0) {
%2 = tail call i64 (...) %0()
ret i64 %2
}
int is_equal(double a, double b) { return (a - b < 0.01); }


x86 assembly (clang, -O0):
<is_equal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_equal>:
subsd  %xmm1,%xmm0
movsd  0xef4(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @is_equal(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = fcmp olt double %7, 1.000000e-02
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_equal(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp olt double %3, 1.000000e-02
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct peer {
  int dummy;
};

/* Variables and functions */
int key_agreement(struct peer *);
int prot_send_handshake(struct peer *peer) {
  int err = key_agreement(peer);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.peer = type { i32 }
define i32 @prot_send_handshake(%struct.peer* %0) {
%2 = alloca %struct.peer*
%3 = alloca i32
store %struct.peer* %0, %struct.peer** %2
%4 = load %struct.peer*, %struct.peer** %2
%5 = call i32 @key_agreement(%struct.peer* %4)
store i32 %5, i32* %3
ret i32 0
}

LLVM IR (-O2):
%struct.peer = type { i32 }
define i32 @prot_send_handshake(%struct.peer* %0) {
%2 = tail call i32 @key_agreement(%struct.peer* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void T2Cam_errormsg() {
  printf("\n\nERROR.\n");
  printf("It appears as though a camera-specific function was called.\n");
  printf("This software was compiled without camera-spefici libraries.\n");
  printf("Try running the software using a video file as input by invoking the "
         "-i switch.\n\n");
}


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

x86 assembly (clang, -O2):
<T2Cam_errormsg>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf46(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\0A\0AERROR.\0A\00"
@.str.1 = [61 x i8] c"It appears as though a camera-specific function was called.\0A\00"
@.str.2 = [62 x i8] c"This software was compiled without camera-spefici libraries.\0A\00"
@.str.3 = [82 x i8] c"Try running the software using a video file as input by invoking the -i switch.\0A\0A\00"
define void @T2Cam_errormsg() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"\0A\0AERROR.\00"
@str.4 = [60 x i8] c"It appears as though a camera-specific function was called.\00"
@str.5 = [61 x i8] c"This software was compiled without camera-spefici libraries.\00"
@str.6 = [81 x i8] c"Try running the software using a video file as input by invoking the -i switch.\0A\00"
define void @T2Cam_errormsg() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putstr(char *str) {
  int i;
  i = 0;
  while (str[i]) {
    write(1, str, 1);
    str++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1156 <ft_putstr+0x46>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <ft_putstr+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @write(i32 1, i8* %5, i32 1)
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
void main() {
  int j = -3;
  int i = 0;
  for (i = 0; i < 3; i++) {
    int temp = j + 2;
    if (temp == 2 || temp == 3) {
      j--;
    } else if (temp == 0) {
      j += 2;
    } else {
      j = 0;
    }
    if (j > 0) {
      i = 3;
    } else {
      j = 3 - i;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xfffffffd,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11a6 <main+0xa6>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
je     1140 <main+0x40>
cmpl   $0x3,-0xc(%rbp)
jne    114e <main+0x4e>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <main+0x72>
cmpl   $0x0,-0xc(%rbp)
jne    1166 <main+0x66>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    116d <main+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    1172 <main+0x72>
cmpl   $0x0,-0x4(%rbp)
jle    1188 <main+0x88>
movl   $0x3,-0x8(%rbp)
jmp    1193 <main+0x93>
mov    $0x3,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1198 <main+0x98>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int pthread_mutex_lock(int /*<<< orphan*/ *);
void lock_wrapper(pthread_mutex_t *lk) {
  int rc = pthread_mutex_lock(lk);
  assert(rc == 0);
}


x86 assembly (clang, -O0):
<lock_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_wrapper>:
push   %rax
call   1040 <pthread_mutex_lock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @lock_wrapper(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_lock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}

LLVM IR (-O2):
define void @lock_wrapper(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
int mpc_soi_anchor(char prev, char next) {
  (void)next;
  return (prev == '\0');
}


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

x86 assembly (clang, -O2):
<mpc_soi_anchor>:
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @mpc_soi_anchor(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* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @mpc_soi_anchor(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int func1(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @func1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @func1() {
ret i32 1
}
void HTS_free_matrix(double **p, const int x) {
  int i;
  for (i = x - 1; i >= 0; i--)
    HTS_free(p[i]);
  HTS_free(p);
}


x86 assembly (clang, -O0):
<HTS_free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1153 <HTS_free_matrix+0x43>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <HTS_free@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <HTS_free_matrix+0x18>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <HTS_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTS_free_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1148 <HTS_free_matrix+0x38>
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
xor    %eax,%eax
call   1030 <HTS_free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <HTS_free_matrix+0x20>
mov    %r14,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <HTS_free@plt>

LLVM IR (-O0):
define void @HTS_free_matrix(double** %0, i32 %1) {
%3 = alloca double**
%4 = alloca i32
%5 = alloca i32
store double** %0, double*** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load double**, double*** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double*, double** %12, i64 %14
%16 = load double*, double** %15
%17 = call i32 (double*, ...) bitcast (i32 (...)* @HTS_free to i32 (double*, ...)*)(double* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, -1
store i32 %20, i32* %5
br label %8
21: ; preds = %8
%22 = load double**, double*** %3
%23 = call i32 (double**, ...) bitcast (i32 (...)* @HTS_free to i32 (double**, ...)*)(double** %22)
ret void
}

LLVM IR (-O2):
define void @HTS_free_matrix(double** %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds double*, double** %0, i64 %9
%11 = load double*, double** %10
%12 = tail call i32 (double*, ...) bitcast (i32 (...)* @HTS_free to i32 (double*, ...)*)(double* %11)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = tail call i32 (double**, ...) bitcast (i32 (...)* @HTS_free to i32 (double**, ...)*)(double** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *threadfunc(void *parm __attribute__((unused))) {
  sleep(5);
  return (NULL);
}


x86 assembly (clang, -O0):
<threadfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @threadfunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 5)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @threadfunc(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 5)
ret i8* null
}
int fun865() { return 865; }


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

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

LLVM IR (-O0):
define i32 @fun865() {
ret i32 865
}

LLVM IR (-O2):
define i32 @fun865() {
ret i32 865
}
void _infix_operator_plus_float_float(float lhs, float rhs, float *__rval_1) {
  *__rval_1 = lhs + rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_plus_float_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_plus_float_float>:
addss  %xmm1,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @_infix_operator_plus_float_float(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fadd float %7, %8
%10 = load float*, float** %6
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @_infix_operator_plus_float_float(float %0, float %1, float* nocapture writeonly %2) {
%4 = fadd float %0, %1
store float %4, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int main(int argc, char *argv[]) {
  char testData[4];
  testData[0] = 0;
  testData[1] = 1;
  testData[2] = 2;
  testData[3] = 3;
  memcpy(&testData[2], &testData[0], 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x14(%rbp)
movb   $0x1,-0x13(%rbp)
movb   $0x2,-0x12(%rbp)
movb   $0x3,-0x11(%rbp)
lea    -0x14(%rbp),%rdi
add    $0x2,%rdi
lea    -0x14(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3020100,0x4(%rsp)
03
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
store i8 0, i8* %7
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 1
store i8 1, i8* %8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 2
store i8 2, i8* %9
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 3
store i8 3, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 2
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%13 = call i32 @memcpy(i8* %11, i8* %12, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 1, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 2, i8* %6
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 3, i8* %7
%8 = call i32 @memcpy(i8* %6, i8* %4, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void display_version(void) {
  printf("rfdformat"
         " "
         "$Revision 1.0 $"
         "\n"
         "\n"
         "This is free software; see the source for copying conditions.  There "
         "is NO\n"
         "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
         "PURPOSE.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<display_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<display_version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [179 x i8] c"rfdformat $Revision 1.0 $\0A\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([179 x i8], [179 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [178 x i8] c"rfdformat $Revision 1.0 $\0A\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @display_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([178 x i8], [178 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *exti_get_IMR() { return mem_get_reg32(0x40010400 + 0x0); }


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

x86 assembly (clang, -O2):
<exti_get_IMR>:
mov    $0x40010400,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @exti_get_IMR() {
%1 = call i32* @mem_get_reg32(i32 1073808384)
ret i32* %1
}

LLVM IR (-O2):
define i32* @exti_get_IMR() {
%1 = tail call i32* @mem_get_reg32(i32 1073808384)
ret i32* %1
}
int b() { return 11; }


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

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

LLVM IR (-O0):
define i32 @b() {
ret i32 11
}

LLVM IR (-O2):
define i32 @b() {
ret i32 11
}