xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void print_float(float out) { printf("%8.4f\n", out); }


x86 assembly (clang, -O0):
<print_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%8.4f\0A\00"
define void @print_float(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_bitmap();
void sp_close_bitmap() { close_bitmap(); }


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

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

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

LLVM IR (-O2):
define void @sp_close_bitmap() {
%1 = tail call i32 (...) @close_bitmap()
ret void
}
int getHammingDistance(int A, int B) {
  int xOr = A ^ B, countOne = 0;
  while (xOr) {
    countOne++;
    xOr -= (xOr & (-xOr));
  }
  return countOne;
}


x86 assembly (clang, -O0):
<getHammingDistance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1144 <getHammingDistance+0x44>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
sub    -0xc(%rbp),%eax
and    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <getHammingDistance+0x1a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHammingDistance>:
xor    %eax,%eax
xor    %esi,%edi
je     111c <getHammingDistance+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <getHammingDistance+0x10>
ret

LLVM IR (-O0):
define i32 @getHammingDistance(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
store i32 %9, i32* %5
store i32 0, i32* %6
br label %10
10: ; preds = %13, %2
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = load i32, i32* %5
%18 = sub nsw i32 0, %17
%19 = and i32 %16, %18
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, %19
store i32 %21, i32* %5
br label %10
22: ; preds = %10
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @getHammingDistance(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = phi i32 [ %10, %5 ], [ %3, %2 ]
%8 = add nuw nsw i32 %6, 1
%9 = add i32 %7, -1
%10 = and i32 %9, %7
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ intif_charposreq(int, char *, int);
int intif_jumpto(int account_id, char *name) {
  intif_charposreq(account_id, name, 1);
  return 0;
}


x86 assembly (clang, -O0):
<intif_jumpto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <intif_charposreq@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @intif_jumpto(i32 %0, i8* %1) {
%3 = tail call i32 @intif_charposreq(i32 %0, i8* %1, i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double random();
void Gen_vector(double x[], int n) {
  int i;
  for (i = 0; i < n; i++)
    x[i] = random() / ((double)RAND_MAX);
}


x86 assembly (clang, -O0):
<Gen_vector>:
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    1164 <Gen_vector+0x54>
mov    $0x0,%al
call   1030 <random@plt>
mov    0x2ea8(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Gen_vector+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gen_vector>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1152 <Gen_vector+0x42>
mov    %rdi,%r14
mov    %esi,%r12d
mov    0x2ebf(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%r15),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <Gen_vector+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define void @Gen_vector(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = call double (...) @random()
%12 = load i64, i64* @RAND_MAX
%13 = sitofp i64 %12 to double
%14 = fdiv double %11, %13
%15 = load double*, double** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
store double %14, double* %18
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define void @Gen_vector(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = tail call double (...) @random()
%9 = load i64, i64* @RAND_MAX
%10 = sitofp i64 %9 to double
%11 = fdiv double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 %7
store double %11, double* %12
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ sg_put_unaligned_le16(scalar_t__, void *);
void sg_nz_put_unaligned_le16(uint16_t val, void *p) {
  if (val)
    sg_put_unaligned_le16(val, p);
}


x86 assembly (clang, -O0):
<sg_nz_put_unaligned_le16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <sg_nz_put_unaligned_le16+0x28>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <sg_put_unaligned_le16@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sg_nz_put_unaligned_le16(i64 %0, i8* %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @sg_put_unaligned_le16(i64 %0, i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
void Char_to_Str(unsigned char *p, unsigned char n) {
  *p++ = '0' + n / 100;
  n %= 100;
  *p++ = '0' + n / 10;
  n %= 10;
  *p++ = '0' + n;
  *p = 0;
}


x86 assembly (clang, -O0):
<Char_to_Str>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
movzbl -0x9(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
movzbl -0x9(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Char_to_Str>:
lea    (%rsi,%rsi,4),%eax
lea    (%rsi,%rax,8),%eax
shr    $0xc,%eax
imul   $0x64,%eax,%ecx
or     $0x30,%al
mov    %al,(%rdi)
sub    %cl,%sil
movzbl %sil,%eax
imul   $0xcd,%eax,%ecx
shr    $0xb,%ecx
mov    %ecx,%edx
or     $0x30,%dl
mov    %dl,0x1(%rdi)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
or     $0x30,%al
mov    %al,0x2(%rdi)
movb   $0x0,0x3(%rdi)
ret

LLVM IR (-O0):
define void @Char_to_Str(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = sdiv i32 %6, 100
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8 %9, i8* %10
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = srem i32 %13, 100
%15 = trunc i32 %14 to i8
store i8 %15, i8* %4
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = sdiv i32 %17, 10
%19 = add nsw i32 48, %18
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
store i8 %20, i8* %21
%23 = load i8, i8* %4
%24 = zext i8 %23 to i32
%25 = srem i32 %24, 10
%26 = trunc i32 %25 to i8
store i8 %26, i8* %4
%27 = load i8, i8* %4
%28 = zext i8 %27 to i32
%29 = add nsw i32 48, %28
%30 = trunc i32 %29 to i8
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %3
store i8 %30, i8* %31
%33 = load i8*, i8** %3
store i8 0, i8* %33
ret void
}

LLVM IR (-O2):
define void @Char_to_Str(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = udiv i8 %1, 100
%4 = or i8 %3, 48
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = urem i8 %1, 100
%7 = udiv i8 %6, 10
%8 = or i8 %7, 48
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %5
%10 = urem i8 %6, 10
%11 = or i8 %10, 48
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %9
store i8 0, i8* %12
ret void
}
/* Variables and functions */
int strcmp(char const *, char *);
int check_string(const char *s) { return strcmp(s, "String"); }


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

x86 assembly (clang, -O2):
<check_string>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"String\00"
define i32 @check_string(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_num(int n) {
  if (n < 0) {
    return;
  }
  printf("\n%d", n);
  print_num(n - 1);
}


x86 assembly (clang, -O0):
<print_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113a <print_num+0x1a>
jmp    1154 <print_num+0x34>
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <print_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_num>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
js     113f <print_num+0x2f>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jb     1130 <print_num+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%d\00"
define void @print_num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define void @print_num(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %4, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int keyboard_getStatus();
void keyboard_outputWait() {
  while (!(keyboard_getStatus() & 0x01))
    ;
}


x86 assembly (clang, -O0):
<keyboard_outputWait>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <keyboard_outputWait+0x9>
mov    $0x0,%al
call   1030 <keyboard_getStatus@plt>
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <keyboard_outputWait+0x28>
jmp    113d <keyboard_outputWait+0x2d>
jmp    1119 <keyboard_outputWait+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_outputWait>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <keyboard_getStatus@plt>
test   $0x1,%al
je     1120 <keyboard_outputWait+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @keyboard_outputWait() {
br label %1
1: ; preds = %6, %0
%2 = call i32 (...) @keyboard_getStatus()
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @keyboard_outputWait() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @keyboard_getStatus()
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ text_out(char *);
void style_normal() { text_out("\x1b[0m"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @style_normal() {
%1 = tail call i32 @text_out(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *alloc(size_t size) {
  void *n;
  n = malloc(size);
  if (n)
    return n;
  perror("malloc");
  exit(1);
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <alloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<alloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <alloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ EAGAIN;
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ errno;
int /*<<< orphan*/ handle_conn(int);
int /*<<< orphan*/ perror(char *);
void sigio(int sock) {
  int nsock;
  while ((nsock = accept(sock, NULL, NULL)) != -1) {
    if (nsock == -1) {
      if (errno != EAGAIN) {
        perror("accept");
      }
      return;
    }
    handle_conn(nsock);
  }
}


x86 assembly (clang, -O0):
<sigio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1050 <accept@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     1198 <sigio+0x68>
cmpl   $0xffffffff,-0x8(%rbp)
jne    118b <sigio+0x5b>
mov    0x2e79(%rip),%rax
mov    (%rax),%rax
mov    0x2e5f(%rip),%rcx
cmp    (%rcx),%rax
je     1186 <sigio+0x56>
lea    0xe7f(%rip),%rdi
call   1040 <perror@plt>
jmp    1198 <sigio+0x68>
mov    -0x8(%rbp),%edi
call   1030 <handle_conn@plt>
jmp    113b <sigio+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigio>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %esi,%esi
xor    %edx,%edx
call   1040 <accept@plt>
cmp    $0xffffffff,%eax
je     1149 <sigio+0x29>
mov    %eax,%edi
call   1030 <handle_conn@plt>
mov    %ebx,%edi
jmp    1130 <sigio+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@EAGAIN = global i64 0
@.str = [7 x i8] c"accept\00"
define void @sigio(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %2
%6 = call i32 @accept(i32 %5, i32* null, i32* null)
store i32 %6, i32* %3
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i64, i64* @errno
%13 = load i64, i64* @EAGAIN
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %11
br label %21
18: ; preds = %8
%19 = load i32, i32* %3
%20 = call i32 @handle_conn(i32 %19)
br label %4
21: ; preds = %17, %4
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@EAGAIN = global i64 0
define void @sigio(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32* null, i32* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @handle_conn(i32 %5)
%7 = tail call i32 @accept(i32 %0, i32* null, i32* null)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
void test_int_p(int *p) { *p = 42; }


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

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

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

LLVM IR (-O2):
define void @test_int_p(i32* nocapture writeonly %0) {
store i32 42, i32* %0
ret void
}
int ft_isprint(int c) { return (c >= 32 && c <= 127); }


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isprint+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x60,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 96
%4 = zext i1 %3 to i32
ret i32 %4
}
int strcmp(const char *s1, const char *s2) {
  int s;
  while ((s = *s1++ - *s2++) == 0)
    ;
  return s;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    1143 <strcmp+0x43>
jmp    110c <strcmp+0xc>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
add    $0x1,%rcx
sub    %edx,%eax
je     1110 <strcmp+0x10>
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %9, %3 ]
%5 = phi i8* [ %0, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %8, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %3, label %14
14: ; preds = %3
ret i32 %12
}
void mystrcat(char *s, char *t) {
  while (*s)
    s++;
  while ((*s++ = *t++))
    ;
}


x86 assembly (clang, -O0):
<mystrcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <mystrcat+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <mystrcat+0xc>
jmp    112f <mystrcat+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115e <mystrcat+0x5e>
jmp    112f <mystrcat+0x2f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <mystrcat>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <mystrcat+0x10>
ret

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

LLVM IR (-O2):
define void @mystrcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closeFileDescriptors();
int /*<<< orphan*/ unexportPin(int);
void closeDACs() {
  closeFileDescriptors();
  unexportPin(32);
  unexportPin(33);
  unexportPin(34);
  unexportPin(36);
  unexportPin(37);
}


x86 assembly (clang, -O0):
<closeDACs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <closeFileDescriptors@plt>
mov    $0x20,%edi
call   1040 <unexportPin@plt>
mov    $0x21,%edi
call   1040 <unexportPin@plt>
mov    $0x22,%edi
call   1040 <unexportPin@plt>
mov    $0x24,%edi
call   1040 <unexportPin@plt>
mov    $0x25,%edi
call   1040 <unexportPin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeDACs>:
push   %rax
xor    %eax,%eax
call   1030 <closeFileDescriptors@plt>
mov    $0x20,%edi
call   1040 <unexportPin@plt>
mov    $0x21,%edi
call   1040 <unexportPin@plt>
mov    $0x22,%edi
call   1040 <unexportPin@plt>
mov    $0x24,%edi
call   1040 <unexportPin@plt>
mov    $0x25,%edi
pop    %rax
jmp    1040 <unexportPin@plt>

LLVM IR (-O0):
define void @closeDACs() {
%1 = call i32 (...) @closeFileDescriptors()
%2 = call i32 @unexportPin(i32 32)
%3 = call i32 @unexportPin(i32 33)
%4 = call i32 @unexportPin(i32 34)
%5 = call i32 @unexportPin(i32 36)
%6 = call i32 @unexportPin(i32 37)
ret void
}

LLVM IR (-O2):
define void @closeDACs() {
%1 = tail call i32 (...) @closeFileDescriptors()
%2 = tail call i32 @unexportPin(i32 32)
%3 = tail call i32 @unexportPin(i32 33)
%4 = tail call i32 @unexportPin(i32 34)
%5 = tail call i32 @unexportPin(i32 36)
%6 = tail call i32 @unexportPin(i32 37)
ret void
}
int jacFun_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @jacFun_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @jacFun_n_out() {
ret i32 2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned int state;
};
typedef TYPE_1__ XCrossingEvent;

/* Variables and functions */
void set_XCrossingEvent_state(void *_p, unsigned _v) {
  ((XCrossingEvent *)_p)->state = (unsigned)_v;
}


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

x86 assembly (clang, -O2):
<set_XCrossingEvent_state>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XCrossingEvent_state(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XCrossingEvent_state(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void rs_poly_zero(unsigned char *_p, int _dp1) {
  memset(_p, 0, _dp1 * sizeof(*_p));
}


x86 assembly (clang, -O0):
<rs_poly_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs_poly_zero>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @rs_poly_zero(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i32 @memset(i8* %5, i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @rs_poly_zero(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
int Glwm_ComparePointers(void *p1, void *p2) {
  if (p1 < p2) {
    return -1;
  } else if (p1 > p2) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Glwm_ComparePointers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1126 <Glwm_ComparePointers+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <Glwm_ComparePointers+0x4c>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1140 <Glwm_ComparePointers+0x40>
movl   $0x1,-0x4(%rbp)
jmp    114c <Glwm_ComparePointers+0x4c>
jmp    1145 <Glwm_ComparePointers+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Glwm_ComparePointers>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Glwm_ComparePointers(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
int _c2i(const char *c) {
  int *rtn = (int *)c;
  return *rtn;
}


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

x86 assembly (clang, -O2):
<_c2i>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @_c2i(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
double horner_r(double x, int n, double *a) {
  double y = 0;
  if (n == 0) {
    y = 1;
  } else {
    y = x * horner_r(x, n - 1, a + 1) + a[0];
  }
  return y;
}


x86 assembly (clang, -O0):
<horner_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1148 <horner_r+0x38>
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1187 <horner_r+0x77>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
call   1030 <horner_r@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<horner_r>:
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
je     113a <horner_r+0x2a>
mov    %rsi,%rbx
add    $0xffffffff,%edi
add    $0x8,%rsi
movsd  %xmm0,0x8(%rsp)
call   1030 <horner_r@plt>
mulsd  0x8(%rsp),%xmm0
addsd  (%rbx),%xmm0
jmp    1142 <horner_r+0x32>
movsd  0xebe(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @horner_r(double %0, i32 %1, double* %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca double*
%7 = alloca double
store double %0, double* %4
store i32 %1, i32* %5
store double* %2, double** %6
store double 0.000000e+00, double* %7
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store double 1.000000e+00, double* %7
br label %23
11: ; preds = %3
%12 = load double, double* %4
%13 = load double, double* %4
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = load double*, double** %6
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = call double @horner_r(double %13, i32 %15, double* %17)
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = call double @llvm.fmuladd.f64(double %12, double %18, double %21)
store double %22, double* %7
br label %23
23: ; preds = %11, %10
%24 = load double, double* %7
ret double %24
}

LLVM IR (-O2):
define double @horner_r(double %0, i32 %1, double* nocapture %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3, %7
%6 = phi double [ %12, %7 ], [ 1.000000e+00, %3 ]
ret double %6
7: ; preds = %3
%8 = add nsw i32 %1, -1
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = tail call double @horner_r(double %0, i32 %8, double* %9)
%11 = load double, double* %2
%12 = tail call double @llvm.fmuladd.f64(double %0, double %10, double %11)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ throw_out_socket();
void die() {
  printf("Exiting on fatal error.\n");
  throw_out_socket();
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <throw_out_socket@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <throw_out_socket@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Exiting on fatal error.\0A\00"
define void @die() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @throw_out_socket()
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"Exiting on fatal error.\00"
define void @die() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @throw_out_socket()
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float M_PI;
float rsl_getPI() { return M_PI; }


x86 assembly (clang, -O0):
<rsl_getPI>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsl_getPI>:
mov    0x2ee1(%rip),%rax
movss  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @rsl_getPI() {
%1 = load float, float* @M_PI
ret float %1
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @rsl_getPI() {
%1 = load float, float* @M_PI
ret float %1
}
int sum(int x) {
  if (x <= 0)
    return 0;
  else
    return x + sum(x - 1);
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <sum+0x21>
movl   $0x0,-0x4(%rbp)
jmp    114c <sum+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sum@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edi,%edi
jle    1119 <sum+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_server_new() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_server_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"NOT IMPLEMENTED:pa_socket_server_new\0A\00"
define i32 @pa_socket_server_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_socket_server_new\00"
define i32 @pa_socket_server_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_36uint16_mem(unsigned short *val) {
  return ((*val) & (0x36 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_36uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 54
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned char __inb_p(unsigned short port) {
  unsigned char _v;
  __asm__ __volatile__("in"
                       "b"
                       " %"
                       "w"
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "d"(port));
  __asm__ __volatile__("outb %al,$0x80");
  return _v;
}


x86 assembly (clang, -O0):
<__inb_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
out    %al,$0x80
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inb_p>:
mov    %edi,%edx
in     (%dx),%al
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i8 @__inb_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @__inb_p(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret i8 %2
}
OP(ed, a6) {}


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

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

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 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
int main() {
  int x;
  int y;
  x = y = 0;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int pa_nextPosition(int pos) { return (pos + 1) % 5; }


x86 assembly (clang, -O0):
<pa_nextPosition>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_nextPosition>:
add    $0x1,%edi
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @pa_nextPosition(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = srem i32 %2, 5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ maxHeap(int *, int, int);
void buildMaxHeap(int A[], int len) {
  int i;
  for (i = len / 2 - 1; i >= 0; i--) {
    maxHeap(A, len, i);
  }
}


x86 assembly (clang, -O0):
<buildMaxHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <buildMaxHeap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <maxHeap@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <buildMaxHeap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildMaxHeap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <buildMaxHeap+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <maxHeap@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <buildMaxHeap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @buildMaxHeap(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 2
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @maxHeap(i32* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @buildMaxHeap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %8, %6 ], [ %5, %4 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @maxHeap(i32* %0, i32 %1, i32 %8)
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_error_ln(int, int, char *);
void print_error_ln_if(int line, int char_number, char message[],
                       bool condition) {
  if (condition) {
    print_error_ln(line, char_number, message);
  }
}


x86 assembly (clang, -O0):
<print_error_ln_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     113e <print_error_ln_if+0x2e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <print_error_ln@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error_ln_if>:
test   %ecx,%ecx
je     1119 <print_error_ln_if+0x9>
jmp    1030 <print_error_ln@plt>
ret

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

LLVM IR (-O2):
define void @print_error_ln_if(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @print_error_ln(i32 %0, i32 %1, i8* %2)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b();
int fwdCheck() { b(); }


x86 assembly (clang, -O0):
<fwdCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <b@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fwdCheck() {
%1 = alloca i32
%2 = call i32 (...) @b()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @fwdCheck() {
%1 = tail call i32 (...) @b()
ret i32 undef
}