xunge/DecIR huggingface dataset:
__attribute__((constructor)) int test() {
  char a = '0';
  short b = 1;
  int c = 2;
  long d = 3;
  __int128_t g = 8;
  float e = 4.5;
  double f = 6.7;
  long double h = 9.10;
  long double result = a + b + c + d + e + f + ((long)g) + h;
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movb   $0x30,-0x1(%rbp)
movw   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x8,-0x20(%rbp)
movl   $0x40900000,-0x24(%rbp)
movabs $0x401acccccccccccd,%rax
cc 1a 40
mov    %rax,-0x30(%rbp)
fldl   0xeb8(%rip)
fstpt  -0x40(%rbp)
movsbl -0x1(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
add    %ecx,%eax
cltq
mov    -0x10(%rbp),%rcx
add    %rcx,%rax
cvtsi2ss %rax,%xmm0
movss  -0x24(%rbp),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdq -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
fldl   -0x58(%rbp)
fldt   -0x40(%rbp)
faddp  %st,%st(1)
fstpt  -0x50(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* bitcast (i32 ()* @test to void ()*), i8* null }]
define i32 @test() {
%1 = alloca i8
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
%5 = alloca i128
%6 = alloca float
%7 = alloca double
%8 = alloca x86_fp80
%9 = alloca x86_fp80
store i8 48, i8* %1
store i16 1, i16* %2
store i32 2, i32* %3
store i64 3, i64* %4
store i128 8, i128* %5
store float 4.500000e+00, float* %6
store double 6.700000e+00, double* %7
store x86_fp80 0xK40029199999999999800, x86_fp80* %8
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = load i16, i16* %2
%13 = sext i16 %12 to i32
%14 = add nsw i32 %11, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = load i64, i64* %4
%19 = add nsw i64 %17, %18
%20 = sitofp i64 %19 to float
%21 = load float, float* %6
%22 = fadd float %20, %21
%23 = fpext float %22 to double
%24 = load double, double* %7
%25 = fadd double %23, %24
%26 = load i128, i128* %5
%27 = trunc i128 %26 to i64
%28 = sitofp i64 %27 to double
%29 = fadd double %25, %28
%30 = fpext double %29 to x86_fp80
%31 = load x86_fp80, x86_fp80* %8
%32 = fadd x86_fp80 %30, %31
store x86_fp80 %32, x86_fp80* %9
ret i32 0
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* bitcast (i32 ()* @test to void ()*), i8* null }]
define i32 @test() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int main(void) { FILE *fl = fopen("", "r"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee2(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee9(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <fopen@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ die(char *);
int sem_post(int /*<<< orphan*/ *);
void v(sem_t *sem) {
  if (sem_post(sem) == -1) {
    die("sem_post");
  }
}


x86 assembly (clang, -O0):
<v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sem_post@plt>
cmp    $0xffffffff,%eax
jne    114a <v+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v>:
push   %rax
call   1030 <sem_post@plt>
cmp    $0xffffffff,%eax
je     112d <v+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"sem_post\00"
define void @v(i32* %0) {
%2 = tail call i32 @sem_post(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int ulong;
typedef scalar_t__ uint;

/* Variables and functions */
uint iterative_popcount_64(ulong x) {
  uint n = 0;
  while (x != 0) {
    ++n;
    x &= (x - 1);
  }
  return n;
}


x86 assembly (clang, -O0):
<iterative_popcount_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <iterative_popcount_64+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110f <iterative_popcount_64+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iterative_popcount_64>:
xor    %eax,%eax
test   %edi,%edi
je     111d <iterative_popcount_64+0x1d>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <iterative_popcount_64+0x10>
ret

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

LLVM IR (-O2):
define i64 @iterative_popcount_64(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i64 %4, 1
%7 = add nsw i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %11
}
void ff_hevc_put_hevc_uni_qpel_v32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_v32_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ModelSpeak();
int main(void) {
  ModelSpeak();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ModelSpeak()
ret i32 0
}
/* Type definitions */
struct tchip_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add2versionex(char *, struct tchip_device *, char *);
void add2version(char *version, struct tchip_device *dev) {
  add2versionex(version, dev, "_");
}


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

x86 assembly (clang, -O2):
<add2version>:
lea    0xee9(%rip),%rdx
jmp    1030 <add2versionex@plt>

LLVM IR (-O0):
%struct.tchip_device = type { i32 }
@.str = [2 x i8] c"_\00"
define void @add2version(i8* %0, %struct.tchip_device* %1) {
%3 = alloca i8*
%4 = alloca %struct.tchip_device*
store i8* %0, i8** %3
store %struct.tchip_device* %1, %struct.tchip_device** %4
%5 = load i8*, i8** %3
%6 = load %struct.tchip_device*, %struct.tchip_device** %4
%7 = call i32 @add2versionex(i8* %5, %struct.tchip_device* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tchip_device = type { i32 }
@.str = [2 x i8] c"_\00"
define void @add2version(i8* %0, %struct.tchip_device* %1) {
%3 = tail call i32 @add2versionex(i8* %0, %struct.tchip_device* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int pthread_self();
int ThreadId() { return pthread_self(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void unixDlClose(sqlite3_vfs *NotUsed, void *pHandle) {
  (void)(NotUsed);
  dlclose(pHandle);
}


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

x86 assembly (clang, -O2):
<unixDlClose>:
mov    %rsi,%rdi
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @unixDlClose(i32* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @dlclose(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bignum_to_fixnum(int /*<<< orphan*/);
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
int /*<<< orphan*/ tag_fixnum(int /*<<< orphan*/);
int /*<<< orphan*/ untag_object(int /*<<< orphan*/);
void primitive_bignum_to_fixnum(void) {
  drepl(tag_fixnum(bignum_to_fixnum(untag_object(dpeek()))));
}


x86 assembly (clang, -O0):
<primitive_bignum_to_fixnum>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <untag_object@plt>
mov    %eax,%edi
call   1070 <bignum_to_fixnum@plt>
mov    %eax,%edi
call   1050 <tag_fixnum@plt>
mov    %eax,%edi
call   1060 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_bignum_to_fixnum>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <untag_object@plt>
mov    %eax,%edi
call   1070 <bignum_to_fixnum@plt>
mov    %eax,%edi
call   1050 <tag_fixnum@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <drepl@plt>

LLVM IR (-O0):
define void @primitive_bignum_to_fixnum() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @untag_object(i32 %1)
%3 = call i32 @bignum_to_fixnum(i32 %2)
%4 = call i32 @tag_fixnum(i32 %3)
%5 = call i32 @drepl(i32 %4)
ret void
}

LLVM IR (-O2):
define void @primitive_bignum_to_fixnum() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @untag_object(i32 %1)
%3 = tail call i32 @bignum_to_fixnum(i32 %2)
%4 = tail call i32 @tag_fixnum(i32 %3)
%5 = tail call i32 @drepl(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ binaryCount();
int /*<<< orphan*/ countUp();
void TIMER16_0_IRQHandler() {
  countUp();
  binaryCount();
  (*(unsigned int *)0x4000C000) |= 1;
}


x86 assembly (clang, -O0):
<TIMER16_0_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <countUp@plt>
mov    $0x0,%al
call   1030 <binaryCount@plt>
mov    $0x4000c000,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x4000c000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TIMER16_0_IRQHandler>:
push   %rax
xor    %eax,%eax
call   1040 <countUp@plt>
xor    %eax,%eax
call   1030 <binaryCount@plt>
orb    $0x1,0x4000c000
01
pop    %rax
ret

LLVM IR (-O0):
define void @TIMER16_0_IRQHandler() {
%1 = call i32 (...) @countUp()
%2 = call i32 (...) @binaryCount()
%3 = load i32, i32* inttoptr (i64 1073790976 to i32*)
%4 = or i32 %3, 1
store i32 %4, i32* inttoptr (i64 1073790976 to i32*)
ret void
}

LLVM IR (-O2):
define void @TIMER16_0_IRQHandler() {
%1 = tail call i32 (...) @countUp()
%2 = tail call i32 (...) @binaryCount()
%3 = load i32, i32* inttoptr (i64 1073790976 to i32*)
%4 = or i32 %3, 1
store i32 %4, i32* inttoptr (i64 1073790976 to i32*)
ret void
}
cut_public() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cut_public() {
ret i32 0
}
void init_int_array(int *array, int size) {
  for (int i = 0; i < size; i++)
    array[i] = 0;
}


x86 assembly (clang, -O0):
<init_int_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <init_int_array+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <init_int_array+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_int_array>:
test   %esi,%esi
jle    1126 <init_int_array+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @init_int_array(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
extern void out_be16(volatile unsigned short *addr, short val) {
  ((void)(void)((*(volatile unsigned short *)(addr)) = (val)));
}


x86 assembly (clang, -O0):
<out_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_be16>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @out_be16(i16* %0, i16 signext %1) {
%3 = alloca i16*
%4 = alloca i16
store i16* %0, i16** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i16*, i16** %3
store volatile i16 %5, i16* %6
ret void
}

LLVM IR (-O2):
define void @out_be16(i16* %0, i16 signext %1) {
store volatile i16 %1, i16* %0
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ fstat(int, struct stat *);
int get_file_size(int f) {
  struct stat st;
  fstat(f, &st);
  return st.st_size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <fstat@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_file_size(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstat(i32 %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int OK;
int saveoldterm() { return (OK); }


x86 assembly (clang, -O0):
<saveoldterm>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveoldterm>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@OK = global i32 0
define i32 @saveoldterm() {
%1 = load i32, i32* @OK
ret i32 %1
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @saveoldterm() {
%1 = load i32, i32* @OK
ret i32 %1
}
outdec(n) int n;
{
  if (n < 0)
    outbyte('-');
  else
    n = -n;
  outint(n);
}


x86 assembly (clang, -O0):
<outdec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1146 <outdec+0x26>
mov    $0x2d,%edi
mov    $0x0,%al
call   1040 <outbyte@plt>
jmp    114e <outdec+0x2e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <outint@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outdec>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
js     112b <outdec+0xb>
neg    %ebx
jmp    1137 <outdec+0x17>
mov    $0x2d,%edi
xor    %eax,%eax
call   1040 <outbyte@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <outint@plt>

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

LLVM IR (-O2):
define i32 @outdec(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @outbyte to i32 (i32, ...)*)(i32 45)
br label %7
5: ; preds = %1
%6 = sub nsw i32 0, %0
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %0, %3 ], [ %6, %5 ]
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @outint to i32 (i32, ...)*)(i32 %8)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void USB_LP_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @USB_LP_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int M_PI;
float fft_dk(const unsigned int n, const float dx) {
  float dk = (2 * M_PI) / (n * dx);
  return dk;
}


x86 assembly (clang, -O0):
<fft_dk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2ss %eax,%xmm0
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft_dk>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2ss %eax,%xmm1
mov    %edi,%eax
cvtsi2ss %rax,%xmm2
mulss  %xmm0,%xmm2
divss  %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @fft_dk(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%6 = load i32, i32* @M_PI
%7 = mul nsw i32 2, %6
%8 = sitofp i32 %7 to float
%9 = load i32, i32* %3
%10 = uitofp i32 %9 to float
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = fdiv float %8, %12
store float %13, float* %5
%14 = load float, float* %5
ret float %14
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @fft_dk(i32 %0, float %1) {
%3 = load i32, i32* @M_PI
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to float
%6 = uitofp i32 %0 to float
%7 = fmul float %6, %1
%8 = fdiv float %5, %7
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void view_curses_finish(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @view_curses_finish() {
%1 = tail call i32 (...) @endwin()
ret void
}
void iomega_ix2_200_init(void) {}


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

x86 assembly (clang, -O2):
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ _sio_timer_adjust_heap(struct sio_timer_manager *,
                                          struct sio_timer *);
void sio_timer_modify(struct sio_timer_manager *st_mgr,
                      struct sio_timer *timer) {
  _sio_timer_adjust_heap(st_mgr, timer);
}


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

x86 assembly (clang, -O2):
<sio_timer_modify>:
jmp    1030 <_sio_timer_adjust_heap@plt>

LLVM IR (-O0):
%struct.sio_timer_manager = type { i32 }
%struct.sio_timer = type { i32 }
define void @sio_timer_modify(%struct.sio_timer_manager* %0, %struct.sio_timer* %1) {
%3 = alloca %struct.sio_timer_manager*
%4 = alloca %struct.sio_timer*
store %struct.sio_timer_manager* %0, %struct.sio_timer_manager** %3
store %struct.sio_timer* %1, %struct.sio_timer** %4
%5 = load %struct.sio_timer_manager*, %struct.sio_timer_manager** %3
%6 = load %struct.sio_timer*, %struct.sio_timer** %4
%7 = call i32 @_sio_timer_adjust_heap(%struct.sio_timer_manager* %5, %struct.sio_timer* %6)
ret void
}

LLVM IR (-O2):
%struct.sio_timer_manager = type { i32 }
%struct.sio_timer = type { i32 }
define void @sio_timer_modify(%struct.sio_timer_manager* %0, %struct.sio_timer* %1) {
%3 = tail call i32 @_sio_timer_adjust_heap(%struct.sio_timer_manager* %0, %struct.sio_timer* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(char *);
char *str_copy(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main() {
  char *foo = "foo";
  char *bar = str_copy(foo);
  assert(!strcmp(foo, bar));
  free(bar);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <str_copy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
mov    %r14,%rdi
call   1060 <str_copy@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @str_copy(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i32 @strcmp(i8* %6, i8* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = tail call i8* @str_copy(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %1)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pointers_crap();
int main() {
  pointers_crap();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pointers_crap()
ret i32 0
}
/* Variables and functions */
int ssleay_rand_bytes(unsigned char *, int, int, int);
int ssleay_rand_pseudo_bytes(unsigned char *buf, int num) {
  return ssleay_rand_bytes(buf, num, 1, 1);
}


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

x86 assembly (clang, -O2):
<ssleay_rand_pseudo_bytes>:
mov    $0x1,%edx
mov    $0x1,%ecx
jmp    1030 <ssleay_rand_bytes@plt>

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

LLVM IR (-O2):
define i32 @ssleay_rand_pseudo_bytes(i8* %0, i32 %1) {
%3 = tail call i32 @ssleay_rand_bytes(i8* %0, i32 %1, i32 1, i32 1)
ret i32 %3
}
/* Variables and functions */
int power(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n;
  printf("%d", power(2, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <power@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @power(i32 2, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
scalar_t__ getuid();
int al_is_root_session() {
  uid_t uid = getuid();
  if (uid == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<al_is_root_session>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113a <al_is_root_session+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <al_is_root_session+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<al_is_root_session>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @al_is_root_session() {
%1 = tail call i64 (...) @getuid()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
int rumStrlen(char *str) { return strlen(str); }


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

x86 assembly (clang, -O2):
<rumStrlen>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @rumStrlen(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
int rep_int(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @rep_int(i32 returned %0) {
ret i32 %0
}
void rdar9432305(float *P) {
  int i;
  for (; i < 10000; ++i)
    P[i] = 0.0f;
}


x86 assembly (clang, -O0):
<rdar9432305>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    1133 <rdar9432305+0x33>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1108 <rdar9432305+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @rdar9432305(float* nocapture writeonly %0) {
ret void
}
int test_imm_66uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x66 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_66uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x66,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_66uint64_midword_reg>:
test   $0x660000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_66uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 102
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_66uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 6684672
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void swap(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
  printf("After swapping the numbers[a] is %i, [b] is %i\n", *a, *b);
  printf("=====================================================\n");
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %rax
mov    (%rdi),%edx
mov    (%rsi),%eax
mov    %eax,(%rdi)
mov    %edx,(%rsi)
mov    (%rdi),%esi
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"After swapping the numbers[a] is %i, [b] is %i\0A\00"
@.str.1 = [55 x i8] c"=====================================================\0A\00"
define void @swap(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
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"After swapping the numbers[a] is %i, [b] is %i\0A\00"
@str = [54 x i8] c"=====================================================\00"
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
%5 = load i32, i32* %0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %3)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ datf_load();
void dat_load(void) { datf_load(); }


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

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

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

LLVM IR (-O2):
define void @dat_load() {
%1 = tail call i32 (...) @datf_load()
ret void
}
void foo408(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo408(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clean_up();
int /*<<< orphan*/ config(int, char const **);
int /*<<< orphan*/ init_X();
scalar_t__ main_loop();
int /*<<< orphan*/ process_command();
int main(int argc, const char **argv) {
  config(argc, argv);
  init_X();
  if (main_loop())
    process_command();
  else
    clean_up();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <config@plt>
mov    $0x0,%al
call   1050 <init_X@plt>
mov    $0x0,%al
call   1070 <main_loop@plt>
cmp    $0x0,%rax
je     1196 <main+0x46>
mov    $0x0,%al
call   1030 <process_command@plt>
jmp    119d <main+0x4d>
mov    $0x0,%al
call   1040 <clean_up@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1060 <config@plt>
xor    %eax,%eax
call   1050 <init_X@plt>
xor    %eax,%eax
call   1070 <main_loop@plt>
test   %rax,%rax
je     1172 <main+0x22>
xor    %eax,%eax
call   1030 <process_command@plt>
jmp    1179 <main+0x29>
xor    %eax,%eax
call   1040 <clean_up@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @config(i32 %6, i8** %7)
%9 = call i32 (...) @init_X()
%10 = call i64 (...) @main_loop()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @process_command()
br label %16
14: ; preds = %2
%15 = call i32 (...) @clean_up()
br label %16
16: ; preds = %14, %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @config(i32 %0, i8** %1)
%4 = tail call i32 (...) @init_X()
%5 = tail call i64 (...) @main_loop()
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 (...) @process_command()
br label %11
9: ; preds = %2
%10 = tail call i32 (...) @clean_up()
br label %11
11: ; preds = %9, %7
ret i32 0
}
int nonzero_sign(double n) { return 2 * (n > 0) - 1; }


x86 assembly (clang, -O0):
<nonzero_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
shl    $0x1,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonzero_sign>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @nonzero_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = mul nsw i32 2, %5
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @nonzero_sign(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = select i1 %2, i32 1, i32 -1
ret i32 %3
}
unsigned int getlong(unsigned char *p) {
  do {
    if (((void)(p), (1 == 0)))
      return (0);
  } while (0);
  return (p[0] << 0 | p[1] << 8 | p[2] << 16 | p[3] << 24);
}


x86 assembly (clang, -O0):
<getlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1117 <getlong+0x17>
jmp    1123 <getlong+0x23>
movl   $0x0,-0x4(%rbp)
jmp    115c <getlong+0x5c>
jmp    1128 <getlong+0x28>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x0,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getlong(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
char select_mode(char mode) {
  switch (mode) {
  case 'r':
    return 0;
  case 't':
    return 1;
  case 'e':
    return 10;
  case 'c':
    return 2;
  case 'd':
    return 9;
  case 'a':
    return 8;
  case 'u':
    return 4;
  case 'i':
    return 5;
  case 'j':
    return 7;
  case 'k':
    return 6;
  default:
    return 11;
  }
}


x86 assembly (clang, -O0):
<select_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x14,%eax
ja     118e <select_mode+0x8e>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x0,-0x1(%rbp)
jmp    1192 <select_mode+0x92>
movb   $0x1,-0x1(%rbp)
jmp    1192 <select_mode+0x92>
movb   $0xa,-0x1(%rbp)
jmp    1192 <select_mode+0x92>
movb   $0x2,-0x1(%rbp)
jmp    1192 <select_mode+0x92>
movb   $0x9,-0x1(%rbp)
jmp    1192 <select_mode+0x92>
movb   $0x8,-0x1(%rbp)
jmp    1192 <select_mode+0x92>
movb   $0x4,-0x1(%rbp)
jmp    1192 <select_mode+0x92>
movb   $0x5,-0x1(%rbp)
jmp    1192 <select_mode+0x92>
movb   $0x7,-0x1(%rbp)
jmp    1192 <select_mode+0x92>
movb   $0x6,-0x1(%rbp)
jmp    1192 <select_mode+0x92>
movb   $0xb,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_mode>:
movslq %edi,%rcx
add    $0xffffffffffffff9f,%rcx
mov    $0xb,%al
cmp    $0x14,%ecx
ja     1118 <select_mode+0x18>
lea    0xeeb(%rip),%rax
mov    (%rcx,%rax,1),%al
ret

LLVM IR (-O0):
define signext i8 @select_mode(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %16 [
i32 114, label %6
i32 116, label %7
i32 101, label %8
i32 99, label %9
i32 100, label %10
i32 97, label %11
i32 117, label %12
i32 105, label %13
i32 106, label %14
i32 107, label %15
]
6: ; preds = %1
store i8 0, i8* %2
br label %17
7: ; preds = %1
store i8 1, i8* %2
br label %17
8: ; preds = %1
store i8 10, i8* %2
br label %17
9: ; preds = %1
store i8 2, i8* %2
br label %17
10: ; preds = %1
store i8 9, i8* %2
br label %17
11: ; preds = %1
store i8 8, i8* %2
br label %17
12: ; preds = %1
store i8 4, i8* %2
br label %17
13: ; preds = %1
store i8 5, i8* %2
br label %17
14: ; preds = %1
store i8 7, i8* %2
br label %17
15: ; preds = %1
store i8 6, i8* %2
br label %17
16: ; preds = %1
store i8 11, i8* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
@switch.table.select_mode = [21 x i8] c"\08\0B\02\09\0A\0B\0B\0B\05\07\06\0B\0B\0B\0B\0B\0B\00\0B\01\04"
define signext i8 @select_mode(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -97
%4 = icmp ult i32 %3, 21
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [21 x i8], [21 x i8]* @switch.table.select_mode, i64 0, i64 %6
%8 = load i8, i8* %7
br label %9
9: ; preds = %1, %5
%10 = phi i8 [ %8, %5 ], [ 11, %1 ]
ret i8 %10
}
int s(x)
short x;
{ return x; }


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):

:
movswl %di,%eax
ret

LLVM IR (-O0):
define i32 @s(i32 %0) {
%2 = alloca i16
%3 = trunc i32 %0 to i16
store i16 %3, i16* %2
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @s(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr exact i32 %2, 16
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ InvMixColumn(unsigned char *);
void InvMixColumns(unsigned char *state) {
  InvMixColumn(state + 0 * 4);
  InvMixColumn(state + 1 * 4);
  InvMixColumn(state + 2 * 4);
  InvMixColumn(state + 3 * 4);
}


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

x86 assembly (clang, -O2):
<InvMixColumns>:
push   %rbx
mov    %rdi,%rbx
call   1030 <InvMixColumn@plt>
lea    0x4(%rbx),%rdi
call   1030 <InvMixColumn@plt>
lea    0x8(%rbx),%rdi
call   1030 <InvMixColumn@plt>
add    $0xc,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <InvMixColumn@plt>

LLVM IR (-O0):
define void @InvMixColumns(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = call i32 @InvMixColumn(i8* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 4
%8 = call i32 @InvMixColumn(i8* %7)
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 8
%11 = call i32 @InvMixColumn(i8* %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 12
%14 = call i32 @InvMixColumn(i8* %13)
ret void
}

LLVM IR (-O2):
define void @InvMixColumns(i8* %0) {
%2 = tail call i32 @InvMixColumn(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = tail call i32 @InvMixColumn(i8* %3)
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = tail call i32 @InvMixColumn(i8* %5)
%7 = getelementptr inbounds i8, i8* %0, i64 12
%8 = tail call i32 @InvMixColumn(i8* %7)
ret void
}