xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double convert_time_to_sec(struct timeval tv) {
  double elapsed_time = (double)(tv.tv_sec) + ((double)(tv.tv_usec) / 1000000);
  return elapsed_time;
}


x86 assembly (clang, -O0):
<convert_time_to_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_time_to_sec>:
cvtsi2sd %rsi,%xmm1
cvtsi2sd %rdi,%xmm0
divsd  0xeee(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @convert_time_to_sec(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = alloca double
%5 = bitcast %struct.timeval* %3 to { i64, i64 }*
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 0
store i64 %0, i64* %6
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 1
store i64 %1, i64* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 1.000000e+06
%15 = fadd double %10, %14
store double %15, double* %4
%16 = load double, double* %4
ret double %16
}

LLVM IR (-O2):
define double @convert_time_to_sec(i64 %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = sitofp i64 %0 to double
%5 = fdiv double %4, 1.000000e+06
%6 = fadd double %5, %3
ret double %6
}
int d_le_cr1(double a1) { return (((100) <= (a1))); }


x86 assembly (clang, -O0):
<d_le_cr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_le_cr1>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @d_le_cr1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_le_cr1(double %0) {
%2 = fcmp oge double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_17int64_lowword_mem(long long *val) {
  return ((*val) & (0x17 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_17int64_lowword_mem>:
testb  $0x17,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_17int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 23
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *argv0, char *text) {
  printf("%s\n", text);
  printf("\n\nUsage:\n\n%s A B N ID\n\n", argv0);
  printf("calculates integral from A to B of sin() with N steps\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [24 x i8] c"\0A\0AUsage:\0A\0A%s A B N ID\0A\0A\00"
@.str.2 = [55 x i8] c"calculates integral from A to B of sin() with N steps\0A\00"
define void @usage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"\0A\0AUsage:\0A\0A%s A B N ID\0A\0A\00"
@str = [54 x i8] c"calculates integral from A to B of sin() with N steps\00"
define void @usage(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) %1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ use(int);
void func1(int cond) {
  int x;
  if (cond)
    x = 1;
  foo();
  if (cond)
    use(x);
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <func1+0x1c>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmpl   $0x0,-0x4(%rbp)
je     1155 <func1+0x35>
mov    -0x8(%rbp),%edi
call   1030 <use@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <foo@plt>
test   %ebx,%ebx
je     1139 <func1+0x19>
mov    $0x1,%edi
pop    %rbx
jmp    1030 <use@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @func1(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = tail call i32 (...) @foo()
br i1 %2, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @use(i32 1)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stderr;
FILE *get_err_stream() { return stderr; }


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

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

LLVM IR (-O0):
@stderr = global i32* null
define i32* @get_err_stream() {
%1 = load i32*, i32** @stderr
ret i32* %1
}

LLVM IR (-O2):
@stderr = global i32* null
define i32* @get_err_stream() {
%1 = load i32*, i32** @stderr
ret i32* %1
}
int test_imm_C8int64_highword_reg(long long val) {
  return ((val >> 32) & (0xC8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C8int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xc8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C8int64_highword_reg>:
movabs $0xc800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C8int64_highword_reg(i64 %0) {
%2 = and i64 %0, 858993459200
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t align(size_t, size_t);
void *resize_or_die(void *, size_t, size_t);
void *relot_or_die(void *p, size_t old_n, size_t new_n, size_t unit_sz,
                   size_t log_lot) {
  return resize_or_die(p, align(old_n, log_lot) * unit_sz,
                       align(new_n, log_lot) * unit_sz);
}


x86 assembly (clang, -O0):
<relot_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <align@plt>
imul   -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <align@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
imul   -0x20(%rbp),%rdx
call   1030 <resize_or_die@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<relot_or_die>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r13
mov    %rdx,%r15
mov    %rdi,%r12
mov    %rsi,%rdi
mov    %r8,%rsi
call   1040 <align@plt>
mov    %rax,%rbx
imul   %r13,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <align@plt>
imul   %rax,%r13
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <resize_or_die@plt>

LLVM IR (-O0):
define i8* @relot_or_die(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %10
%14 = call i64 @align(i64 %12, i64 %13)
%15 = load i64, i64* %9
%16 = mul i64 %14, %15
%17 = load i64, i64* %8
%18 = load i64, i64* %10
%19 = call i64 @align(i64 %17, i64 %18)
%20 = load i64, i64* %9
%21 = mul i64 %19, %20
%22 = call i8* @resize_or_die(i8* %11, i64 %16, i64 %21)
ret i8* %22
}

LLVM IR (-O2):
define i8* @relot_or_die(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 @align(i64 %1, i64 %4)
%7 = mul i64 %6, %3
%8 = tail call i64 @align(i64 %2, i64 %4)
%9 = mul i64 %8, %3
%10 = tail call i8* @resize_or_die(i8* %0, i64 %7, i64 %9)
ret i8* %10
}
int compileSWFActionCode(const char *script, int version, void **data,
                         int *len) {
  return 0;
}


x86 assembly (clang, -O0):
<compileSWFActionCode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compileSWFActionCode(i8* %0, i32 %1, i8** %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32* %3, i32** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @compileSWFActionCode(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ samlmr_(double *, int *, double *, int *, double *,
                           double *);
void csamlmr(double *x, int n, double *xmom, int nmom, double a, double b) {
  samlmr_(x, &n, xmom, &nmom, &a, &b);
}


x86 assembly (clang, -O0):
<csamlmr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0xc(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1030 <samlmr_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csamlmr>:
sub    $0x18,%rsp
mov    %esi,0x4(%rsp)
mov    %ecx,(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rcx
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
call   1030 <samlmr_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @csamlmr(double* %0, i32 %1, double* %2, i32 %3, double %4, double %5) {
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store double* %0, double** %7
store i32 %1, i32* %8
store double* %2, double** %9
store i32 %3, i32* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double*, double** %7
%14 = load double*, double** %9
%15 = call i32 @samlmr_(double* %13, i32* %8, double* %14, i32* %10, double* %11, double* %12)
ret void
}

LLVM IR (-O2):
define void @csamlmr(double* %0, i32 %1, double* %2, i32 %3, double %4, double %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store i32 %1, i32* %7
store i32 %3, i32* %8
store double %4, double* %9
store double %5, double* %10
%11 = call i32 @samlmr_(double* %0, i32* %7, double* %2, i32* %8, double* %9, double* %10)
ret void
}
/* Variables and functions */
int awosInit();
int awInit() { return awosInit(); }


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

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

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

LLVM IR (-O2):
define i32 @awInit() {
%1 = tail call i32 (...) @awosInit()
ret i32 %1
}
/* Type definitions */
typedef int u_int64_t;
typedef int u_int32_t;

/* Variables and functions */
u_int32_t bitvector_get(u_int32_t *b, u_int64_t n) {
  return b[n >> 5] & (1 << (n & 31));
}


x86 assembly (clang, -O0):
<bitvector_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitvector_get>:
mov    %esi,%ecx
mov    %esi,%edx
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x5,%edx
movslq %edx,%rcx
and    (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @bitvector_get(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 = ashr i32 %6, 5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = and i32 %11, 31
%13 = shl i32 1, %12
%14 = and i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @bitvector_get(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 31
%8 = shl nuw i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}
/* Variables and functions */
scalar_t__ COND_MI();
int /*<<< orphan*/ EA_AW_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_smi_8_aw(void) { m68ki_write_8(EA_AW_8(), COND_MI() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_smi_8_aw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AW_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_MI@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_smi_8_aw>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AW_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_MI@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_smi_8_aw() {
%1 = call i32 (...) @EA_AW_8()
%2 = call i64 (...) @COND_MI()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_smi_8_aw() {
%1 = tail call i32 (...) @EA_AW_8()
%2 = tail call i64 (...) @COND_MI()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void __asan_report_store1() {}


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

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

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

LLVM IR (-O2):
define void @__asan_report_store1() {
ret void
}
/* Variables and functions */
int Mini(int, int);
int Min3i(int a, int b, int c) { return Mini(Mini(a, b), c); }


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

x86 assembly (clang, -O2):
<Min3i>:
push   %rbx
mov    %edx,%ebx
call   1030 <Mini@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <Mini@plt>

LLVM IR (-O0):
define i32 @Min3i(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @Mini(i32 %7, i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @Mini(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @Min3i(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Mini(i32 %0, i32 %1)
%5 = tail call i32 @Mini(i32 %4, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int strcasecmp(char const *, char const *);
int __strcasecmp_l(const char *l, const char *r, locale_t loc) {
  return strcasecmp(l, r);
}


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

x86 assembly (clang, -O2):
<__strcasecmp_l>:
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @__strcasecmp_l(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcasecmp(i8* %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @__strcasecmp_l(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ happy();
int /*<<< orphan*/ releases();
int /*<<< orphan*/ stretching();
int /*<<< orphan*/ takeObj();
int /*<<< orphan*/ thanks();
void demostration() {
  stretching();
  takeObj();
  happy();
  releases();
  thanks();
}


x86 assembly (clang, -O0):
<demostration>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <stretching@plt>
mov    $0x0,%al
call   1040 <takeObj@plt>
mov    $0x0,%al
call   1060 <happy@plt>
mov    $0x0,%al
call   1030 <releases@plt>
mov    $0x0,%al
call   1070 <thanks@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<demostration>:
push   %rax
xor    %eax,%eax
call   1050 <stretching@plt>
xor    %eax,%eax
call   1040 <takeObj@plt>
xor    %eax,%eax
call   1060 <happy@plt>
xor    %eax,%eax
call   1030 <releases@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <thanks@plt>

LLVM IR (-O0):
define void @demostration() {
%1 = call i32 (...) @stretching()
%2 = call i32 (...) @takeObj()
%3 = call i32 (...) @happy()
%4 = call i32 (...) @releases()
%5 = call i32 (...) @thanks()
ret void
}

LLVM IR (-O2):
define void @demostration() {
%1 = tail call i32 (...) @stretching()
%2 = tail call i32 (...) @takeObj()
%3 = tail call i32 (...) @happy()
%4 = tail call i32 (...) @releases()
%5 = tail call i32 (...) @thanks()
ret void
}
int sum(int start, int end) {
  int count = (start + end) * (end - start + 1) / 2;
  return count;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rsi,%rdi,1),%eax
sub    %edi,%esi
lea    0x1(%rsi),%ecx
imul   %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @sum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = add nsw i32 %11, 1
%13 = mul nsw i32 %8, %12
%14 = sdiv i32 %13, 2
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}
long calcWallTime(long t0, long t1) {
  long cp;
  cp = (long)(t1 - t0);
  return cp;
}


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

x86 assembly (clang, -O2):
<calcWallTime>:
mov    %rsi,%rax
sub    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @calcWallTime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @calcWallTime(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
ret i64 %3
}
int bar(int a, int b, int c, int d) { return a + b + c + d; }


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

x86 assembly (clang, -O2):
<bar>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = add nsw i32 %5, %2
%7 = add nsw i32 %6, %3
ret i32 %7
}
void __attribute__((weak)) weakBrace2(void) {}


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

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

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

LLVM IR (-O2):
define weak void @weakBrace2() {
ret void
}
int test_imm_C0uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xC0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C0uint64_lowword_mem>:
testb  $0xc0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C0uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 192
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int exp(double);
double sigmoid(double z) {
  if (z < -45.0)
    return 0;
  if (z > 45.0)
    return 1;
  double a = (1 / (1 + exp(-z)));
  return a;
}


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <sigmoid+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a7 <sigmoid+0x97>
movsd  -0x10(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1166 <sigmoid+0x56>
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a7 <sigmoid+0x97>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
push   %rax
xorpd  %xmm1,%xmm1
movsd  0xee3(%rip),%xmm2
ucomisd %xmm0,%xmm2
ja     1159 <sigmoid+0x49>
ucomisd 0xee5(%rip),%xmm0
jbe    1137 <sigmoid+0x27>
movsd  0xed3(%rip),%xmm1
jmp    1159 <sigmoid+0x49>
xorpd  0xee1(%rip),%xmm0
call   1030 <exp@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sigmoid(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, -4.500000e+01
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %20
8: ; preds = %1
%9 = load double, double* %3
%10 = fcmp ogt double %9, 4.500000e+01
br i1 %10, label %11, label %12
11: ; preds = %8
store double 1.000000e+00, double* %2
br label %20
12: ; preds = %8
%13 = load double, double* %3
%14 = fneg double %13
%15 = call i32 @exp(double %14)
%16 = add nsw i32 1, %15
%17 = sdiv i32 1, %16
%18 = sitofp i32 %17 to double
store double %18, double* %4
%19 = load double, double* %4
store double %19, double* %2
br label %20
20: ; preds = %12, %11, %7
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @sigmoid(double %0) {
%2 = fcmp olt double %0, -4.500000e+01
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 4.500000e+01
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = fneg double %0
%7 = tail call i32 @exp(double %6)
%8 = add nsw i32 %7, 1
%9 = add i32 %7, 2
%10 = icmp ult i32 %9, 3
%11 = select i1 %10, i32 %8, i32 0
%12 = sitofp i32 %11 to double
br label %13
13: ; preds = %3, %1, %5
%14 = phi double [ %12, %5 ], [ 0.000000e+00, %1 ], [ 1.000000e+00, %3 ]
ret double %14
}
void quit(int *working) { *working = 0; }


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

x86 assembly (clang, -O2):
<quit>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @quit(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
int test_imm_35uint32_mem(unsigned int *val) {
  return ((*val) & (0x35 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_35uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x35,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_35uint32_mem>:
testb  $0x35,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_35uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 53
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bootloader_gpio_write(int, int);
int /*<<< orphan*/ bootloader_spi_transac8(int /*<<< orphan*/, int, int *,
                                           void *);
__attribute__((section(".boot.text"))) void
bootloader_spiflash_globalunlock(uint32_t spidev) {
  uint8_t cmd[1];
  cmd[0] = 0x98;
  bootloader_gpio_write(
      (0 << 4) | (9 << 0) | (1 << 12) | (0 << 18) | (2 << 16) | (1 << 19), 0);
  bootloader_spi_transac8(spidev, 1, cmd, ((void *)0));
  bootloader_gpio_write(
      (0 << 4) | (9 << 0) | (1 << 12) | (0 << 18) | (2 << 16) | (1 << 19), 1);
}


x86 assembly (clang, -O0):
<bootloader_spiflash_globalunlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x98,-0x8(%rbp)
mov    $0xa1009,%edi
xor    %esi,%esi
call   1040 <bootloader_gpio_write@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rdx
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <bootloader_spi_transac8@plt>
mov    $0xa1009,%edi
mov    $0x1,%esi
call   1040 <bootloader_gpio_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bootloader_spiflash_globalunlock>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x98,0xc(%rsp)
mov    $0xa1009,%edi
xor    %esi,%esi
call   1040 <bootloader_gpio_write@plt>
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
call   1030 <bootloader_spi_transac8@plt>
mov    $0xa1009,%edi
mov    $0x1,%esi
call   1040 <bootloader_gpio_write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @bootloader_spiflash_globalunlock(i32 %0) section ".boot.text" {
%2 = alloca i32
%3 = alloca [1 x i32]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 152, i32* %4
%5 = call i32 @bootloader_gpio_write(i32 659465, i32 0)
%6 = load i32, i32* %2
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i32 @bootloader_spi_transac8(i32 %6, i32 1, i32* %7, i8* null)
%9 = call i32 @bootloader_gpio_write(i32 659465, i32 1)
ret void
}

LLVM IR (-O2):
define void @bootloader_spiflash_globalunlock(i32 %0) section ".boot.text" {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 152, i32* %4
%5 = tail call i32 @bootloader_gpio_write(i32 659465, i32 0)
%6 = call i32 @bootloader_spi_transac8(i32 %0, i32 1, i32* %4, i8* null)
%7 = call i32 @bootloader_gpio_write(i32 659465, i32 1)
ret void
}
void mdp4_mddi_overlay_kickoff(struct msm_fb_data_type *mfd,
                               struct mdp4_overlay_pipe *pipe) {}


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

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

LLVM IR (-O0):
%struct.msm_fb_data_type = type opaque
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_mddi_overlay_kickoff(%struct.msm_fb_data_type* %0, %struct.mdp4_overlay_pipe* %1) {
%3 = alloca %struct.msm_fb_data_type*
%4 = alloca %struct.mdp4_overlay_pipe*
store %struct.msm_fb_data_type* %0, %struct.msm_fb_data_type** %3
store %struct.mdp4_overlay_pipe* %1, %struct.mdp4_overlay_pipe** %4
ret void
}

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_mddi_overlay_kickoff(%struct.msm_fb_data_type* nocapture %0, %struct.mdp4_overlay_pipe* nocapture %1) {
ret void
}
int main() {
  int a = 0;
  int b = 1;
  return a + b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
double Bbp3b(double x) { return 1.0; }


x86 assembly (clang, -O0):
<Bbp3b>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bbp3b>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Bbp3b(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @Bbp3b(double %0) {
ret double 1.000000e+00
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRE6_set(void) { return U_WMRCORENONE_set("U_WMRE6"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE6\00"
define i8* @U_WMRE6_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void VirtualizeTimerC$0$TimerFrom$stop(void) { AlarmToTimerC$0$Timer$stop(); }


x86 assembly (clang, -O0):
<VirtualizeTimerC$0$TimerFrom$stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AlarmToTimerC$0$Timer$stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VirtualizeTimerC$0$TimerFrom$stop>:
xor    %eax,%eax
jmp    1030 <AlarmToTimerC$0$Timer$stop@plt>

LLVM IR (-O0):
define void @"VirtualizeTimerC$0$TimerFrom$stop"() {
%1 = call i32 (...) @"AlarmToTimerC$0$Timer$stop"()
ret void
}

LLVM IR (-O2):
define void @"VirtualizeTimerC$0$TimerFrom$stop"() {
%1 = tail call i32 (...) @"AlarmToTimerC$0$Timer$stop"()
ret void
}
/* Type definitions */
typedef int volatile uint8_t;

/* Variables and functions */
uint8_t volatile_fetch_xor_u8(volatile uint8_t *dest, uint8_t val) {
  uint8_t result = *dest;
  *dest = result ^ val;
  return result;
}


x86 assembly (clang, -O0):
<volatile_fetch_xor_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_fetch_xor_u8>:
mov    %esi,-0x4(%rsp)
mov    (%rdi),%eax
mov    %eax,-0x8(%rsp)
mov    -0x8(%rsp),%eax
xor    -0x4(%rsp),%eax
mov    %eax,(%rdi)
mov    -0x8(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @volatile_fetch_xor_u8(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store volatile i32 %1, i32* %3
%5 = bitcast i32* %4 to i8*
%6 = load volatile i32, i32* %0
store volatile i32 %6, i32* %4
%7 = load volatile i32, i32* %4
%8 = load volatile i32, i32* %3
%9 = xor i32 %8, %7
store volatile i32 %9, i32* %0
%10 = load volatile i32, i32* %4
ret i32 %10
}
/* Variables and functions */
double pow(int, double);
double xpow10(int n) { return pow(10, (double)n); }


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

x86 assembly (clang, -O2):
<xpow10>:
cvtsi2sd %edi,%xmm0
mov    $0xa,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @xpow10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double @pow(i32 10, double %4)
ret double %5
}

LLVM IR (-O2):
define double @xpow10(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @pow(i32 10, double %2)
ret double %3
}
void foo814() {}


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

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

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

LLVM IR (-O2):
define void @foo814() {
ret void
}
/* Variables and functions */
void *realloc(void *, int);
int safe_realloc(void **ptr, int bytes) {
  void *t;
  t = realloc(*ptr, bytes);
  if (!t)
    return -1;
  *ptr = t;
  return 0;
}


x86 assembly (clang, -O0):
<safe_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1149 <safe_realloc+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <safe_realloc+0x4b>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <realloc@plt>
test   %rax,%rax
je     1128 <safe_realloc+0x18>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @safe_realloc(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @realloc(i8* %3, i32 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %2
store i8* %4, i8** %0
br label %7
7: ; preds = %2, %6
%8 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %8
}
int HelpItem93(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem93() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ err_printversion(char const *, char const *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void(err_version)(const char *program, const char *verinfo) {
  err_printversion(program, verinfo);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<err_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <err_printversion@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_version>:
push   %rax
call   1030 <err_printversion@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @err_version(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @err_printversion(i8* %5, i8* %6)
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @err_version(i8* %0, i8* %1) {
%3 = tail call i32 @err_printversion(i8* %0, i8* %1)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int is_alpha(char c) {
  return (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_');
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_alpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <is_alpha+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <is_alpha+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <is_alpha+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
cmp    $0x5f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %22, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %22, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 95
br label %22
22: ; preds = %18, %14, %6
%23 = phi i1 [ true, %14 ], [ true, %6 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = icmp eq i8 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
void sub1(n) int n;
{
  int i;
#pragma omp parallel private(i) shared(n)
  {
#pragma omp for
    for (i = 0; i < n; i++) {
      sub2(i);
    }
  }
}


x86 assembly (clang, -O0):
<sub1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <sub1+0x36>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <sub2@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <sub1+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub1>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1130 <sub1+0x20>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <sub2@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <sub1+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sub1(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @sub2 to i32 (i32, ...)*)(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *substring(char **, char);
char *parse_url_path_def(char **url) { return substring(url, '/'); }


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

x86 assembly (clang, -O2):
<parse_url_path_def>:
mov    $0x2f,%esi
jmp    1030 <substring@plt>

LLVM IR (-O0):
define i8* @parse_url_path_def(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i8* @substring(i8** %3, i8 signext 47)
ret i8* %4
}

LLVM IR (-O2):
define i8* @parse_url_path_def(i8** %0) {
%2 = tail call i8* @substring(i8** %0, i8 signext 47)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void writel(uint32_t val, void *addr) { *((volatile uint32_t *)addr) = val; }


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writel>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @writel(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
/* Variables and functions */
char *build_simple_cdrom(char *, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *build_context_cdrom(const char *user_data) {
  return build_simple_cdrom("CONFIGDISK", "CONTEXT.SH", user_data,
                            strlen(user_data));
}


x86 assembly (clang, -O0):
<build_context_cdrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
lea    0xeb6(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1030 <build_simple_cdrom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_context_cdrom>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0xed0(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
jmp    1030 <build_simple_cdrom@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CONFIGDISK\00"
@.str.1 = [11 x i8] c"CONTEXT.SH\00"
define i8* @build_context_cdrom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @build_simple_cdrom(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"CONFIGDISK\00"
@.str.1 = [11 x i8] c"CONTEXT.SH\00"
define i8* @build_context_cdrom(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @build_simple_cdrom(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %2)
ret i8* %3
}