xunge/DecIR huggingface dataset:
int bar(int x) { return x + 7; }


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

x86 assembly (clang, -O2):
<bar>:
lea    0x7(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 7
ret i32 %4
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add nsw i32 %0, 7
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ win_gravity;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_win_gravity(void *_p) {
  return (int)((XSizeHints *)_p)->win_gravity;
}


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

x86 assembly (clang, -O2):
<get_XSizeHints_win_gravity>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XSizeHints_win_gravity(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XSizeHints_win_gravity(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int fun_call_align_2(char a, char b) {
  printf("a = %d, b = %d\n", a, b);
  return a + b;
}


x86 assembly (clang, -O0):
<fun_call_align_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_call_align_2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define i32 @fun_call_align_2(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
%4 = sext i8 %0 to i32
%5 = sext i8 %1 to i32
%6 = add nsw i32 %5, %4
ret i32 %6
}
int row_byte_uhc_2(int row) { return 0xa1 + row; }


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

x86 assembly (clang, -O2):
<row_byte_uhc_2>:
lea    0xa1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @row_byte_uhc_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 161, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @row_byte_uhc_2(i32 %0) {
%2 = add nsw i32 %0, 161
ret i32 %2
}
/* Variables and functions */
char *regexR(char *regex) {
  if (regex != NULL) {
    return regex;
  }
  return ".*";
}


x86 assembly (clang, -O0):
<regexR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1120 <regexR+0x20>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112b <regexR+0x2b>
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regexR>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c".*\00"
define i8* @regexR(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %3
store i8* %7, i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c".*\00"
define i8* @regexR(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
int ansimove(row, col)
int row, col;
{
  ttflush();
  ttputc(0x1B);
  ttputc('[');
  ansiparm(row + 1);
  ttputc(';');
  ansiparm(col + 1);
  ttputc('H');
  return 0;
}


x86 assembly (clang, -O0):
<ansimove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <ttflush@plt>
mov    $0x1b,%edi
mov    $0x0,%al
call   1050 <ttputc@plt>
mov    $0x5b,%edi
mov    $0x0,%al
call   1050 <ttputc@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    $0x0,%al
call   1040 <ansiparm@plt>
mov    $0x3b,%edi
mov    $0x0,%al
call   1050 <ttputc@plt>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    $0x0,%al
call   1040 <ansiparm@plt>
mov    $0x48,%edi
mov    $0x0,%al
call   1050 <ttputc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ansimove>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <ttflush@plt>
mov    $0x1b,%edi
xor    %eax,%eax
call   1050 <ttputc@plt>
mov    $0x5b,%edi
xor    %eax,%eax
call   1050 <ttputc@plt>
add    $0x1,%ebp
mov    %ebp,%edi
xor    %eax,%eax
call   1040 <ansiparm@plt>
mov    $0x3b,%edi
xor    %eax,%eax
call   1050 <ttputc@plt>
add    $0x1,%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <ansiparm@plt>
mov    $0x48,%edi
xor    %eax,%eax
call   1050 <ttputc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ansimove(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @ttflush()
%6 = call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 27)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 91)
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = call i32 (i32, ...) bitcast (i32 (...)* @ansiparm to i32 (i32, ...)*)(i32 %9)
%11 = call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 59)
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
%14 = call i32 (i32, ...) bitcast (i32 (...)* @ansiparm to i32 (i32, ...)*)(i32 %13)
%15 = call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 72)
ret i32 0
}

LLVM IR (-O2):
define i32 @ansimove(i32 %0, i32 %1) {
%3 = tail call i32 (...) @ttflush()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 27)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 91)
%6 = add nsw i32 %0, 1
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @ansiparm to i32 (i32, ...)*)(i32 %6)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 59)
%9 = add nsw i32 %1, 1
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @ansiparm to i32 (i32, ...)*)(i32 %9)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 72)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void inf_loop_cb(void *env) {
  (void)env;
  for (;;) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<inf_loop_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    111c <inf_loop_cb+0xc>

x86 assembly (clang, -O2):
<inf_loop_cb>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <inf_loop_cb+0x10>

LLVM IR (-O0):
define void @inf_loop_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
br label %4
4: ; preds = %4, %1
%5 = call i32 @sleep(i32 1)
br label %4
}

LLVM IR (-O2):
define void @inf_loop_cb(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
double I4(unsigned char *);
double U4(unsigned char *);
double I8(unsigned char *p) { return I4(p + 4) * 4294967296.0 + U4(p); }


x86 assembly (clang, -O0):
<I8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1040 <I4@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <U4@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xea9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I8>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
add    $0x4,%rdi
call   1040 <I4@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <U4@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @I8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = call double @I4(i8* %4)
%6 = load i8*, i8** %2
%7 = call double @U4(i8* %6)
%8 = call double @llvm.fmuladd.f64(double %5, double 0x41F0000000000000, double %7)
ret double %8
}

LLVM IR (-O2):
define double @I8(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = tail call double @I4(i8* %2)
%4 = tail call double @U4(i8* %0)
%5 = tail call double @llvm.fmuladd.f64(double %3, double 0x41F0000000000000, double %4)
ret double %5
}
unsigned int get_sysctl_timer_migration(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @get_sysctl_timer_migration() {
ret i32 1
}

LLVM IR (-O2):
define i32 @get_sysctl_timer_migration() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_smatrix(short **m, long nrl, long ncl) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_smatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
add    $0xfffffffffffffffe,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_smatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rdx,2),%rdi
add    $0xfffffffffffffffe,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_smatrix(i16** %0, i64 %1, i64 %2) {
%4 = alloca i16**
%5 = alloca i64
%6 = alloca i64
store i16** %0, i16*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i16**, i16*** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i16*, i16** %7, i64 %8
%10 = load i16*, i16** %9
%11 = load i64, i64* %6
%12 = getelementptr inbounds i16, i16* %10, i64 %11
%13 = getelementptr inbounds i16, i16* %12, i64 -1
%14 = bitcast i16* %13 to i8*
%15 = call i32 @free(i8* %14)
%16 = load i16**, i16*** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds i16*, i16** %16, i64 %17
%19 = getelementptr inbounds i16*, i16** %18, i64 -1
%20 = bitcast i16** %19 to i8*
%21 = call i32 @free(i8* %20)
ret void
}

LLVM IR (-O2):
define void @free_smatrix(i16** nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i16*, i16** %0, i64 %1
%5 = load i16*, i16** %4
%6 = getelementptr inbounds i16, i16* %5, i64 %2
%7 = getelementptr inbounds i16, i16* %6, i64 -1
%8 = bitcast i16* %7 to i8*
%9 = tail call i32 @free(i8* %8)
%10 = getelementptr inbounds i16*, i16** %4, i64 -1
%11 = bitcast i16** %10 to i8*
%12 = tail call i32 @free(i8* %11)
ret void
}
void s5p6442_default_sdhci2(void) {}


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

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

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

LLVM IR (-O2):
define void @s5p6442_default_sdhci2() {
ret void
}
void SSMR3HandleHostBits(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3HandleHostBits() {
ret void
}
int foo(int *a) {
  int x = 3;
  return __atomic_compare_exchange_n(a, &x, 0, 1, 2, 2);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
mov    %al,-0x19(%rbp)
mov    %ecx,-0x18(%rbp)
test   $0x1,%al
jne    113d <foo+0x3d>
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x3,%eax
lock cmpxchg %edx,(%rdi)
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32* %0, i32** %2
store i32 3, i32* %3
%6 = load i32*, i32** %2
store i32 0, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = cmpxchg weak i32* %6, i32 %7, i32 %8 acquire acquire
%10 = extractvalue { i32, i1 } %9, 0
%11 = extractvalue { i32, i1 } %9, 1
br i1 %11, label %13, label %12
12: ; preds = %1
store i32 %10, i32* %3
br label %13
13: ; preds = %12, %1
%14 = zext i1 %11 to i8
store i8 %14, i8* %5
%15 = load i8, i8* %5
%16 = trunc i8 %15 to i1
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = cmpxchg weak i32* %0, i32 3, i32 0 acquire acquire
%3 = extractvalue { i32, i1 } %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
void *indirect_call(void *(*fn)(int)) { return fn(16); }


x86 assembly (clang, -O0):
<indirect_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x10,%edi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect_call>:
mov    %rdi,%rax
mov    $0x10,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i8* @indirect_call(i8* (i32)* nocapture %0) {
%2 = tail call i8* %0(i32 16)
ret i8* %2
}
void EoCIRQ_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @EoCIRQ_Interrupt() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_set1_ps(float);
__m128 __attribute__((__always___, __nodebug__)) _mm_set_ps1(float w) {
  return _mm_set1_ps(w);
}


x86 assembly (clang, -O0):
<_mm_set_ps1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <_mm_set1_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_set_ps1>:
jmp    1030 <_mm_set1_ps@plt>

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

LLVM IR (-O2):
define i32 @_mm_set_ps1(float %0) {
%2 = tail call i32 @_mm_set1_ps(float %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ adc_init();
int /*<<< orphan*/ cli();
int /*<<< orphan*/ port_init();
int /*<<< orphan*/ sei();
int /*<<< orphan*/ spi_init();
int /*<<< orphan*/ timer5_init();
void init_devices(void) {
  cli();
  port_init();
  spi_init();
  adc_init();
  timer5_init();
  sei();
}


x86 assembly (clang, -O0):
<init_devices>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <cli@plt>
mov    $0x0,%al
call   1050 <port_init@plt>
mov    $0x0,%al
call   1030 <spi_init@plt>
mov    $0x0,%al
call   1060 <adc_init@plt>
mov    $0x0,%al
call   1080 <timer5_init@plt>
mov    $0x0,%al
call   1040 <sei@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_devices>:
push   %rax
xor    %eax,%eax
call   1070 <cli@plt>
xor    %eax,%eax
call   1050 <port_init@plt>
xor    %eax,%eax
call   1030 <spi_init@plt>
xor    %eax,%eax
call   1060 <adc_init@plt>
xor    %eax,%eax
call   1080 <timer5_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sei@plt>

LLVM IR (-O0):
define void @init_devices() {
%1 = call i32 (...) @cli()
%2 = call i32 (...) @port_init()
%3 = call i32 (...) @spi_init()
%4 = call i32 (...) @adc_init()
%5 = call i32 (...) @timer5_init()
%6 = call i32 (...) @sei()
ret void
}

LLVM IR (-O2):
define void @init_devices() {
%1 = tail call i32 (...) @cli()
%2 = tail call i32 (...) @port_init()
%3 = tail call i32 (...) @spi_init()
%4 = tail call i32 (...) @adc_init()
%5 = tail call i32 (...) @timer5_init()
%6 = tail call i32 (...) @sei()
ret void
}
char const *_Locale_messages_name(const void *__DUMMY_PAR1, char *__DUMMY_PAR) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @_Locale_messages_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
f() {
  static int a[10];
  return a + 10;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rax
add    $0x28,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x2f29(%rip),%rax
add    $0x28,%eax
ret

LLVM IR (-O0):
@f.a = internal global [10 x i32] zeroinitializer
define i32 @f() {
ret i32 ptrtoint (i32* getelementptr inbounds ([10 x i32], [10 x i32]* @f.a, i64 1, i64 0) to i32)
}

LLVM IR (-O2):
@f.a = internal global [10 x i32] zeroinitializer
define i32 @f() {
ret i32 ptrtoint (i32* getelementptr inbounds ([10 x i32], [10 x i32]* @f.a, i64 1, i64 0) to i32)
}
/* Type definitions */
struct cdrom_dirent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct cdrom_dirent *);
void cdrom_dirent_close(struct cdrom_dirent *d) { kfree(d); }


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

x86 assembly (clang, -O2):
<cdrom_dirent_close>:
jmp    1030 <kfree@plt>

LLVM IR (-O0):
%struct.cdrom_dirent = type { i32 }
define void @cdrom_dirent_close(%struct.cdrom_dirent* %0) {
%2 = alloca %struct.cdrom_dirent*
store %struct.cdrom_dirent* %0, %struct.cdrom_dirent** %2
%3 = load %struct.cdrom_dirent*, %struct.cdrom_dirent** %2
%4 = call i32 @kfree(%struct.cdrom_dirent* %3)
ret void
}

LLVM IR (-O2):
%struct.cdrom_dirent = type { i32 }
define void @cdrom_dirent_close(%struct.cdrom_dirent* %0) {
%2 = tail call i32 @kfree(%struct.cdrom_dirent* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *_mp_default_reallocate(void *oldptr, size_t old_size, size_t new_size) {
  void *ret;
  ret = realloc(oldptr, new_size);
  if (ret == 0) {
    perror("cannot allocate in libmp");
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<_mp_default_reallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <_mp_default_reallocate+0x43>
lea    0xe99(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mp_default_reallocate>:
push   %rax
mov    %rdx,%rsi
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <_mp_default_reallocate+0x10>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"cannot allocate in libmp\00"
define i8* @_mp_default_reallocate(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %6
%10 = call i8* @realloc(i8* %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %3
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
@.str = [25 x i8] c"cannot allocate in libmp\00"
define noalias i8* @_mp_default_reallocate(i8* nocapture %0, i64 %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3
ret i8* %4
}
void XAddHost() {}


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

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

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

LLVM IR (-O2):
define void @XAddHost() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y2;
};
typedef TYPE_1__ XSegment;

/* Variables and functions */
short get_XSegment_y2(void *_p) { return (short)((XSegment *)_p)->y2; }


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

x86 assembly (clang, -O2):
<get_XSegment_y2>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define signext i16 @get_XSegment_y2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @get_XSegment_y2(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
double standardNormalVar();
double normalVar(double mean, double sigma) {
  return standardNormalVar() * sigma + mean;
}


x86 assembly (clang, -O0):
<normalVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <standardNormalVar@plt>
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalVar>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <standardNormalVar@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @normalVar(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @standardNormalVar()
%6 = load double, double* %4
%7 = load double, double* %3
%8 = call double @llvm.fmuladd.f64(double %5, double %6, double %7)
ret double %8
}

LLVM IR (-O2):
define double @normalVar(double %0, double %1) {
%3 = tail call double (...) @standardNormalVar()
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double %0)
ret double %4
}
int setbit(int n, int index, int val) {
  if (val == 1) {
    n |= 1 << index;
    return n;
  } else if (val == 0) {
    int temp = 1 << index;
    temp = ~temp;
    n &= temp;
    return n;
  }
}


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1132 <setbit+0x32>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <setbit+0x6b>
cmpl   $0x0,-0x10(%rbp)
jne    1166 <setbit+0x66>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <setbit+0x6b>
jmp    116b <setbit+0x6b>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit>:
mov    %edi,%eax
test   %edx,%edx
je     110f <setbit+0xf>
cmp    $0x1,%edx
jne    1112 <setbit+0x12>
bts    %esi,%eax
ret
btr    %esi,%eax
ret

LLVM IR (-O0):
define i32 @setbit(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load i32, i32* %6
%13 = shl i32 1, %12
%14 = load i32, i32* %5
%15 = or i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
store i32 %16, i32* %4
br label %30
17: ; preds = %3
%18 = load i32, i32* %7
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load i32, i32* %6
%22 = shl i32 1, %21
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = xor i32 %23, -1
store i32 %24, i32* %8
%25 = load i32, i32* %8
%26 = load i32, i32* %5
%27 = and i32 %26, %25
store i32 %27, i32* %5
%28 = load i32, i32* %5
store i32 %28, i32* %4
br label %30
29: ; preds = %17
br label %30
30: ; preds = %11, %20, %29
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
define i32 @setbit(i32 %0, i32 %1, i32 %2) {
switch i32 %2, label %11 [
i32 1, label %4
i32 0, label %7
]
4: ; preds = %3
%5 = shl nuw i32 1, %1
%6 = or i32 %5, %0
br label %11
7: ; preds = %3
%8 = shl nuw i32 1, %1
%9 = xor i32 %8, -1
%10 = and i32 %9, %0
br label %11
11: ; preds = %3, %4, %7
%12 = phi i32 [ %6, %4 ], [ %10, %7 ], [ undef, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void Util_ZeroFree(void *buf, size_t bufSize) {
  if (buf != ((void *)0)) {
    memset(buf, 0, bufSize);
    free(buf);
  }
}


x86 assembly (clang, -O0):
<Util_ZeroFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <Util_ZeroFree+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_ZeroFree>:
test   %rdi,%rdi
je     113c <Util_ZeroFree+0x1c>
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @Util_ZeroFree(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @memset(i8* %8, i32 0, i64 %9)
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @Util_ZeroFree(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
extern uint8_t gf_add(uint8_t lhs, uint8_t rhs) { return lhs ^ rhs; }


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

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

LLVM IR (-O0):
define i32 @gf_add(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 = xor i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @gf_add(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
float ipowf(float base, int exp) {
  float result = 1;
  while (exp) {
    if (exp & 1)
      result *= base;
    exp >>= 1;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<ipowf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  0xeec(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115e <ipowf+0x5e>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1141 <ipowf+0x41>
movss  -0x4(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1119 <ipowf+0x19>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipowf>:
test   %edi,%edi
je     1145 <ipowf+0x45>
movss  0xef4(%rip),%xmm2
movaps %xmm2,%xmm1
jmp    1133 <ipowf+0x33>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mulss  %xmm3,%xmm1
mov    %edi,%eax
sar    %eax
mulss  %xmm0,%xmm0
cmp    $0x1,%edi
mov    %eax,%edi
jbe    1141 <ipowf+0x41>
movaps %xmm2,%xmm3
test   $0x1,%dil
je     1120 <ipowf+0x20>
movaps %xmm0,%xmm3
jmp    1120 <ipowf+0x20>
movaps %xmm1,%xmm0
ret
movss  0xeb3(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ipowf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca float
store float %0, float* %3
store i32 %1, i32* %4
store float 1.000000e+00, float* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load float, float* %3
%15 = load float, float* %5
%16 = fmul float %15, %14
store float %16, float* %5
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %4
%19 = ashr i32 %18, 1
store i32 %19, i32* %4
%20 = load float, float* %3
%21 = load float, float* %3
%22 = fmul float %21, %20
store float %22, float* %3
br label %6
23: ; preds = %6
%24 = load float, float* %5
ret float %24
}

LLVM IR (-O2):
define float @ipowf(float %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi float [ %11, %4 ], [ 1.000000e+00, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi float [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, float 1.000000e+00, float %7
%11 = fmul float %5, %10
%12 = ashr i32 %6, 1
%13 = fmul float %7, %7
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi float [ 1.000000e+00, %2 ], [ %11, %4 ]
ret float %16
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int get_char(FILE *f) {
  int ch;
  ch = getc(f);
  if (ch == '#') {
    do {
      ch = getc(f);
    } while (ch != '\n' && ch != EOF);
  }
  return ch;
}


x86 assembly (clang, -O0):
<get_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x23,-0xc(%rbp)
jne    1174 <get_char+0x64>
jmp    1137 <get_char+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1164 <get_char+0x54>
mov    -0xc(%rbp),%eax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1137 <get_char+0x27>
jmp    1174 <get_char+0x64>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
cmp    $0x23,%eax
jne    1142 <get_char+0x32>
mov    0x2ec0(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
je     1142 <get_char+0x32>
cmp    (%r14),%eax
jne    1130 <get_char+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @get_char(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 35
br i1 %7, label %8, label %22
8: ; preds = %1
br label %9
9: ; preds = %19, %8
%10 = load i32*, i32** %2
%11 = call i32 @getc(i32* %10)
store i32 %11, i32* %3
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %3
%17 = load i32, i32* @EOF
%18 = icmp ne i32 %16, %17
br label %19
19: ; preds = %15, %12
%20 = phi i1 [ false, %12 ], [ %18, %15 ]
br i1 %20, label %9, label %21
21: ; preds = %19
br label %22
22: ; preds = %21, %1
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @get_char(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = icmp eq i32 %2, 35
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = tail call i32 @getc(i32* %0)
%6 = icmp ne i32 %5, 10
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %5, %7
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ %2, %1 ], [ %5, %4 ]
ret i32 %11
}
void swap1(int x, int y) {
  int tmp;
  tmp = x;
  x = y;
  y = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap1(i32 %0, i32 %1) {
ret void
}
int is_even(int number) {
  if (number % 2 == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <is_even+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_even+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_even>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_even(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
int Cyc_Core_nptrcmp(void *a, void *b) {
  int _T0;
  if (a != b)
    goto _TL2;
  return 0;
_TL2:
  if (a <= b)
    goto _TL4;
  return 1;
_TL4:
  _T0 = -1;
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Core_nptrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     111f <Cyc_Core_nptrcmp+0x1f>
jmp    112b <Cyc_Core_nptrcmp+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1157 <Cyc_Core_nptrcmp+0x57>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     113e <Cyc_Core_nptrcmp+0x3e>
jmp    114a <Cyc_Core_nptrcmp+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1157 <Cyc_Core_nptrcmp+0x57>
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Core_nptrcmp>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rsi,%rdi
seta   %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Cyc_Core_nptrcmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = select i1 %4, i32 1, i32 -1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ call(int volatile, long volatile);
int /*<<< orphan*/ call2(int volatile, long volatile);
int /*<<< orphan*/ m(char *, int volatile, long volatile);
int main(int argc, char **argv) {
  volatile int i = 64;
  volatile long j = 42;
  call(i, j);
  call2(i, j);
  m("main", i, j);
  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   $0x40,-0x14(%rbp)
movq   $0x2a,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <call@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <call2@plt>
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xe85(%rip),%rdi
call   1040 <m@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x40,0xc(%rsp)
movq   $0x2a,0x10(%rsp)
mov    0xc(%rsp),%edi
mov    0x10(%rsp),%rsi
call   1050 <call@plt>
mov    0xc(%rsp),%edi
mov    0x10(%rsp),%rsi
call   1030 <call2@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%rdx
lea    0xe8f(%rip),%rdi
call   1040 <m@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"main\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 64, i32* %6
store volatile i64 42, i64* %7
%8 = load volatile i32, i32* %6
%9 = load volatile i64, i64* %7
%10 = call i32 @call(i32 %8, i64 %9)
%11 = load volatile i32, i32* %6
%12 = load volatile i64, i64* %7
%13 = call i32 @call2(i32 %11, i64 %12)
%14 = load volatile i32, i32* %6
%15 = load volatile i64, i64* %7
%16 = call i32 @m(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14, i64 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i64
%5 = bitcast i32* %3 to i8*
store volatile i32 64, i32* %3
%6 = bitcast i64* %4 to i8*
store volatile i64 42, i64* %4
%7 = load volatile i32, i32* %3
%8 = load volatile i64, i64* %4
%9 = tail call i32 @call(i32 %7, i64 %8)
%10 = load volatile i32, i32* %3
%11 = load volatile i64, i64* %4
%12 = tail call i32 @call2(i32 %10, i64 %11)
%13 = load volatile i32, i32* %3
%14 = load volatile i64, i64* %4
%15 = tail call i32 @m(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %13, i64 %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ return_int8();
int /*<<< orphan*/ take_int8(int /*<<< orphan*/);
void test_int8() { take_int8(return_int8()); }


x86 assembly (clang, -O0):
<test_int8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_int8@plt>
mov    %eax,%edi
call   1030 <take_int8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_int8>:
push   %rax
xor    %eax,%eax
call   1040 <return_int8@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_int8@plt>

LLVM IR (-O0):
define void @test_int8() {
%1 = call i32 (...) @return_int8()
%2 = call i32 @take_int8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_int8() {
%1 = tail call i32 (...) @return_int8()
%2 = tail call i32 @take_int8(i32 %1)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
};

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(scalar_t__);
void reb_tools_init_srand(void) {
  struct timeval tim;
  gettimeofday(&tim, NULL);
  srand(tim.tv_usec + getpid());
}


x86 assembly (clang, -O0):
<reb_tools_init_srand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1050 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reb_tools_init_srand>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i64 }
define void @reb_tools_init_srand() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = call i64 (...) @getpid()
%6 = add nsw i64 %4, %5
%7 = call i32 @srand(i64 %6)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define void @reb_tools_init_srand() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = tail call i64 (...) @getpid()
%7 = add nsw i64 %6, %5
%8 = tail call i32 @srand(i64 %7)
ret void
}
/* Type definitions */
struct app_config_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ configure_defaults(struct app_config_t *);
int /*<<< orphan*/ configure_from_cmd(struct app_config_t *, int, char **);
void configure(struct app_config_t *config, int argc, char *argv[]) {
  configure_defaults(config);
  configure_from_cmd(config, argc, argv);
}


x86 assembly (clang, -O0):
<configure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <configure_defaults@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <configure_from_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <configure_defaults@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <configure_from_cmd@plt>

LLVM IR (-O0):
%struct.app_config_t = type { i32 }
define void @configure(%struct.app_config_t* %0, i32 %1, i8** %2) {
%4 = alloca %struct.app_config_t*
%5 = alloca i32
%6 = alloca i8**
store %struct.app_config_t* %0, %struct.app_config_t** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.app_config_t*, %struct.app_config_t** %4
%8 = call i32 @configure_defaults(%struct.app_config_t* %7)
%9 = load %struct.app_config_t*, %struct.app_config_t** %4
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = call i32 @configure_from_cmd(%struct.app_config_t* %9, i32 %10, i8** %11)
ret void
}

LLVM IR (-O2):
%struct.app_config_t = type { i32 }
define void @configure(%struct.app_config_t* %0, i32 %1, i8** %2) {
%4 = tail call i32 @configure_defaults(%struct.app_config_t* %0)
%5 = tail call i32 @configure_from_cmd(%struct.app_config_t* %0, i32 %1, i8** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
int read_int();
int main(int argc, char **argv) {
  int x;
  print_string("enter number: ");
  x = read_int();
  print_string("input: ");
  print_int(x);
  print_string("\n");
  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)
lea    0xeb3(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x0,%al
call   1050 <read_int@plt>
mov    %eax,-0x14(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x14(%rbp),%edi
call   1040 <print_int@plt>
lea    0xea0(%rip),%rdi
call   1030 <print_string@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <print_string@plt>
xor    %eax,%eax
call   1050 <read_int@plt>
mov    %eax,%ebx
lea    0xec2(%rip),%rdi
call   1030 <print_string@plt>
mov    %ebx,%edi
call   1040 <print_int@plt>
lea    0xeb7(%rip),%rdi
call   1030 <print_string@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"enter number: \00"
@.str.1 = [8 x i8] c"input: \00"
@.str.2 = [2 x i8] c"\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
%7 = call i32 @print_string(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @read_int()
store i32 %8, i32* %6
%9 = call i32 @print_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %6
%11 = call i32 @print_int(i32 %10)
%12 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"enter number: \00"
@.str.1 = [8 x i8] c"input: \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @read_int()
%5 = tail call i32 @print_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @print_int(i32 %4)
%7 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void handle_GRANT(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_GRANT(i32 %0) {
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
time_t sas_epoch() { return -3653 * 86400; }


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

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

LLVM IR (-O0):
define i32 @sas_epoch() {
ret i32 -315619200
}

LLVM IR (-O2):
define i32 @sas_epoch() {
ret i32 -315619200
}