xunge/DecIR huggingface dataset:
/* Variables and functions */
long inc_turn();
long add_turn(long n) {
  long ret;
  long i;
  ret = -1;
  for (i = 0; i < n; i++)
    ret = inc_turn();
  return ret;
}


x86 assembly (clang, -O0):
<add_turn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1156 <add_turn+0x46>
mov    $0x0,%al
call   1030 <inc_turn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <add_turn+0x1c>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_turn>:
test   %rdi,%rdi
jle    112f <add_turn+0x1f>
push   %rbx
mov    %rdi,%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <inc_turn@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <add_turn+0x10>
pop    %rbx
ret
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @add_turn(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i64 (...) @inc_turn()
%6 = add nuw nsw i64 %4, 1
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = phi i64 [ -1, %1 ], [ %5, %3 ]
ret i64 %9
}
int f(int x) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stdout;
void progressBar(int count, int max) {
  printf("\rCalculating: %d/%d", count, max);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<progressBar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progressBar>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\0DCalculating: %d/%d\00"
@stdout = global i32 0
define void @progressBar(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 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0DCalculating: %d/%d\00"
@stdout = global i32 0
define void @progressBar(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
int query(int *a, int i, int j) {
  if (i == 0)
    return a[j];
  return a[j] - a[i - 1];
}


x86 assembly (clang, -O0):
<query>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    112b <query+0x2b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <query+0x49>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<query>:
movslq %edx,%rax
mov    (%rdi,%rax,4),%eax
test   %esi,%esi
je     1111 <query+0x11>
movslq %esi,%rcx
sub    -0x4(%rdi,%rcx,4),%eax
ret

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

LLVM IR (-O2):
define i32 @query(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
br i1 %4, label %14, label %8
8: ; preds = %3
%9 = add nsw i32 %1, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = sub nsw i32 %7, %12
br label %14
14: ; preds = %3, %8
%15 = phi i32 [ %13, %8 ], [ %7, %3 ]
ret i32 %15
}
int symbolic_link(char *path) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @symbolic_link(i8* nocapture readnone %0) {
ret i32 0
}
void glVertex3f(float a, float b, float c) {}


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

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

LLVM IR (-O0):
define void @glVertex3f(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
ret void
}

LLVM IR (-O2):
define void @glVertex3f(float %0, float %1, float %2) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
void s16_to_bigendian(uint8_t *dst, int16_t s16) {
  dst[0] = (s16 >> 8) & 0xFF;
  dst[1] = s16 & 0xFF;
}


x86 assembly (clang, -O0):
<s16_to_bigendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<s16_to_bigendian>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @s16_to_bigendian(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @s16_to_bigendian(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
int int_equal(const void *data1, const void *data2) {
  return *(int *)data1 == *(int *)data2;
}


x86 assembly (clang, -O0):
<int_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_equal>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @int_equal(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @int_equal(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ putcbyte(int);
void cd_evariable(int op, int lev, int off) {
  putcbyte(op);
  putcbyte(lev);
  putcbyte(off);
}


x86 assembly (clang, -O0):
<cd_evariable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putcbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <putcbyte@plt>
mov    -0xc(%rbp),%edi
call   1030 <putcbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_evariable>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <putcbyte@plt>
mov    %ebp,%edi
call   1030 <putcbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putcbyte@plt>

LLVM IR (-O0):
define void @cd_evariable(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* %4
%8 = call i32 @putcbyte(i32 %7)
%9 = load i32, i32* %5
%10 = call i32 @putcbyte(i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @putcbyte(i32 %11)
ret void
}

LLVM IR (-O2):
define void @cd_evariable(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @putcbyte(i32 %0)
%5 = tail call i32 @putcbyte(i32 %1)
%6 = tail call i32 @putcbyte(i32 %2)
ret void
}
/* Type definitions */
struct ll {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EFAULT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ llins(struct ll *, unsigned char);
void llbuild(struct ll *p, unsigned n, unsigned char key) {
  if (!p)
    exit(EFAULT);
  if (!n)
    return;
  llins(p, key);
  llbuild(p, n - 1, key);
}


x86 assembly (clang, -O0):
<llbuild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115d <llbuild+0x2d>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
cmpl   $0x0,-0xc(%rbp)
jne    116c <llbuild+0x3c>
jmp    118c <llbuild+0x5c>
mov    -0x8(%rbp),%rdi
movzbl -0xd(%rbp),%esi
call   1030 <llins@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
movzbl -0xd(%rbp),%edx
call   1040 <llbuild@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llbuild>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1154 <llbuild+0x34>
mov    %esi,%ebx
test   %esi,%esi
je     114f <llbuild+0x2f>
mov    %rdi,%r14
movzbl %dl,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <llins@plt>
add    $0xffffffff,%ebx
jne    1140 <llbuild+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.ll = type { i32 }
@EFAULT = global i32 0
define void @llbuild(%struct.ll* %0, i32 %1, i8 zeroext %2) {
%4 = alloca %struct.ll*
%5 = alloca i32
%6 = alloca i8
store %struct.ll* %0, %struct.ll** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load %struct.ll*, %struct.ll** %4
%8 = icmp ne %struct.ll* %7, null
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load i32, i32* @EFAULT
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %3
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %12
br label %24
16: ; preds = %12
%17 = load %struct.ll*, %struct.ll** %4
%18 = load i8, i8* %6
%19 = call i32 @llins(%struct.ll* %17, i8 zeroext %18)
%20 = load %struct.ll*, %struct.ll** %4
%21 = load i32, i32* %5
%22 = sub i32 %21, 1
%23 = load i8, i8* %6
br label %24
24: ; preds = %16, %15
ret void
}

LLVM IR (-O2):
%struct.ll = type { i32 }
@EFAULT = global i32 0
define void @llbuild(%struct.ll* %0, i32 %1, i8 zeroext %2) {
%4 = icmp eq %struct.ll* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = icmp eq i32 %1, 0
br i1 %6, label %15, label %10
7: ; preds = %3
%8 = load i32, i32* @EFAULT
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %5, %10
%11 = phi i32 [ %13, %10 ], [ %1, %5 ]
%12 = tail call i32 @llins(%struct.ll* %0, i8 zeroext %2)
%13 = add i32 %11, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %10
15: ; preds = %10, %5
ret void
}
unsigned long freq_ms2hard(unsigned int v) {
  double h = 50e6;
  double vs = v;
  vs = vs * 1e-3;
  double tick = h * vs;
  double shift = 1 << 12;
  return tick / shift;
}


x86 assembly (clang, -O0):
<freq_ms2hard>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movabs $0x4187d78400000000,%rax
d7 87 41
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movabs $0x40b0000000000000,%rax
mov    %rax,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xe8a(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freq_ms2hard>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xef1(%rip),%xmm0
mulsd  0xef1(%rip),%xmm0
mulsd  0xef1(%rip),%xmm0
cvttsd2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subsd  0xee5(%rip),%xmm0
cvttsd2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @freq_ms2hard(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %2
store double 5.000000e+07, double* %3
%7 = load i32, i32* %2
%8 = uitofp i32 %7 to double
store double %8, double* %4
%9 = load double, double* %4
%10 = fmul double %9, 1.000000e-03
store double %10, double* %4
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fmul double %11, %12
store double %13, double* %5
store double 4.096000e+03, double* %6
%14 = load double, double* %5
%15 = load double, double* %6
%16 = fdiv double %14, %15
%17 = fptoui double %16 to i64
ret i64 %17
}

LLVM IR (-O2):
define i64 @freq_ms2hard(i32 %0) {
%2 = uitofp i32 %0 to double
%3 = fmul double %2, 1.000000e-03
%4 = fmul double %3, 5.000000e+07
%5 = fmul double %4, 0x3F30000000000000
%6 = fptoui double %5 to i64
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int maxSumIn(int *, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a[] = {1, 101, 2, 3, 100, 4, 5};
  int len = sizeof(a) / sizeof(a[0]);
  int res = maxSumIn(a, len);
  printf("Max sum is %d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <maxSumIn@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1040 <maxSumIn@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 1, i32 101, i32 2, i32 3, i32 100, i32 4, i32 5]
@.str = [14 x i8] c"Max sum is %d\00"
define void @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @maxSumIn(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
unsigned f(unsigned i) {
  if (i < 0)
    exit(-1);
  return i * i;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jae    112f <f+0x1f>
mov    $0xffffffff,%edi
call   1030 <exit@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = mul i32 %0, %0
ret i32 %2
}
void main() {
  int x[2];
  int *xp = x;
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca [2 x i32]
%2 = alloca i32*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32* %3, i32** %2
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
float elasticIn(int, float, float, float, int, float);
float elasticOut(float fraction, float start, float delta, float amplitude,
                 int bounces, float damping) {
  return elasticIn(1 - fraction, start + delta, -delta, amplitude, bounces,
                   damping);
}


x86 assembly (clang, -O0):
<elasticOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movss  %xmm4,-0x18(%rbp)
movss  0xec4(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  -0x10(%rbp),%xmm2
mov    -0x14(%rbp),%esi
movss  -0x18(%rbp),%xmm3
call   1030 <elasticIn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elasticOut>:
movss  0xee8(%rip),%xmm5
subss  %xmm0,%xmm5
cvttss2si %xmm5,%eax
mov    %edi,%esi
movaps %xmm1,%xmm0
addss  %xmm2,%xmm0
xorps  0xee0(%rip),%xmm2
mov    %eax,%edi
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
movaps %xmm4,%xmm3
jmp    1030 <elasticIn@plt>

LLVM IR (-O0):
define float @elasticOut(float %0, float %1, float %2, float %3, i32 %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store i32 %4, i32* %11
store float %5, float* %12
%13 = load float, float* %7
%14 = fsub float 1.000000e+00, %13
%15 = fptosi float %14 to i32
%16 = load float, float* %8
%17 = load float, float* %9
%18 = fadd float %16, %17
%19 = load float, float* %9
%20 = fneg float %19
%21 = load float, float* %10
%22 = load i32, i32* %11
%23 = load float, float* %12
%24 = call float @elasticIn(i32 %15, float %18, float %20, float %21, i32 %22, float %23)
ret float %24
}

LLVM IR (-O2):
define float @elasticOut(float %0, float %1, float %2, float %3, i32 %4, float %5) {
%7 = fsub float 1.000000e+00, %0
%8 = fptosi float %7 to i32
%9 = fadd float %1, %2
%10 = fneg float %2
%11 = tail call float @elasticIn(i32 %8, float %9, float %10, float %3, i32 %4, float %5)
ret float %11
}
int lim_incr(int i, int n) { return i == n ? 0 : i + 1; }


x86 assembly (clang, -O0):
<lim_incr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1120 <lim_incr+0x20>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <lim_incr+0x29>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lim_incr>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    %esi,%edi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @lim_incr(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = add nsw i32 %0, 1
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
int function(int arg) { return arg + 1; }


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

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

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

LLVM IR (-O2):
define i32 @function(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void signed_char_or_signed_char(signed char *LHS, signed char RHS) {
  (*LHS) |= RHS;
}


x86 assembly (clang, -O0):
<signed_char_or_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_or_signed_char>:
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_or_signed_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = or i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_or_signed_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = or i8 %3, %1
store i8 %4, i8* %0
ret void
}
int do_613() { return 613; }


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

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

LLVM IR (-O0):
define i32 @do_613() {
ret i32 613
}

LLVM IR (-O2):
define i32 @do_613() {
ret i32 613
}
int main(void) {
  int a[9];
  int *c;
  c = a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
store i32* %4, i32** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void rop3_37_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S & T;
  stk3 = ~stk3;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_37_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_37_1_0>:
mov    %edx,%eax
and    %sil,%al
not    %al
mov    (%rdi),%cl
and    %cl,%al
xor    %dl,%al
or     %sil,%al
not    %al
and    %sil,%cl
or     %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_37_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %9
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %6
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = trunc i32 %35 to i8
store i8 %36, i8* %7
%37 = load i8, i8* %7
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %5
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_37_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
%8 = xor i8 %7, %2
%9 = or i8 %8, %1
%10 = xor i8 %9, -1
%11 = and i8 %6, %1
%12 = or i8 %11, %10
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MiiStationWrite(int, int, int);
void PhyReset(void) {
  MiiStationWrite(0x00, 1, 0x8000);
  MiiStationWrite(0x00, 1, 0);
  MiiStationWrite(17, 1, 0x00000008 + 0x00000002);
  MiiStationWrite(19, 1, 0x00000080);
  MiiStationWrite(0x04, 1,
                  (1 << (10)) + (1 << (9)) + (1 << (8)) + (1 << (7)) +
                      (1 << (6)) + (1 << (5)) + (1 << (0)));
  MiiStationWrite(0x00, 1, 0x1000 + 0x0200);
}


x86 assembly (clang, -O0):
<PhyReset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
call   1030 <MiiStationWrite@plt>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <MiiStationWrite@plt>
mov    $0x11,%edi
mov    $0x1,%esi
mov    $0xa,%edx
call   1030 <MiiStationWrite@plt>
mov    $0x13,%edi
mov    $0x1,%esi
mov    $0x80,%edx
call   1030 <MiiStationWrite@plt>
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x7e1,%edx
call   1030 <MiiStationWrite@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1200,%edx
call   1030 <MiiStationWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PhyReset>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
call   1030 <MiiStationWrite@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <MiiStationWrite@plt>
mov    $0x11,%edi
mov    $0x1,%esi
mov    $0xa,%edx
call   1030 <MiiStationWrite@plt>
mov    $0x13,%edi
mov    $0x1,%esi
mov    $0x80,%edx
call   1030 <MiiStationWrite@plt>
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x7e1,%edx
call   1030 <MiiStationWrite@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1200,%edx
pop    %rax
jmp    1030 <MiiStationWrite@plt>

LLVM IR (-O0):
define void @PhyReset() {
%1 = call i32 @MiiStationWrite(i32 0, i32 1, i32 32768)
%2 = call i32 @MiiStationWrite(i32 0, i32 1, i32 0)
%3 = call i32 @MiiStationWrite(i32 17, i32 1, i32 10)
%4 = call i32 @MiiStationWrite(i32 19, i32 1, i32 128)
%5 = call i32 @MiiStationWrite(i32 4, i32 1, i32 2017)
%6 = call i32 @MiiStationWrite(i32 0, i32 1, i32 4608)
ret void
}

LLVM IR (-O2):
define void @PhyReset() {
%1 = tail call i32 @MiiStationWrite(i32 0, i32 1, i32 32768)
%2 = tail call i32 @MiiStationWrite(i32 0, i32 1, i32 0)
%3 = tail call i32 @MiiStationWrite(i32 17, i32 1, i32 10)
%4 = tail call i32 @MiiStationWrite(i32 19, i32 1, i32 128)
%5 = tail call i32 @MiiStationWrite(i32 4, i32 1, i32 2017)
%6 = tail call i32 @MiiStationWrite(i32 0, i32 1, i32 4608)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ tty_restore();
void sig_alarm(int signo) {
  tty_restore();
  die("Not enough input data (timeout)");
}


x86 assembly (clang, -O0):
<sig_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <tty_restore@plt>
lea    0xec7(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_alarm>:
push   %rax
xor    %eax,%eax
call   1030 <tty_restore@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Not enough input data (timeout)\00"
define void @sig_alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @tty_restore()
%4 = call i32 @die(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Not enough input data (timeout)\00"
define void @sig_alarm(i32 %0) {
%2 = tail call i32 (...) @tty_restore()
%3 = tail call i32 @die(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
void fa124(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        p024A:
          goto p024A;
          goto a;
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
a:
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa124>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa124+0x4>

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

LLVM IR (-O0):
define void @fa124() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; No predecessors!
br label %27
27: ; preds = %27, %26
br label %27
}

LLVM IR (-O2):
define void @fa124() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ halIntOn();
int /*<<< orphan*/ halMcuInit();
void halBoardInit(void) {
  halMcuInit();
  halIntOn();
}


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

x86 assembly (clang, -O2):
<halBoardInit>:
push   %rax
xor    %eax,%eax
call   1030 <halMcuInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <halIntOn@plt>

LLVM IR (-O0):
define void @halBoardInit() {
%1 = call i32 (...) @halMcuInit()
%2 = call i32 (...) @halIntOn()
ret void
}

LLVM IR (-O2):
define void @halBoardInit() {
%1 = tail call i32 (...) @halMcuInit()
%2 = tail call i32 (...) @halIntOn()
ret void
}
void reset_to_make_array(int *to_make_array) {
  to_make_array[0] = 0;
  to_make_array[1] = 0;
  to_make_array[2] = -1;
  to_make_array[3] = -1;
}


x86 assembly (clang, -O0):
<reset_to_make_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0xffffffff,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0xffffffff,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_to_make_array>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @reset_to_make_array(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 0, i32 0, i32 -1, i32 -1>, <4 x i32>* %2
ret void
}
int func2(void) { return 7; }


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

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

LLVM IR (-O0):
define i32 @func2() {
ret i32 7
}

LLVM IR (-O2):
define i32 @func2() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ append();
int /*<<< orphan*/ current();
int /*<<< orphan*/ expect_ch(char);
scalar_t__ isalnum(int /*<<< orphan*/);
int symbol(void) {
  expect_ch('$');
  while (isalnum(current()))
    append();
  return 1;
}


x86 assembly (clang, -O0):
<symbol>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
call   1040 <expect_ch@plt>
mov    $0x0,%al
call   1060 <current@plt>
mov    %eax,%edi
call   1050 <isalnum@plt>
cmp    $0x0,%rax
je     1172 <symbol+0x32>
mov    $0x0,%al
call   1030 <append@plt>
jmp    114e <symbol+0xe>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbol>:
push   %rax
mov    $0x24,%edi
call   1040 <expect_ch@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <current@plt>
mov    %eax,%edi
call   1050 <isalnum@plt>
test   %rax,%rax
je     116c <symbol+0x2c>
xor    %eax,%eax
call   1030 <append@plt>
jmp    1150 <symbol+0x10>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @symbol() {
%1 = call i32 @expect_ch(i8 signext 36)
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @current()
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 (...) @append()
br label %2
8: ; preds = %2
ret i32 1
}

LLVM IR (-O2):
define i32 @symbol() {
%1 = tail call i32 @expect_ch(i8 signext 36)
%2 = tail call i32 (...) @current()
%3 = tail call i64 @isalnum(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = tail call i32 (...) @append()
%7 = tail call i32 (...) @current()
%8 = tail call i64 @isalnum(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret i32 1
}
void SSMR3GetU32(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetU32() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ painelPerguntas();
int main() { painelPerguntas(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @painelPerguntas()
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void print_unknown(int fd, char *layer, char *protoname) {
  fprintf((FILE *)fd, "[Unknown protocol/%s layer]", layer);
}


x86 assembly (clang, -O0):
<print_unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0x4(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_unknown>:
mov    %rsi,%rdx
movslq %edi,%rdi
lea    0xee3(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"[Unknown protocol/%s layer]\00"
define void @print_unknown(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load i8*, i8** %5
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"[Unknown protocol/%s layer]\00"
define void @print_unknown(i32 %0, i8* %1, i8* nocapture readnone %2) {
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int *);
int f(void) {
  int i = 1;
  int j = 2;
  swap(&i, &j);
  return j;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <swap@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x2,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <swap@plt>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%5 = call i32 @swap(i32* %1, i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
int ft_strlen(char *str) {
  int i;
  i = 0;
  while (str[i])
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <ft_strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int is_quote(char c) { return c && strchr("\"'`", c); }


x86 assembly (clang, -O0):
<is_quote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     114a <is_quote+0x3a>
lea    0xec9(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_quote>:
test   %dil,%dil
je     1136 <is_quote+0x26>
push   %rax
movsbl %dil,%esi
lea    0xedf(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\22'`\00"
define i32 @is_quote(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"\22'`\00"
define i32 @is_quote(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
int LZ4_sizeofStreamState() {
  return (((1 << (14 - 3)) + 4) * sizeof(unsigned long long));
}


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

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

LLVM IR (-O0):
define i32 @LZ4_sizeofStreamState() {
ret i32 16416
}

LLVM IR (-O2):
define i32 @LZ4_sizeofStreamState() {
ret i32 16416
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char buf[10];
  printf("Say your name: ");
  gets(buf);
  printf("buff: %s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe(%rbp),%rdi
call   1040 <gets@plt>
lea    -0xe(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Say your name: \00"
@.str.1 = [10 x i8] c"buff: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Say your name: \00"
@.str.1 = [10 x i8] c"buff: %s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ check_huge_pages(struct __test_metadata *);
void wrapper_check_huge_pages(struct __test_metadata *_metadata,
                              struct __fixture_variant_metadata *variant) {
  check_huge_pages(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_check_huge_pages>:
jmp    1030 <check_huge_pages@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_check_huge_pages(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @check_huge_pages(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_check_huge_pages(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @check_huge_pages(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ basic_assign();
int /*<<< orphan*/ basic_expr();
int /*<<< orphan*/ basic_let();
int /*<<< orphan*/ basic_ret();
int /*<<< orphan*/ basic_stmt();
int main(void) {
  basic_let();
  basic_assign();
  basic_expr();
  basic_ret();
  basic_stmt();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <basic_let@plt>
mov    $0x0,%al
call   1060 <basic_assign@plt>
mov    $0x0,%al
call   1040 <basic_expr@plt>
mov    $0x0,%al
call   1070 <basic_ret@plt>
mov    $0x0,%al
call   1050 <basic_stmt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <basic_let@plt>
xor    %eax,%eax
call   1060 <basic_assign@plt>
xor    %eax,%eax
call   1040 <basic_expr@plt>
xor    %eax,%eax
call   1070 <basic_ret@plt>
xor    %eax,%eax
call   1050 <basic_stmt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @basic_let()
%3 = call i32 (...) @basic_assign()
%4 = call i32 (...) @basic_expr()
%5 = call i32 (...) @basic_ret()
%6 = call i32 (...) @basic_stmt()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @basic_let()
%2 = tail call i32 (...) @basic_assign()
%3 = tail call i32 (...) @basic_expr()
%4 = tail call i32 (...) @basic_ret()
%5 = tail call i32 (...) @basic_stmt()
ret i32 0
}