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

/* Variables and functions */
uint64_t rdtsc() {
  uint32_t lo, hi;
  __asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi));
  return (uint64_t)hi << 32 | lo;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rdtsc() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = shl i32 %6, 32
%8 = load i32, i32* %1
%9 = or i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rdtsc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
ret i32 poison
}
void XtSetSensitive() {}


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

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

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

LLVM IR (-O2):
define void @XtSetSensitive() {
ret void
}
/* Variables and functions */
size_t roundup_size(size_t s) { return (s + ((1 << 2) - 1)) & ~((1 << 2) - 1); }


x86 assembly (clang, -O0):
<roundup_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
and    $0xfffffffffffffffc,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_size>:
lea    0x3(%rdi),%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i64 @roundup_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 3
%5 = and i64 %4, -4
ret i64 %5
}

LLVM IR (-O2):
define i64 @roundup_size(i64 %0) {
%2 = add i64 %0, 3
%3 = and i64 %2, -4
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
void test_12b(void *p, void *q) { __analyzer_eval(p == q); }


x86 assembly (clang, -O0):
<test_12b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_12b>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
mov    %eax,%edi
jmp    1030 <__analyzer_eval@plt>

LLVM IR (-O0):
define void @test_12b(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @__analyzer_eval(i32 %8)
ret void
}

LLVM IR (-O2):
define void @test_12b(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @__analyzer_eval(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_dialog_hide_i(char const *);
void roadmap_download_show_space_ok(const char *name, void *context) {
  roadmap_dialog_hide_i(name);
}


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

x86 assembly (clang, -O2):
<roadmap_download_show_space_ok>:
jmp    1030 <roadmap_dialog_hide_i@plt>

LLVM IR (-O0):
define void @roadmap_download_show_space_ok(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 = call i32 @roadmap_dialog_hide_i(i8* %5)
ret void
}

LLVM IR (-O2):
define void @roadmap_download_show_space_ok(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @roadmap_dialog_hide_i(i8* %0)
ret void
}
/* Type definitions */
struct stat {
  size_t st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
size_t getfilesize(char *filename) {
  struct stat st;
  if (!stat(filename, &st)) {
    return st.st_size;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<getfilesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
jne    113f <getfilesize+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <getfilesize+0x37>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfilesize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
jne    1123 <getfilesize+0x13>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @getfilesize(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i64, i64* %9
store i64 %10, i64* %2
br label %12
11: ; preds = %1
store i64 0, i64* %2
br label %12
12: ; preds = %11, %8
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @getfilesize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 %7, i64 0
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void PWMSyncTimeBase(unsigned long ulBase, unsigned long ulGenBits) {
  DEBUG_ASSERT((ulBase == 0x40028000) || (ulBase == 0x40029000));
  DEBUG_ASSERT(
      !(ulGenBits & ~(0x00000001 | 0x00000002 | 0x00000004 | 0x00000008)));
  (*((volatile unsigned long *)(ulBase + 0x00000004))) = ulGenBits;
}


x86 assembly (clang, -O0):
<PWMSyncTimeBase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x40028000,-0x8(%rbp)
40
mov    %al,-0x11(%rbp)
je     1141 <PWMSyncTimeBase+0x31>
cmpq   $0x40029000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffff0,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMSyncTimeBase>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40028000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x10,%r14
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,0x4(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PWMSyncTimeBase(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073905664
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1073909760
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = and i64 %14, -16
%16 = icmp ne i64 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = call i32 @DEBUG_ASSERT(i32 %18)
%20 = load i64, i64* %4
%21 = load i64, i64* %3
%22 = add i64 %21, 4
%23 = inttoptr i64 %22 to i64*
store volatile i64 %20, i64* %23
ret void
}

LLVM IR (-O2):
define void @PWMSyncTimeBase(i64 %0, i64 %1) {
%3 = and i64 %0, -4097
%4 = icmp eq i64 %3, 1073905664
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = icmp ult i64 %1, 16
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = add i64 %0, 4
%11 = inttoptr i64 %10 to i64*
store volatile i64 %1, i64* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
void SigAlarm(int num) {
  printf("Test Timeout!\n");
  abort();
}


x86 assembly (clang, -O0):
<SigAlarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
@.str = [15 x i8] c"Test Timeout!\0A\00"
define void @SigAlarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@str = [14 x i8] c"Test Timeout!\00"
define void @SigAlarm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
extern int strlen(const char *s) {
  register int __res;
  __asm__("cld\n\t"
          "repne\n\t"
          "scasb\n\t"
          "notl %0\n\t"
          "decl %0"
          : "=c"(__res)
          : "D"(s), "a"(0), "0"(0xffffffff));
  return __res;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cld
repnz scas %es:(%rdi),%al
not    %ecx
dec    %ecx
mov    %ecx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
mov    $0xffffffff,%ecx
cld
repnz scas %es:(%rdi),%al
not    %ecx
dec    %ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 asm "cld\0A\09repne\0A\09scasb\0A\09notl $0\0A\09decl $0", "={cx},{di},{ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %4, i32 0, i32 -1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @strlen(i8* readnone %0) {
%2 = tail call i32 asm "cld\0A\09repne\0A\09scasb\0A\09notl $0\0A\09decl $0", "={cx},{di},{ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 0, i32 -1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ outb(int, int /*<<< orphan*/);
void set_pic1_mask(uint8_t mask) { outb(0x00A1, mask); }


x86 assembly (clang, -O0):
<set_pic1_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xa1,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pic1_mask>:
mov    %edi,%esi
mov    $0xa1,%edi
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @set_pic1_mask(i32 %0) {
%2 = tail call i32 @outb(i32 161, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void debug_str(const char *string) { printf("%s\r", string); }


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

x86 assembly (clang, -O2):
<debug_str>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0D\00"
define void @debug_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0D\00"
define void @debug_str(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _hi_free(void *ptr, const char *name, int line) {
  ;
  if (name == NULL && line == 1) {
  }
  free(ptr);
}


x86 assembly (clang, -O0):
<_hi_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113d <_hi_free+0x2d>
cmpl   $0x1,-0x14(%rbp)
jne    113d <_hi_free+0x2d>
jmp    113d <_hi_free+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hi_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_hi_free(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @free(i8* %0)
ret void
}
void IgnitionDwellISR() {}


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

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

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

LLVM IR (-O2):
define void @IgnitionDwellISR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello\n");
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  puts("This is a test");
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xed5(%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>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\0A\00"
@.str.1 = [15 x i8] c"This is a test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello\0A\00"
@.str.1 = [15 x i8] c"This is a test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _print_horiz(int);
int /*<<< orphan*/ printf(char *);
void print_st7565(void) {
  printf("/* 2010 Quinn Evans, 2020 David DiPaola. Licensed under CC0 (public "
         "domain, see https://creativecommons.org/publicdomain/zero/1.0/). */"
         "\n"
         "\n"
         "#ifndef __VINCENT_ST7565_H"
         "\n"
         "#define __VINCENT_ST7565_H"
         "\n"
         "\n"
         "static unsigned char vincent_st7565[] = {"
         "\n");
  _print_horiz(1);
  printf("};"
         "\n"
         "#define vincent_st7565_length (sizeof(vincent_st7565) / "
         "sizeof(*vincent_st7565))"
         "\n"
         "\n"
         "#endif"
         "\n");
}


x86 assembly (clang, -O0):
<print_st7565>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <_print_horiz@plt>
lea    0xfaa(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_st7565>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <_print_horiz@plt>
lea    0xfac(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [235 x i8] c"/* 2010 Quinn Evans, 2020 David DiPaola. Licensed under CC0 (public domain, see https://creativecommons.org/publicdomain/zero/1.0/). */\0A\0A#ifndef __VINCENT_ST7565_H\0A#define __VINCENT_ST7565_H\0A\0Astatic unsigned char vincent_st7565[] = {\0A\00"
@.str.1 = [93 x i8] c"};\0A#define vincent_st7565_length (sizeof(vincent_st7565) / sizeof(*vincent_st7565))\0A\0A#endif\0A\00"
define void @print_st7565() {
%1 = call i32 @printf(i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @_print_horiz(i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [234 x i8] c"/* 2010 Quinn Evans, 2020 David DiPaola. Licensed under CC0 (public domain, see https://creativecommons.org/publicdomain/zero/1.0/). */\0A\0A#ifndef __VINCENT_ST7565_H\0A#define __VINCENT_ST7565_H\0A\0Astatic unsigned char vincent_st7565[] = {\00"
@str.2 = [92 x i8] c"};\0A#define vincent_st7565_length (sizeof(vincent_st7565) / sizeof(*vincent_st7565))\0A\0A#endif\00"
define void @print_st7565() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([234 x i8], [234 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @_print_horiz(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int account_balance = 10;
  int product_cost = 20;
  assert(account_balance > 0);
  account_balance -= product_cost;
  assert(account_balance > 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
void breakpoint() {}


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

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

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

LLVM IR (-O2):
define void @breakpoint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sha1(unsigned char const *, size_t, unsigned char *);
int /*<<< orphan*/ sha1_to_hex(unsigned char *, char *);
void sha1_hex(const unsigned char *input, size_t ilen, char output[41]) {
  unsigned char raw[20];
  sha1(input, ilen, raw);
  sha1_to_hex(raw, output);
}


x86 assembly (clang, -O0):
<sha1_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <sha1@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <sha1_to_hex@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha1_hex>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %rsp,%r14
mov    %r14,%rdx
call   1030 <sha1@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <sha1_to_hex@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @sha1_hex(i8* %0, i64 %1, i8* %2) {
%4 = alloca [20 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%6 = call i32 @sha1(i8* %0, i64 %1, i8* %5)
%7 = call i32 @sha1_to_hex(i8* %5, i8* %2)
ret void
}
void mmtype_vlan_actions(struct mme_struct *mme) {}


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

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

LLVM IR (-O0):
%struct.mme_struct = type opaque
define void @mmtype_vlan_actions(%struct.mme_struct* %0) {
%2 = alloca %struct.mme_struct*
store %struct.mme_struct* %0, %struct.mme_struct** %2
ret void
}

LLVM IR (-O2):
%struct.mme_struct = type opaque
define void @mmtype_vlan_actions(%struct.mme_struct* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
char *skipNumeric(char *s) {
  while (isdigit(*s))
    ++s;
  return s;
}


x86 assembly (clang, -O0):
<skipNumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1143 <skipNumeric+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipNumeric+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipNumeric>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1120 <skipNumeric+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipNumeric(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isdigit(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @skipNumeric(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isdigit(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c_test1() { printf("c_test1\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"c_test1\00"
define void @c_test1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
void initialiseConstants(double *variables) {}


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

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

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

LLVM IR (-O2):
define void @initialiseConstants(double* nocapture %0) {
ret void
}
int sasl_mutex_lock(void *mutex __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sasl_mutex_lock(i8* nocapture readnone %0) {
ret i32 0
}
int ft_any(char **tab, int (*f)(char *)) {
  while (tab++)
    if (f(*tab) == 1)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1150 <ft_any+0x50>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rdi
call   *%rax
cmp    $0x1,%eax
jne    114b <ft_any+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1157 <ft_any+0x57>
jmp    1110 <ft_any+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_any>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
test   %rbx,%rbx
je     112c <ft_any+0x2c>
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
call   *%r14
cmp    $0x1,%eax
jne    1110 <ft_any+0x10>
mov    $0x1,%eax
jmp    112e <ft_any+0x2e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ft_any(i8** %0, i32 (i8*)* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8** [ %0, %2 ], [ %5, %7 ]
%5 = getelementptr inbounds i8*, i8** %4, i64 1
%6 = icmp eq i8** %4, null
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = load i8*, i8** %5
%9 = tail call i32 %1(i8* %8)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
int sumn(int n) {
  if (n == 0) {
    return 0;
  } else
    return (n + sumn(n - 1));
}


x86 assembly (clang, -O0):
<sumn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <sumn+0x21>
movl   $0x0,-0x4(%rbp)
jmp    114c <sumn+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sumn@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumn>:
test   %edi,%edi
je     1119 <sumn+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sumn(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ *get_back();
int /*<<< orphan*/ *get_front();
bool is_empty() {
  if (get_front() == NULL && get_back() == NULL)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_front@plt>
cmp    $0x0,%rax
jne    1156 <is_empty+0x36>
mov    $0x0,%al
call   1040 <get_back@plt>
cmp    $0x0,%rax
jne    1156 <is_empty+0x36>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_empty+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <get_front@plt>
test   %rax,%rax
jne    1140 <is_empty+0x20>
xor    %eax,%eax
call   1040 <get_back@plt>
test   %rax,%rax
jne    1140 <is_empty+0x20>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_empty() {
%1 = tail call i32* (...) @get_front()
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32* (...) @get_back()
%5 = icmp eq i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ q921_send_sabme(void *, int);
void q921_send_sabme_now(void *vpri) { q921_send_sabme(vpri, 1); }


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

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

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

LLVM IR (-O2):
define void @q921_send_sabme_now(i8* %0) {
%2 = tail call i32 @q921_send_sabme(i8* %0, i32 1)
ret void
}
/* Variables and functions */
float pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int radius;
  float pi = 3.1415;
  printf("Cirkelns radie: ");
  scanf("%d", &radius);
  printf("Cirklens omkrets: %f\n", pow(radius, 2) * pi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1050 <pow@plt>
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe91(%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    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0x2,%esi
call   1050 <pow@plt>
mulss  0xe9a(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Cirkelns radie: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Cirklens omkrets: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store float 0x400921CAC0000000, float* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call float @pow(i32 %6, i32 2)
%8 = load float, float* %3
%9 = fmul float %7, %8
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Cirkelns radie: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Cirklens omkrets: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call float @pow(i32 %5, i32 2)
%7 = fmul float %6, 0x400921CAC0000000
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}
/* Variables and functions */
int f451(int *);
int f452(int *p) { return f451(p); }


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

x86 assembly (clang, -O2):
<f452>:
jmp    1030 <f451@plt>

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

LLVM IR (-O2):
define i32 @f452(i32* %0) {
%2 = tail call i32 @f451(i32* %0)
ret i32 %2
}
void ShutdownSockets() {}


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

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

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

LLVM IR (-O2):
define void @ShutdownSockets() {
ret void
}
/* Variables and functions */
int vectordereales();
int main() {
  int num = vectordereales();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @vectordereales()
ret i32 0
}
/* Variables and functions */
void QGL_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @QGL_Shutdown() {
ret void
}
float Vector_Dot_Product(float vector1[3], float vector2[3]) {
  int c;
  float op = 0;
  for (c = 0; c < 3; c++) {
    op += vector1[c] * vector2[c];
  }
  return op;
}


x86 assembly (clang, -O0):
<Vector_Dot_Product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    115f <Vector_Dot_Product+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <Vector_Dot_Product+0x1b>
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector_Dot_Product>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  (%rsi),%xmm0
xorps  %xmm2,%xmm2
addss  %xmm0,%xmm2
mulss  0x4(%rsi),%xmm1
addss  %xmm2,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Vector_Dot_Product(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i32
%6 = alloca float
store float* %0, float** %3
store float* %1, float** %4
store float 0.000000e+00, float* %6
store i32 0, i32* %5
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load float*, float** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float, float* %11, i64 %13
%15 = load float, float* %14
%16 = load float*, float** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* %16, i64 %18
%20 = load float, float* %19
%21 = load float, float* %6
%22 = call float @llvm.fmuladd.f32(float %15, float %20, float %21)
store float %22, float* %6
br label %23
23: ; preds = %10
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %7
26: ; preds = %7
%27 = load float, float* %6
ret float %27
}

LLVM IR (-O2):
define float @Vector_Dot_Product(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = tail call float @llvm.fmuladd.f32(float %3, float %4, float 0.000000e+00)
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = tail call float @llvm.fmuladd.f32(float %7, float %9, float %5)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
/* Variables and functions */
int /*<<< orphan*/ thLockMutex(void *);
void thLockFastMutex(void *p) { thLockMutex(p); }


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

x86 assembly (clang, -O2):
<thLockFastMutex>:
jmp    1030 <thLockMutex@plt>

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

LLVM IR (-O2):
define void @thLockFastMutex(i8* %0) {
%2 = tail call i32 @thLockMutex(i8* %0)
ret void
}
int cdm_register_xml(const char *xmltext, int len) {}


x86 assembly (clang, -O0):
<cdm_register_xml>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cdm_register_xml(i8* nocapture readnone %0, i32 %1) {
ret i32 undef
}
int isPrimer(int a) {
  int i;
  for (i = 2; i < a; i++) {
    if (a % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrimer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isPrimer+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isPrimer+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <isPrimer+0x50>
jmp    113b <isPrimer+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isPrimer+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrimer>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <isPrimer+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isPrimer+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isPrimer+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrimer(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int *malloc(int);
int main() {
  int *arr = malloc(42 * sizeof(int));
  arr[5] = 2;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 168)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
scalar_t__ isatty(int /*<<< orphan*/);
const char *maybe_colour(FILE *f, const char *col) {
  return isatty(fileno(f)) ? col : "";
}


x86 assembly (clang, -O0):
<maybe_colour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
cmp    $0x0,%rax
je     1157 <maybe_colour+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1167 <maybe_colour+0x47>
lea    0xea2(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1167 <maybe_colour+0x47>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maybe_colour>:
push   %rbx
mov    %rsi,%rbx
call   1040 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
test   %rax,%rax
lea    0xec6(%rip),%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @maybe_colour(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 @fileno(i32* %5)
%7 = call i64 @isatty(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i8*, i8** %4
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %9
%13 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %11 ]
ret i8* %13
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @maybe_colour(i32* nocapture %0, i8* readnone %1) {
%3 = tail call i32 @fileno(i32* %0)
%4 = tail call i64 @isatty(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void test3(void *dead) {
  sleep(300000);
  printf("test3\n");
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x493e0,%edi
call   1040 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rax
mov    $0x493e0,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"test3\00"
define void @test3(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 300000)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int *fibonacci(int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ pretty_print(int *, int *);
int main(int argc, char *argv[]) {
  if (argc <= 1)
    exit(1);
  int n;
  n = atoi(argv[1]);
  int *fibarray;
  fibarray = fibonacci(n);
  pretty_print(fibarray, &n);
  free(fibarray);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     117a <main+0x2a>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <fibonacci@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <pretty_print@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x1,%edi
jle    118e <main+0x3e>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,0xc(%rsp)
mov    %eax,%edi
call   1050 <fibonacci@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
call   1040 <pretty_print@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = call i32* @fibonacci(i32 %17)
store i32* %18, i32** %7
%19 = load i32*, i32** %7
%20 = call i32 @pretty_print(i32* %19, i32* %6)
%21 = load i32*, i32** %7
%22 = call i32 @free(i32* %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = bitcast i32* %3 to i8*
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
store i32 %11, i32* %3
%12 = tail call i32* @fibonacci(i32 %11)
%13 = call i32 @pretty_print(i32* %12, i32* %3)
%14 = call i32 @free(i32* %12)
ret i32 0
}