xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t fdt64_to_cpu(uint64_t x) {
  return (((unsigned long long)((uint8_t *)&x)[0]) << 56) |
         (((unsigned long long)((uint8_t *)&x)[1]) << 48) |
         (((unsigned long long)((uint8_t *)&x)[2]) << 40) |
         (((unsigned long long)((uint8_t *)&x)[3]) << 32) |
         (((unsigned long long)((uint8_t *)&x)[4]) << 24) |
         (((unsigned long long)((uint8_t *)&x)[5]) << 16) |
         (((unsigned long long)((uint8_t *)&x)[6]) << 8) |
         ((unsigned long long)((uint8_t *)&x)[7]);
}


x86 assembly (clang, -O0):
<fdt64_to_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x38,%rax
mov    0x0(%rbp),%rcx
shl    $0x30,%rcx
or     %rcx,%rax
mov    0x8(%rbp),%rcx
shl    $0x28,%rcx
or     %rcx,%rax
mov    0x10(%rbp),%rcx
shl    $0x20,%rcx
or     %rcx,%rax
mov    0x18(%rbp),%rcx
shl    $0x18,%rcx
or     %rcx,%rax
mov    0x20(%rbp),%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    0x28(%rbp),%rcx
shl    $0x8,%rcx
or     %rcx,%rax
or     0x30(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @fdt64_to_cpu(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = getelementptr inbounds i64, i64* %2, i64 0
%4 = load i64, i64* %3
%5 = shl i64 %4, 56
%6 = getelementptr inbounds i64, i64* %2, i64 1
%7 = load i64, i64* %6
%8 = shl i64 %7, 48
%9 = or i64 %5, %8
%10 = getelementptr inbounds i64, i64* %2, i64 2
%11 = load i64, i64* %10
%12 = shl i64 %11, 40
%13 = or i64 %9, %12
%14 = getelementptr inbounds i64, i64* %2, i64 3
%15 = load i64, i64* %14
%16 = shl i64 %15, 32
%17 = or i64 %13, %16
%18 = getelementptr inbounds i64, i64* %2, i64 4
%19 = load i64, i64* %18
%20 = shl i64 %19, 24
%21 = or i64 %17, %20
%22 = getelementptr inbounds i64, i64* %2, i64 5
%23 = load i64, i64* %22
%24 = shl i64 %23, 16
%25 = or i64 %21, %24
%26 = getelementptr inbounds i64, i64* %2, i64 6
%27 = load i64, i64* %26
%28 = shl i64 %27, 8
%29 = or i64 %25, %28
%30 = getelementptr inbounds i64, i64* %2, i64 7
%31 = load i64, i64* %30
%32 = or i64 %29, %31
ret i64 %32
}

LLVM IR (-O2):
define i64 @fdt64_to_cpu(i64 %0) {
ret i64 poison
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *gettext(char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, gettext("usage: cal [-13smjyV] [[month] year]\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <gettext@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
lea    0xebf(%rip),%rdi
call   1030 <gettext@plt>
mov    %ebx,%edi
mov    %rax,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"usage: cal [-13smjyV] [[month] year]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* @gettext(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @fprintf(i32 %1, i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: cal [-13smjyV] [[month] year]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* @gettext(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32 %1, i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int min(int i1, int i2) { return (i1 > i2) ? i2 : i1; }


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

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

LLVM IR (-O0):
define i32 @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 sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putc(int);
int /*<<< orphan*/ puts(char const *);
void putln(const char *s) {
  puts(s);
  putc(0x0A);
  putc(0x0D);
}


x86 assembly (clang, -O0):
<putln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <putc@plt>
mov    $0xd,%edi
call   1040 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putln>:
push   %rax
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <putc@plt>
mov    $0xd,%edi
pop    %rax
jmp    1040 <putc@plt>

LLVM IR (-O0):
define void @putln(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @putc(i32 10)
%6 = call i32 @putc(i32 13)
ret void
}

LLVM IR (-O2):
define void @putln(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @putc(i32 10)
%4 = tail call i32 @putc(i32 13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void generate_random(void) {
  srand(time(NULL));
  int randomNumber = rand();
  printf("c: Random Number = %d\n", randomNumber);
}


x86 assembly (clang, -O0):
<generate_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"c: Random Number = %d\0A\00"
define void @generate_random() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @rand()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"c: Random Number = %d\0A\00"
define void @generate_random() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void GPIOIntClear(uint32_t ui32Port, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Port + 0x0000041C))) = ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<GPIOIntClear>:
mov    %rsi,0x41c(%rdi)
ret

LLVM IR (-O0):
define void @GPIOIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 1052
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @GPIOIntClear(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 1052
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
void wrdlen_(int *len) {
  *len = 1;
  return;
}


x86 assembly (clang, -O0):
<wrdlen_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrdlen_>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @wrdlen_(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
int fills(int n, int *array) {
  if (!array[n])
    array[n] = (fills(n - 1, array) << 2) - fills(n - 2, array);
  return array[n];
}


x86 assembly (clang, -O0):
<fills>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1165 <fills+0x55>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fills@plt>
shl    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fills@plt>
mov    -0x14(%rbp),%edx
sub    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fills>:
push   %rbp
push   %r14
push   %rbx
movslq %edi,%rbx
mov    (%rsi,%rbx,4),%ebp
test   %ebp,%ebp
jne    113f <fills+0x2f>
mov    %rsi,%r14
lea    -0x1(%rbx),%edi
call   1030 <fills@plt>
mov    %eax,%ebp
shl    $0x2,%ebp
lea    -0x2(%rbx),%edi
mov    %r14,%rsi
call   1030 <fills@plt>
sub    %eax,%ebp
mov    %ebp,(%r14,%rbx,4)
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fills(i32 %0, i32* %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = add nsw i32 %0, -1
%9 = tail call i32 @fills(i32 %8, i32* %1)
%10 = shl i32 %9, 2
%11 = add nsw i32 %0, -2
%12 = tail call i32 @fills(i32 %11, i32* %1)
%13 = sub nsw i32 %10, %12
store i32 %13, i32* %4
br label %14
14: ; preds = %7, %2
%15 = phi i32 [ %13, %7 ], [ %5, %2 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ onewire_name_init();
void onewire_init() { onewire_name_init(); }


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

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

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

LLVM IR (-O2):
define void @onewire_init() {
%1 = tail call i32 (...) @onewire_name_init()
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *strdupnull(const char *s) { return s ? strdup(s) : NULL; }


x86 assembly (clang, -O0):
<strdupnull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <strdupnull+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <strdupnull+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <strdupnull+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdupnull>:
test   %rdi,%rdi
je     111a <strdupnull+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strdupnull(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i8* @strdup(i8* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %7, %5 ], [ null, %8 ]
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @strdupnull(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
unsigned round_to_next_multiple_of(unsigned number, unsigned divisor) {
  number += divisor - 1;
  number -= number % divisor;
  return number;
}


x86 assembly (clang, -O0):
<round_to_next_multiple_of>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_next_multiple_of>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @round_to_next_multiple_of(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub i32 %5, 1
%7 = load i32, i32* %3
%8 = add i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = urem i32 %9, %10
%12 = load i32, i32* %3
%13 = sub i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @round_to_next_multiple_of(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = urem i32 %4, %1
%6 = sub i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
char decodeBase(uint32_t indexBase) {
  switch (indexBase) {
  case 0:
    return ('A');
  case 1:
    return ('C');
  case 2:
    return ('G');
  case 3:
    return ('T');
  default:
    return ('N');
  }
}


x86 assembly (clang, -O0):
<decodeBase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1150 <decodeBase+0x50>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x1(%rbp)
jmp    1154 <decodeBase+0x54>
movb   $0x43,-0x1(%rbp)
jmp    1154 <decodeBase+0x54>
movb   $0x47,-0x1(%rbp)
jmp    1154 <decodeBase+0x54>
movb   $0x54,-0x1(%rbp)
jmp    1154 <decodeBase+0x54>
movb   $0x4e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decodeBase>:
lea    0x0(,%rdi,8),%ecx
mov    $0x54474341,%edx
shr    %cl,%edx
cmp    $0x4,%edi
mov    $0x4e,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @decodeBase(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i8 65, i8* %2
br label %10
6: ; preds = %1
store i8 67, i8* %2
br label %10
7: ; preds = %1
store i8 71, i8* %2
br label %10
8: ; preds = %1
store i8 84, i8* %2
br label %10
9: ; preds = %1
store i8 78, i8* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @decodeBase(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = shl i32 %0, 3
%4 = lshr i32 1413956417, %3
%5 = trunc i32 %4 to i8
%6 = select i1 %2, i8 %5, i8 78
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("You are %d miles away. \n", distance);
  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)
movl   $0x64,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"You are %d miles away. \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"You are %d miles away. \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init();
int x_close(int);
int v4l2_close(int fd) {
  init();
  return x_close(fd);
}


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

x86 assembly (clang, -O2):
<v4l2_close>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <init@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <x_close@plt>

LLVM IR (-O0):
define i32 @v4l2_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @init()
%4 = load i32, i32* %2
%5 = call i32 @x_close(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @v4l2_close(i32 %0) {
%2 = tail call i32 (...) @init()
%3 = tail call i32 @x_close(i32 %0)
ret i32 %3
}
const char *net_getVersion() { return "1.0.4"; }


x86 assembly (clang, -O0):
<net_getVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_getVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.0.4\00"
define i8* @net_getVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.0.4\00"
define i8* @net_getVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void NoSoundDrv_CD_SetVolume(int volume) {}


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

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

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

LLVM IR (-O2):
define void @NoSoundDrv_CD_SetVolume(i32 %0) {
ret void
}
int _libmain(unsigned long reason) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @_libmain(i64 %0) {
ret i32 1
}
/* Type definitions */
typedef unsigned long uint8_t;

/* Variables and functions */
void bit_clear8(volatile uint8_t *ptr, uint8_t bit) {
  *((volatile uint8_t *)(((uintptr_t)ptr) | (1 << 26))) =
      (uint8_t)(~(1ul << bit));
}


x86 assembly (clang, -O0):
<bit_clear8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x8(%rbp),%rax
or     $0x4000000,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_clear8>:
mov    %rsi,%rcx
mov    $0xfffffffffffffffe,%rax
rol    %cl,%rax
or     $0x4000000,%rdi
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @bit_clear8(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = shl i64 1, %5
%7 = xor i64 %6, -1
%8 = load i64*, i64** %3
%9 = ptrtoint i64* %8 to i64
%10 = or i64 %9, 67108864
%11 = inttoptr i64 %10 to i64*
store volatile i64 %7, i64* %11
ret void
}

LLVM IR (-O2):
define void @bit_clear8(i64* %0, i64 %1) {
%3 = shl nuw i64 1, %1
%4 = xor i64 %3, -1
%5 = ptrtoint i64* %0 to i64
%6 = or i64 %5, 67108864
%7 = inttoptr i64 %6 to i64*
store volatile i64 %4, i64* %7
ret void
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *rikenParser(char *header) {
  return tokenParser(header, "|", 2, "rikenParser");
}


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

x86 assembly (clang, -O2):
<rikenParser>:
lea    0xee9(%rip),%rsi
lea    0xee4(%rip),%rcx
mov    $0x2,%edx
jmp    1030 <tokenParser@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"|\00"
@.str.1 = [12 x i8] c"rikenParser\00"
define i8* @rikenParser(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @tokenParser(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
@.str.1 = [12 x i8] c"rikenParser\00"
define i8* @rikenParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double left(double lhs, double rhs) {
  assert(lhs < rhs);
  return lhs;
}


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %edi,%edi
ucomisd %xmm0,%xmm1
seta   %dil
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @left(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @left(double returned %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret double %0
}
unsigned swab32(unsigned w) {
  unsigned r = 0;
  r |= (w & 0x000000ffU) << 24;
  r |= (w & 0x0000ff00U) << 8;
  r |= (w & 0x00ff0000U) >> 8;
  r |= (w & 0xff000000U) >> 24;
  return r;
}


x86 assembly (clang, -O0):
<swab32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
shr    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swab32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = shl i32 %5, 24
%7 = load i32, i32* %3
%8 = or i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = and i32 %9, 65280
%11 = shl i32 %10, 8
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = and i32 %14, 16711680
%16 = lshr i32 %15, 8
%17 = load i32, i32* %3
%18 = or i32 %17, %16
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = and i32 %19, -16777216
%21 = lshr i32 %20, 24
%22 = load i32, i32* %3
%23 = or i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @swab32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
extern float sxstos(float x, float y) { return x * y; }


x86 assembly (clang, -O0):
<sxstos>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sxstos>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sxstos(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @sxstos(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int SIZE_MAX;
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
int vsprintf(char *buffer, const char *format, va_list ap) {
  return vsnprintf(buffer, SIZE_MAX / 2, format, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
@SIZE_MAX = global i32 0
define i32 @vsprintf(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** %4
%8 = load i32, i32* @SIZE_MAX
%9 = sdiv i32 %8, 2
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @vsnprintf(i8* %7, i32 %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@SIZE_MAX = global i32 0
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @SIZE_MAX
%5 = sdiv i32 %4, 2
%6 = tail call i32 @vsnprintf(i8* %0, i32 %5, i8* %1, i32 %2)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ sfmt_lrand64();
int64_t sfmt_mrand64() { return (int64_t)sfmt_lrand64(); }


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

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

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

LLVM IR (-O2):
define i32 @sfmt_mrand64() {
%1 = tail call i32 (...) @sfmt_lrand64()
ret i32 %1
}
void YYDebug(const char *s) { ; }


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

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

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

LLVM IR (-O2):
define void @YYDebug(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int ps() { return syscall(1, 0, 0); }


x86 assembly (clang, -O0):
<ps>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps>:
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @ps() {
%1 = call i32 @syscall(i32 1, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @ps() {
%1 = tail call i32 @syscall(i32 1, i32 0, i32 0)
ret i32 %1
}
void call2f(float f2, long l, double d2, char c, float f1, short s, double d1,
            int i) {
  c = 'a';
  f1 = 0.0;
  s = 5;
  d1 = 0.0;
  i = 6;
  f2 = 0.1;
  l = 7;
  d2 = 0.2;
}


x86 assembly (clang, -O0):
<call2f>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %sil,%dl
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %dl,-0x19(%rbp)
movss  %xmm2,-0x20(%rbp)
mov    %ax,-0x22(%rbp)
movsd  %xmm3,-0x30(%rbp)
mov    %ecx,-0x34(%rbp)
movb   $0x61,-0x19(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movw   $0x5,-0x22(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x6,-0x34(%rbp)
movss  0xeb3(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movq   $0x7,-0x10(%rbp)
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call2f(float %0, i64 %1, double %2, i8 signext %3, float %4, i16 signext %5, double %6, i32 %7) {
%9 = alloca float
%10 = alloca i64
%11 = alloca double
%12 = alloca i8
%13 = alloca float
%14 = alloca i16
%15 = alloca double
%16 = alloca i32
store float %0, float* %9
store i64 %1, i64* %10
store double %2, double* %11
store i8 %3, i8* %12
store float %4, float* %13
store i16 %5, i16* %14
store double %6, double* %15
store i32 %7, i32* %16
store i8 97, i8* %12
store float 0.000000e+00, float* %13
store i16 5, i16* %14
store double 0.000000e+00, double* %15
store i32 6, i32* %16
store float 0x3FB99999A0000000, float* %9
store i64 7, i64* %10
store double 2.000000e-01, double* %11
ret void
}

LLVM IR (-O2):
define void @call2f(float %0, i64 %1, double %2, i8 signext %3, float %4, i16 signext %5, double %6, i32 %7) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ term_color(char *);
int /*<<< orphan*/ term_reset();
void logger_error(char *message) {
  term_color("red");
  printf("  error: ");
  term_reset();
  puts(message);
}


x86 assembly (clang, -O0):
<logger_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1060 <term_color@plt>
lea    0xea5(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <term_reset@plt>
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_error>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
call   1060 <term_color@plt>
lea    0xead(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <term_reset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"red\00"
@.str.1 = [10 x i8] c" error: \00"
define void @logger_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @term_color(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @term_reset()
%6 = load i8*, i8** %2
%7 = call i32 @puts(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"red\00"
@.str.1 = [10 x i8] c" error: \00"
define void @logger_error(i8* nocapture %0) {
%2 = tail call i32 @term_color(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @term_reset()
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rand();
void mineEx1(void) {
  int X = 0;
  int N = rand();
  if (N < 0) {
    N = 0;
  }
  while (X < N) {
    X++;
  }
  assert(X - N == 0);
  if (X == N) {
    N = 8;
  } else {
    N = 42;
  }
}


x86 assembly (clang, -O0):
<mineEx1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114a <mineEx1+0x2a>
movl   $0x0,-0x8(%rbp)
jmp    114f <mineEx1+0x2f>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1169 <mineEx1+0x49>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <mineEx1+0x2f>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1197 <mineEx1+0x77>
movl   $0x8,-0x8(%rbp)
jmp    119e <mineEx1+0x7e>
movl   $0x2a,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mineEx1>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @mineEx1() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @rand()
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 i32 0, i32* %2
br label %7
7: ; preds = %6, %0
br label %8
8: ; preds = %12, %7
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %8
15: ; preds = %8
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = sub nsw i32 %16, %17
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %15
store i32 8, i32* %2
br label %27
26: ; preds = %15
store i32 42, i32* %2
br label %27
27: ; preds = %26, %25
ret void
}

LLVM IR (-O2):
define void @mineEx1() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 @assert(i32 1)
ret void
}
/* Type definitions */
struct sockaddr_un {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ clt_addr;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int accept_client(int lsn_fd) {
  int apt_fd;
  struct sockaddr_un clt_addr;
  socklen_t clt_len;
  clt_len = sizeof(clt_addr);
  apt_fd = accept(lsn_fd, (struct sockaddr *)&clt_addr, &clt_len);
  if (apt_fd < 0) {
    return -1;
  }
  return apt_fd;
}


x86 assembly (clang, -O0):
<accept_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <accept@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114b <accept_client+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <accept_client+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_client>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <accept@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @accept_client(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sockaddr_un
%6 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %6
%7 = load i32, i32* %3
%8 = bitcast %struct.sockaddr_un* %5 to %struct.sockaddr*
%9 = call i32 @accept(i32 %7, %struct.sockaddr* %8, i32* %6)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %15
13: ; preds = %1
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @accept_client(i32 %0) {
%2 = alloca %struct.sockaddr_un
%3 = alloca i32
%4 = bitcast %struct.sockaddr_un* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_un* %2 to %struct.sockaddr*
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp sgt i32 %7, -1
%9 = select i1 %8, i32 %7, i32 -1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rev();
int main() {
  rev();
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rev@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @rev()
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int baz();
int bar(void) { return 32 + baz(); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <baz@plt>
add    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1030 <baz@plt>
add    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 (...) @baz()
%2 = add nsw i32 32, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @baz()
%2 = add nsw i32 %1, 32
ret i32 %2
}
void radio_df_cte_rx_4us_switching(void) {}


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

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

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

LLVM IR (-O2):
define void @radio_df_cte_rx_4us_switching() {
ret void
}
/* Type definitions */
struct single_row_lut {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int interpolate_scalingfactor_fcc(struct single_row_lut *fcc_sf_lut,
                                  int cycles) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<interpolate_scalingfactor_fcc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate_scalingfactor_fcc>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.single_row_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_scalingfactor_fcc(%struct.single_row_lut* %0, i32 %1) {
%3 = alloca %struct.single_row_lut*
%4 = alloca i32
store %struct.single_row_lut* %0, %struct.single_row_lut** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.single_row_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_scalingfactor_fcc(%struct.single_row_lut* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: kallsyms [--all-symbols] "
                  "[--base-relative] < in.map > out.S\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [68 x i8] c"Usage: kallsyms [--all-symbols] [--base-relative] < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [68 x i8] c"Usage: kallsyms [--all-symbols] [--base-relative] < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void test_two(int x, int y) {
#pragma omp target
#pragma omp teams distribute simd
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}
void _uninpchar(void **inp, int outchar) {
  char *buf = (char *)(*inp);
  buf--;
  *inp = (void *)buf;
  return;
}


x86 assembly (clang, -O0):
<_uninpchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_uninpchar>:
addq   $0xffffffffffffffff,(%rdi)
ret

LLVM IR (-O0):
define void @_uninpchar(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i8*
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i32 -1
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8**, i8*** %3
store i8* %10, i8** %11
ret void
}

LLVM IR (-O2):
define void @_uninpchar(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 -1
store i8* %4, i8** %0
ret void
}
void noop_rcv_flush(struct htrace_rcv *rcv) {}


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

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

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

LLVM IR (-O2):
%struct.htrace_rcv = type opaque
define void @noop_rcv_flush(%struct.htrace_rcv* nocapture %0) {
ret void
}
void longa() {
  int i, j;
  for (i = 0; i < 10000; i++)
    j = i;
}


x86 assembly (clang, -O0):
<longa>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    112c <longa+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <longa+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @longa() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10000
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
br label %8
8: ; preds = %6
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @longa() {
ret void
}
/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ getenv(char *);
int strlen(char *);
int calmiddle(char *c) { return ((atoi(getenv("COLUMNS")) - strlen(c)) / 2); }


x86 assembly (clang, -O0):
<calmiddle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calmiddle>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec3(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
sub    %eax,%ebp
mov    %ebp,%eax
shr    $0x1f,%eax
add    %ebp,%eax
sar    %eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"COLUMNS\00"
define i32 @calmiddle(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @atoi(i32 %3)
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sub nsw i32 %4, %6
%8 = sdiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"COLUMNS\00"
define i32 @calmiddle(i8* %0) {
%2 = tail call i32 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @atoi(i32 %2)
%4 = tail call i32 @strlen(i8* %0)
%5 = sub nsw i32 %3, %4
%6 = sdiv i32 %5, 2
ret i32 %6
}
void foo278() {}


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

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

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

LLVM IR (-O2):
define void @foo278() {
ret void
}
void Timer4B_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Timer4B_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Timer4B_Handler+0x9>
jmp    1109 <Timer4B_Handler+0x9>

x86 assembly (clang, -O2):
<Timer4B_Handler>:
jmp    1100 <Timer4B_Handler>

LLVM IR (-O0):
define void @Timer4B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Timer4B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}