xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *malloc(int const);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int const);
char *copy_string_into_new_buf(const char *src) {
  const int len = strlen(src) + 1;
  char *buf = malloc(len);
  assert(buf && "Failed to alloc");
  strncpy(buf, src, len);
  return buf;
}


x86 assembly (clang, -O0):
<copy_string_into_new_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1181 <copy_string_into_new_buf+0x41>
mov    $0x1,%al
mov    %al,-0x19(%rbp)
jmp    1181 <copy_string_into_new_buf+0x41>
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string_into_new_buf>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Failed to alloc\00"
define i8* @copy_string_into_new_buf(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %1
%14 = phi i1 [ false, %1 ], [ true, %12 ]
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i8*, i8** %4
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = call i32 @strncpy(i8* %17, i8* %18, i32 %19)
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
define i8* @copy_string_into_new_buf(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ recurser_void();
int main() {
  recurser_void();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <recurser_void@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <recurser_void@plt>
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @recurser_void()
%2 = tail call i32 @exit(i32 0)
unreachable
}
RCU_DEF_DESTROY_FUNC(user_f4_destroy, param) {}


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

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

LLVM IR (-O0):
define i32 @RCU_DEF_DESTROY_FUNC(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @RCU_DEF_DESTROY_FUNC(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int /*<<< orphan*/ syserr(int, char *);
void unlock(pthread_mutex_t *l) {
  int err;
  if ((err = pthread_mutex_unlock(l)) != 0)
    syserr(err, "unlock failed");
}


x86 assembly (clang, -O0):
<unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1150 <unlock+0x30>
mov    -0xc(%rbp),%edi
lea    0xeb5(%rip),%rsi
call   1030 <syserr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock>:
push   %rax
call   1040 <pthread_mutex_unlock@plt>
test   %eax,%eax
je     1139 <unlock+0x19>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <syserr@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"unlock failed\00"
define void @unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @syserr(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct iocb {
  int dummy;
};
typedef int /*<<< orphan*/ aio_context_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_io_submit;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, long, struct iocb **);
int io_submit(aio_context_t ctx, long nr, struct iocb **iocbpp) {
  return syscall(__NR_io_submit, ctx, nr, iocbpp);
}


x86 assembly (clang, -O0):
<io_submit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_submit>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.iocb = type { i32 }
@__NR_io_submit = global i32 0
define i32 @io_submit(i32 %0, i64 %1, %struct.iocb** %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca %struct.iocb**
store i32 %0, i32* %4
store i64 %1, i64* %5
store %struct.iocb** %2, %struct.iocb*** %6
%7 = load i32, i32* @__NR_io_submit
%8 = load i32, i32* %4
%9 = load i64, i64* %5
%10 = load %struct.iocb**, %struct.iocb*** %6
%11 = call i32 @syscall(i32 %7, i32 %8, i64 %9, %struct.iocb** %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.iocb = type { i32 }
@__NR_io_submit = global i32 0
define i32 @io_submit(i32 %0, i64 %1, %struct.iocb** %2) {
%4 = load i32, i32* @__NR_io_submit
%5 = tail call i32 @syscall(i32 %4, i32 %0, i64 %1, %struct.iocb** %2)
ret i32 %5
}
void test_RETFIE() {}


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

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

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

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

/* Variables and functions */
int atoi(char *);
char *findLine(int /*<<< orphan*/ *, char *);
int parseadminlevel(FILE *plr_file, int level) {
  char *fromFile = findLine(plr_file, "Admn:");
  if (fromFile != NULL)
    return atoi(fromFile);
  if (level >= 30)
    return level - 30;
  else
    return 0;
}


x86 assembly (clang, -O0):
<parseadminlevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1040 <findLine@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115f <parseadminlevel+0x3f>
mov    -0x20(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    117e <parseadminlevel+0x5e>
cmpl   $0x1e,-0x14(%rbp)
jl     1177 <parseadminlevel+0x57>
mov    -0x14(%rbp),%eax
sub    $0x1e,%eax
mov    %eax,-0x4(%rbp)
jmp    117e <parseadminlevel+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseadminlevel>:
push   %rbx
mov    %esi,%ebx
lea    0xed6(%rip),%rsi
call   1040 <findLine@plt>
test   %rax,%rax
je     113d <parseadminlevel+0x1d>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <atoi@plt>
lea    -0x1e(%rbx),%ecx
xor    %eax,%eax
cmp    $0x1e,%ebx
cmovge %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"Admn:\00"
define i32 @parseadminlevel(i32* %0, i32 %1) {
%3 = tail call i8* @findLine(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @atoi(i8* %3)
br label %11
7: ; preds = %2
%8 = icmp sgt i32 %1, 29
%9 = add nsw i32 %1, -30
%10 = select i1 %8, i32 %9, i32 0
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ %6, %5 ], [ %10, %7 ]
ret i32 %12
}
int test(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @test() {
ret i32 1
}
double impulse_to_class_fraction(double impulse) {
  while (impulse >= 10.)
    impulse /= 2;
  return (impulse - 5.) / 5.;
}


x86 assembly (clang, -O0):
<impulse_to_class_fraction>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     113b <impulse_to_class_fraction+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1109 <impulse_to_class_fraction+0x9>
movsd  -0x8(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<impulse_to_class_fraction>:
ucomisd 0xef8(%rip),%xmm0
jb     112a <impulse_to_class_fraction+0x2a>
movsd  0xef6(%rip),%xmm1
movsd  0xee6(%rip),%xmm2
nopw   0x0(%rax,%rax,1)
mulsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jae    1120 <impulse_to_class_fraction+0x20>
addsd  0xede(%rip),%xmm0
divsd  0xede(%rip),%xmm0
ret

LLVM IR (-O0):
define double @impulse_to_class_fraction(double %0) {
%2 = alloca double
store double %0, double* %2
br label %3
3: ; preds = %6, %1
%4 = load double, double* %2
%5 = fcmp oge double %4, 1.000000e+01
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load double, double* %2
%8 = fdiv double %7, 2.000000e+00
store double %8, double* %2
br label %3
9: ; preds = %3
%10 = load double, double* %2
%11 = fsub double %10, 5.000000e+00
%12 = fdiv double %11, 5.000000e+00
ret double %12
}

LLVM IR (-O2):
define double @impulse_to_class_fraction(double %0) {
%2 = fcmp ult double %0, 1.000000e+01
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi double [ %5, %3 ], [ %0, %1 ]
%5 = fmul double %4, 5.000000e-01
%6 = fcmp ult double %5, 1.000000e+01
br i1 %6, label %7, label %3
7: ; preds = %3, %1
%8 = phi double [ %0, %1 ], [ %5, %3 ]
%9 = fadd double %8, -5.000000e+00
%10 = fdiv double %9, 5.000000e+00
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
void decrc(void) { esc("8"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"8\00"
define void @decrc() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rq_asset_fxvol {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rq_asset_fxvol_free(struct rq_asset_fxvol *);
void rq_asset_fxvol_freefunc(void *asset_data) {
  rq_asset_fxvol_free((struct rq_asset_fxvol *)asset_data);
}


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

x86 assembly (clang, -O2):
<rq_asset_fxvol_freefunc>:
jmp    1030 <rq_asset_fxvol_free@plt>

LLVM IR (-O0):
%struct.rq_asset_fxvol = type { i32 }
define void @rq_asset_fxvol_freefunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.rq_asset_fxvol*
%5 = call i32 @rq_asset_fxvol_free(%struct.rq_asset_fxvol* %4)
ret void
}

LLVM IR (-O2):
%struct.rq_asset_fxvol = type { i32 }
define void @rq_asset_fxvol_freefunc(i8* %0) {
%2 = bitcast i8* %0 to %struct.rq_asset_fxvol*
%3 = tail call i32 @rq_asset_fxvol_free(%struct.rq_asset_fxvol* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exec_once_0_block(void) { printf("Hello World from a constructor 1\n"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Hello World from a constructor 1\0A\00"
define void @exec_once_0_block() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"Hello World from a constructor 1\00"
define void @exec_once_0_block() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *OCMalloc(size_t size) {
  if (0 == size) {
    return NULL;
  }
  return malloc(size);
}


x86 assembly (clang, -O0):
<OCMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1135 <OCMalloc+0x25>
movq   $0x0,-0x8(%rbp)
jmp    1142 <OCMalloc+0x32>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OCMalloc>:
test   %rdi,%rdi
je     111a <OCMalloc+0xa>
jmp    1030 <malloc@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @OCMalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
nulldev() {}


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

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

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

LLVM IR (-O2):
define i32 @nulldev() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ stress_double_put(double const);
double __attribute__((no))
stress_funccall_double_4(const double a, const double b, const double c,
                         const double d) {
  stress_double_put(a);
  stress_double_put(b);
  stress_double_put(c);
  stress_double_put(d);
  return a + b + c + d;
}


x86 assembly (clang, -O0):
<stress_funccall_double_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <stress_double_put@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <stress_double_put@plt>
movsd  -0x18(%rbp),%xmm0
call   1030 <stress_double_put@plt>
movsd  -0x20(%rbp),%xmm0
call   1030 <stress_double_put@plt>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funccall_double_4>:
sub    $0x28,%rsp
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x20(%rsp)
call   1030 <stress_double_put@plt>
movsd  0x8(%rsp),%xmm0
call   1030 <stress_double_put@plt>
movsd  0x10(%rsp),%xmm0
call   1030 <stress_double_put@plt>
movsd  0x18(%rsp),%xmm0
call   1030 <stress_double_put@plt>
movsd  0x20(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @stress_funccall_double_4(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = call i32 @stress_double_put(double %9)
%11 = load double, double* %6
%12 = call i32 @stress_double_put(double %11)
%13 = load double, double* %7
%14 = call i32 @stress_double_put(double %13)
%15 = load double, double* %8
%16 = call i32 @stress_double_put(double %15)
%17 = load double, double* %5
%18 = load double, double* %6
%19 = fadd double %17, %18
%20 = load double, double* %7
%21 = fadd double %19, %20
%22 = load double, double* %8
%23 = fadd double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @stress_funccall_double_4(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @stress_double_put(double %0)
%6 = tail call i32 @stress_double_put(double %1)
%7 = tail call i32 @stress_double_put(double %2)
%8 = tail call i32 @stress_double_put(double %3)
%9 = fadd double %0, %1
%10 = fadd double %9, %2
%11 = fadd double %10, %3
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ restart_network();
scalar_t__ should_restart_network();
int network_restart() {
  if (should_restart_network())
    restart_network();
  return 0;
}


x86 assembly (clang, -O0):
<network_restart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <should_restart_network@plt>
cmp    $0x0,%rax
je     113c <network_restart+0x1c>
mov    $0x0,%al
call   1030 <restart_network@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_restart>:
push   %rax
xor    %eax,%eax
call   1040 <should_restart_network@plt>
test   %rax,%rax
je     1134 <network_restart+0x14>
xor    %eax,%eax
call   1030 <restart_network@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @network_restart() {
%1 = call i64 (...) @should_restart_network()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @restart_network()
br label %5
5: ; preds = %3, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @network_restart() {
%1 = tail call i64 (...) @should_restart_network()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @restart_network()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ af(char *);
void bf(void) {
  int i = 1;
  char v[i];
  af(v);
}


x86 assembly (clang, -O0):
<bf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1030 <af@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf>:
push   %rax
mov    %rsp,%rdi
call   1030 <af@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @bf() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 1, i32* %1
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i8, i64 %5
store i64 %5, i64* %3
%8 = call i32 @af(i8* %7)
%9 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @bf() {
%1 = alloca i8
%2 = call i32 @af(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  char kj = 'a' + (('z' - 'a') / 2);
  scanf("%c", &c);
  printf("%c\n", kj - c + kj + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x6d,-0x6(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x6(%rbp),%eax
movsbl -0x5(%rbp),%ecx
sub    %ecx,%eax
movsbl -0x6(%rbp),%ecx
add    %ecx,%eax
add    $0x1,%eax
lea    0xea6(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ uci();
void main(void) {
  uci();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <uci@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <uci@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @uci()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @uci()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int *f(int s, int *c, int *d) {
  int a1, a2, a3, *x1, *x2, *x3;
  a1 = 2 * s;
  x1 = c - a1;
  a2 = 4 * s;
  x2 = c - a2;
  a3 = 6 * s;
  x3 = c - a3;
  return x1 == d ? x2 : x3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
imul   $0x6,-0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    118b <f+0x8b>
mov    -0x38(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    1193 <f+0x93>
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rsi,%rax
lea    (%rdi,%rdi,1),%ecx
movslq %ecx,%rcx
lea    0x0(,%rcx,4),%r8
sub    %r8,%rsi
shl    $0x2,%edi
lea    (%rcx,%rcx,2),%ecx
cmp    %rdx,%rsi
cmove  %edi,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i32* @f(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%13 = load i32, i32* %4
%14 = mul nsw i32 2, %13
store i32 %14, i32* %7
%15 = load i32*, i32** %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = sub i64 0, %17
%19 = getelementptr inbounds i32, i32* %15, i64 %18
store i32* %19, i32** %10
%20 = load i32, i32* %4
%21 = mul nsw i32 4, %20
store i32 %21, i32* %8
%22 = load i32*, i32** %5
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = sub i64 0, %24
%26 = getelementptr inbounds i32, i32* %22, i64 %25
store i32* %26, i32** %11
%27 = load i32, i32* %4
%28 = mul nsw i32 6, %27
store i32 %28, i32* %9
%29 = load i32*, i32** %5
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = sub i64 0, %31
%33 = getelementptr inbounds i32, i32* %29, i64 %32
store i32* %33, i32** %12
%34 = load i32*, i32** %10
%35 = load i32*, i32** %6
%36 = icmp eq i32* %34, %35
br i1 %36, label %37, label %39
37: ; preds = %3
%38 = load i32*, i32** %11
br label %41
39: ; preds = %3
%40 = load i32*, i32** %12
br label %41
41: ; preds = %39, %37
%42 = phi i32* [ %38, %37 ], [ %40, %39 ]
ret i32* %42
}

LLVM IR (-O2):
define i32* @f(i32 %0, i32* readnone %1, i32* readnone %2) {
%4 = shl nsw i32 %0, 1
%5 = sext i32 %4 to i64
%6 = sub nsw i64 0, %5
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = shl nsw i32 %0, 2
%9 = mul nsw i32 %0, 6
%10 = icmp eq i32* %7, %2
%11 = select i1 %10, i32 %8, i32 %9
%12 = sext i32 %11 to i64
%13 = sub nsw i64 0, %12
%14 = getelementptr inbounds i32, i32* %1, i64 %13
ret i32* %14
}
void BN_sub(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_sub() {
ret void
}
void prefetch256(const void *table) {
  volatile unsigned long *t = (void *)table, ret;
  unsigned long sum;
  int i;
  for (sum = 0, i = 0; i < 256 / sizeof(t[0]); i += 32 / sizeof(t[0]))
    sum ^= t[i];
  ret = sum;
}


x86 assembly (clang, -O0):
<prefetch256>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x20,%rax
jae    1151 <prefetch256+0x51>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
xor    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0x24(%rbp),%rax
add    $0x4,%rax
mov    %eax,-0x24(%rbp)
jmp    111f <prefetch256+0x1f>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefetch256>:
mov    (%rdi),%rax
xor    0x20(%rdi),%rax
xor    0x40(%rdi),%rax
xor    0x60(%rdi),%rax
xor    0x80(%rdi),%rax
xor    0xa0(%rdi),%rax
xor    0xc0(%rdi),%rax
xor    0xe0(%rdi),%rax
mov    %rax,-0x8(%rsp)
ret

LLVM IR (-O0):
define void @prefetch256(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %3
store i64 0, i64* %5
store i32 0, i32* %6
br label %9
9: ; preds = %21, %1
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %11, 32
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i64*, i64** %3
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
%18 = load volatile i64, i64* %17
%19 = load i64, i64* %5
%20 = xor i64 %19, %18
store i64 %20, i64* %5
br label %21
21: ; preds = %13
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = add i64 %23, 4
%25 = trunc i64 %24 to i32
store i32 %25, i32* %6
br label %9
26: ; preds = %9
%27 = load i64, i64* %5
store volatile i64 %27, i64* %4
ret void
}

LLVM IR (-O2):
define void @prefetch256(i8* %0) {
%2 = alloca i64
%3 = bitcast i8* %0 to i64*
%4 = bitcast i64* %2 to i8*
%5 = load volatile i64, i64* %3
%6 = getelementptr inbounds i8, i8* %0, i64 32
%7 = bitcast i8* %6 to i64*
%8 = load volatile i64, i64* %7
%9 = xor i64 %8, %5
%10 = getelementptr inbounds i8, i8* %0, i64 64
%11 = bitcast i8* %10 to i64*
%12 = load volatile i64, i64* %11
%13 = xor i64 %12, %9
%14 = getelementptr inbounds i8, i8* %0, i64 96
%15 = bitcast i8* %14 to i64*
%16 = load volatile i64, i64* %15
%17 = xor i64 %16, %13
%18 = getelementptr inbounds i8, i8* %0, i64 128
%19 = bitcast i8* %18 to i64*
%20 = load volatile i64, i64* %19
%21 = xor i64 %20, %17
%22 = getelementptr inbounds i8, i8* %0, i64 160
%23 = bitcast i8* %22 to i64*
%24 = load volatile i64, i64* %23
%25 = xor i64 %24, %21
%26 = getelementptr inbounds i8, i8* %0, i64 192
%27 = bitcast i8* %26 to i64*
%28 = load volatile i64, i64* %27
%29 = xor i64 %28, %25
%30 = getelementptr inbounds i8, i8* %0, i64 224
%31 = bitcast i8* %30 to i64*
%32 = load volatile i64, i64* %31
%33 = xor i64 %32, %29
store volatile i64 %33, i64* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
char *uid_to_username(uid_t uid) {
  struct passwd *pwd = getpwuid(uid);
  return (pwd == NULL) ? "<no-user>" : pwd->pw_name;
}


x86 assembly (clang, -O0):
<uid_to_username>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <uid_to_username+0x32>
lea    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    114d <uid_to_username+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uid_to_username>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1120 <uid_to_username+0x10>
mov    (%rax),%rax
pop    %rcx
ret
lea    0xed9(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [10 x i8] c"<no-user>\00"
define i8* @uid_to_username(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.passwd*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.passwd* @getpwuid(i32 %4)
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = icmp eq %struct.passwd* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %13
9: ; preds = %1
%10 = load %struct.passwd*, %struct.passwd** %3
%11 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i32 0, i32 0
%12 = load i8*, i8** %11
br label %13
13: ; preds = %9, %8
%14 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %8 ], [ %12, %9 ]
ret i8* %14
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [10 x i8] c"<no-user>\00"
define i8* @uid_to_username(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int fn(float);
float integrateSimpson(float x0, float x1, float x2) {
  float h = x1 - x0;
  return h / 3 * (fn(x0) + 4 * fn(x1) + fn(x2));
}


x86 assembly (clang, -O0):
<integrateSimpson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xebd(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fn@plt>
mov    %eax,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fn@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <fn@plt>
movss  -0x18(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integrateSimpson>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm2,0x8(%rsp)
movss  %xmm1,0x4(%rsp)
movaps %xmm1,%xmm2
subss  %xmm0,%xmm2
divss  0xed0(%rip),%xmm2
movss  %xmm2,0xc(%rsp)
call   1030 <fn@plt>
mov    %eax,%ebx
movss  0x4(%rsp),%xmm0
call   1030 <fn@plt>
lea    (%rbx,%rax,4),%ebx
movss  0x8(%rsp),%xmm0
call   1030 <fn@plt>
add    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @integrateSimpson(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %5
%9 = load float, float* %4
%10 = fsub float %8, %9
store float %10, float* %7
%11 = load float, float* %7
%12 = fdiv float %11, 3.000000e+00
%13 = load float, float* %4
%14 = call i32 @fn(float %13)
%15 = load float, float* %5
%16 = call i32 @fn(float %15)
%17 = mul nsw i32 4, %16
%18 = add nsw i32 %14, %17
%19 = load float, float* %6
%20 = call i32 @fn(float %19)
%21 = add nsw i32 %18, %20
%22 = sitofp i32 %21 to float
%23 = fmul float %12, %22
ret float %23
}

LLVM IR (-O2):
define float @integrateSimpson(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = fdiv float %4, 3.000000e+00
%6 = tail call i32 @fn(float %0)
%7 = tail call i32 @fn(float %1)
%8 = shl nsw i32 %7, 2
%9 = add nsw i32 %8, %6
%10 = tail call i32 @fn(float %2)
%11 = add nsw i32 %9, %10
%12 = sitofp i32 %11 to float
%13 = fmul float %5, %12
ret float %13
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createLtExpression(struct memorycontainer *expression1,
                   struct memorycontainer *expression2) {
  return createExpression(0x06, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createLtExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x6,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLtExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 6, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLtExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 6, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
/* Variables and functions */
scalar_t__ mkfifo(char const *, int);
int rl_create_signal(const char *signal_name) {
  return mkfifo(signal_name, 0777) == 0 ? 0 : 6;
}


x86 assembly (clang, -O0):
<rl_create_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1ff,%esi
call   1030 <mkfifo@plt>
mov    %rax,%rdx
mov    $0x6,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_create_signal>:
push   %rax
mov    $0x1ff,%esi
call   1030 <mkfifo@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0x6,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rl_create_signal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mkfifo(i8* %3, i32 511)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rl_create_signal(i8* %0) {
%2 = tail call i64 @mkfifo(i8* %0, i32 511)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 6
ret i32 %4
}
void foo133(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo133(i32 %0) {
ret void
}
/* Type definitions */
struct feed_line {
  int dummy;
};
struct feed_glyph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ feed_line_insert_glyph_before(struct feed_line *const,
                                                 struct feed_glyph *const,
                                                 struct feed_glyph *);
void feed_line_append_glyph(struct feed_line *const p_line,
                            struct feed_glyph *const p_glyph) {
  feed_line_insert_glyph_before(p_line, p_glyph, (struct feed_glyph *)(0));
}


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

x86 assembly (clang, -O2):
<feed_line_append_glyph>:
xor    %edx,%edx
jmp    1030 <feed_line_insert_glyph_before@plt>

LLVM IR (-O0):
%struct.feed_line = type { i32 }
%struct.feed_glyph = type { i32 }
define void @feed_line_append_glyph(%struct.feed_line* %0, %struct.feed_glyph* %1) {
%3 = alloca %struct.feed_line*
%4 = alloca %struct.feed_glyph*
store %struct.feed_line* %0, %struct.feed_line** %3
store %struct.feed_glyph* %1, %struct.feed_glyph** %4
%5 = load %struct.feed_line*, %struct.feed_line** %3
%6 = load %struct.feed_glyph*, %struct.feed_glyph** %4
%7 = call i32 @feed_line_insert_glyph_before(%struct.feed_line* %5, %struct.feed_glyph* %6, %struct.feed_glyph* null)
ret void
}

LLVM IR (-O2):
%struct.feed_line = type { i32 }
%struct.feed_glyph = type { i32 }
define void @feed_line_append_glyph(%struct.feed_line* %0, %struct.feed_glyph* %1) {
%3 = tail call i32 @feed_line_insert_glyph_before(%struct.feed_line* %0, %struct.feed_glyph* %1, %struct.feed_glyph* null)
ret void
}
/* Variables and functions */
int sscanf(char *, char *, unsigned int *);
unsigned int strtoint(char *str) {
  unsigned int value;
  if (str == NULL) {
    return 0;
  }
  if (sscanf(str, "%ud", &value) != 1) {
    return 0;
  }
  return value;
}


x86 assembly (clang, -O0):
<strtoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <strtoint+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1162 <strtoint+0x52>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     115c <strtoint+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1162 <strtoint+0x52>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoint>:
test   %rdi,%rdi
je     1139 <strtoint+0x29>
push   %rax
lea    0xee3(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    1134 <strtoint+0x24>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ud\00"
define i32 @strtoint(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %15
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %4)
%11 = icmp ne i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %15
13: ; preds = %8
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %12, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ud\00"
define i32 @strtoint(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = icmp eq i32 %6, 1
%8 = load i32, i32* %2
%9 = select i1 %7, i32 %8, i32 0
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int is_whitespace(char c) {
  if (strchr(" \t\r\n", c))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1144 <is_whitespace+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <is_whitespace+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0D\0A\00"
define i32 @is_whitespace(i8 signext %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
unsigned align_size(unsigned size, unsigned page_size) {
  return ((size + page_size - 1) / page_size) * page_size;
}


x86 assembly (clang, -O0):
<align_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_size>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @align_size(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add i32 %5, %6
%8 = sub i32 %7, 1
%9 = load i32, i32* %4
%10 = udiv i32 %8, %9
%11 = load i32, i32* %4
%12 = mul i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @align_size(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = urem i32 %4, %1
%6 = sub i32 %4, %5
ret i32 %6
}
int foo(int x()) { return x(); }


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

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define i32 @foo(i32 (...)* nocapture %0) {
%2 = tail call i32 (...) %0()
ret i32 %2
}
/* Variables and functions */
int i2c_smbus_read_byte(int);
int radxaI2CRead(int fd) { return i2c_smbus_read_byte(fd); }


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

x86 assembly (clang, -O2):
<radxaI2CRead>:
jmp    1030 <i2c_smbus_read_byte@plt>

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

LLVM IR (-O2):
define i32 @radxaI2CRead(i32 %0) {
%2 = tail call i32 @i2c_smbus_read_byte(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ __builtin_jn(int, double);
int /*<<< orphan*/ link_failure_builtin_jn();
void test_builtin_jn(int x, double d) {
  if (__builtin_jn(x, d) != __builtin_jn(x, d))
    link_failure_builtin_jn();
}


x86 assembly (clang, -O0):
<test_builtin_jn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
call   1030 <__builtin_jn@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
call   1030 <__builtin_jn@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1165 <test_builtin_jn+0x45>
mov    $0x0,%al
call   1040 <link_failure_builtin_jn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_jn>:
push   %r14
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
mov    %edi,%ebx
call   1030 <__builtin_jn@plt>
mov    %rax,%r14
mov    %ebx,%edi
movsd  (%rsp),%xmm0
call   1030 <__builtin_jn@plt>
cmp    %rax,%r14
jne    114c <test_builtin_jn+0x2c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_builtin_jn@plt>

LLVM IR (-O0):
define void @test_builtin_jn(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = load double, double* %4
%7 = call i64 @__builtin_jn(i32 %5, double %6)
%8 = load i32, i32* %3
%9 = load double, double* %4
%10 = call i64 @__builtin_jn(i32 %8, double %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_builtin_jn()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_builtin_jn(i32 %0, double %1) {
%3 = tail call i64 @__builtin_jn(i32 %0, double %1)
%4 = tail call i64 @__builtin_jn(i32 %0, double %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_builtin_jn()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void execvp_error() { perror("execvp error"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"execvp error\00"
define void @execvp_error() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}