xunge/DecIR huggingface dataset:
/* Variables and functions */
int findFiboN(long);
int printf(char *, ...);
int scanf(char *, long *);
int main(void) {
  long n;
  int i;
  i = printf("Enter the number: ");
  i = scanf("%d", &n);
  i = printf("The %d fibonacci number is: %d\n", n, findFiboN(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <findFiboN@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <findFiboN@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"The %d fibonacci number is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %2)
store i32 %5, i32* %3
%6 = load i64, i64* %2
%7 = load i64, i64* %2
%8 = call i32 @findFiboN(i64 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i64 %6, i32 %8)
store i32 %9, i32* %3
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"The %d fibonacci number is: %d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @findFiboN(i64 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i64 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
__attribute__((__noreturn__)) void abort(void) { panic("abort() was called"); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <panic@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <panic@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"abort() was called\00"
define void @abort() {
%1 = call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"abort() was called\00"
define void @abort() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
unreachable
}
unsigned char setBit_fun_uchar(unsigned char x, unsigned i) {
  return x | 1 << i;
}


x86 assembly (clang, -O0):
<setBit_fun_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @setBit_fun_uchar(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @setBit_fun_uchar(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = or i8 %4, %0
ret i8 %5
}
int test_func() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @test_func() {
ret i32 1
}
void test4() {
  if (0)
    ;
  int X;
foo:
  if (0)
    ;
}


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

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

LLVM IR (-O0):
define void @test4() {
%1 = alloca i32
br label %2
2: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @test4() {
ret void
}
int do_906() { return 906; }


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

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

LLVM IR (-O0):
define i32 @do_906() {
ret i32 906
}

LLVM IR (-O2):
define i32 @do_906() {
ret i32 906
}
int ltsf2(float a, float b) { return a < b; }


x86 assembly (clang, -O0):
<ltsf2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltsf2>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

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

LLVM IR (-O2):
define i32 @ltsf2(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void *test_anti_range_79(unsigned n) {
  extern void *alloc_anti_range_79(unsigned) __attribute__((alloc_size(1)));
  if (1 <= n && n <= 1)
    n = 1 - 1;
  return alloc_anti_range_79(n);
}


x86 assembly (clang, -O0):
<test_anti_range_79>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
ja     113a <test_anti_range_79+0x2a>
cmpl   $0x1,-0x4(%rbp)
ja     113a <test_anti_range_79+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_79@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_79>:
xor    %eax,%eax
cmp    $0x1,%edi
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_79@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_79(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 0, i32 %0
%4 = tail call i8* @alloc_anti_range_79(i32 %3)
ret i8* %4
}
/* Variables and functions */
size_t pstrnlen(const char *s, size_t count) {
  const char *p = s;
  while (*p && count-- > 0)
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<pstrnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1142 <pstrnlen+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <pstrnlen+0x52>
jmp    1163 <pstrnlen+0x63>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <pstrnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstrnlen>:
cmpb   $0x0,(%rdi)
mov    %rdi,%rax
je     1135 <pstrnlen+0x35>
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <pstrnlen+0x35>
add    $0xffffffffffffffff,%rsi
mov    %rdi,%rax
nopw   0x0(%rax,%rax,1)
sub    $0x1,%rsi
setb   %cl
cmpb   $0x0,0x1(%rax)
lea    0x1(%rax),%rax
je     1135 <pstrnlen+0x35>
test   %cl,%cl
je     1120 <pstrnlen+0x20>
sub    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @pstrnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %18, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i64, i64* %4
%14 = add i64 %13, -1
store i64 %14, i64* %4
%15 = icmp ugt i64 %13, 0
br label %16
16: ; preds = %12, %7
%17 = phi i1 [ false, %7 ], [ %15, %12 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %5
br label %7
21: ; preds = %16
%22 = load i8*, i8** %5
%23 = load i8*, i8** %3
%24 = ptrtoint i8* %22 to i64
%25 = ptrtoint i8* %23 to i64
%26 = sub i64 %24, %25
ret i64 %26
}

LLVM IR (-O2):
define i64 @pstrnlen(i8* %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = icmp eq i64 %1, 0
%6 = or i1 %4, %5
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i8* [ %11, %7 ], [ %0, %2 ]
%9 = phi i64 [ %10, %7 ], [ %1, %2 ]
%10 = add i64 %9, -1
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = icmp eq i64 %10, 0
%15 = select i1 %13, i1 true, i1 %14
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i8* [ %0, %2 ], [ %11, %7 ]
%18 = ptrtoint i8* %17 to i64
%19 = ptrtoint i8* %0 to i64
%20 = sub i64 %18, %19
ret i64 %20
}
/* Variables and functions */
void set_to_zero_d(size_t len, double *A) {
  for (; len--;)
    *A++ = 0.0;
}


x86 assembly (clang, -O0):
<set_to_zero_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1140 <set_to_zero_d+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    110c <set_to_zero_d+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_to_zero_d>:
test   %rdi,%rdi
je     112b <set_to_zero_d+0x1b>
push   %rax
mov    %rdi,%rdx
shl    $0x3,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @set_to_zero_d(i64 %0, double* %1) {
%3 = alloca i64
%4 = alloca double*
store i64 %0, i64* %3
store double* %1, double** %4
br label %5
5: ; preds = %9, %2
%6 = load i64, i64* %3
%7 = add i64 %6, -1
store i64 %7, i64* %3
%8 = icmp ne i64 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i32 1
store double* %11, double** %4
store double 0.000000e+00, double* %10
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @set_to_zero_d(i64 %0, double* nocapture writeonly %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast double* %1 to i8*
%6 = shl nuw i64 %0, 3
br label %7
7: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int truncate(char const *, int /*<<< orphan*/);
int fu_Truncate(const char *path, int length) {
  return truncate(path, (off_t)length);
}


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

x86 assembly (clang, -O2):
<fu_Truncate>:
jmp    1030 <truncate@plt>

LLVM IR (-O0):
define i32 @fu_Truncate(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 @truncate(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @fu_Truncate(i8* %0, i32 %1) {
%3 = tail call i32 @truncate(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int syscall(int /*<<< orphan*/);
int my_gettid(void) { return syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<my_gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @my_gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = call i32 @syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @my_gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
/* Variables and functions */
scalar_t__ log(double);
double rnd_double();
double expdev(void) {
  double dum;
  do
    dum = rnd_double();
  while (dum == 0.0);
  return (float)-log(dum);
}


x86 assembly (clang, -O0):
<expdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rnd_double@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1151 <expdev+0x31>
jp     1151 <expdev+0x31>
jmp    1128 <expdev+0x8>
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expdev>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rnd_double@plt>
ucomisd 0xec1(%rip),%xmm0
jne    1143 <expdev+0x23>
jnp    1130 <expdev+0x10>
call   1040 <log@plt>
neg    %rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @expdev() {
%1 = alloca double
br label %2
2: ; preds = %4, %0
%3 = call double (...) @rnd_double()
store double %3, double* %1
br label %4
4: ; preds = %2
%5 = load double, double* %1
%6 = fcmp oeq double %5, 0.000000e+00
br i1 %6, label %2, label %7
7: ; preds = %4
%8 = load double, double* %1
%9 = call i64 @log(double %8)
%10 = sub nsw i64 0, %9
%11 = sitofp i64 %10 to float
%12 = fpext float %11 to double
ret double %12
}

LLVM IR (-O2):
define double @expdev() {
br label %1
1: ; preds = %1, %0
%2 = tail call double (...) @rnd_double()
%3 = fcmp oeq double %2, 0.000000e+00
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i64 @log(double %2)
%6 = sub nsw i64 0, %5
%7 = sitofp i64 %6 to float
%8 = fpext float %7 to double
ret double %8
}
void cmp_drv_i8d_update(struct CmpDrvI8d *drv, double dt) {
  (void)drv;
  (void)dt;
}


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

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

LLVM IR (-O0):
%struct.CmpDrvI8d = type opaque
define void @cmp_drv_i8d_update(%struct.CmpDrvI8d* %0, double %1) {
%3 = alloca %struct.CmpDrvI8d*
%4 = alloca double
store %struct.CmpDrvI8d* %0, %struct.CmpDrvI8d** %3
store double %1, double* %4
%5 = load %struct.CmpDrvI8d*, %struct.CmpDrvI8d** %3
%6 = load double, double* %4
ret void
}

LLVM IR (-O2):
%struct.CmpDrvI8d = type opaque
define void @cmp_drv_i8d_update(%struct.CmpDrvI8d* nocapture %0, double %1) {
ret void
}
char *construct_have_message(int piece_index) {
  char *msg = malloc(9);
  int *msgLen = malloc(4);
  *msgLen = 5;
  int *piece_id = malloc(4);
  char *msgID = malloc(1);
  *msgID = 4;
  *piece_id = piece_index;
  memcpy(msg, msgLen, 4);
  memcpy(msg + 4, msgID, 1);
  memcpy(msg + 5, piece_id, 4);
  free(msgLen);
  free(msgID);
  free(piece_id);
  return msg;
}


x86 assembly (clang, -O0):
<construct_have_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x4,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rcx),%cl
mov    %cl,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x5(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<construct_have_message>:
push   %rbx
mov    %edi,%ebx
mov    $0x9,%edi
call   1030 <malloc@plt>
movl   $0x5,(%rax)
movb   $0x4,0x4(%rax)
mov    %ebx,0x5(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @construct_have_message(i32 %0) {
%2 = tail call dereferenceable_or_null(9) i8* @malloc(i64 9)
%3 = bitcast i8* %2 to i32*
store i32 5, i32* %3
%4 = getelementptr inbounds i8, i8* %2, i64 4
store i8 4, i8* %4
%5 = getelementptr inbounds i8, i8* %2, i64 5
%6 = bitcast i8* %5 to i32*
store i32 %0, i32* %6
ret i8* %2
}
void h_copsname(char *name, int argc, char **argv, void *user_data) {
  printf("Called: %s\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<h_copsname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_copsname>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_copsname = [11 x i8] c"h_copsname\00"
define void @h_copsname(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.h_copsname, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_copsname = [11 x i8] c"h_copsname\00"
define void @h_copsname(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.h_copsname, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void app() { puts("app"); }


x86 assembly (clang, -O0):
<app>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<app>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"app\00"
define void @app() {
%1 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"app\00"
define void @app() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
cbuf24(f, n) int f, n;
{ cbuf(f, n, 24); }


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

x86 assembly (clang, -O2):
<cbuf24>:
mov    $0x18,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf24(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 24)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf24(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 24)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ is_le();
int is_be(void) { return (!is_le()); }


x86 assembly (clang, -O0):
<is_be>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <is_le@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_be() {
%1 = call i32 (...) @is_le()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_be() {
%1 = tail call i32 (...) @is_le()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int ch;
  int charcount = 0;
  while ((ch = getchar()) != '.') {
    if (ch != '"' && ch != '\'')
      charcount++;
  }
  printf("There are %d non-quote characters.\n", charcount);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x2e,%eax
je     116b <main+0x4b>
cmpl   $0x22,-0x8(%rbp)
je     1166 <main+0x46>
cmpl   $0x27,-0x8(%rbp)
je     1166 <main+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x22,%eax
je     1130 <main+0x10>
cmp    $0x27,%eax
je     1130 <main+0x10>
cmp    $0x2e,%eax
je     114b <main+0x2b>
add    $0x1,%ebx
jmp    1130 <main+0x10>
lea    0xeae(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"There are %d non-quote characters.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %16, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = icmp ne i32 %5, 46
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 34
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 39
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %10, %7
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"There are %d non-quote characters.\0A\00"
define i32 @main() {
br label %1
1: ; preds = %6, %0
%2 = phi i32 [ %7, %6 ], [ 0, %0 ]
br label %3
3: ; preds = %5, %1
%4 = tail call i32 (...) @getchar()
switch i32 %4, label %6 [
i32 46, label %8
i32 39, label %5
i32 34, label %5
]
5: ; preds = %3, %3
br label %3
6: ; preds = %3
%7 = add nuw nsw i32 %2, 1
br label %1
8: ; preds = %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
struct scanner_state {
  int dummy;
};

/* Variables and functions */
int add_digit(struct scanner_state *, char, int);
scalar_t__ isodigit(char);
int non_digit(struct scanner_state *);
int mode_oct_more(struct scanner_state *s, char c) {
  return isodigit(c) ? add_digit(s, c, 8) : non_digit(s);
}


x86 assembly (clang, -O0):
<mode_oct_more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1050 <isodigit@plt>
cmp    $0x0,%rax
je     116f <mode_oct_more+0x3f>
mov    -0x8(%rbp),%rdi
mov    $0x8,%edx
movsbl -0x9(%rbp),%esi
call   1040 <add_digit@plt>
mov    %eax,-0x10(%rbp)
jmp    117b <mode_oct_more+0x4b>
mov    -0x8(%rbp),%rdi
call   1030 <non_digit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_oct_more>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1050 <isodigit@plt>
test   %rax,%rax
je     115b <mode_oct_more+0x2b>
movsbl %bpl,%esi
mov    %rbx,%rdi
mov    $0x8,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <add_digit@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <non_digit@plt>

LLVM IR (-O0):
%struct.scanner_state = type { i32 }
define i32 @mode_oct_more(%struct.scanner_state* %0, i8 signext %1) {
%3 = alloca %struct.scanner_state*
%4 = alloca i8
store %struct.scanner_state* %0, %struct.scanner_state** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = call i64 @isodigit(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load %struct.scanner_state*, %struct.scanner_state** %3
%10 = load i8, i8* %4
%11 = call i32 @add_digit(%struct.scanner_state* %9, i8 signext %10, i32 8)
br label %15
12: ; preds = %2
%13 = load %struct.scanner_state*, %struct.scanner_state** %3
%14 = call i32 @non_digit(%struct.scanner_state* %13)
br label %15
15: ; preds = %12, %8
%16 = phi i32 [ %11, %8 ], [ %14, %12 ]
ret i32 %16
}

LLVM IR (-O2):
%struct.scanner_state = type { i32 }
define i32 @mode_oct_more(%struct.scanner_state* %0, i8 signext %1) {
%3 = tail call i64 @isodigit(i8 signext %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @add_digit(%struct.scanner_state* %0, i8 signext %1, i32 8)
br label %9
7: ; preds = %2
%8 = tail call i32 @non_digit(%struct.scanner_state* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
int is_valid_S2K(const unsigned int algo) {
  return (algo == 0 || algo == 1 || algo == 3);
}


x86 assembly (clang, -O0):
<is_valid_S2K>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <is_valid_S2K+0x2f>
mov    $0x1,%al
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <is_valid_S2K+0x2f>
cmpl   $0x3,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_S2K>:
cmp    $0x3,%edi
sete   %al
cmp    $0x2,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_valid_S2K(i32 %0) {
%2 = icmp eq i32 %0, 3
%3 = icmp ult i32 %0, 2
%4 = or i1 %3, %2
%5 = zext i1 %4 to i32
ret i32 %5
}
void InvalidateDcache(unsigned long addr, unsigned long len) {
  unsigned long end;
  return;
  addr &= (~((1 << 5) - 1));
  len >>= 5;
  end = addr + len * (1 << 5);
  while (addr != end) {
    asm("mcr p15, 0, %0, c7, c6, 1" ::"r"(addr));
    addr += (1 << 5);
  }
  return;
}


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

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

LLVM IR (-O0):
define void @InvalidateDcache(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @InvalidateDcache(i64 %0, i64 %1) {
ret void
}
void av_encryption_init_info_add_side_data() {}


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

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

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

LLVM IR (-O2):
define void @av_encryption_init_info_add_side_data() {
ret void
}
__attribute__((noreturn)) void noreturn(void) {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @noreturn() {
br label %1
1: ; preds = %1, %0
br label %1
}
char *SubStrings_ASCII_LowerS(char *const S) {
  register char *Worker = S;
  for (; *Worker != '\0'; ++Worker) {
    if (*Worker >= 'A' && *Worker <= 'Z') {
      *Worker += ('a' - 'A');
    }
  }
  return S;
}


x86 assembly (clang, -O0):
<SubStrings_ASCII_LowerS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <SubStrings_ASCII_LowerS+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114c <SubStrings_ASCII_LowerS+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114c <SubStrings_ASCII_LowerS+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
jmp    1151 <SubStrings_ASCII_LowerS+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <SubStrings_ASCII_LowerS+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubStrings_ASCII_LowerS>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <SubStrings_ASCII_LowerS+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <SubStrings_ASCII_LowerS+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <SubStrings_ASCII_LowerS+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <SubStrings_ASCII_LowerS+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <SubStrings_ASCII_LowerS+0x10>
ret

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

LLVM IR (-O2):
define i8* @SubStrings_ASCII_LowerS(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
void ext_unit2quantify_unit() {}


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

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

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

LLVM IR (-O2):
define void @ext_unit2quantify_unit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\nplaceholder for sloadhost-tms320x28\n");
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [37 x i8] c"\0Aplaceholder for sloadhost-tms320x28\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 1
}
float beginningz(float cosqr, float a, float alpha, float A, int r) {
  return A * cosqr * a;
}


x86 assembly (clang, -O0):
<beginningz>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @beginningz(float %0, float %1, float %2, float %3, i32 %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i32
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store i32 %4, i32* %10
%11 = load float, float* %9
%12 = load float, float* %6
%13 = fmul float %11, %12
%14 = load float, float* %7
%15 = fmul float %13, %14
ret float %15
}

LLVM IR (-O2):
define float @beginningz(float %0, float %1, float %2, float %3, i32 %4) {
%6 = fmul float %0, %3
%7 = fmul float %6, %1
ret float %7
}
void a_or(volatile void *p, int v) {
  __asm__("lock ; or %1, %0" : "=m"(*(int *)p) : "r"(v) : "memory");
}


x86 assembly (clang, -O0):
<a_or>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
lock or %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_or>:
lock or %esi,(%rdi)
ret

LLVM IR (-O0):
define void @a_or(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @a_or(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
tail call void asm "lock ; or $1, $0", "=*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ setbits(unsigned int, int, int, unsigned int *);
int main() {
  unsigned x, y;
  int p, n;
  x = 0xaaaa;
  y = 0xffff;
  p = 7;
  n = 4;
  setbits(x, p, n, &y);
  printf("%x\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xaaaa,-0x8(%rbp)
movl   $0xffff,-0xc(%rbp)
movl   $0x7,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    -0xc(%rbp),%rcx
call   1040 <setbits@plt>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xffff,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0xaaaa,%edi
mov    $0x7,%esi
mov    $0x4,%edx
call   1040 <setbits@plt>
mov    0x4(%rsp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 43690, i32* %2
store i32 65535, i32* %3
store i32 7, i32* %4
store i32 4, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @setbits(i32 %6, i32 %7, i32 %8, i32* %3)
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 65535, i32* %1
%3 = call i32 @setbits(i32 43690, i32 7, i32 4, i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int ips_startup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ips_startup() {
ret i32 0
}
int GAOptionExists(int argc, char **argv) {
  while (argc--)
    if ((*argv++)[0] == '-')
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<GAOptionExists>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     114e <GAOptionExists+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1149 <GAOptionExists+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1155 <GAOptionExists+0x55>
jmp    110b <GAOptionExists+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GAOptionExists>:
mov    %edi,%ecx
xor    %eax,%eax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
cmp    %edx,%ecx
je     1126 <GAOptionExists+0x26>
mov    (%rsi,%rdx,8),%rdi
add    $0x1,%rdx
cmpb   $0x2d,(%rdi)
jne    1110 <GAOptionExists+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @GAOptionExists(i32 %0, i8** nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32 [ %0, %2 ], [ %8, %7 ]
%5 = phi i8** [ %1, %2 ], [ %9, %7 ]
%6 = icmp eq i32 %4, 0
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = getelementptr inbounds i8*, i8** %5, i64 1
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 45
br i1 %12, label %13, label %3
13: ; preds = %3, %7
%14 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %14
}
/* Type definitions */
typedef int clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
int __builtin_nyuzi_read_control_reg(int);
clock_t clock(void) {
  return __builtin_nyuzi_read_control_reg(6) / (50000000 / CLOCKS_PER_SEC);
}


x86 assembly (clang, -O0):
<clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6,%edi
call   1030 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2faf080,%eax
mov    0x2eb7(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock>:
push   %rax
mov    $0x6,%edi
call   1030 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,%ecx
mov    0x2ec4(%rip),%rsi
mov    $0x2faf080,%eax
xor    %edx,%edx
idivl  (%rsi)
mov    %eax,%esi
mov    %ecx,%eax
cltd
idiv   %esi
pop    %rcx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define i32 @clock() {
%1 = call i32 @__builtin_nyuzi_read_control_reg(i32 6)
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 50000000, %2
%4 = sdiv i32 %1, %3
ret i32 %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define i32 @clock() {
%1 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 6)
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 50000000, %2
%4 = sdiv i32 %1, %3
ret i32 %4
}
void setbitfield(unsigned char *pageaddr, int mask, int shift, int val) {
  *pageaddr = (*pageaddr & ~(mask << shift)) | ((val & mask) << shift);
}


x86 assembly (clang, -O0):
<setbitfield>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x14(%rbp),%edx
and    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbitfield>:
mov    %ecx,%eax
mov    %edx,%ecx
and    %esi,%eax
shl    %cl,%esi
movzbl (%rdi),%edx
shl    %cl,%eax
not    %esi
and    %edx,%esi
or     %esi,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @setbitfield(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = shl i32 %12, %13
%15 = xor i32 %14, -1
%16 = and i32 %11, %15
%17 = load i32, i32* %8
%18 = load i32, i32* %6
%19 = and i32 %17, %18
%20 = load i32, i32* %7
%21 = shl i32 %19, %20
%22 = or i32 %16, %21
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %5
store i8 %23, i8* %24
ret void
}

LLVM IR (-O2):
define void @setbitfield(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = load i8, i8* %0
%6 = zext i8 %5 to i32
%7 = shl i32 %1, %2
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
%10 = and i32 %3, %1
%11 = shl i32 %10, %2
%12 = or i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %0
ret void
}
/* Type definitions */
struct qre_il_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct qre_il_block *);
int qre_il_block_destroy(struct qre_il_block *qre_il_block) {
  free(qre_il_block);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.qre_il_block = type { i32 }
define i32 @qre_il_block_destroy(%struct.qre_il_block* nocapture %0) {
%2 = tail call i32 @free(%struct.qre_il_block* %0)
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *ALreverbState_New(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<ALreverbState_New>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @ALreverbState_New(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void printcharc(char ch) {
  *((volatile unsigned char *)(((signed int)0x80000000) + 0x10000000 +
                               0x0000)) = ch;
}


x86 assembly (clang, -O0):
<printcharc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0xffffffff90000000,%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<printcharc>:
mov    %dil,0xffffffff90000000
90
ret

LLVM IR (-O0):
define void @printcharc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store volatile i8 %3, i8* inttoptr (i64 -1879048192 to i8*)
ret void
}

LLVM IR (-O2):
define void @printcharc(i8 signext %0) {
store volatile i8 %0, i8* inttoptr (i64 -1879048192 to i8*)
ret void
}