xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void displayResults(float duration) {
  printf("Estimated flight duration hours:  %f \n", duration);
}


x86 assembly (clang, -O0):
<displayResults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"Estimated flight duration hours: %f \0A\00"
define void @displayResults(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Estimated flight duration hours: %f \0A\00"
define void @displayResults(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
int mod(int n, int m) {
  if (m < 2)
    return 0;
  n = n % m;
  while (n < 0)
    n += m;
  return n;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1120 <mod+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1148 <mod+0x48>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1142 <mod+0x42>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112a <mod+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
xor    %eax,%eax
cmp    $0x2,%esi
jl     1114 <mod+0x14>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sub    %esi,%eax
add    %esi,%eax
js     1110 <mod+0x10>
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = srem i32 %0, %1
br label %6
6: ; preds = %6, %4
%7 = phi i32 [ %5, %4 ], [ %9, %6 ]
%8 = icmp slt i32 %7, 0
%9 = add nsw i32 %7, %1
br i1 %8, label %6, label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %7, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_CC_FIFO_INPUT() { clear_io_bit(-6, 2); }


x86 assembly (clang, -O0):
<TOSH_MAKE_CC_FIFO_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffa,%edi
mov    $0x2,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_CC_FIFO_INPUT>:
mov    $0xfffffffa,%edi
mov    $0x2,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_CC_FIFO_INPUT() {
%1 = call i32 @clear_io_bit(i32 -6, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_CC_FIFO_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 -6, i32 2)
ret void
}
void *my_atomic_fasptr(void *volatile *a, void *v) {
  return __sync_lock_test_and_set(a, v);
}


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

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

LLVM IR (-O0):
define i8* @my_atomic_fasptr(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = bitcast i8** %5 to i64*
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = atomicrmw xchg i64* %6, i64 %8 seq_cst
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @my_atomic_fasptr(i8** nocapture %0, i8* %1) {
%3 = bitcast i8** %0 to i64*
%4 = ptrtoint i8* %1 to i64
%5 = atomicrmw xchg i64* %3, i64 %4 seq_cst
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
void swap(int *a, int *b) {
  int tmp;
  if (*a == *b)
    return;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    1123 <swap+0x23>
jmp    1141 <swap+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
je     110c <swap+0xc>
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
br i1 %5, label %7, label %6
6: ; preds = %2
store i32 %4, i32* %0
store i32 %3, i32* %1
br label %7
7: ; preds = %2, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
epic_usage() {
  printf("Usage: \nepic infile [-o outfile] [-x xdim] [-y ydim] [-l levels] "
         "[-b binsize]\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@.str = [79 x i8] c"Usage: \0Aepic infile [-o outfile] [-x xdim] [-y ydim] [-l levels] [-b binsize]\0A\00"
define i32 @epic_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [78 x i8] c"Usage: \0Aepic infile [-o outfile] [-x xdim] [-y ydim] [-l levels] [-b binsize]\00"
define i32 @epic_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc) {
  printf("Hello World\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int identity(int);
int bad_example(void) { return identity(3); }


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

x86 assembly (clang, -O2):
<bad_example>:
mov    $0x3,%edi
jmp    1030 <identity@plt>

LLVM IR (-O0):
define i32 @bad_example() {
%1 = call i32 @identity(i32 3)
ret i32 %1
}

LLVM IR (-O2):
define i32 @bad_example() {
%1 = tail call i32 @identity(i32 3)
ret i32 %1
}
int main(void) {
  int i = 42, j = 41;
  return 10 == 10 ? i : j;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free_bucket_real(char const *, int);
uint64_t free_bucket_mid_queue(const char *bucketpath) {
  return free_bucket_real(bucketpath, false);
}


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

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

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

LLVM IR (-O2):
define i32 @free_bucket_mid_queue(i8* %0) {
%2 = tail call i32 @free_bucket_real(i8* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int convertAgcToNative(uint16_t n) {
  int i;
  i = n;
  if ((n & 040000) != 0)
    i = -(077777 & ~i);
  return (i);
}


x86 assembly (clang, -O0):
<convertAgcToNative>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4000,%eax
cmp    $0x0,%eax
je     1131 <convertAgcToNative+0x31>
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    $0x7fff,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertAgcToNative>:
mov    %edi,%eax
or     $0xffff8000,%eax
add    $0x1,%eax
test   $0x4000,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @convertAgcToNative(i32 %0) {
%2 = and i32 %0, 16384
%3 = icmp eq i32 %2, 0
%4 = or i32 %0, -32768
%5 = add nsw i32 %4, 1
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
/* Variables and functions */
int a();
int func() {
  int b = a();
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @func() {
%1 = tail call i32 (...) @a()
ret i32 %1
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fstat(int, struct stat *);
int open(char const *, int /*<<< orphan*/);
int file_exists(const char *filename) {
  int fd;
  struct stat file_info;
  int exists = 1;
  fd = open(filename, O_RDONLY);
  fstat(fd, &file_info);
  if (!S_ISREG(file_info.st_mode))
    exists = 0;
  close(fd);
  return exists;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1060 <fstat@plt>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%eax
jne    118c <file_exists+0x4c>
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
call   1060 <fstat@plt>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@O_RDONLY = global i32 0
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %5
%6 = load i8*, i8** %2
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @fstat(i32 %9, %struct.stat* %4)
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @S_ISREG(i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %1
store i32 0, i32* %5
br label %16
16: ; preds = %15, %1
%17 = load i32, i32* %3
%18 = call i32 @close(i32 %17)
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@O_RDONLY = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = call i32 @fstat(i32 %5, %struct.stat* %2)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISREG(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @close(i32 %5)
ret i32 %11
}
void manchester_advance_pulse(int *buf, int *len, unsigned length) {
  if (*len % 2)
    buf[++(*len)] = length;
  else
    buf[*len] += length;
}


x86 assembly (clang, -O0):
<manchester_advance_pulse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1143 <manchester_advance_pulse+0x43>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    (%rsi),%ecx
add    $0x1,%ecx
mov    %ecx,(%rsi)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1157 <manchester_advance_pulse+0x57>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<manchester_advance_pulse>:
movslq (%rsi),%rax
test   $0x1,%al
jne    110b <manchester_advance_pulse+0xb>
add    %edx,(%rdi,%rax,4)
ret
lea    0x1(%rax),%rcx
mov    %ecx,(%rsi)
mov    %edx,0x4(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @manchester_advance_pulse(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** %5
%8 = load i32, i32* %7
%9 = srem i32 %8, 2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load i32, i32* %6
%13 = load i32*, i32** %4
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %13, i64 %17
store i32 %12, i32* %18
br label %28
19: ; preds = %3
%20 = load i32, i32* %6
%21 = load i32*, i32** %4
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %21, i64 %24
%26 = load i32, i32* %25
%27 = add i32 %26, %20
store i32 %27, i32* %25
br label %28
28: ; preds = %19, %11
ret void
}

LLVM IR (-O2):
define void @manchester_advance_pulse(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = add nsw i32 %4, 1
store i32 %8, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %2, i32* %10
br label %16
11: ; preds = %3
%12 = sext i32 %4 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = add i32 %14, %2
store i32 %15, i32* %13
br label %16
16: ; preds = %11, %7
ret void
}
/* Variables and functions */
unsigned int rand32();
int brand(void) {
  static unsigned int urand = 0;
  static unsigned int uc = 31;
  unsigned int uret;
  if (uc == 31) {
    urand = rand32();
    uc = 0;
  } else {
    uc += 1;
  }
  uret = urand & 1U;
  urand >>= 1;
  return uret;
}


x86 assembly (clang, -O0):
<brand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x1f,0x2f09(%rip)
jne    1141 <brand+0x31>
mov    $0x0,%al
call   1030 <rand32@plt>
mov    %eax,0x2efe(%rip)
movl   $0x0,0x2eec(%rip)
jmp    1150 <brand+0x40>
mov    0x2ee1(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed8(%rip)
mov    0x2eda(%rip),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    0x2ece(%rip),%eax
shr    $0x1,%eax
mov    %eax,0x2ec5(%rip)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brand>:
push   %rbx
mov    0x2f11(%rip),%ebx
cmp    $0x1f,%ebx
jne    1127 <brand+0x17>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <rand32@plt>
jmp    1130 <brand+0x20>
add    $0x1,%ebx
mov    0x2f00(%rip),%eax
mov    %ebx,0x2ef2(%rip)
mov    %eax,%ecx
and    $0x1,%ecx
shr    %eax
mov    %eax,0x2eed(%rip)
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@brand.urand = internal global i32 0
@brand.uc = internal global i32 31
define i32 @brand() {
%1 = alloca i32
%2 = load i32, i32* @brand.uc
%3 = icmp eq i32 %2, 31
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @rand32()
store i32 %5, i32* @brand.urand
store i32 0, i32* @brand.uc
br label %9
6: ; preds = %0
%7 = load i32, i32* @brand.uc
%8 = add i32 %7, 1
store i32 %8, i32* @brand.uc
br label %9
9: ; preds = %6, %4
%10 = load i32, i32* @brand.urand
%11 = and i32 %10, 1
store i32 %11, i32* %1
%12 = load i32, i32* @brand.urand
%13 = lshr i32 %12, 1
store i32 %13, i32* @brand.urand
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@brand.urand = internal unnamed_addr global i32 0
@brand.uc = internal unnamed_addr global i32 31
define i32 @brand() {
%1 = load i32, i32* @brand.uc
%2 = icmp eq i32 %1, 31
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @rand32()
br label %8
5: ; preds = %0
%6 = add i32 %1, 1
%7 = load i32, i32* @brand.urand
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ %7, %5 ], [ %4, %3 ]
%10 = phi i32 [ %6, %5 ], [ 0, %3 ]
store i32 %10, i32* @brand.uc
%11 = and i32 %9, 1
%12 = lshr i32 %9, 1
store i32 %12, i32* @brand.urand
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_encoding_to_string() {
  printf("NOT IMPLEMENTED:"
         "pa_encoding_to_string"
         "\n");
}


x86 assembly (clang, -O0):
<pa_encoding_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_encoding_to_string\0A\00"
define i32 @pa_encoding_to_string() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_encoding_to_string\00"
define i32 @pa_encoding_to_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int quot;
  int rem;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
div_t div(int numer, int denom) {
  div_t ans;
  ans.quot = numer / denom;
  ans.rem = numer - ans.quot * denom;
  return ans;
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
mov    %edi,%eax
cltd
idiv   %esi
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define i64 @div(i32 %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = sdiv i32 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load i32, i32* %5
%14 = mul nsw i32 %12, %13
%15 = sub nsw i32 %10, %14
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i32 %15, i32* %16
%17 = bitcast %struct.TYPE_3__* %3 to i64*
%18 = load i64, i64* %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = mul nsw i32 %3, %1
%5 = srem i32 %0, %1
%6 = zext i32 %5 to i64
%7 = shl nuw i64 %6, 32
%8 = zext i32 %3 to i64
%9 = or i64 %7, %8
ret i64 %9
}
/* Variables and functions */
void *malloc(size_t);
void *mte_mmap(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<mte_mmap>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @mte_mmap(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
char Char_from_MINUS_int(int i) { return (char)i; }


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

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

LLVM IR (-O0):
define signext i8 @Char_from_MINUS_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @Char_from_MINUS_int(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int iNum, iNum2, iSum = 0, iDig;
  printf("\nEnter a number\n");
  scanf("%d", &iNum);
  printf("\nIn Decimal : %d\n", iNum);
  printf("\nIn Hexadecimal : %X\n", iNum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\0AEnter a number\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"\0AIn Decimal : %d\0A\00"
@.str.3 = [22 x i8] c"\0AIn Hexadecimal : %X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"\0AIn Decimal : %d\0A\00"
@.str.3 = [22 x i8] c"\0AIn Hexadecimal : %X\0A\00"
@str = [16 x i8] c"\0AEnter a number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char char_hex(uint8_t val) {
  if (val < 10)
    return '0' + val;
  return 'a' + val - 10;
}


x86 assembly (clang, -O0):
<char_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <char_hex+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <char_hex+0x2b>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_hex>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x57,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @char_hex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add nsw i32 97, %11
%13 = sub nsw i32 %12, 10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @char_hex(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 87
%5 = add i8 %4, %3
ret i8 %5
}
char TestC() {
  char r;
  __asm__("stc" : "=@ccc"(r));
  if (r) {
    __asm__("clc" : "=@ccnc"(r));
    if (r)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<TestC>:
push   %rbp
mov    %rsp,%rbp
stc
setb   %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1134 <TestC+0x34>
clc
setae  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     112f <TestC+0x2f>
movb   $0x1,-0x1(%rbp)
jmp    1138 <TestC+0x38>
jmp    1134 <TestC+0x34>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestC>:
stc
jae    1109 <TestC+0x9>
clc
mov    $0x1,%al
jb     1109 <TestC+0x9>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @TestC() {
%1 = alloca i8
%2 = alloca i8
%3 = call i8 asm "stc", "={@ccc},~{dirflag},~{fpsr},~{flags}"()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = call i8 asm "clc", "={@ccnc},~{dirflag},~{fpsr},~{flags}"()
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 1, i8* %1
br label %13
11: ; preds = %6
br label %12
12: ; preds = %11, %0
store i8 0, i8* %1
br label %13
13: ; preds = %12, %10
%14 = load i8, i8* %1
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @TestC() {
%1 = tail call i8 asm "stc", "={@ccc},~{dirflag},~{fpsr},~{flags}"()
%2 = icmp eq i8 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i8 asm "clc", "={@ccnc},~{dirflag},~{fpsr},~{flags}"()
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i8 [ 0, %6 ], [ 1, %3 ]
ret i8 %8
}
int aa_pro_ctr_a16(int chan, unsigned char *buf, int len) {
  hu_log(6, "hu_aap", __func__, "!!!!!!!!");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x6,%edi
lea    0xed2(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a16>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a16 = [15 x i8] c"aa_pro_ctr_a16\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a16(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 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a16, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a16 = [15 x i8] c"aa_pro_ctr_a16\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a16(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a16, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
void TIM7_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @TIM7_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_login();
void handler_request_login() { do_login(); }


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

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

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

LLVM IR (-O2):
define void @handler_request_login() {
%1 = tail call i32 (...) @do_login()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OscilloscopeC__Boot__booted();
void RealMainP__Boot__booted(void) { OscilloscopeC__Boot__booted(); }


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

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

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

LLVM IR (-O2):
define void @RealMainP__Boot__booted() {
%1 = tail call i32 (...) @OscilloscopeC__Boot__booted()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *realloc_or_die(void *ptr, size_t size) {
  void *new = realloc(ptr, size);
  if (!new) {
    free(ptr);
    fprintf(stderr, "Out of memory\n");
    exit(1);
  }
  return new;
}


x86 assembly (clang, -O0):
<realloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1194 <realloc_or_die+0x54>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    0xe7b(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_or_die>:
push   %rbx
mov    %rdi,%rbx
call   1050 <realloc@plt>
test   %rax,%rax
je     1150 <realloc_or_die+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @realloc_or_die(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %17, label %11
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define noalias i8* @realloc_or_die(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ setInitializerHasRun(int /*<<< orphan*/ *);
void __cxa_guard_release(uint64_t *guard_object) {
  setInitializerHasRun(guard_object);
}


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

x86 assembly (clang, -O2):
<__cxa_guard_release>:
jmp    1030 <setInitializerHasRun@plt>

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

LLVM IR (-O2):
define void @__cxa_guard_release(i32* %0) {
%2 = tail call i32 @setInitializerHasRun(i32* %0)
ret void
}
void g_type_interface_add_prerequisite() {}


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

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

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

LLVM IR (-O2):
define void @g_type_interface_add_prerequisite() {
ret void
}
double rossler_event_scan(double t, double *Y, int n, double *pars,
                          double *res) {
  *res = (t - pars[3]);
}


x86 assembly (clang, -O0):
<rossler_event_scan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x28(%rbp),%rax
subsd  0x18(%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rossler_event_scan>:
subsd  0x18(%rdx),%xmm0
movsd  %xmm0,(%rcx)
ret

LLVM IR (-O0):
define double @rossler_event_scan(double %0, double* %1, i32 %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
store double %0, double* %7
store double* %1, double** %8
store i32 %2, i32* %9
store double* %3, double** %10
store double* %4, double** %11
%12 = load double, double* %7
%13 = load double*, double** %10
%14 = getelementptr inbounds double, double* %13, i64 3
%15 = load double, double* %14
%16 = fsub double %12, %15
%17 = load double*, double** %11
store double %16, double* %17
%18 = load double, double* %6
ret double %18
}

LLVM IR (-O2):
define double @rossler_event_scan(double %0, double* nocapture readnone %1, i32 %2, double* nocapture %3, double* nocapture writeonly %4) {
%6 = getelementptr inbounds double, double* %3, i64 3
%7 = load double, double* %6
%8 = fsub double %0, %7
store double %8, double* %4
ret double undef
}
int i7(int *base) { return base[00400000]; }


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

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

LLVM IR (-O0):
define i32 @i7(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 131072
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @i7(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 131072
%3 = load i32, i32* %2
ret i32 %3
}
void BN_mod_lshift_quick(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_mod_lshift_quick() {
ret void
}
void reverse_string(char *string, int start, int end) {
  char tmp;
  while (end > start) {
    tmp = string[start];
    string[start] = string[end];
    string[end] = tmp;
    end--;
    start++;
  }
}


x86 assembly (clang, -O0):
<reverse_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1163 <reverse_string+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <reverse_string+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_string>:
cmp    %esi,%edx
jle    1131 <reverse_string+0x31>
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
xchg   %ax,%ax
movzbl -0x1(%rdi,%rax,1),%esi
movzbl (%rdi,%rcx,1),%edx
mov    %dl,-0x1(%rdi,%rax,1)
mov    %sil,(%rdi,%rcx,1)
add    $0xffffffffffffffff,%rcx
lea    0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jg     1110 <reverse_string+0x10>
ret

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

LLVM IR (-O2):
define void @reverse_string(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %15, %8 ]
%10 = phi i64 [ %6, %5 ], [ %16, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %9
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %9, -1
%16 = add nsw i64 %10, 1
%17 = icmp sgt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
double r15(void *x) { return *(double *)(x + 32753); }


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

x86 assembly (clang, -O2):
<r15>:
movsd  0x7ff1(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @r15(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32753
%5 = bitcast i8* %4 to double*
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
define double @r15(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32753
%3 = bitcast i8* %2 to double*
%4 = load double, double* %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ g5_set_range(double, double, double);
void(g5_set_range_)(double *xmin, double *xmax, double *mmin) {
  g5_set_range(*xmin, *xmax, *mmin);
}


x86 assembly (clang, -O0):
<g5_set_range_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
call   1030 <g5_set_range@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g5_set_range_>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  (%rdx),%xmm2
jmp    1030 <g5_set_range@plt>

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

LLVM IR (-O2):
define void @g5_set_range_(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = load double, double* %2
%7 = tail call i32 @g5_set_range(double %4, double %5, double %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fflush(FILE *fp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fflush(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGQUIT;
int catchSig(int /*<<< orphan*/);
int caughtSigQuit(void) { return (catchSig(SIGQUIT)); }


x86 assembly (clang, -O0):
<caughtSigQuit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <catchSig@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<caughtSigQuit>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <catchSig@plt>

LLVM IR (-O0):
@SIGQUIT = global i32 0
define i32 @caughtSigQuit() {
%1 = load i32, i32* @SIGQUIT
%2 = call i32 @catchSig(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SIGQUIT = global i32 0
define i32 @caughtSigQuit() {
%1 = load i32, i32* @SIGQUIT
%2 = tail call i32 @catchSig(i32 %1)
ret i32 %2
}
__attribute__((__const__)) double dim_rampsd(double encoding) {
  return encoding / (double)2.f;
}


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

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

LLVM IR (-O0):
define double @dim_rampsd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @dim_rampsd(double %0) {
%2 = fmul double %0, 5.000000e-01
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ MSG_NOSIGNAL;
int send(int, char *, int, int /*<<< orphan*/);
int clientWrite(int clientSocket, char *buffer, int len) {
  return send(clientSocket, buffer, len, MSG_NOSIGNAL);
}


x86 assembly (clang, -O0):
<clientWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clientWrite>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <send@plt>

LLVM IR (-O0):
@MSG_NOSIGNAL = global i32 0
define i32 @clientWrite(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 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32, i32* @MSG_NOSIGNAL
%11 = call i32 @send(i32 %7, i8* %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@MSG_NOSIGNAL = global i32 0
define i32 @clientWrite(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @MSG_NOSIGNAL
%5 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_U32_N16_swap(char *, int, int);
void U_WMRPATBLT_swap(char *record, int torev) {
  U_WMRCORE_U32_N16_swap(record, 4, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRPATBLT_swap>:
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <U_WMRCORE_U32_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRPATBLT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_U32_N16_swap(i8* %0, i32 4, i32 %1)
ret void
}