xunge/DecIR huggingface dataset:
/* Variables and functions */
int STC31xx_ReadUnsignedWord16(int, unsigned short *);
int STC31xx_GetRunningCounter(void) {
  unsigned short value;
  int status;
  status = STC31xx_ReadUnsignedWord16(0x04, &value);
  if (status < 0)
    value = -1;
  return ((int)value);
}


x86 assembly (clang, -O0):
<STC31xx_GetRunningCounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
lea    -0x2(%rbp),%rsi
call   1030 <STC31xx_ReadUnsignedWord16@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1139 <STC31xx_GetRunningCounter+0x29>
movw   $0xffff,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC31xx_GetRunningCounter>:
push   %rax
lea    0x6(%rsp),%rsi
mov    $0x4,%edi
call   1030 <STC31xx_ReadUnsignedWord16@plt>
test   %eax,%eax
movzwl 0x6(%rsp),%ecx
mov    $0xffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @STC31xx_GetRunningCounter() {
%1 = alloca i16
%2 = alloca i32
%3 = call i32 @STC31xx_ReadUnsignedWord16(i32 4, i16* %1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i16 -1, i16* %1
br label %7
7: ; preds = %6, %0
%8 = load i16, i16* %1
%9 = zext i16 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @STC31xx_GetRunningCounter() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = call i32 @STC31xx_ReadUnsignedWord16(i32 4, i16* %1)
%4 = icmp slt i32 %3, 0
%5 = load i16, i16* %1
%6 = zext i16 %5 to i32
%7 = select i1 %4, i32 65535, i32 %6
ret i32 %7
}
/* Variables and functions */
double exp(double);
double f(double x) { return exp(-x * x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movapd 0xee8(%rip),%xmm1
xorpd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = call double @exp(double %6)
ret double %7
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fneg double %0
%3 = fmul double %2, %0
%4 = tail call double @exp(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
void *ccr_malloc(size_t length) {
  void *ptr = malloc(length);
  assert(ptr != NULL);
  return ptr;
}


x86 assembly (clang, -O0):
<ccr_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccr_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ccr_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @ccr_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello!\n");
  printf("This line, is updated in a local machine\n");
  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 <printf@plt>
lea    0xecf(%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>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Hello!\0A\00"
@.str.1 = [42 x i8] c"This line, is updated in a local machine\0A\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 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Hello!\00"
@str.2 = [41 x i8] c"This line, is updated in a local machine\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
size_t sizeof_option_str(uint8_t code, size_t datalen) {
  if (code == 0x00 || code == 0xff)
    return 1;
  return 2 + datalen;
}


x86 assembly (clang, -O0):
<sizeof_option_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1122 <sizeof_option_str+0x22>
cmpl   $0xff,-0xc(%rbp)
jne    112f <sizeof_option_str+0x2f>
movq   $0x1,-0x8(%rbp)
jmp    113b <sizeof_option_str+0x3b>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizeof_option_str>:
mov    $0x1,%eax
test   %edi,%edi
je     1111 <sizeof_option_str+0x11>
cmp    $0xff,%edi
jne    1112 <sizeof_option_str+0x12>
ret
add    $0x2,%rsi
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @sizeof_option_str(i32 %0, i64 %1) {
switch i32 %0, label %3 [
i32 255, label %5
i32 0, label %5
]
3: ; preds = %2
%4 = add i64 %1, 2
br label %5
5: ; preds = %2, %2, %3
%6 = phi i64 [ %4, %3 ], [ 1, %2 ], [ 1, %2 ]
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ unmask_shutter();
void sig_handler(int signo) {
  printf("Caught INT signal - Exiting ...\n");
  unmask_shutter();
  exit(0);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <unmask_shutter@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O0):
@.str = [33 x i8] c"Caught INT signal - Exiting ...\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @unmask_shutter()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [32 x i8] c"Caught INT signal - Exiting ...\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @unmask_shutter()
%4 = tail call i32 @exit(i32 0)
unreachable
}
void g_ptr_array_sort() {}


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

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

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

LLVM IR (-O2):
define void @g_ptr_array_sort() {
ret void
}
void dsk_report(const char *s) {}


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

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

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

LLVM IR (-O2):
define void @dsk_report(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mdelay(int);
void delay_1us_more(void) { mdelay(1); }


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

x86 assembly (clang, -O2):
<delay_1us_more>:
mov    $0x1,%edi
jmp    1030 <mdelay@plt>

LLVM IR (-O0):
define void @delay_1us_more() {
%1 = call i32 @mdelay(i32 1)
ret void
}

LLVM IR (-O2):
define void @delay_1us_more() {
%1 = tail call i32 @mdelay(i32 1)
ret void
}
int test_imm_56uint8_mem(unsigned char *val) {
  return ((*val) & (0x56 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_56uint8_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, 86
%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_56uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 86
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int nest2();
int nest1() { return nest2(); }


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

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

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

LLVM IR (-O2):
define i32 @nest1() {
%1 = tail call i32 (...) @nest2()
ret i32 %1
}
/* Variables and functions */
int _assign_handler(long, unsigned long, unsigned long);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
unsigned long mon_assignhandler(long hnum, unsigned long arg1,
                                unsigned long arg2) {
  int ret;
  monLock();
  ret = _assign_handler(hnum, arg1, arg2);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_assignhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <_assign_handler@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
movslq -0x1c(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_assignhandler>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <_assign_handler@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
movslq %ebx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @mon_assignhandler(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = call i32 (...) @monLock()
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = call i32 @_assign_handler(i64 %9, i64 %10, i64 %11)
store i32 %12, i32* %7
%13 = call i32 (...) @monUnlock()
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
ret i64 %15
}

LLVM IR (-O2):
define i64 @mon_assignhandler(i64 %0, i64 %1, i64 %2) {
%4 = tail call i32 (...) @monLock()
%5 = tail call i32 @_assign_handler(i64 %0, i64 %1, i64 %2)
%6 = tail call i32 (...) @monUnlock()
%7 = sext i32 %5 to i64
ret i64 %7
}
void f() {
  struct {
    int a;
    float b;
  };
}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cu_run(int, char **);
int /*<<< orphan*/ cu_set_out_prefix(char *);
int main(int argc, char *argv[]) {
  cu_set_out_prefix("regressions/");
  cu_run(argc, argv);
  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    0xec3(%rip),%rdi
call   1030 <cu_set_out_prefix@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <cu_run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1030 <cu_set_out_prefix@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <cu_run@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"regressions/\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 @cu_set_out_prefix(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @cu_run(i32 %7, i8** %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"regressions/\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @cu_set_out_prefix(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @cu_run(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int gethostname(char *name, size_t len) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<gethostname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostname>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @gethostname(i8* nocapture readnone %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  printf("%d", 2 * a * b * c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
imul   -0xc(%rbp),%esi
imul   -0x10(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
imul   0x10(%rsp),%esi
imul   0xc(%rsp),%esi
add    %esi,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = shl nsw i32 %8, 1
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = mul nsw i32 %11, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}
void mod_tcpd_is_dlclose_safe() {}


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

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

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

LLVM IR (-O2):
define void @mod_tcpd_is_dlclose_safe() {
ret void
}
int implies(int a, int b) { return a ? b : 1; }


x86 assembly (clang, -O0):
<implies>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <implies+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112c <implies+0x2c>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <implies+0x2c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<implies>:
test   %edi,%edi
mov    $0x1,%eax
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @implies(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 1, i32 %1
ret i32 %4
}
void foo_2_1_2_1_1_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_1_1_2_1_1() {
ret void
}
char *MIMEH_absorb_whitespace(char *p) {
  if (p) {
    while ((*p != '\0') && ((*p == ' ') || (*p == '\t')))
      p++;
  }
  return p;
}


x86 assembly (clang, -O0):
<MIMEH_absorb_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117e <MIMEH_absorb_whitespace+0x7e>
jmp    1118 <MIMEH_absorb_whitespace+0x18>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1158 <MIMEH_absorb_whitespace+0x58>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1152 <MIMEH_absorb_whitespace+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1168 <MIMEH_absorb_whitespace+0x68>
jmp    1179 <MIMEH_absorb_whitespace+0x79>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1118 <MIMEH_absorb_whitespace+0x18>
jmp    117e <MIMEH_absorb_whitespace+0x7e>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIMEH_absorb_whitespace>:
test   %rdi,%rdi
je     1122 <MIMEH_absorb_whitespace+0x22>
mov    %rdi,%rax
jmp    1114 <MIMEH_absorb_whitespace+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <MIMEH_absorb_whitespace+0x10>
cmp    $0x9,%cl
je     1110 <MIMEH_absorb_whitespace+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @MIMEH_absorb_whitespace(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 9, label %6
i8 32, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %9
}
void stop_master_listen(master_socket_val) int master_socket_val;
{ close(master_socket_val); }


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

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

LLVM IR (-O0):
define void @stop_master_listen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %3)
ret void
}

LLVM IR (-O2):
define void @stop_master_listen(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vreportf(char *, char *, char const *, int /*<<< orphan*/);
void warn_builtin(const char *fmt, va_list params) {
  vreportf("[W] ", "", fmt, params);
}


x86 assembly (clang, -O0):
<warn_builtin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xed3(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <vreportf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_builtin>:
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee4(%rip),%rdi
lea    0xee1(%rip),%rsi
jmp    1030 <vreportf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"[W] \00"
@.str.1 = [1 x i8] zeroinitializer
define void @warn_builtin(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 @vreportf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"[W] \00"
@.str.1 = [1 x i8] zeroinitializer
define void @warn_builtin(i8* %0, i32 %1) {
%3 = tail call i32 @vreportf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_usage(char *argv[]) {
  printf("usage: %s <interface>\n", argv[0]);
  printf("Interfaces:\n");
  printf("\tremendo --gtk\n");
  printf("\tremendo --qt\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    (%rdi),%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"usage: %s <interface>\0A\00"
@.str.1 = [13 x i8] c"Interfaces:\0A\00"
@.str.2 = [16 x i8] c"\09remendo --gtk\0A\00"
@.str.3 = [15 x i8] c"\09remendo --qt\0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s <interface>\0A\00"
@str = [12 x i8] c"Interfaces:\00"
@str.4 = [15 x i8] c"\09remendo --gtk\00"
@str.5 = [14 x i8] c"\09remendo --qt\00"
define void @print_usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
ret void
}
void memory_barrier(void) { asm volatile("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @memory_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct statfs {
  int f_bsize;
  scalar_t__ f_bfree;
};

/* Variables and functions */
int /*<<< orphan*/ statfs(char *, struct statfs *);
int tst_cwd_has_free(int required_kib) {
  struct statfs sf;
  statfs(".", &sf);
  return ((float)sf.f_bfree) / (1024 / sf.f_bsize) >= required_kib ? 1 : 0;
}


x86 assembly (clang, -O0):
<tst_cwd_has_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <statfs@plt>
cvtsi2ssq -0x10(%rbp),%xmm0
mov    $0x400,%eax
cltd
idivl  -0x18(%rbp)
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmovae %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_cwd_has_free>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xee2(%rip),%rdi
mov    %rsp,%rsi
call   1030 <statfs@plt>
cvtsi2ssq 0x8(%rsp),%xmm0
mov    $0x400,%eax
xor    %edx,%edx
idivl  (%rsp)
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %ebx,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.statfs = type { i32, i64 }
@.str = [2 x i8] c".\00"
define i32 @tst_cwd_has_free(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.statfs
store i32 %0, i32* %2
%4 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %3)
%5 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to float
%8 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = sdiv i32 1024, %9
%11 = sitofp i32 %10 to float
%12 = fdiv float %7, %11
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to float
%15 = fcmp oge float %12, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
ret i32 %17
}

LLVM IR (-O2):
%struct.statfs = type { i32, i64 }
@.str = [2 x i8] c".\00"
define i32 @tst_cwd_has_free(i32 %0) {
%2 = alloca %struct.statfs
%3 = bitcast %struct.statfs* %2 to i8*
%4 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %2)
%5 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to float
%8 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = sdiv i32 1024, %9
%11 = sitofp i32 %10 to float
%12 = fdiv float %7, %11
%13 = sitofp i32 %0 to float
%14 = fcmp oge float %12, %13
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_string(int, char const *);
void print_info(const char *str) { __console_tx_string(6, str); }


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

x86 assembly (clang, -O2):
<print_info>:
mov    %rdi,%rsi
mov    $0x6,%edi
jmp    1030 <__console_tx_string@plt>

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

LLVM IR (-O2):
define void @print_info(i8* %0) {
%2 = tail call i32 @__console_tx_string(i32 6, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void printk(const char *msg) { fputs(msg, stderr); }


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

x86 assembly (clang, -O2):
<printk>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
define void @printk(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Type definitions */
struct blz_state {
  int dummy;
};

/* Variables and functions */
unsigned long blz_getbit(struct blz_state *);
unsigned long blz_getgamma(struct blz_state *bs) {
  unsigned long result = 1;
  do {
    result = (result << 1) + blz_getbit(bs);
  } while (blz_getbit(bs));
  return result;
}


x86 assembly (clang, -O0):
<blz_getgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <blz_getbit@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <blz_getbit@plt>
cmp    $0x0,%rax
jne    1124 <blz_getgamma+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blz_getgamma>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <blz_getbit@plt>
lea    (%rax,%rbx,2),%rbx
mov    %r14,%rdi
call   1030 <blz_getbit@plt>
test   %rax,%rax
jne    1120 <blz_getgamma+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.blz_state = type { i32 }
define i64 @blz_getgamma(%struct.blz_state* %0) {
%2 = alloca %struct.blz_state*
%3 = alloca i64
store %struct.blz_state* %0, %struct.blz_state** %2
store i64 1, i64* %3
br label %4
4: ; preds = %10, %1
%5 = load i64, i64* %3
%6 = shl i64 %5, 1
%7 = load %struct.blz_state*, %struct.blz_state** %2
%8 = call i64 @blz_getbit(%struct.blz_state* %7)
%9 = add i64 %6, %8
store i64 %9, i64* %3
br label %10
10: ; preds = %4
%11 = load %struct.blz_state*, %struct.blz_state** %2
%12 = call i64 @blz_getbit(%struct.blz_state* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %10
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
%struct.blz_state = type { i32 }
define i64 @blz_getgamma(%struct.blz_state* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 1, %1 ], [ %6, %2 ]
%4 = shl i64 %3, 1
%5 = tail call i64 @blz_getbit(%struct.blz_state* %0)
%6 = add i64 %4, %5
%7 = tail call i64 @blz_getbit(%struct.blz_state* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret i64 %6
}
int checksum(char *message) {
  int c = 0;
  while (*message) {
    c += c ^ (int)(*message);
    message++;
  }
  return c;
}


x86 assembly (clang, -O0):
<checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <checksum+0x3f>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <checksum+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @checksum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = xor i32 %6, %8
%10 = add nsw i32 %9, %6
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Type definitions */
struct AVLTree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AVLTreeClear(struct AVLTree *);
int /*<<< orphan*/ free(struct AVLTree *);
void AVLTreeDelete(struct AVLTree *tree) {
  AVLTreeClear(tree);
  free(tree);
  tree = NULL;
}


x86 assembly (clang, -O0):
<AVLTreeDelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <AVLTreeClear@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AVLTreeDelete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <AVLTreeClear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.AVLTree = type { i32 }
define void @AVLTreeDelete(%struct.AVLTree* %0) {
%2 = alloca %struct.AVLTree*
store %struct.AVLTree* %0, %struct.AVLTree** %2
%3 = load %struct.AVLTree*, %struct.AVLTree** %2
%4 = call i32 @AVLTreeClear(%struct.AVLTree* %3)
%5 = load %struct.AVLTree*, %struct.AVLTree** %2
%6 = call i32 @free(%struct.AVLTree* %5)
store %struct.AVLTree* null, %struct.AVLTree** %2
ret void
}

LLVM IR (-O2):
%struct.AVLTree = type { i32 }
define void @AVLTreeDelete(%struct.AVLTree* %0) {
%2 = tail call i32 @AVLTreeClear(%struct.AVLTree* %0)
%3 = tail call i32 @free(%struct.AVLTree* %0)
ret void
}
int ch5_int_min(int a, int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<ch5_int_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <ch5_int_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <ch5_int_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch5_int_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ch5_int_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int __catgets_error_code();
int __catgetmsg_error_code(void) { return (__catgets_error_code()); }


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

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

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

LLVM IR (-O2):
define i32 @__catgetmsg_error_code() {
%1 = tail call i32 (...) @__catgets_error_code()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char string[] = "Hello World";
  printf("%s\n", string);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x8(%rsp)
movl   $0x646c72,0x10(%rsp)
lea    0xeda(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.string = [12 x i8] c"Hello World\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
double ViewAngle(theta)
double theta;
{
  double y, a;
  a = ((theta < 0.0) ? -theta : theta);
  if (a >= 180.0)
    a = 179.0;
  y = tan((180.0 - a) * 0.0087266462599715) * 320;
  return ((double)y);
}


x86 assembly (clang, -O0):
<ViewAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1151 <ViewAngle+0x41>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    115b <ViewAngle+0x4b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe8e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1189 <ViewAngle+0x79>
movsd  0xe84(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe6f(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xe7a(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <tan@plt>
movsd  0xe61(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ViewAngle>:
push   %rax
movapd 0xee7(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
movsd  0xed2(%rip),%xmm0
movapd %xmm0,%xmm1
subsd  %xmm3,%xmm1
movsd  0xeca(%rip),%xmm2
mulsd  %xmm2,%xmm1
cmpnlesd %xmm3,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
call   1030 <tan@plt>
mulsd  0xeb0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ViewAngle(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %12
10: ; preds = %1
%11 = load double, double* %2
br label %12
12: ; preds = %10, %7
%13 = phi double [ %9, %7 ], [ %11, %10 ]
store double %13, double* %4
%14 = load double, double* %4
%15 = fcmp oge double %14, 1.800000e+02
br i1 %15, label %16, label %17
16: ; preds = %12
store double 1.790000e+02, double* %4
br label %17
17: ; preds = %16, %12
%18 = load double, double* %4
%19 = fsub double 1.800000e+02, %18
%20 = fmul double %19, 0x3F81DF46A2529CE4
%21 = call double @tan(double %20)
%22 = fmul double %21, 3.200000e+02
store double %22, double* %3
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @ViewAngle(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fcmp ult double %4, 1.800000e+02
%6 = fsub double 1.800000e+02, %4
%7 = fmul double %6, 0x3F81DF46A2529CE4
%8 = select i1 %5, double %7, double 0x3F81DF46A2529CE4
%9 = tail call double @tan(double %8)
%10 = fmul double %9, 3.200000e+02
ret double %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool bitArrayGet(const void *array, unsigned bit) {
  return (((uint32_t *)array)[(bit) / (sizeof(((uint32_t *)array)[0]) * 8)] &
          (1 << ((bit) % (sizeof(((uint32_t *)array)[0]) * 8))));
}


x86 assembly (clang, -O0):
<bitArrayGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x5,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
and    $0x1f,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitArrayGet>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x5,%ecx
and    (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @bitArrayGet(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = udiv i64 %8, 32
%10 = getelementptr inbounds i32, i32* %6, i64 %9
%11 = load i32, i32* %10
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = urem i64 %13, 32
%15 = trunc i64 %14 to i32
%16 = shl i32 1, %15
%17 = and i32 %11, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @bitArrayGet(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = lshr i32 %1, 5
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 %5
%7 = load i32, i32* %6
%8 = and i32 %1, 31
%9 = shl nuw i32 1, %8
%10 = and i32 %7, %9
ret i32 %10
}
void ARGBColorTableRow_X86() {}


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

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

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

LLVM IR (-O2):
define void @ARGBColorTableRow_X86() {
ret void
}
int seek_end_function(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @seek_end_function() {
ret i32 2
}

LLVM IR (-O2):
define i32 @seek_end_function() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ display_status_line();
void opcode_show_status(void) {
  ;
  ;
  display_status_line();
}


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

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

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

LLVM IR (-O2):
define void @opcode_show_status() {
%1 = tail call i32 (...) @display_status_line()
ret void
}
/* Variables and functions */
int strcmp(void *, void *);
int _strcmp(void *data, void *key) { return strcmp(data, key); }


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

x86 assembly (clang, -O2):
<_strcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int singleNumber(int *, int);
int main(int argc, char **argv) {
  int a[] = {1, 1, 2, 3, 3, 4, 5, 4, 5};
  printf("%d\n", singleNumber(a, 9));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
call   1030 <singleNumber@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <singleNumber@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

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