xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ strcmp(char const *, char const *);
bool streq(const char *_1, const char *_2) {
  assert(_1);
  assert(_2);
  return !strcmp(_1, _2);
}


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %r14,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @streq(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 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcmp(i8* %9, i8* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ load_initial_config();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setup_output_pins();
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ thread_run();
int main(int argc, char *argv[]) {
  pthread_t thread1;
  int iret1;
  load_initial_config();
  setup_output_pins();
  thread_run();
  printf("ALL DONE - Goodbye\n");
  system("PAUSE");
  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)
mov    $0x0,%al
call   1070 <load_initial_config@plt>
mov    $0x0,%al
call   1060 <setup_output_pins@plt>
mov    $0x0,%al
call   1050 <thread_run@plt>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe86(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <load_initial_config@plt>
xor    %eax,%eax
call   1060 <setup_output_pins@plt>
xor    %eax,%eax
call   1050 <thread_run@plt>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
lea    0xe87(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"ALL DONE - Goodbye\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
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 = call i32 (...) @load_initial_config()
%9 = call i32 (...) @setup_output_pins()
%10 = call i32 (...) @thread_run()
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"PAUSE\00"
@str = [19 x i8] c"ALL DONE - Goodbye\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @load_initial_config()
%4 = tail call i32 (...) @setup_output_pins()
%5 = tail call i32 (...) @thread_run()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void myFunction(int *integer, int arraySize, int i) {
  (i < arraySize)                       ? printf("%c", *((int *)integer + i++)),
      myFunction(integer, arraySize, i) : 0;
}


x86 assembly (clang, -O0):
<myFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1173 <myFunction+0x53>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <myFunction@plt>
jmp    1178 <myFunction+0x58>
jmp    1178 <myFunction+0x58>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myFunction>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %esi,%edx
jge    1155 <myFunction+0x45>
mov    %esi,%r12d
movslq %edx,%rax
lea    (%rdi,%rax,4),%r15
sub    %edx,%r12d
xor    %ebx,%ebx
lea    0xece(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <myFunction+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @myFunction(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
store i32 %13, i32* %6
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = load i32, i32* %6
br label %22
21: ; preds = %3
br label %22
22: ; preds = %21, %10
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @myFunction(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = sext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %9, %7 ]
%9 = add nsw i64 %8, 1
%10 = getelementptr inbounds i32, i32* %0, i64 %8
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = trunc i64 %9 to i32
%14 = icmp eq i32 %13, %1
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
int main() {
  signed long int a = 4L;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x4,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
void do_report(file, line, ok) char *file;
int line;
int ok;
{
  char reason;
  reason = ok ? 'e' : 'f';
  if (!ok) {
    do_fail(file, line, "Generic failure");
  } else {
    reply(&reason, 1);
  }
}


x86 assembly (clang, -O0):
<do_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    $0x66,%eax
mov    $0x65,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x11(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    116c <do_report+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xea0(%rip),%rdx
mov    $0x0,%al
call   1030 <do_fail@plt>
jmp    117c <do_report+0x5c>
lea    -0x11(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <reply@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_report>:
push   %rax
test   %edx,%edx
sete   %al
add    $0x65,%al
mov    %al,0x7(%rsp)
test   %edx,%edx
je     1143 <do_report+0x23>
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <reply@plt>
pop    %rax
ret
lea    0xeb6(%rip),%rdx
xor    %eax,%eax
pop    %rcx
jmp    1030 <do_fail@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Generic failure\00"
define void @do_report(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 101, i32 102
%12 = trunc i32 %11 to i8
store i8 %12, i8* %7
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @do_fail to i32 (i8*, i32, i8*, ...)*)(i8* %16, i32 %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %21
19: ; preds = %3
%20 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @reply to i32 (i8*, i32, ...)*)(i8* %7, i32 1)
br label %21
21: ; preds = %19, %15
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Generic failure\00"
define void @do_report(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = icmp eq i32 %2, 0
%6 = select i1 %5, i8 102, i8 101
store i8 %6, i8* %4
br i1 %5, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @do_fail to i32 (i8*, i32, i8*, ...)*)(i8* %0, i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %3
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @reply to i32 (i8*, i32, ...)*)(i8* %4, i32 1)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void threadfree(void *ptr, size_t s, int n) { free(ptr); }


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

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

LLVM IR (-O0):
define void @threadfree(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @threadfree(i8* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i32 @free(i8* %0)
ret void
}
int is_lowercase(int c) {
  if (c >= 'a' && c <= 'z')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_lowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <is_lowercase+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <is_lowercase+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_lowercase+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lowercase>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_lowercase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_lowercase(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char const);
void putstr(const char *str) {
  while (*str) {
    const char *p = str++;
    uart_putc(*p);
    if (*p == '\n')
      uart_putc('\r');
  }
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1167 <putstr+0x57>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <uart_putc@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1162 <putstr+0x52>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
jmp    111c <putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1145 <putstr+0x35>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    112b <putstr+0x1b>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1145 <putstr+0x35>
movsbl %al,%edi
call   1030 <uart_putc@plt>
cmpb   $0xa,-0x1(%rbx)
jne    1120 <putstr+0x10>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
jmp    1120 <putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %14, %13 ], [ %2, %1 ]
%6 = phi i8* [ %7, %13 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @uart_putc(i8 signext %5)
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = tail call i32 @uart_putc(i8 signext 13)
br label %13
13: ; preds = %11, %4
%14 = load i8, i8* %7
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %13, %1
ret void
}
float ease_out_quad(float t, float b, float c, float d) {
  t /= d;
  return -c * t * (t - 2) + b;
}


x86 assembly (clang, -O0):
<ease_out_quad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xeb1(%rip),%xmm1
subss  %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ease_out_quad>:
divss  %xmm3,%xmm0
mulss  %xmm0,%xmm2
addss  0xef0(%rip),%xmm0
mulss  %xmm2,%xmm0
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ease_out_quad(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %8
%10 = load float, float* %5
%11 = fdiv float %10, %9
store float %11, float* %5
%12 = load float, float* %7
%13 = fneg float %12
%14 = load float, float* %5
%15 = fmul float %13, %14
%16 = load float, float* %5
%17 = fsub float %16, 2.000000e+00
%18 = load float, float* %6
%19 = call float @llvm.fmuladd.f32(float %15, float %17, float %18)
ret float %19
}

LLVM IR (-O2):
define float @ease_out_quad(float %0, float %1, float %2, float %3) {
%5 = fdiv float %0, %3
%6 = fneg float %2
%7 = fmul float %5, %6
%8 = fadd float %5, -2.000000e+00
%9 = tail call float @llvm.fmuladd.f32(float %7, float %8, float %1)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_w32(int);
void emit_fcmps(int x, int y) {
  assem_debug("fcmps s14, s15\n");
  output_w32(0xeeb47a67);
}


x86 assembly (clang, -O0):
<emit_fcmps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xeeb47a67,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fcmps>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xeeb47a67,%edi
pop    %rax
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"fcmps s14, s15\0A\00"
define void @emit_fcmps(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @output_w32(i32 -290162073)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"fcmps s14, s15\0A\00"
define void @emit_fcmps(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @output_w32(i32 -290162073)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgiString(char *);
int intExp(int /*<<< orphan*/);
int cgiIntExp(char *varName) { return intExp(cgiString(varName)); }


x86 assembly (clang, -O0):
<cgiIntExp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cgiString@plt>
mov    %eax,%edi
call   1040 <intExp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiIntExp>:
push   %rax
call   1030 <cgiString@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <intExp@plt>

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

LLVM IR (-O2):
define i32 @cgiIntExp(i8* %0) {
%2 = tail call i32 @cgiString(i8* %0)
%3 = tail call i32 @intExp(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int main(int argc, char *argv[]) { raise(SIGQUIT); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@SIGQUIT = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @SIGQUIT
%4 = tail call i32 @raise(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
a(int i, int j) {
  i = j + i;
  printf("%d 0x%x\n", i, j);
  j -= 4;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
mov    %esi,%edx
lea    (%rdi,%rdx,1),%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d 0x%x\0A\00"
define i32 @a(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %1)
ret i32 undef
}
/* Variables and functions */
double getSecs();
double getNanoPerN(unsigned int N) {
  return (getSecs() / (double)(N)) * (double)(1.0e9);
}


x86 assembly (clang, -O0):
<getNanoPerN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
call   1030 <getSecs@plt>
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNanoPerN>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getSecs@plt>
mov    %ebx,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xed3(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @getNanoPerN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call double (...) @getSecs()
%4 = load i32, i32* %2
%5 = uitofp i32 %4 to double
%6 = fdiv double %3, %5
%7 = fmul double %6, 1.000000e+09
ret double %7
}

LLVM IR (-O2):
define double @getNanoPerN(i32 %0) {
%2 = tail call double (...) @getSecs()
%3 = uitofp i32 %0 to double
%4 = fdiv double %2, %3
%5 = fmul double %4, 1.000000e+09
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ resetHardA7GSMModule();
void startRecoveryForA7DataConnectFailed(int n) { resetHardA7GSMModule(); }


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

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

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

LLVM IR (-O2):
define void @startRecoveryForA7DataConnectFailed(i32 %0) {
%2 = tail call i32 (...) @resetHardA7GSMModule()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_eq(int, int);
void test_assert_eq_int_pass(void) {
  int x = 5;
  int y = 10;
  assert_eq(x, y / 2);
}


x86 assembly (clang, -O0):
<test_assert_eq_int_pass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <assert_eq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_eq_int_pass>:
mov    $0x5,%edi
mov    $0x5,%esi
jmp    1030 <assert_eq@plt>

LLVM IR (-O0):
define void @test_assert_eq_int_pass() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 2
%6 = call i32 @assert_eq(i32 %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @test_assert_eq_int_pass() {
%1 = tail call i32 @assert_eq(i32 5, i32 5)
ret void
}
void gtk_editable_get_chars() {}


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

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

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

LLVM IR (-O2):
define void @gtk_editable_get_chars() {
ret void
}
void ultrasonic_init() {}


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

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

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

LLVM IR (-O2):
define void @ultrasonic_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void ll_unloadlib(void *lib) { dlclose(lib); }


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

x86 assembly (clang, -O2):
<ll_unloadlib>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @ll_unloadlib(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ bcm2835_write(int, int);
int /*<<< orphan*/ console_insert_char(int);
int pl011_uart_getc_noblock();
int32_t pl011_uart_interrupt_handler(void) {
  uint32_t ascii;
  while (1) {
    ascii = pl011_uart_getc_noblock();
    if (ascii == -1)
      break;
    console_insert_char(ascii);
  }
  bcm2835_write((0 + 0x201000 + 0x44), (1 << 6));
  return 0;
}


x86 assembly (clang, -O0):
<pl011_uart_interrupt_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pl011_uart_getc_noblock@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1151 <pl011_uart_interrupt_handler+0x21>
jmp    115e <pl011_uart_interrupt_handler+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <console_insert_char@plt>
jmp    1138 <pl011_uart_interrupt_handler+0x8>
mov    $0x201044,%edi
mov    $0x40,%esi
call   1050 <bcm2835_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl011_uart_interrupt_handler>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <pl011_uart_getc_noblock@plt>
cmp    $0xffffffff,%eax
je     1155 <pl011_uart_interrupt_handler+0x25>
mov    %eax,%edi
call   1030 <console_insert_char@plt>
jmp    1140 <pl011_uart_interrupt_handler+0x10>
mov    $0x201044,%edi
mov    $0x40,%esi
call   1050 <bcm2835_write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pl011_uart_interrupt_handler() {
%1 = alloca i32
br label %2
2: ; preds = %0, %7
%3 = call i32 (...) @pl011_uart_getc_noblock()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %2
br label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = call i32 @console_insert_char(i32 %8)
br label %2
10: ; preds = %6
%11 = call i32 @bcm2835_write(i32 2101316, i32 64)
ret i32 0
}

LLVM IR (-O2):
define i32 @pl011_uart_interrupt_handler() {
%1 = tail call i32 (...) @pl011_uart_getc_noblock()
%2 = icmp eq i32 %1, -1
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @console_insert_char(i32 %4)
%6 = tail call i32 (...) @pl011_uart_getc_noblock()
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %3
8: ; preds = %3, %0
%9 = tail call i32 @bcm2835_write(i32 2101316, i32 64)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int shm_open(const char *name, int oflag, mode_t mode) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<shm_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_open>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @shm_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @shm_open(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ hputc(int, int /*<<< orphan*/ *);
int hputs(char *str, FILE *out) {
  while (*str)
    hputc(*str++ & 0xff, out);
  return 0;
}


x86 assembly (clang, -O0):
<hputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <hputs+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <hputc@plt>
jmp    1120 <hputs+0x10>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputs>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <hputs+0x36>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <hputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <hputs+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @hputs(i8* nocapture %0, i32* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %6 to i32
%10 = tail call i32 @hputc(i32 %9, i32* %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int R(int /*<<< orphan*/);
int /*<<< orphan*/ cudaFree(void *);
int /*<<< orphan*/ msg_print(char *);
int Free(void *devPtr) {
  msg_print("[Free]");
  return R(cudaFree(devPtr));
}


x86 assembly (clang, -O0):
<Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <msg_print@plt>
mov    -0x8(%rbp),%rdi
call   1040 <cudaFree@plt>
mov    %eax,%edi
call   1030 <R@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Free>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <msg_print@plt>
mov    %rbx,%rdi
call   1040 <cudaFree@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <R@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"[Free]\00"
define i32 @Free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @msg_print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @cudaFree(i8* %4)
%6 = call i32 @R(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"[Free]\00"
define i32 @Free(i8* %0) {
%2 = tail call i32 @msg_print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @cudaFree(i8* %0)
%4 = tail call i32 @R(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die(char *d) {
  perror(d);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int foo1();
int bar1_from_bar3(void) { return foo1(); }


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

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

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

LLVM IR (-O2):
define i32 @bar1_from_bar3() {
%1 = tail call i32 (...) @foo1()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM8_CC_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM8_CC_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM8_CC_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
float get_arduino_temperature() { return ((float)rand()) / RAND_MAX + 40.0; }


x86 assembly (clang, -O0):
<get_arduino_temperature>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec1(%rip),%rax
divss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_arduino_temperature>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
divss  (%rax),%xmm0
addss  0xed0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @get_arduino_temperature() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
%5 = fpext float %4 to double
%6 = fadd double %5, 4.000000e+01
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @get_arduino_temperature() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
%5 = fadd float %4, 4.000000e+01
ret float %5
}
/* Variables and functions */
int strlen(char *);
void rmlb(char *p) {
  int len = strlen(p);
  if (len > 1 && p[len - 1] == '\n') {
    p[len - 1] = '\0';
  }
}


x86 assembly (clang, -O0):
<rmlb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    115d <rmlb+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115d <rmlb+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmlb>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     112b <rmlb+0x1b>
add    $0xffffffff,%eax
cmpb   $0xa,(%rbx,%rax,1)
jne    112b <rmlb+0x1b>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @rmlb(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret void
}
int serial_get_status() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @serial_get_status() {
ret i32 0
}
/* Type definitions */
typedef size_t uint8_t;

/* Variables and functions */
bool BitArray_Get(void *buf, size_t bit) {
  return ((((uint8_t *)buf)[bit >> 3] >> (bit & 0x7)) & 0x1);
}


x86 assembly (clang, -O0):
<BitArray_Get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%rcx
and    $0x7,%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BitArray_Get>:
mov    %rsi,%rcx
mov    %rsi,%rax
and    $0xfffffffffffffff8,%rax
mov    (%rdi,%rax,1),%rax
and    $0x7,%cl
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @BitArray_Get(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %4
%8 = lshr i64 %7, 3
%9 = getelementptr inbounds i64, i64* %6, i64 %8
%10 = load i64, i64* %9
%11 = load i64, i64* %4
%12 = and i64 %11, 7
%13 = lshr i64 %10, %12
%14 = and i64 %13, 1
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @BitArray_Get(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
%4 = lshr i64 %1, 3
%5 = getelementptr inbounds i64, i64* %3, i64 %4
%6 = load i64, i64* %5
%7 = and i64 %1, 7
%8 = lshr i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = and i32 %9, 1
ret i32 %10
}
void Tcl_Ckfree(ptr) char *ptr;
{ free(ptr); }


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

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

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

LLVM IR (-O2):
define void @Tcl_Ckfree(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *stringAlloc(int l) { return (char *)malloc(sizeof(char) * (l + 1)); }


x86 assembly (clang, -O0):
<stringAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringAlloc>:
add    $0x1,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @stringAlloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @stringAlloc(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void butler_proc(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @butler_proc() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ comparisonTestid(int, double);
int /*<<< orphan*/ printf(char *);
void comparisonOpsid() {
  printf("int op double:\n");
  comparisonTestid(1, 2.0);
  comparisonTestid(1, 1.0);
  comparisonTestid(2, 1.0);
}


x86 assembly (clang, -O0):
<comparisonOpsid>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
movsd  0xecb(%rip),%xmm0
call   1040 <comparisonTestid@plt>
mov    $0x1,%edi
movsd  0xeb1(%rip),%xmm0
call   1040 <comparisonTestid@plt>
mov    $0x2,%edi
movsd  0xe9f(%rip),%xmm0
call   1040 <comparisonTestid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparisonOpsid>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
movsd  0xecb(%rip),%xmm0
mov    $0x1,%edi
call   1040 <comparisonTestid@plt>
movsd  0xec1(%rip),%xmm0
mov    $0x1,%edi
call   1040 <comparisonTestid@plt>
mov    $0x2,%edi
movsd  0xeaa(%rip),%xmm0
pop    %rax
jmp    1040 <comparisonTestid@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"int op double:\0A\00"
define void @comparisonOpsid() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @comparisonTestid(i32 1, double 2.000000e+00)
%3 = call i32 @comparisonTestid(i32 1, double 1.000000e+00)
%4 = call i32 @comparisonTestid(i32 2, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"int op double:\00"
define void @comparisonOpsid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @comparisonTestid(i32 1, double 2.000000e+00)
%3 = tail call i32 @comparisonTestid(i32 1, double 1.000000e+00)
%4 = tail call i32 @comparisonTestid(i32 2, double 1.000000e+00)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t printer_rgb(int color) {
  switch (color) {
  case 0:
    return 0x00F0F0F0;
  case 1:
    return 0x00C0C0C0;
  case 2:
    return 0x00808080;
  case 3:
    return 0x00404040;
  }
  return 0;
}


x86 assembly (clang, -O0):
<printer_rgb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     115c <printer_rgb+0x5c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xf0f0f0,-0x4(%rbp)
jmp    1163 <printer_rgb+0x63>
movl   $0xc0c0c0,-0x4(%rbp)
jmp    1163 <printer_rgb+0x63>
movl   $0x808080,-0x4(%rbp)
jmp    1163 <printer_rgb+0x63>
movl   $0x404040,-0x4(%rbp)
jmp    1163 <printer_rgb+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<printer_rgb>:
xor    %eax,%eax
cmp    $0x3,%edi
ja     1114 <printer_rgb+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @printer_rgb(i32 %0) {
%2 = alloca i32
%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 i32 15790320, i32* %2
br label %10
6: ; preds = %1
store i32 12632256, i32* %2
br label %10
7: ; preds = %1
store i32 8421504, i32* %2
br label %10
8: ; preds = %1
store i32 4210752, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.printer_rgb = [4 x i32] [i32 15790320, i32 12632256, i32 8421504, i32 4210752]
define i32 @printer_rgb(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.printer_rgb, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat_(char *, char *);
int main() {
  char a[20] = "hello ";
  char b[] = "world!";
  strcat_(a, b);
  printf("%s\n", a);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec0(%rip),%eax
mov    %eax,-0x27(%rbp)
mov    0xeba(%rip),%ax
mov    %ax,-0x23(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0x21(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x27(%rbp),%rsi
call   1040 <strcat_@plt>
lea    -0x20(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x21646c,0xb(%rsp)
movl   $0x6c726f77,0x8(%rsp)
6c
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strcat_@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [20 x i8] c"hello \00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.b = [7 x i8] c"world!\00"
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [7 x i8]
store i32 0, i32* %1
%4 = bitcast [20 x i8]* %2 to i8*
%5 = bitcast [7 x i8]* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%8 = call i32 @strcat_(i8* %6, i8* %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@__const.main.a = [20 x i8] c"hello \00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.b = [7 x i8] c"world!\00"
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [7 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcat_(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
int MickeyToPixel(int mickey) { return mickey; }


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

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

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

LLVM IR (-O2):
define i32 @MickeyToPixel(i32 returned %0) {
ret i32 %0
}