xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(char *, size_t);
char *malloc(int);
char *ft_strnew(size_t size) {
  char *str_new;
  str_new = malloc(sizeof(char) * (size + 1));
  if (str_new) {
    ft_bzero(str_new, size + 1);
    return (str_new);
  } else
    return (NULL);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116c <ft_strnew+0x4c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <ft_bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <ft_strnew+0x54>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rbx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1145 <ft_strnew+0x25>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <ft_bzero@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strnew(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = add i64 %5, 1
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i64, i64* %3
%15 = add i64 %14, 1
%16 = call i32 @ft_bzero(i8* %13, i64 %15)
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %19
18: ; preds = %1
store i8* null, i8** %2
br label %19
19: ; preds = %18, %12
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = add i64 %0, 1
%3 = trunc i64 %2 to i32
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @ft_bzero(i8* %4, i64 %2)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Type definitions */
struct l_class_OC_DummyStream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
_ZN9__gnu_cxx13new_allocatorIPiEC2Ev(struct l_class_OC_DummyStream *);
void _ZNSaIPiEC2Ev(struct l_class_OC_DummyStream *llvm_cbe_this) {
  unsigned char *llvm_cbe__rethrow;
  struct l_class_OC_DummyStream *llvm_cbe_this_2e_addr;
  struct l_class_OC_DummyStream *llvm_cbe_this1;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  _ZN9__gnu_cxx13new_allocatorIPiEC2Ev(llvm_cbe_this1);
  return;
}


x86 assembly (clang, -O0):
<_ZNSaIPiEC2Ev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <_ZN9__gnu_cxx13new_allocatorIPiEC2Ev@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ZNSaIPiEC2Ev>:
jmp    1030 <_ZN9__gnu_cxx13new_allocatorIPiEC2Ev@plt>

LLVM IR (-O0):
%struct.l_class_OC_DummyStream = type { i32 }
define void @_ZNSaIPiEC2Ev(%struct.l_class_OC_DummyStream* %0) {
%2 = alloca %struct.l_class_OC_DummyStream*
%3 = alloca i8*
%4 = alloca %struct.l_class_OC_DummyStream*
%5 = alloca %struct.l_class_OC_DummyStream*
store %struct.l_class_OC_DummyStream* %0, %struct.l_class_OC_DummyStream** %2
%6 = load %struct.l_class_OC_DummyStream*, %struct.l_class_OC_DummyStream** %2
store %struct.l_class_OC_DummyStream* %6, %struct.l_class_OC_DummyStream** %4
%7 = load %struct.l_class_OC_DummyStream*, %struct.l_class_OC_DummyStream** %4
store %struct.l_class_OC_DummyStream* %7, %struct.l_class_OC_DummyStream** %5
%8 = load %struct.l_class_OC_DummyStream*, %struct.l_class_OC_DummyStream** %5
%9 = call i32 @_ZN9__gnu_cxx13new_allocatorIPiEC2Ev(%struct.l_class_OC_DummyStream* %8)
ret void
}

LLVM IR (-O2):
%struct.l_class_OC_DummyStream = type { i32 }
define void @_ZNSaIPiEC2Ev(%struct.l_class_OC_DummyStream* %0) {
%2 = tail call i32 @_ZN9__gnu_cxx13new_allocatorIPiEC2Ev(%struct.l_class_OC_DummyStream* %0)
ret void
}
/* Variables and functions */
int file_exists_p(char *);
int fileutils___file_exists_p(char *filename) {
  return (file_exists_p(filename));
}


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

x86 assembly (clang, -O2):
<fileutils___file_exists_p>:
jmp    1030 <file_exists_p@plt>

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

LLVM IR (-O2):
define i32 @fileutils___file_exists_p(i8* %0) {
%2 = tail call i32 @file_exists_p(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int get_file_length(FILE *fp, int *length) {
  int err;
  err = fseek(fp, 0L, SEEK_END);
  if (err == 0) {
    *length = ftell(fp);
    if (*length == -1L)
      err = -1;
  }
  return err;
}


x86 assembly (clang, -O0):
<get_file_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1181 <get_file_length+0x61>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
cmp    $0xffffffffffffffff,%rax
jne    117c <get_file_length+0x5c>
movl   $0xffffffff,-0x14(%rbp)
jmp    1181 <get_file_length+0x61>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_length>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
test   %eax,%eax
jne    1155 <get_file_length+0x35>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ecx
mov    %eax,(%r14)
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i32 @get_file_length(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* @SEEK_END
%8 = call i32 @fseek(i32* %6, i64 0, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = call i32 @ftell(i32* %12)
%14 = load i32*, i32** %4
store i32 %13, i32* %14
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = icmp eq i64 %17, -1
br i1 %18, label %19, label %20
19: ; preds = %11
store i32 -1, i32* %5
br label %20
20: ; preds = %19, %11
br label %21
21: ; preds = %20, %2
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i32 @get_file_length(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @ftell(i32* %0)
store i32 %7, i32* %1
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ %4, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
double pochhammer_func(double, int, int);
double rising_fact(double x, int n) { return pochhammer_func(x, n, 1); }


x86 assembly (clang, -O0):
<rising_fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1030 <pochhammer_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rising_fact>:
mov    $0x1,%esi
jmp    1030 <pochhammer_func@plt>

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

LLVM IR (-O2):
define double @rising_fact(double %0, i32 %1) {
%3 = tail call double @pochhammer_func(double %0, i32 %1, i32 1)
ret double %3
}
void debug_check_no_locks_freed(const void *from, unsigned long len) {}


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

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

LLVM IR (-O0):
define void @debug_check_no_locks_freed(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @debug_check_no_locks_freed(i8* nocapture %0, i64 %1) {
ret void
}
unsigned long long get_tick_count(void) {
  unsigned long long result;
  __asm__ volatile("xor %%eax, %%eax\n\t"
                   "mov %%rbx, %%r10\n\t"
                   "cpuid\n\t"
                   "rdtsc\n\t"
                   "mov %%r10, %%rbx\n\t"
                   "shl $32, %%rdx\n\t"
                   "or %%rdx, %%rax\n"
                   : "=A"(result)
                   :
                   : "ecx", "edx", "r10");
  return result;
}


x86 assembly (clang, -O0):
<get_tick_count>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %rbx,%r10
cpuid
rdtsc
mov    %r10,%rbx
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tick_count>:
xor    %eax,%eax
mov    %rbx,%r10
cpuid
rdtsc
mov    %r10,%rbx
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @get_tick_count() {
%1 = alloca i64
%2 = call i64 asm sideeffect "xor %eax, %eax\0A\09mov %rbx, %r10\0A\09cpuid\0A\09rdtsc\0A\09mov %r10, %rbx\0A\09shl $$32, %rdx\0A\09or %rdx, %rax\0A", "=A,~{ecx},~{edx},~{r10},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_tick_count() {
%1 = tail call i64 asm sideeffect "xor %eax, %eax\0A\09mov %rbx, %r10\0A\09cpuid\0A\09rdtsc\0A\09mov %r10, %rbx\0A\09shl $$32, %rdx\0A\09or %rdx, %rax\0A", "=A,~{ecx},~{edx},~{r10},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() {
  printf("BDT clld\n");
  printf("Copyright (c) 2008-2011 Brown Deer Technology, LLC."
         " All Rights Reserved.\n");
  printf("This program is free software distributed under GPLv3.\n");
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"BDT clld\0A\00"
@.str.1 = [74 x i8] c"Copyright (c) 2008-2011 Brown Deer Technology, LLC. All Rights Reserved.\0A\00"
@.str.2 = [56 x i8] c"This program is free software distributed under GPLv3.\0A\00"
define void @version() {
%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 ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"BDT clld\00"
@str.3 = [73 x i8] c"Copyright (c) 2008-2011 Brown Deer Technology, LLC. All Rights Reserved.\00"
@str.4 = [55 x i8] c"This program is free software distributed under GPLv3.\00"
define void @version() {
%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 ([73 x i8], [73 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ wctype_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int iswctype(int /*<<< orphan*/, int /*<<< orphan*/);
int iswctype_l(wint_t c, wctype_t t, locale_t l) { return iswctype(c, t); }


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

x86 assembly (clang, -O2):
<iswctype_l>:
jmp    1030 <iswctype@plt>

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

LLVM IR (-O2):
define i32 @iswctype_l(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @iswctype(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
long long INT_MAX;
long long INT_MIN;
long long str2ll(char const *);
int wet_str2int(const char *s) {
  int ret;
  long long n;
  n = str2ll(s);
  if (n > INT_MAX)
    ret = INT_MAX;
  else if (n < INT_MIN)
    ret = INT_MIN;
  else
    ret = (int)n;
  return ret;
}


x86 assembly (clang, -O0):
<wet_str2int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <str2ll@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2eb4(%rip),%rcx
cmp    (%rcx),%rax
jle    114f <wet_str2int+0x3f>
mov    0x2ea4(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
jmp    1181 <wet_str2int+0x71>
mov    -0x18(%rbp),%rax
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
jge    1175 <wet_str2int+0x65>
mov    0x2e76(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
jmp    117c <wet_str2int+0x6c>
mov    -0x18(%rbp),%rax
mov    %eax,-0xc(%rbp)
jmp    1181 <wet_str2int+0x71>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wet_str2int>:
push   %rax
call   1030 <str2ll@plt>
mov    0x2ecb(%rip),%rcx
mov    0x2ebc(%rip),%rdx
mov    (%rdx),%rdx
cmp    %rdx,%rax
cmovge %eax,%edx
mov    (%rcx),%rcx
cmp    %rcx,%rax
cmovle %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@INT_MAX = global i64 0
@INT_MIN = global i64 0
define i32 @wet_str2int(i8* %0) {
%2 = tail call i64 @str2ll(i8* %0)
%3 = load i64, i64* @INT_MAX
%4 = icmp sgt i64 %2, %3
%5 = load i64, i64* @INT_MIN
%6 = icmp slt i64 %2, %5
%7 = select i1 %6, i64 %5, i64 %2
%8 = select i1 %4, i64 %3, i64 %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
void mypause(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @mypause(i8* nocapture %0) {
ret void
}
__attribute__((visibility("default"))) void
SetInputCallback(void (*callback)(void)) {}


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

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

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

LLVM IR (-O2):
define void @SetInputCallback(void ()* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *program) {
  printf("usage: %s <filename>\n", program);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"usage: %s <filename>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"usage: %s <filename>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void div_const_Bad() {
  int a[2];
  int x = 5 / 2;
  a[x] = 0;
}


x86 assembly (clang, -O0):
<div_const_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movl   $0x0,-0x8(%rbp,%rax,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @div_const_Bad() {
%1 = alloca [2 x i32]
%2 = alloca i32
store i32 2, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 %4
store i32 0, i32* %5
ret void
}

LLVM IR (-O2):
define void @div_const_Bad() {
ret void
}
int sort_floats(const void *arg1, const void *arg2) {
  float diff = *((float *)arg1) - *((float *)arg2);
  if (diff > 0) {
    return 1;
  } else if (diff < 0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<sort_floats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    113e <sort_floats+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    115e <sort_floats+0x5e>
xorps  %xmm0,%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    1157 <sort_floats+0x57>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <sort_floats+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_floats>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
xorps  %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sort_floats(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
%13 = fsub float %9, %12
store float %13, float* %6
%14 = load float, float* %6
%15 = fcmp ogt float %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %22
17: ; preds = %2
%18 = load float, float* %6
%19 = fcmp olt float %18, 0.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 -1, i32* %3
br label %22
21: ; preds = %17
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %16
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @sort_floats(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fsub float %4, %6
%8 = fcmp ogt float %7, 0.000000e+00
%9 = fcmp olt float %7, 0.000000e+00
%10 = sext i1 %9 to i32
%11 = select i1 %8, i32 1, i32 %10
ret i32 %11
}
void op0x00(void) { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @op0x00() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ recv_ack();
scalar_t__ send_msg(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ strlen(char *);
void log_trail() {
  char buf[80];
  sprintf(buf, "C TRAIL\n");
  if (send_msg(buf, strlen(buf))) {
    recv_ack();
  }
}


x86 assembly (clang, -O0):
<log_trail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,%esi
call   1050 <send_msg@plt>
cmp    $0x0,%rax
je     1185 <log_trail+0x45>
mov    $0x0,%al
call   1030 <recv_ack@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_trail>:
push   %rbx
sub    $0x50,%rsp
movabs $0xa4c494152542043,%rax
49 4c 0a
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <send_msg@plt>
test   %rax,%rax
je     1169 <log_trail+0x39>
xor    %eax,%eax
call   1030 <recv_ack@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"C TRAIL\0A\00"
define void @log_trail() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = call i64 @send_msg(i8* %4, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @recv_ack()
br label %11
11: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"C TRAIL\0A\00"
define void @log_trail() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i64 @send_msg(i8* %2, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @recv_ack()
br label %8
8: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ make_tree(int, int, int, int);
void test_main(void) { make_tree(4, 3, 3, 4); }


x86 assembly (clang, -O0):
<test_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%ecx
mov    $0x3,%edx
mov    %ecx,%edi
mov    %edx,%esi
call   1030 <make_tree@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_main>:
mov    $0x4,%edi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
jmp    1030 <make_tree@plt>

LLVM IR (-O0):
define void @test_main() {
%1 = call i32 @make_tree(i32 4, i32 3, i32 3, i32 4)
ret void
}

LLVM IR (-O2):
define void @test_main() {
%1 = tail call i32 @make_tree(i32 4, i32 3, i32 3, i32 4)
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void AONRTCModeCh1Set(uint32_t ui32Mode) {

  ;
  (*((volatile unsigned long
          *)(((unsigned long)(0x40092000 + 0x00000014) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40092000 + 0x00000014) & 0x000FFFFF) << 5) |
             ((9) << 2)))) = ui32Mode;
}


x86 assembly (clang, -O0):
<AONRTCModeCh1Set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x432402a4,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONRTCModeCh1Set>:
mov    %rdi,0x432402a4
43
ret

LLVM IR (-O0):
define void @AONRTCModeCh1Set(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1126433444 to i64*)
ret void
}

LLVM IR (-O2):
define void @AONRTCModeCh1Set(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1126433444 to i64*)
ret void
}
int test_imm_B7int16_reg(short val) {
  return ((val) & (0xB7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B7int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xb7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B7int16_reg>:
test   $0xb7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B7int16_reg(i16 signext %0) {
%2 = and i16 %0, 183
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
int close_connection(int socket_desc) {
  if (close(socket_desc) == -1) {
    perror("Error while closing socket");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<close_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1154 <close_connection+0x34>
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <close_connection+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_connection>:
push   %rax
call   1030 <close@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <close_connection+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Error while closing socket\00"
define i32 @close_connection(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @close(i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [27 x i8] c"Error while closing socket\00"
define i32 @close_connection(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int fix_angle(int);
int index_160_to_deg(int idx) { return (fix_angle(idx * 45 / 2)); }


x86 assembly (clang, -O0):
<index_160_to_deg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x2d,-0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <fix_angle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_160_to_deg>:
lea    (%rdi,%rdi,8),%eax
lea    (%rax,%rax,4),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
jmp    1030 <fix_angle@plt>

LLVM IR (-O0):
define i32 @index_160_to_deg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 45
%5 = sdiv i32 %4, 2
%6 = call i32 @fix_angle(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @index_160_to_deg(i32 %0) {
%2 = mul nsw i32 %0, 45
%3 = sdiv i32 %2, 2
%4 = tail call i32 @fix_angle(i32 %3)
ret i32 %4
}
const char *tai__match_string(const char *s, const char *str) {
  while (*str) {
    if (*str != *s)
      return 0;
    s++;
    str++;
  }
  return s;
}


x86 assembly (clang, -O0):
<tai__match_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <tai__match_string+0x59>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     113c <tai__match_string+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    1161 <tai__match_string+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <tai__match_string+0xc>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tai__match_string>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1123 <tai__match_string+0x23>
add    $0x1,%rsi
nopl   (%rax)
cmp    (%rax),%cl
jne    1124 <tai__match_string+0x24>
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <tai__match_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @tai__match_string(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %0, %2 ], [ %12, %11 ], [ null, %5 ]
ret i8* %17
}
/* Variables and functions */
int f(int, int);
int g(int, int);
int main() { return f(1, 2) - g(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <g@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <g@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 1, i32 2)
%3 = call i32 @g(i32 1, i32 2)
%4 = sub nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2)
%2 = tail call i32 @g(i32 1, i32 2)
%3 = sub nsw i32 %1, %2
ret i32 %3
}
void RTMemEfDupExNP(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemEfDupExNP() {
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
void file_close(int fd) {
  int close_return_value = close(fd);
  if (close_return_value < 0) {
    perror("Error while closing");
  }
}


x86 assembly (clang, -O0):
<file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114c <file_close+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_close>:
push   %rax
call   1030 <close@plt>
test   %eax,%eax
js     112c <file_close+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Error while closing\00"
define void @file_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Error while closing\00"
define void @file_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct callbacks {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close_log();
void logging_exit(struct callbacks *cb) { close_log(); }


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

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

LLVM IR (-O0):
%struct.callbacks = type { i32 }
define void @logging_exit(%struct.callbacks* %0) {
%2 = alloca %struct.callbacks*
store %struct.callbacks* %0, %struct.callbacks** %2
%3 = call i32 (...) @close_log()
ret void
}

LLVM IR (-O2):
%struct.callbacks = type { i32 }
define void @logging_exit(%struct.callbacks* nocapture readnone %0) {
%2 = tail call i32 (...) @close_log()
ret void
}
/* Variables and functions */
int rl_maybe_unsave_line();
int maybe_unsave_line() { return rl_maybe_unsave_line(); }


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

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

LLVM IR (-O0):
define i32 @maybe_unsave_line() {
%1 = call i32 (...) @rl_maybe_unsave_line()
ret i32 %1
}

LLVM IR (-O2):
define i32 @maybe_unsave_line() {
%1 = tail call i32 (...) @rl_maybe_unsave_line()
ret i32 %1
}
int pad_array(int *buffer, int offset, int count) {
  int i;
  for (i = 0; i < count; i++)
    buffer[i + offset] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<pad_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1143 <pad_array+0x43>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <pad_array+0x15>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad_array>:
test   %edx,%edx
jle    112d <pad_array+0x1d>
push   %rax
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
mov    %edx,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pad_array(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr i32, i32* %0, i64 %6
%8 = bitcast i32* %7 to i8*
%9 = zext i32 %2 to i64
%10 = shl nuw nsw i64 %9, 2
br label %11
11: ; preds = %5, %3
ret i32 0
}
void glutReshapeFunc(void (*func)(int w, int h)) {}


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

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

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

LLVM IR (-O2):
define void @glutReshapeFunc(void (i32, i32)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, const char *argv[]) {
  puts("1.849016");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@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 = [9 x i8] c"1.849016\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"1.849016\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int getchar(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getchar() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  float a, r;
  r = 22.4;
  a = 3.1415 * r * r;
  printf("hello\n");
  printf("Hello world! %f\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
movsd  0xec4(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
@.str.1 = [17 x i8] c"Hello world! %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0x4036666660000000, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fmul double 3.141500e+00, %5
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fmul double %6, %8
%10 = fptrunc double %9 to float
store float %10, float* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %13)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"Hello world! %f\0A\00"
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0x4098A11DA0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ msgbuf_exit();
void pipe_unix_exit(void) { msgbuf_exit(); }


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

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

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

LLVM IR (-O2):
define void @pipe_unix_exit() {
%1 = tail call i32 (...) @msgbuf_exit()
ret void
}
unsigned long int getulong(unsigned char *buffer, int offset) {
  return (unsigned long)buffer[offset] |
         ((unsigned long)buffer[offset + 1] << 8L) |
         ((unsigned long)buffer[offset + 2] << 16L) |
         ((unsigned long)buffer[offset + 3] << 24L);
}


x86 assembly (clang, -O0):
<getulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getulong>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%eax
ret

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

LLVM IR (-O2):
define i64 @getulong(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = add nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 8
%13 = or i64 %12, %6
%14 = add nsw i32 %1, 2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i64
%19 = shl nuw nsw i64 %18, 16
%20 = or i64 %13, %19
%21 = add nsw i32 %1, 3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %0, i64 %22
%24 = load i8, i8* %23
%25 = zext i8 %24 to i64
%26 = shl nuw nsw i64 %25, 24
%27 = or i64 %20, %26
ret i64 %27
}
/* Variables and functions */
scalar_t__ ft_isalnum(int);
int ft_ischar(int c) { return (ft_isalnum(c) || c == '$'); }


x86 assembly (clang, -O0):
<ft_ischar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <ft_ischar+0x2f>
cmpl   $0x24,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ischar>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x24,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_ischar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ft_isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 36
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @ft_ischar(i32 %0) {
%2 = tail call i64 @ft_isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 36
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned SK_USHIFT16(unsigned x) { return x >> 16; }


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

x86 assembly (clang, -O2):
<SK_USHIFT16>:
mov    %edi,%eax
shr    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @SK_USHIFT16(i32 %0) {
%2 = lshr i32 %0, 16
ret i32 %2
}
int test_imm_7Fuint8_mem(unsigned char *val) {
  return ((*val) & (-0x7F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -127
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}