xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void OutOfSpace() {
  printf("**Out of Memory**\n");
  exit(2);
}


x86 assembly (clang, -O0):
<OutOfSpace>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<OutOfSpace>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"**Out of Memory**\0A\00"
define void @OutOfSpace() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@str = [18 x i8] c"**Out of Memory**\00"
define void @OutOfSpace() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 2)
unreachable
}
int FDLIBM_isnan(double x) {
  int hx, lx;
  hx = (*(1 + (int *)&x) & 0x7fffffff);
  lx = *(int *)&x;
  hx |= (unsigned)(lx | (-lx)) >> 31;
  hx = 0x7ff00000 - hx;
  return ((unsigned)(hx)) >> 31;
}


x86 assembly (clang, -O0):
<FDLIBM_isnan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
or     %ecx,%eax
shr    $0x1f,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x7ff00000,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FDLIBM_isnan>:
movq   %xmm0,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
and    $0x7fffffff,%ecx
xor    %edx,%edx
test   %eax,%eax
setne  %dl
or     %ecx,%edx
xor    %eax,%eax
cmp    $0x7ff00001,%edx
setae  %al
ret

LLVM IR (-O0):
define i32 @FDLIBM_isnan(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store double %0, double* %2
%5 = bitcast double* %2 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = and i32 %7, 2147483647
store i32 %8, i32* %3
%9 = bitcast double* %2 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = sub nsw i32 0, %12
%14 = or i32 %11, %13
%15 = lshr i32 %14, 31
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = sub nsw i32 2146435072, %18
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = lshr i32 %20, 31
ret i32 %21
}

LLVM IR (-O2):
define i32 @FDLIBM_isnan(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 32
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 2147483647
%6 = trunc i64 %2 to i32
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = or i32 %5, %8
%10 = icmp ugt i32 %9, 2146435072
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: %s [-LP]\n", getprogname());
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"usage: %s [-LP]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"usage: %s [-LP]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int turn_on(int reg) { return reg | (reg + 1); }


x86 assembly (clang, -O0):
<turn_on>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_on>:
lea    0x1(%rdi),%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @turn_on(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = or i32 %2, %0
ret i32 %3
}
void curveprecision_(nsegments) int *nsegments;
{ curveprecision((short)*nsegments); }


x86 assembly (clang, -O0):
<curveprecision_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movswl %ax,%edi
mov    $0x0,%al
call   1030 <curveprecision@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curveprecision_>:
movswl (%rdi),%edi
xor    %eax,%eax
jmp    1030 <curveprecision@plt>

LLVM IR (-O0):
define void @curveprecision_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = trunc i32 %4 to i16
%6 = sext i16 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @curveprecision to i32 (i32, ...)*)(i32 %6)
ret void
}

LLVM IR (-O2):
define void @curveprecision_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 16
%4 = ashr exact i32 %3, 16
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @curveprecision to i32 (i32, ...)*)(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int *a, int size) {
  for (int i = 0; i < size; i++)
    printf("%d ", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
void mbed_hal_init(void) {}


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

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

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

LLVM IR (-O2):
define void @mbed_hal_init() {
ret void
}
int sqlite3_libversion_number(void) { return 3002002; }


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

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

LLVM IR (-O0):
define i32 @sqlite3_libversion_number() {
ret i32 3002002
}

LLVM IR (-O2):
define i32 @sqlite3_libversion_number() {
ret i32 3002002
}
/* Type definitions */
struct pkt_buff {
  int dummy;
};
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ tprintf(char *);
void dissect_opt_hop(struct pkt_buff *pkt __attribute__((__unused__)),
                     ssize_t *opt_len) {
  if (*opt_len)
    tprintf(", Option(s) recognized ");
}


x86 assembly (clang, -O0):
<dissect_opt_hop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113a <dissect_opt_hop+0x2a>
lea    0xecb(%rip),%rdi
call   1030 <tprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dissect_opt_hop>:
cmpq   $0x0,(%rsi)
je     1122 <dissect_opt_hop+0x12>
lea    0xee3(%rip),%rdi
jmp    1030 <tprintf@plt>
ret

LLVM IR (-O0):
%struct.pkt_buff = type { i32 }
@.str = [24 x i8] c", Option(s) recognized \00"
define void @dissect_opt_hop(%struct.pkt_buff* %0, i64* %1) {
%3 = alloca %struct.pkt_buff*
%4 = alloca i64*
store %struct.pkt_buff* %0, %struct.pkt_buff** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i64, i64* %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @tprintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.pkt_buff = type { i32 }
@.str = [24 x i8] c", Option(s) recognized \00"
define void @dissect_opt_hop(%struct.pkt_buff* nocapture readnone %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @tprintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello world again");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"Hello world again\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serverAdminSet(int);
void server_admin_set(int player) { serverAdminSet(player); }


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

x86 assembly (clang, -O2):
<server_admin_set>:
jmp    1030 <serverAdminSet@plt>

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

LLVM IR (-O2):
define void @server_admin_set(i32 %0) {
%2 = tail call i32 @serverAdminSet(i32 %0)
ret void
}
/* Variables and functions */
float pow(float, float);
float saturate(float);
float SrgbLinearToGamma(float flLinearValue) {
  float x = saturate(flLinearValue);
  return (x <= 0.0031308f) ? (x * 12.92f)
                           : (1.055f * pow(x, (1.0f / 2.4f))) - 0.055f;
}


x86 assembly (clang, -O0):
<SrgbLinearToGamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <saturate@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xebc(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1165 <SrgbLinearToGamma+0x45>
movss  0xeba(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1194 <SrgbLinearToGamma+0x74>
movss  -0x8(%rbp),%xmm0
movss  0xe9a(%rip),%xmm1
call   1030 <pow@plt>
movss  0xe85(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe7d(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SrgbLinearToGamma>:
push   %rax
call   1040 <saturate@plt>
movss  0xed2(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1152 <SrgbLinearToGamma+0x32>
movss  0xecd(%rip),%xmm1
call   1030 <pow@plt>
mulss  0xec4(%rip),%xmm0
addss  0xec0(%rip),%xmm0
pop    %rax
ret
mulss  0xeaa(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @SrgbLinearToGamma(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @saturate(float %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = fcmp ole float %6, 0x3F69A5C380000000
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load float, float* %3
%10 = fmul float %9, 0x4029D70A40000000
br label %15
11: ; preds = %1
%12 = load float, float* %3
%13 = call float @pow(float %12, float 0x3FDAAAAAA0000000)
%14 = call float @llvm.fmuladd.f32(float 0x3FF0E147A0000000, float %13, float 0xBFAC28F5C0000000)
br label %15
15: ; preds = %11, %8
%16 = phi float [ %10, %8 ], [ %14, %11 ]
ret float %16
}

LLVM IR (-O2):
define float @SrgbLinearToGamma(float %0) {
%2 = tail call float @saturate(float %0)
%3 = fcmp ugt float %2, 0x3F69A5C380000000
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = fmul float %2, 0x4029D70A40000000
br label %9
6: ; preds = %1
%7 = tail call float @pow(float %2, float 0x3FDAAAAAA0000000)
%8 = tail call float @llvm.fmuladd.f32(float %7, float 0x3FF0E147A0000000, float 0xBFAC28F5C0000000)
br label %9
9: ; preds = %6, %4
%10 = phi float [ %5, %4 ], [ %8, %6 ]
ret float %10
}
void unused(void) { unused(); }


x86 assembly (clang, -O0):
<unused>:
push   %rbp
mov    %rsp,%rbp
call   1030 <unused@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @unused() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
scalar_t__ ldexpf(float, int);
int /*<<< orphan*/ link_failure_ldexpf();
void test_ldexpf(float f, int x) {
  if (ldexpf(f, x) != ldexpf(f, x))
    link_failure_ldexpf();
}


x86 assembly (clang, -O0):
<test_ldexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1040 <ldexpf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1040 <ldexpf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1165 <test_ldexpf+0x45>
mov    $0x0,%al
call   1030 <link_failure_ldexpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ldexpf>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movss  %xmm0,0x4(%rsp)
call   1040 <ldexpf@plt>
mov    %rax,%r14
movss  0x4(%rsp),%xmm0
mov    %ebx,%edi
call   1040 <ldexpf@plt>
cmp    %rax,%r14
jne    114e <test_ldexpf+0x2e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <link_failure_ldexpf@plt>

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

LLVM IR (-O2):
define void @test_ldexpf(float %0, i32 %1) {
%3 = tail call i64 @ldexpf(float %0, i32 %1)
%4 = tail call i64 @ldexpf(float %0, i32 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_ldexpf()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
void rosn_utils_clrprnt_cprint_reset(void) { printf("%c[%dm", 27, 0); }


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

x86 assembly (clang, -O2):
<rosn_utils_clrprnt_cprint_reset>:
lea    0xee9(%rip),%rdi
mov    $0x1b,%esi
xor    %edx,%edx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dm\00"
define void @rosn_utils_clrprnt_cprint_reset() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 0)
ret void
}
void XpmFree(ptr) void *ptr;
{ free(ptr); }


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

x86 assembly (clang, -O2):
<XpmFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @XpmFree(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void delimiter(FILE *f) {
  fprintf(f, "----------------------------------------------------\n");
}


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

x86 assembly (clang, -O2):
<delimiter>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x35,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"----------------------------------------------------\0A\00"
define void @delimiter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"----------------------------------------------------\0A\00"
define void @delimiter(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i64 53, i64 1, i32* %0)
ret void
}
/* Variables and functions */
char *cgi_variable(char *);
scalar_t__ strcmp(char *, char *);
int cgi_boolean(char *name, int def) {
  char *p = cgi_variable(name);
  if (!p)
    return def;
  return strcmp(p, "1") == 0;
}


x86 assembly (clang, -O0):
<cgi_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cgi_variable@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1152 <cgi_boolean+0x32>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <cgi_boolean+0x51>
mov    -0x20(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgi_boolean>:
push   %rbx
mov    %esi,%ebx
call   1030 <cgi_variable@plt>
test   %rax,%rax
je     1144 <cgi_boolean+0x24>
lea    0xecc(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
define i32 @cgi_boolean(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 = call i8* @cgi_variable(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
define i32 @cgi_boolean(i8* %0, i32 %1) {
%3 = tail call i8* @cgi_variable(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ %1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ asm_beep();
void beep() { asm_beep(); }


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

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

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

LLVM IR (-O2):
define void @beep() {
%1 = tail call i32 (...) @asm_beep()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void cleanup_charptr(char **ptr) {
  if (*ptr)
    free(*ptr);
}


x86 assembly (clang, -O0):
<cleanup_charptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <cleanup_charptr+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_charptr>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <cleanup_charptr+0xd>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @cleanup_charptr(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
br label %6
6: ; preds = %4, %1
ret void
}
extern void be16enc(void *buf, unsigned short u) {
  unsigned char *p = (unsigned char *)buf;
  p[0] = ((unsigned)u >> 8) & 0xff;
  p[1] = u & 0xff;
}


x86 assembly (clang, -O0):
<be16enc>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movzwl -0xa(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<be16enc>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @be16enc(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8*
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = lshr i32 %8, 8
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
ret void
}

LLVM IR (-O2):
define void @be16enc(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %0
%5 = trunc i16 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
void void_signal_handler(int signo) {}


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

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

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

LLVM IR (-O2):
define void @void_signal_handler(i32 %0) {
ret void
}
/* Variables and functions */
bool chars_is_white_space(char c) { return c <= 0x20; }


x86 assembly (clang, -O0):
<chars_is_white_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_is_white_space>:
xor    %eax,%eax
cmp    $0x21,%dil
setl   %al
ret

LLVM IR (-O0):
define i32 @chars_is_white_space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 32
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @chars_is_white_space(i8 signext %0) {
%2 = icmp slt i8 %0, 33
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex8(int /*<<< orphan*/, unsigned char);
void print_emerg_hex8(unsigned char value) { __console_tx_hex8(0, value); }


x86 assembly (clang, -O0):
<print_emerg_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_hex8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_emerg_hex8>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <__console_tx_hex8@plt>

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

LLVM IR (-O2):
define void @print_emerg_hex8(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_hex8(i32 0, i8 zeroext %0)
ret void
}
int test_imm_27uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x27 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_27uint64_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, 39
%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_27uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 39
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
_Bool bitIsSet(const int flags, const int bitI) {
  if (flags & (1 << bitI))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<bitIsSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     112d <bitIsSet+0x2d>
movb   $0x1,-0x1(%rbp)
jmp    1131 <bitIsSet+0x31>
movb   $0x0,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitIsSet>:
bt     %esi,%edi
setb   %al
ret

LLVM IR (-O0):
define zeroext i1 @bitIsSet(i32 %0, i32 %1) {
%3 = alloca i1
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i1 true, i1* %3
br label %13
12: ; preds = %2
store i1 false, i1* %3
br label %13
13: ; preds = %12, %11
%14 = load i1, i1* %3
ret i1 %14
}

LLVM IR (-O2):
define zeroext i1 @bitIsSet(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
ret i1 %5
}
OP(op, ce) { ADC(ARG()); }


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <ARG@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <ADC@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @ARG()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @ADC to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
/* Variables and functions */
int EXIT_SUCCESS;
int h_exit_success(void) { return EXIT_SUCCESS; }


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @h_exit_success() {
%1 = load i32, i32* @EXIT_SUCCESS
ret i32 %1
}
/* Variables and functions */
double indefinite_integral_f1_dx(double, double);
double definite_integral_f1_dx(double r, double x, double a, double b) {
  double value_at_point_b = 0.0;
  double value_at_point_a = 0.0;
  value_at_point_a = indefinite_integral_f1_dx(r, a);
  value_at_point_b = indefinite_integral_f1_dx(r, b);
  return (value_at_point_b - value_at_point_a);
}


x86 assembly (clang, -O0):
<definite_integral_f1_dx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <indefinite_integral_f1_dx@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <indefinite_integral_f1_dx@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<definite_integral_f1_dx>:
sub    $0x18,%rsp
movsd  %xmm3,0x10(%rsp)
movaps %xmm2,%xmm1
movsd  %xmm0,(%rsp)
call   1030 <indefinite_integral_f1_dx@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <indefinite_integral_f1_dx@plt>
subsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @definite_integral_f1_dx(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
%11 = load double, double* %5
%12 = load double, double* %7
%13 = call double @indefinite_integral_f1_dx(double %11, double %12)
store double %13, double* %10
%14 = load double, double* %5
%15 = load double, double* %8
%16 = call double @indefinite_integral_f1_dx(double %14, double %15)
store double %16, double* %9
%17 = load double, double* %9
%18 = load double, double* %10
%19 = fsub double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @definite_integral_f1_dx(double %0, double %1, double %2, double %3) {
%5 = tail call double @indefinite_integral_f1_dx(double %0, double %2)
%6 = tail call double @indefinite_integral_f1_dx(double %0, double %3)
%7 = fsub double %6, %5
ret double %7
}
int gcd(int a, int b) {
  if (a == 0)
    return b;
  else if (b == 0)
    return a;
  if (a < b)
    return gcd(a, b - a);
  else
    return gcd(b, a - b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <gcd+0x70>
cmpl   $0x0,-0xc(%rbp)
jne    1148 <gcd+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <gcd+0x70>
jmp    114d <gcd+0x3d>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116f <gcd+0x5f>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1180 <gcd+0x70>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
test   %edi,%edi
je     112c <gcd+0x2c>
test   %esi,%esi
je     1129 <gcd+0x29>
mov    %esi,%eax
mov    %esi,%ecx
nopl   0x0(%rax)
sub    %edi,%ecx
jle    1120 <gcd+0x20>
mov    %ecx,%eax
jne    1110 <gcd+0x10>
jmp    1129 <gcd+0x29>
nopw   0x0(%rax,%rax,1)
mov    %edi,%esi
mov    %eax,%edi
sub    %eax,%esi
jne    1108 <gcd+0x8>
ret
mov    %edi,%eax
ret
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %5
store i32 %9, i32* %3
br label %32
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %32
15: ; preds = %10
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = sub nsw i32 %22, %23
%25 = call i32 @gcd(i32 %21, i32 %24)
store i32 %25, i32* %3
br label %32
26: ; preds = %16
%27 = load i32, i32* %5
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = sub nsw i32 %28, %29
%31 = call i32 @gcd(i32 %27, i32 %30)
store i32 %31, i32* %3
br label %32
32: ; preds = %26, %20, %13, %8
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %18, label %6
6: ; preds = %4, %15
%7 = phi i32 [ %10, %15 ], [ %0, %4 ]
%8 = phi i32 [ %16, %15 ], [ %1, %4 ]
br label %9
9: ; preds = %6, %12
%10 = phi i32 [ %8, %6 ], [ %13, %12 ]
%11 = icmp sgt i32 %10, %7
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = sub nsw i32 %10, %7
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %9
15: ; preds = %9
%16 = sub nsw i32 %7, %10
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %6
18: ; preds = %15, %12, %4, %2
%19 = phi i32 [ %1, %2 ], [ %0, %4 ], [ %7, %12 ], [ %10, %15 ]
ret i32 %19
}
long zz() { return 0x00000000L; }


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

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

LLVM IR (-O0):
define i64 @zz() {
ret i64 0
}

LLVM IR (-O2):
define i64 @zz() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ CDROMEJECT;
int O_NONBLOCK;
int O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/);
int open(char *, int);
void ioctl_eject(void) {
  int fd = open("/dev/cdrom", O_RDONLY | O_NONBLOCK);
  if (fd <= 0)
    return;
  ioctl(fd, CDROMEJECT);
  close(fd);
}


x86 assembly (clang, -O0):
<ioctl_eject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1168 <ioctl_eject+0x38>
jmp    1181 <ioctl_eject+0x51>
mov    -0x4(%rbp),%edi
mov    0x2e5e(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioctl_eject>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1050 <open@plt>
test   %eax,%eax
jle    116d <ioctl_eject+0x3d>
mov    %eax,%ebx
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1030 <ioctl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/cdrom\00"
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
@CDROMEJECT = global i32 0
define void @ioctl_eject() {
%1 = alloca i32
%2 = load i32, i32* @O_RDONLY
%3 = load i32, i32* @O_NONBLOCK
%4 = or i32 %2, %3
%5 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
br label %15
9: ; preds = %0
%10 = load i32, i32* %1
%11 = load i32, i32* @CDROMEJECT
%12 = call i32 @ioctl(i32 %10, i32 %11)
%13 = load i32, i32* %1
%14 = call i32 @close(i32 %13)
br label %15
15: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/cdrom\00"
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
@CDROMEJECT = global i32 0
define void @ioctl_eject() {
%1 = load i32, i32* @O_RDONLY
%2 = load i32, i32* @O_NONBLOCK
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i32, i32* @CDROMEJECT
%8 = tail call i32 @ioctl(i32 %4, i32 %7)
%9 = tail call i32 @close(i32 %4)
br label %10
10: ; preds = %0, %6
ret void
}
/* Type definitions */
struct oldold_utsname {
  int dummy;
};

/* Variables and functions */
int main() {
  struct oldold_utsname oldold_uts;
  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):
%struct.oldold_utsname = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.oldold_utsname
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct session {
  int dummy;
};

/* Variables and functions */
double mathexp(struct session *, char *);
int /*<<< orphan*/ substitute(struct session *, char *, char *, int);
double get_number(struct session *ses, char *str) {
  char number[10000];
  substitute(ses, str, number, (1 << 1) | (1 << 2));
  return mathexp(ses, number);
}


x86 assembly (clang, -O0):
<get_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x2720(%rbp),%rdx
mov    $0x6,%ecx
call   1040 <substitute@plt>
mov    -0x8(%rbp),%rdi
lea    -0x2720(%rbp),%rsi
call   1030 <mathexp@plt>
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number>:
push   %r14
push   %rbx
sub    $0x2718,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdx
mov    $0x6,%ecx
call   1040 <substitute@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <mathexp@plt>
add    $0x2718,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.session = type { i32 }
define double @get_number(%struct.session* %0, i8* %1) {
%3 = alloca %struct.session*
%4 = alloca i8*
%5 = alloca [10000 x i8]
store %struct.session* %0, %struct.session** %3
store i8* %1, i8** %4
%6 = load %struct.session*, %struct.session** %3
%7 = load i8*, i8** %4
%8 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 0
%9 = call i32 @substitute(%struct.session* %6, i8* %7, i8* %8, i32 6)
%10 = load %struct.session*, %struct.session** %3
%11 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 0
%12 = call double @mathexp(%struct.session* %10, i8* %11)
ret double %12
}

LLVM IR (-O2):
%struct.session = type { i32 }
define double @get_number(%struct.session* %0, i8* %1) {
%3 = alloca [10000 x i8]
%4 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 0
%5 = call i32 @substitute(%struct.session* %0, i8* %1, i8* %4, i32 6)
%6 = call double @mathexp(%struct.session* %0, i8* %4)
ret double %6
}
int ld_blt_mr1(long double *a1, long double a2) {
  return (__builtin_isless(*a1, a2));
}


x86 assembly (clang, -O0):
<ld_blt_mr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blt_mr1>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

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

LLVM IR (-O2):
define i32 @ld_blt_mr1(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp olt x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int t[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, *p = t;
  p += 2;
  p += p[-1];
  printf("%d", *p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x4(%rax),%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
void foo681() {}


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

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

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

LLVM IR (-O2):
define void @foo681() {
ret void
}
/* Variables and functions */
int bbm_long_write(void *, unsigned short, unsigned int);
signed int bbm_com_long_write(void *handle, unsigned short addr,
                              unsigned int data) {
  signed int res;
  res = bbm_long_write(handle, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_long_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x10(%rbp),%edx
movzwl %ax,%esi
call   1030 <bbm_long_write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_long_write>:
jmp    1030 <bbm_long_write@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_long_write(i8* %0, i16 zeroext %1, i32 %2) {
%4 = tail call i32 @bbm_long_write(i8* %0, i16 zeroext %1, i32 %2)
ret i32 %4
}