xunge/DecIR huggingface dataset:
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
int snprintf(char *, size_t, char *, int);
int snprintf_error_lostarb(char *buf, size_t len, struct can_frame *cf) {
  if (len <= 0)
    return 0;
  return snprintf(buf, len, "{at bit %d}", cf->data[0]);
}


x86 assembly (clang, -O0):
<snprintf_error_lostarb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
ja     113b <snprintf_error_lostarb+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    115b <snprintf_error_lostarb+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
lea    0xead(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snprintf_error_lostarb>:
test   %rsi,%rsi
je     1126 <snprintf_error_lostarb+0x16>
mov    (%rdx),%rax
mov    (%rax),%ecx
lea    0xedf(%rip),%rdx
jmp    1030 <snprintf@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
@.str = [12 x i8] c"{at bit %d}\00"
define i32 @snprintf_error_lostarb(i8* %0, i64 %1, %struct.can_frame* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.can_frame*
store i8* %0, i8** %5
store i64 %1, i64* %6
store %struct.can_frame* %2, %struct.can_frame** %7
%8 = load i64, i64* %6
%9 = icmp ule i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 0, i32* %4
br label %20
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = load %struct.can_frame*, %struct.can_frame** %7
%15 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %14, i32 0, i32 0
%16 = load i32*, i32** %15
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = call i32 @snprintf(i8* %12, i64 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %18)
store i32 %19, i32* %4
br label %20
20: ; preds = %11, %10
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
@.str = [12 x i8] c"{at bit %d}\00"
define i32 @snprintf_error_lostarb(i8* %0, i64 %1, %struct.can_frame* nocapture %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %2, i64 0, i32 0
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %3, %5
%11 = phi i32 [ %9, %5 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int exp(double const);
double boltzmann(const double V, const double V_0, const double k) {
  return 1. / (1. + exp(-k * (V - V_0)));
}


x86 assembly (clang, -O0):
<boltzmann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe92(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boltzmann>:
push   %rax
xorpd  0xee7(%rip),%xmm2
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xedb(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @boltzmann(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fneg double %7
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = fmul double %8, %11
%13 = call i32 @exp(double %12)
%14 = sitofp i32 %13 to double
%15 = fadd double 1.000000e+00, %14
%16 = fdiv double 1.000000e+00, %15
ret double %16
}

LLVM IR (-O2):
define double @boltzmann(double %0, double %1, double %2) {
%4 = fneg double %2
%5 = fsub double %0, %1
%6 = fmul double %5, %4
%7 = tail call i32 @exp(double %6)
%8 = sitofp i32 %7 to double
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double 1.000000e+00, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int _destroy_fct(void *data) {
  free(data);
  return 1;
}


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

x86 assembly (clang, -O2):
<_destroy_fct>:
push   %rax
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_destroy_fct(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 1
}
/* Variables and functions */
int allTests();
int /*<<< orphan*/ printf(char *);
int main(void) {
  int result = allTests();
  if (result == 0) {
    printf("COMPLETE: all tests report success.\n");
  } else {
    printf("COMPLETE: a test reports failure.\n");
  }
  return result != 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <allTests@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1154 <main+0x34>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x40>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <allTests@plt>
xor    %ebx,%ebx
test   %eax,%eax
lea    0xeef(%rip),%rax
lea    0xec6(%rip),%rdi
cmove  %rax,%rdi
setne  %bl
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"COMPLETE: all tests report success.\0A\00"
@.str.1 = [35 x i8] c"COMPLETE: a test reports failure.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @allTests()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@str = [34 x i8] c"COMPLETE: a test reports failure.\00"
@str.2 = [36 x i8] c"COMPLETE: all tests report success.\00"
define i32 @main() {
%1 = tail call i32 (...) @allTests()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = icmp ne i32 %1, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ usleep(int);
void PIL_sleep_ms(int ms) {
  if (ms >= 1000) {
    sleep(ms / 1000);
    ms = (ms % 1000);
  }
  usleep(ms * 1000);
}


x86 assembly (clang, -O0):
<PIL_sleep_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jl     1158 <PIL_sleep_ms+0x38>
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <sleep@plt>
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIL_sleep_ms>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x3e8,%edi
jl     114c <PIL_sleep_ms+0x2c>
mov    %ebx,%eax
imul   $0x10624dd3,%rax,%r14
shr    $0x26,%r14
mov    %r14d,%edi
call   1030 <sleep@plt>
imul   $0x3e8,%r14d,%eax
sub    %eax,%ebx
imul   $0x3e8,%ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @PIL_sleep_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 1000
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 1000
%8 = call i32 @sleep(i32 %7)
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000
store i32 %10, i32* %2
br label %11
11: ; preds = %5, %1
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, 1000
%14 = call i32 @usleep(i32 %13)
ret void
}

LLVM IR (-O2):
define void @PIL_sleep_ms(i32 %0) {
%2 = icmp sgt i32 %0, 999
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = udiv i32 %0, 1000
%5 = tail call i32 @sleep(i32 %4)
%6 = urem i32 %0, 1000
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ %6, %3 ], [ %0, %1 ]
%9 = mul nsw i32 %8, 1000
%10 = tail call i32 @usleep(i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int pthread_cond_signal(int /*<<< orphan*/ *);
void __safe_p_cond_signal(pthread_cond_t *cv) {
  int en = pthread_cond_signal(cv);
  if (en) {
    abort();
  }
}


x86 assembly (clang, -O0):
<__safe_p_cond_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_cond_signal@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <__safe_p_cond_signal+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__safe_p_cond_signal>:
push   %rax
call   1040 <pthread_cond_signal@plt>
test   %eax,%eax
jne    112c <__safe_p_cond_signal+0xc>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @__safe_p_cond_signal(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_cond_signal(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @__safe_p_cond_signal(i32* %0) {
%2 = tail call i32 @pthread_cond_signal(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
void gtk_text_iter_get_visible_slice() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ sigwait(int /*<<< orphan*/ *, int *);
int waitSignal(sigset_t *sigsToCatch) {
  int signum;
  sigwait(sigsToCatch, &signum);
  return signum;
}


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

x86 assembly (clang, -O2):
<waitSignal>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <sigwait@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @waitSignal(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigwait(i32* %0, i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
void WRITEREF(char *S_) { ; }


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

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

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

LLVM IR (-O2):
define void @WRITEREF(i8* nocapture %0) {
ret void
}
int test_imm_2Dint16_reg(short val) {
  return ((val) & (-0x2D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Dint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffd3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_2Dint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -45
%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_2Dint16_reg(i16 signext %0) {
%2 = and i16 %0, -45
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void _Z10_Jv_InitGCv(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z10_Jv_InitGCv() {
ret void
}
unsigned getval_201() { return 3286270280U; }


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

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

LLVM IR (-O0):
define i32 @getval_201() {
ret i32 -1008697016
}

LLVM IR (-O2):
define i32 @getval_201() {
ret i32 -1008697016
}
double spline(double a, double b, double c, double d, double x) {
  return (a * x * x * x + b * x * x + c * x + d);
}


x86 assembly (clang, -O0):
<spline>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<spline>:
mulsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm1
mulsd  %xmm4,%xmm1
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm2
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @spline(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %10
%13 = fmul double %11, %12
%14 = load double, double* %10
%15 = fmul double %13, %14
%16 = load double, double* %10
%17 = load double, double* %7
%18 = load double, double* %10
%19 = fmul double %17, %18
%20 = load double, double* %10
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %15, double %16, double %21)
%23 = load double, double* %8
%24 = load double, double* %10
%25 = call double @llvm.fmuladd.f64(double %23, double %24, double %22)
%26 = load double, double* %9
%27 = fadd double %25, %26
ret double %27
}

LLVM IR (-O2):
define double @spline(double %0, double %1, double %2, double %3, double %4) {
%6 = fmul double %0, %4
%7 = fmul double %6, %4
%8 = fmul double %1, %4
%9 = fmul double %8, %4
%10 = tail call double @llvm.fmuladd.f64(double %7, double %4, double %9)
%11 = tail call double @llvm.fmuladd.f64(double %2, double %4, double %10)
%12 = fadd double %11, %3
ret double %12
}
int readInt(int *n) {
  int *IO = (int *)(0x3c000000 + 3 * 0x00000020);
  int status, value;
  value = *IO;
  status = *(IO + 1);
  if (status == 0) {
    *n = value;
  }
  return status;
}


x86 assembly (clang, -O0):
<readInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x3c000060,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1137 <readInt+0x37>
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt>:
mov    0x3c000064,%eax
test   %eax,%eax
je     110c <readInt+0xc>
ret
mov    0x3c000060,%ecx
mov    %ecx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @readInt(i32* nocapture writeonly %0) {
%2 = load i32, i32* inttoptr (i64 1006633060 to i32*)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i32, i32* inttoptr (i64 1006633056 to i32*)
store i32 %5, i32* %0
br label %6
6: ; preds = %4, %1
ret i32 %2
}
int max2(int a, int b) {}


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

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

LLVM IR (-O0):
define i32 @max2(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 @max2(i32 %0, i32 %1) {
ret i32 undef
}
int test_imm_1Aint64_lowword_mem(long long *val) {
  return ((*val) & (0x1A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Aint64_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, 26
%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_1Aint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 26
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int strncmp(char const *, char *, size_t);
bool is_cpio(const char *test) {
  size_t s = sizeof("070701") + 1;
  int result;
  result = strncmp(test, "070701", s);
  if (result != 0)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<is_cpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x8,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xecd(%rip),%rsi
call   1030 <strncmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1151 <is_cpio+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1158 <is_cpio+0x48>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_cpio>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"070701\00"
define i32 @is_cpio(i8* nocapture %0) {
%2 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 8)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void buscarRegistro() {}


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

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

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

LLVM IR (-O2):
define void @buscarRegistro() {
ret void
}
int test_imm_20int8_reg(signed char val) {
  return ((val) & (-0x20 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_20int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffe0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_20int8_reg>:
cmp    $0x20,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_20int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -32
%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_20int8_reg(i8 signext %0) {
%2 = icmp ult i8 %0, 32
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int bar(int);
int baz(int b) { return bar(b); }


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

x86 assembly (clang, -O2):
<baz>:
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define i32 @baz(i32 %0) {
%2 = tail call i32 @bar(i32 %0)
ret i32 %2
}
int pinconf_check_ops(const struct pinconf_ops *ops) { return 0; }


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

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

LLVM IR (-O0):
%struct.pinconf_ops = type opaque
define i32 @pinconf_check_ops(%struct.pinconf_ops* %0) {
%2 = alloca %struct.pinconf_ops*
store %struct.pinconf_ops* %0, %struct.pinconf_ops** %2
ret i32 0
}

LLVM IR (-O2):
%struct.pinconf_ops = type opaque
define i32 @pinconf_check_ops(%struct.pinconf_ops* nocapture readnone %0) {
ret i32 0
}
void foo() { int x; }


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

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
void gf8mul_11110101(void) {
  __asm__ __volatile__("\tpxor    %xmm7, %xmm6\n"
                       "\tpxor    %xmm6, %xmm5\n"
                       "\tpxor    %xmm5, %xmm4\n"
                       "\tpxor    %xmm4, %xmm3\n"
                       "\tpxor    %xmm3, %xmm2\n"
                       "\tpxor    %xmm2, %xmm1\n"
                       "\tpxor    %xmm1, %xmm0\n"
                       "\tpxor    %xmm0, %xmm7\n"
                       "\tpxor    %xmm0, %xmm6\n"
                       "\tpxor    %xmm0, %xmm5\n"
                       "\tpxor    %xmm0, %xmm4\n"
                       "\tpxor    %xmm0, %xmm2\n");
}


x86 assembly (clang, -O0):
<gf8mul_11110101>:
push   %rbp
mov    %rsp,%rbp
pxor   %xmm7,%xmm6
pxor   %xmm6,%xmm5
pxor   %xmm5,%xmm4
pxor   %xmm4,%xmm3
pxor   %xmm3,%xmm2
pxor   %xmm2,%xmm1
pxor   %xmm1,%xmm0
pxor   %xmm0,%xmm7
pxor   %xmm0,%xmm6
pxor   %xmm0,%xmm5
pxor   %xmm0,%xmm4
pxor   %xmm0,%xmm2
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf8mul_11110101>:
pxor   %xmm7,%xmm6
pxor   %xmm6,%xmm5
pxor   %xmm5,%xmm4
pxor   %xmm4,%xmm3
pxor   %xmm3,%xmm2
pxor   %xmm2,%xmm1
pxor   %xmm1,%xmm0
pxor   %xmm0,%xmm7
pxor   %xmm0,%xmm6
pxor   %xmm0,%xmm5
pxor   %xmm0,%xmm4
pxor   %xmm0,%xmm2
ret

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

LLVM IR (-O2):
define void @gf8mul_11110101() {
tail call void asm sideeffect "\09pxor %xmm7, %xmm6\0A\09pxor %xmm6, %xmm5\0A\09pxor %xmm5, %xmm4\0A\09pxor %xmm4, %xmm3\0A\09pxor %xmm3, %xmm2\0A\09pxor %xmm2, %xmm1\0A\09pxor %xmm1, %xmm0\0A\09pxor %xmm0, %xmm7\0A\09pxor %xmm0, %xmm6\0A\09pxor %xmm0, %xmm5\0A\09pxor %xmm0, %xmm4\0A\09pxor %xmm0, %xmm2\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void outer_iter() { putchar('+'); }


x86 assembly (clang, -O0):
<outer_iter>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<outer_iter>:
mov    $0x2b,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @outer_iter() {
%1 = call i32 @putchar(i8 signext 43)
ret void
}

LLVM IR (-O2):
define void @outer_iter() {
%1 = tail call i32 @putchar(i8 signext 43)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strlen(char *);
void ct2db_cmdline_parser_print_version(void) {
  printf("%s %s\n", (strlen("ct2db") ? "ct2db" : "ct2db"), "1.0");
}


x86 assembly (clang, -O0):
<ct2db_cmdline_parser_print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xedc(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed0(%rip),%rsi
cmp    $0x0,%rax
cmovne %rsi,%rsi
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rdx
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct2db_cmdline_parser_print_version>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xee8(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [6 x i8] c"ct2db\00"
@.str.2 = [4 x i8] c"1.0\00"
define void @ct2db_cmdline_parser_print_version() {
%1 = call i64 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [6 x i8] c"ct2db\00"
@.str.2 = [4 x i8] c"1.0\00"
define void @ct2db_cmdline_parser_print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ putenv(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int strlen(char const *);
void set_file(const char *file) {
  char *env = (char *)malloc(strlen(file) + sizeof("MAT_SERVER=file://"));
  sprintf(env, "MAT_SERVER=file://%s", file);
  putenv(env);
}


x86 assembly (clang, -O0):
<set_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cltq
add    $0x13,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe8b(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <putenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x13(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xea2(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <putenv@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"MAT_SERVER=file://%s\00"
define void @set_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = add i64 %6, 19
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 @putenv(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"MAT_SERVER=file://%s\00"
define void @set_file(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, 19
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @putenv(i8* %5)
ret void
}
/* Type definitions */
struct spx_msg {
  int dummy;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int spx_msg_seek(struct spx_msg *, int /*<<< orphan*/, int);
int spx_msg_align(struct spx_msg *ctx, off_t offset) {
  return spx_msg_seek(ctx, offset, 1);
}


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

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

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

LLVM IR (-O2):
%struct.spx_msg = type { i32 }
define i32 @spx_msg_align(%struct.spx_msg* %0, i32 %1) {
%3 = tail call i32 @spx_msg_seek(%struct.spx_msg* %0, i32 %1, i32 1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ emit_generic_instruction(int /*<<< orphan*/,
                                            int /*<<< orphan*/, int);
void xor_r64_r64(uint8_t dest, uint8_t source) {
  emit_generic_instruction(dest, source, 0x33);
}


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

x86 assembly (clang, -O2):
<xor_r64_r64>:
mov    $0x33,%edx
jmp    1030 <emit_generic_instruction@plt>

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

LLVM IR (-O2):
define void @xor_r64_r64(i32 %0, i32 %1) {
%3 = tail call i32 @emit_generic_instruction(i32 %0, i32 %1, i32 51)
ret void
}
double discard_epsilon(double x) {
  return ((-1e-10 < x) && (x < 1e-10)) ? 0.0 : x;
}


x86 assembly (clang, -O0):
<discard_epsilon>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1140 <discard_epsilon+0x40>
movsd  0xee0(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1140 <discard_epsilon+0x40>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114a <discard_epsilon+0x4a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<discard_epsilon>:
movsd  0xef8(%rip),%xmm1
cmpltsd %xmm0,%xmm1
movapd %xmm0,%xmm2
cmpltsd 0xeee(%rip),%xmm2
andnpd %xmm0,%xmm2
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @discard_epsilon(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double -1.000000e-10, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp olt double %6, 1.000000e-10
br i1 %7, label %8, label %9
8: ; preds = %5
br label %11
9: ; preds = %5, %1
%10 = load double, double* %2
br label %11
11: ; preds = %9, %8
%12 = phi double [ 0.000000e+00, %8 ], [ %10, %9 ]
ret double %12
}

LLVM IR (-O2):
define double @discard_epsilon(double %0) {
%2 = fcmp ogt double %0, -1.000000e-10
%3 = fcmp olt double %0, 1.000000e-10
%4 = and i1 %2, %3
%5 = select i1 %4, double 0.000000e+00, double %0
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ gtp_print_vertices(int, int *, int *);
void gtp_print_vertex(int i, int j) { gtp_print_vertices(1, &i, &j); }


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

x86 assembly (clang, -O2):
<gtp_print_vertex>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x1,%edi
call   1030 <gtp_print_vertices@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @gtp_print_vertex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @gtp_print_vertices(i32 1, i32* %3, i32* %4)
ret void
}
int foo(char *fmt, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Type definitions */
struct timeval {
  unsigned long tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
unsigned long time_elapsed(const struct timeval *last,
                           const struct timeval *current) {
  unsigned long secs, diff;
  secs = current->tv_sec - last->tv_sec;
  diff = 1000000 * secs + current->tv_usec - last->tv_usec;
  return diff;
}


x86 assembly (clang, -O0):
<time_elapsed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%rax
mov    %rax,-0x18(%rbp)
imul   $0xf4240,-0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    0x8(%rcx),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_elapsed>:
mov    (%rsi),%rax
sub    (%rdi),%rax
imul   $0xf4240,%rax,%rax
add    0x8(%rsi),%rax
sub    0x8(%rdi),%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @time_elapsed(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
%5 = alloca i64
%6 = alloca i64
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = load %struct.timeval*, %struct.timeval** %3
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sub i64 %9, %12
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = mul i64 1000000, %14
%16 = load %struct.timeval*, %struct.timeval** %4
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
%18 = load i64, i64* %17
%19 = add i64 %15, %18
%20 = load %struct.timeval*, %struct.timeval** %3
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %20, i32 0, i32 1
%22 = load i64, i64* %21
%23 = sub i64 %19, %22
store i64 %23, i64* %6
%24 = load i64, i64* %6
ret i64 %24
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @time_elapsed(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = mul i64 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = add i64 %8, %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
ret i64 %14
}
double dt2jd(date, time)
double date;
double time;
{
  double dj;
  double tsec;
  tsec = dt2ts(date, time);
  if (date == 0.0)
    dj = tsec / 86400.0;
  else
    dj = ts2jd(tsec);
  return (dj);
}


x86 assembly (clang, -O0):
<dt2jd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x2,%al
call   1030 <dt2ts@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117f <dt2jd+0x5f>
jp     117f <dt2jd+0x5f>
movsd  -0x20(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1194 <dt2jd+0x74>
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
call   1040 <ts2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt2jd>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x2,%al
call   1030 <dt2ts@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorpd  %xmm1,%xmm1
movsd  (%rsp),%xmm2
ucomisd %xmm1,%xmm2
jne    114f <dt2jd+0x2f>
jp     114f <dt2jd+0x2f>
divsd  0xeb3(%rip),%xmm0
pop    %rax
ret
mov    $0x1,%al
call   1040 <ts2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dt2jd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2ts to i32 (double, double, ...)*)(double %7, double %8)
%10 = sitofp i32 %9 to double
store double %10, double* %6
%11 = load double, double* %3
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load double, double* %6
%15 = fdiv double %14, 8.640000e+04
store double %15, double* %5
br label %20
16: ; preds = %2
%17 = load double, double* %6
%18 = call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %17)
%19 = sitofp i32 %18 to double
store double %19, double* %5
br label %20
20: ; preds = %16, %13
%21 = load double, double* %5
ret double %21
}

LLVM IR (-O2):
define double @dt2jd(double %0, double %1) {
%3 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dt2ts to i32 (double, double, ...)*)(double %0, double %1)
%4 = sitofp i32 %3 to double
%5 = fcmp oeq double %0, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = fdiv double %4, 8.640000e+04
br label %11
8: ; preds = %2
%9 = tail call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %4)
%10 = sitofp i32 %9 to double
br label %11
11: ; preds = %8, %6
%12 = phi double [ %7, %6 ], [ %10, %8 ]
ret double %12
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ fatal_error_with_errno(char *, char const *);
void xclose(void *_fp, const char *name) {
  int fd = (int)(intptr_t)_fp;
  if (close(fd))
    fatal_error_with_errno("Error closing \"%s\"", name);
}


x86 assembly (clang, -O0):
<xclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     1159 <xclose+0x39>
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <fatal_error_with_errno@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xclose>:
push   %rbx
mov    %rsi,%rbx
call   1040 <close@plt>
test   %rax,%rax
je     113e <xclose+0x1e>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fatal_error_with_errno@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Error closing \22%s\22\00"
define void @xclose(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i64 @close(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Error closing \22%s\22\00"
define void @xclose(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i64 @close(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %9
9: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  if ('a\'' != 24871)
    abort();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
__typeof__(fprintf(1, 1, 1)) test_fprintf_244(void) { return fprintf(1, 1, 1); }


x86 assembly (clang, -O0):
<test_fprintf_244>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %edx,%edi
mov    %edx,%esi
mov    $0x0,%al
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fprintf_244>:
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
define i32 @test_fprintf_244() {
%1 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @fprintf to i32 (i32, i32, i32, ...)*)(i32 1, i32 1, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_fprintf_244() {
%1 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @fprintf to i32 (i32, i32, i32, ...)*)(i32 1, i32 1, i32 1)
ret i32 %1
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t get_posix_time_usecs(void) {
  struct timeval tval = {
      0,
      0,
  };
  if (gettimeofday(&tval, NULL))
    return 0;
  return ((((uint64_t)tval.tv_sec) * 1000000) + ((uint64_t)tval.tv_usec));
}


x86 assembly (clang, -O0):
<get_posix_time_usecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     115b <get_posix_time_usecs+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    116e <get_posix_time_usecs+0x4e>
mov    -0x18(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    -0x20(%rbp),%rcx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_posix_time_usecs>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
xor    %ebx,%ebx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%ecx
add    (%rsp),%ecx
test   %rax,%rax
cmovne %ebx,%ecx
mov    %ecx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64, i32, i32 }
define i32 @get_posix_time_usecs() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %16
7: ; preds = %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, 1000000
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = add nsw i32 %11, %14
store i32 %15, i32* %1
br label %16
16: ; preds = %7, %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64, i32, i32 }
define i32 @get_posix_time_usecs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = add nsw i32 %8, %11
%13 = select i1 %4, i32 %12, i32 0
ret i32 %13
}
/* Variables and functions */
int u8isuppergreeki(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8isuppergreekcc(const char *c) { return u8isuppergreeki(u8tointcc(c)); }


x86 assembly (clang, -O0):
<u8isuppergreekcc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointcc@plt>
mov    %eax,%edi
call   1040 <u8isuppergreeki@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isuppergreekcc>:
push   %rax
call   1030 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isuppergreeki@plt>

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

LLVM IR (-O2):
define i32 @u8isuppergreekcc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8isuppergreeki(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello sundy");
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"hello sundy\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello sundy\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_exit(i32 0)
unreachable
}