xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int get_tmp_path(char *buf, int len) {
  int rc = -1;
  char *path = "/tmp";
  if (len < strlen(path) + 1) {
    goto cleanup;
  }
  strcpy(buf, path);
  rc = 0;
cleanup:
  return rc;
}


x86 assembly (clang, -O0):
<get_tmp_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1165 <get_tmp_path+0x45>
jmp    1179 <get_tmp_path+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tmp_path>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ebp,%ecx
jge    1150 <get_tmp_path+0x30>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"/tmp\00"
define i32 @get_tmp_path(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %2 ], [ 0, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ atan2(double, double);
double ephRadToDeg(int /*<<< orphan*/);
double ephATan2(double y, double x) { return ephRadToDeg(atan2(y, x)); }


x86 assembly (clang, -O0):
<ephATan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
mov    %eax,%edi
call   1040 <ephRadToDeg@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @ephATan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @atan2(double %5, double %6)
%8 = call double @ephRadToDeg(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @ephATan2(double %0, double %1) {
%3 = tail call i32 @atan2(double %0, double %1)
%4 = tail call double @ephRadToDeg(i32 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b, re;
  scanf("%d%d", &a, &b);
  re = a / b;
  printf("%d", re);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cltd
idivl  (%rsp)
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = sdiv i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sdiv i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parse_bool(char const *, int *);
int /*<<< orphan*/ set_auto_expand_albums_search_int(int);
void set_auto_expand_albums_search(unsigned int id, const char *buf) {
  int tmp;
  parse_bool(buf, &tmp);
  set_auto_expand_albums_search_int(tmp);
}


x86 assembly (clang, -O0):
<set_auto_expand_albums_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <parse_bool@plt>
mov    -0x14(%rbp),%edi
call   1040 <set_auto_expand_albums_search_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_auto_expand_albums_search>:
push   %rax
mov    %rsi,%rdi
lea    0x4(%rsp),%rsi
call   1030 <parse_bool@plt>
mov    0x4(%rsp),%edi
call   1040 <set_auto_expand_albums_search_int@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @set_auto_expand_albums_search(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @parse_bool(i8* %6, i32* %5)
%8 = load i32, i32* %5
%9 = call i32 @set_auto_expand_albums_search_int(i32 %8)
ret void
}

LLVM IR (-O2):
define void @set_auto_expand_albums_search(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @parse_bool(i8* %1, i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @set_auto_expand_albums_search_int(i32 %6)
ret void
}
double dle(x, y)
double x, y;
{ return ((double)(x <= y)); }


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

x86 assembly (clang, -O2):
<dle>:
cmplesd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @dle(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
long double pow(long double, long double);
long double powl(long double __x, long double __y) {
  return pow(__x, __y / 2) * pow(__x, __y / 2);
}


x86 assembly (clang, -O0):
<powl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
flds   0xed0(%rip)
fld    %st(0)
fstpt  -0x38(%rbp)
fdivrp %st,%st(1)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <pow@plt>
fldt   -0x38(%rbp)
fxch   %st(1)
fstpt  -0x2c(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fdivp  %st,%st(2)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <pow@plt>
fldt   -0x2c(%rbp)
fmulp  %st,%st(1)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powl>:
sub    $0x48,%rsp
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x30(%rsp)
fldt   0x60(%rsp)
fmuls  0xed8(%rip)
fld    %st(0)
fstpt  0x24(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <pow@plt>
fstpt  0x3c(%rsp)
fldt   0x24(%rsp)
fstpt  0x10(%rsp)
fldt   0x30(%rsp)
fstpt  (%rsp)
call   1030 <pow@plt>
fldt   0x3c(%rsp)
fmulp  %st,%st(1)
add    $0x48,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @powl(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* %4
%7 = fdiv x86_fp80 %6, 0xK40008000000000000000
%8 = call x86_fp80 @pow(x86_fp80 %5, x86_fp80 %7)
%9 = load x86_fp80, x86_fp80* %3
%10 = load x86_fp80, x86_fp80* %4
%11 = fdiv x86_fp80 %10, 0xK40008000000000000000
%12 = call x86_fp80 @pow(x86_fp80 %9, x86_fp80 %11)
%13 = fmul x86_fp80 %8, %12
ret x86_fp80 %13
}

LLVM IR (-O2):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = fmul x86_fp80 %1, 0xK3FFE8000000000000000
%4 = tail call x86_fp80 @pow(x86_fp80 %0, x86_fp80 %3)
%5 = tail call x86_fp80 @pow(x86_fp80 %0, x86_fp80 %3)
%6 = fmul x86_fp80 %4, %5
ret x86_fp80 %6
}
int exDIsjunctionValue(int x, int y) {
  if (x == 1 && y == 1) {
    return 0;
    ;
  } else if (x == 0 && y == 0) {
    return 0;
    ;
  } else
    return 1;
  ;
}


x86 assembly (clang, -O0):
<exDIsjunctionValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    112a <exDIsjunctionValue+0x2a>
cmpl   $0x1,-0xc(%rbp)
jne    112a <exDIsjunctionValue+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <exDIsjunctionValue+0x51>
cmpl   $0x0,-0x8(%rbp)
jne    114a <exDIsjunctionValue+0x4a>
cmpl   $0x0,-0xc(%rbp)
jne    114a <exDIsjunctionValue+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <exDIsjunctionValue+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exDIsjunctionValue>:
mov    %edi,%eax
xor    $0x1,%eax
mov    %esi,%ecx
xor    $0x1,%ecx
or     %edi,%esi
setne  %dl
or     %eax,%ecx
setne  %al
and    %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @exDIsjunctionValue(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, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %3
br label %20
12: ; preds = %8, %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 0, i32* %3
br label %20
19: ; preds = %15, %12
store i32 1, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @exDIsjunctionValue(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 1
%4 = icmp ne i32 %1, 1
%5 = or i32 %1, %0
%6 = icmp ne i32 %5, 0
%7 = or i1 %3, %4
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ioNext();
char ioPeek();
scalar_t__ isspace(char);
void skipWhite(void) {
  while (isspace(ioPeek()) && ioPeek() != '\n') {
    ioNext();
  }
}


x86 assembly (clang, -O0):
<skipWhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    113d <skipWhite+0xd>
mov    $0x0,%al
call   1050 <ioPeek@plt>
movsbl %al,%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1171 <skipWhite+0x41>
mov    $0x0,%al
call   1050 <ioPeek@plt>
movsbl %al,%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
test   $0x1,%al
jne    1181 <skipWhite+0x51>
jmp    118d <skipWhite+0x5d>
mov    $0x0,%al
call   1030 <ioNext@plt>
jmp    113d <skipWhite+0xd>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipWhite>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <ioPeek@plt>
movsbl %al,%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     1168 <skipWhite+0x38>
xor    %eax,%eax
call   1050 <ioPeek@plt>
cmp    $0xa,%al
je     1168 <skipWhite+0x38>
xor    %eax,%eax
call   1030 <ioNext@plt>
jmp    1140 <skipWhite+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @skipWhite() {
br label %1
1: ; preds = %11, %0
%2 = call signext i8 (...) @ioPeek()
%3 = call i64 @isspace(i8 signext %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call signext i8 (...) @ioPeek()
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = call i32 (...) @ioNext()
br label %1
13: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @skipWhite() {
%1 = tail call signext i8 (...) @ioPeek()
%2 = tail call i64 @isspace(i8 signext %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %0, %7
%5 = tail call signext i8 (...) @ioPeek()
%6 = icmp eq i8 %5, 10
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = tail call i32 (...) @ioNext()
%9 = tail call signext i8 (...) @ioPeek()
%10 = tail call i64 @isspace(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %7, %0
ret void
}
double test_ceil(double x) { return __builtin_ceil(x); }


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

x86 assembly (clang, -O2):
<test_ceil>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @test_ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.ceil.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @test_ceil(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
ret double %2
}
void swap(int *x, int *y) {
  if (x != y) {
    *x ^= *y;
    *y ^= *x;
    *x ^= *y;
  }
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1144 <swap+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    %rsi,%rdi
je     1111 <swap+0x11>
mov    (%rdi),%eax
xor    (%rsi),%eax
mov    %eax,(%rdi)
xor    (%rsi),%eax
mov    %eax,(%rsi)
xor    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @swap(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = load i32, i32* %0
%7 = xor i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = xor i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %0
%11 = xor i32 %10, %9
store i32 %11, i32* %0
br label %12
12: ; preds = %4, %2
ret void
}
int ne(double a, double b) { return a != b; }


x86 assembly (clang, -O0):
<ne>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne>:
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ne(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long cmap;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
void set_Screen_cmap(void *_p, unsigned long _v) {
  ((Screen *)_p)->cmap = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_Screen_cmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_Screen_cmap(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int rmdir(char *);
int cleanup_tempdir(char *path) { return rmdir(path); }


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

x86 assembly (clang, -O2):
<cleanup_tempdir>:
jmp    1030 <rmdir@plt>

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

LLVM IR (-O2):
define i32 @cleanup_tempdir(i8* nocapture %0) {
%2 = tail call i32 @rmdir(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
char *copy_bytes_16(char *dst, char *src) {
  *(uint64_t *)dst = *(uint64_t *)(src + 8);
  *(uint64_t *)(dst + 8) = *(uint64_t *)src;
  return dst + 16;
}


x86 assembly (clang, -O0):
<copy_bytes_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_bytes_16>:
mov    0x8(%rsi),%eax
mov    %eax,(%rdi)
mov    (%rsi),%eax
mov    %eax,0x8(%rdi)
lea    0x10(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @copy_bytes_16(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 8
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 8
%16 = bitcast i8* %15 to i32*
store i32 %13, i32* %16
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 16
ret i8* %18
}

LLVM IR (-O2):
define i8* @copy_bytes_16(i8* writeonly %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 8
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %0 to i32*
store i32 %5, i32* %6
%7 = bitcast i8* %1 to i32*
%8 = load i32, i32* %7
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = getelementptr inbounds i8, i8* %0, i64 16
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void img_buf_free(void *memblk) {
  if (memblk) {
    void *addr = (void *)(((size_t *)memblk)[-1]);
    free(addr);
  }
}


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

x86 assembly (clang, -O2):
<img_buf_free>:
test   %rdi,%rdi
je     111e <img_buf_free+0xe>
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @img_buf_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i64*
%9 = getelementptr inbounds i64, i64* %8, i64 -1
%10 = load i64, i64* %9
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @img_buf_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @free(i8* %7)
br label %9
9: ; preds = %3, %1
ret void
}
int reset_assert(struct reset_ctl *reset_ctl) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.reset_ctl = type opaque
define i32 @reset_assert(%struct.reset_ctl* nocapture readnone %0) {
ret i32 0
}
void RTStrCurrentCPToUtf8Tag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrCurrentCPToUtf8Tag() {
ret void
}
void toggle_tx_led(void) {}


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

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

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

LLVM IR (-O2):
define void @toggle_tx_led() {
ret void
}
int test_imm_F4int32_reg(int val) { return ((val) & (0xF4 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_F4int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xf4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F4int32_reg>:
test   $0xf4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F4int32_reg(i32 %0) {
%2 = and i32 %0, 244
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void writes(int fd, const char *p) { write(fd, p, strlen(p)); }


x86 assembly (clang, -O0):
<writes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writes>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @writes(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @writes(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
void __attribute__((no_instrument_function)) __cyg_profile_func_exit() {}


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

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

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

LLVM IR (-O2):
define void @__cyg_profile_func_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, int, char const *);
void rtxErrAssertionFailed(const char *conditionText, int lineNo,
                           const char *fileName) {
  printf("Run-time assertion '%s' failed.  Line %d, File %s\n", conditionText,
         lineNo, fileName);
  exit(-1);
}


x86 assembly (clang, -O0):
<rtxErrAssertionFailed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<rtxErrAssertionFailed>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Run-time assertion '%s' failed. Line %d, File %s\0A\00"
define void @rtxErrAssertionFailed(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [51 x i8] c"Run-time assertion '%s' failed. Line %d, File %s\0A\00"
define void @rtxErrAssertionFailed(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
void EVP_CIPHER_CTX_ctrl(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_ctrl() {
ret void
}
int supports_eci(const int symbology) {
  int result = 0;
  switch (symbology) {
  case 92:
  case 71:
  case 57:
  case 84:
  case 55:
  case 56:
  case 58:
  case 115:
  case 142:
  case 116:
    result = 1;
    break;
  }
  return result;
}


x86 assembly (clang, -O0):
<supports_eci>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffc9,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x57,%eax
ja     113e <supports_eci+0x3e>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<supports_eci>:
xor    %eax,%eax
add    $0xffffffc9,%edi
cmp    $0x57,%edi
ja     111f <supports_eci+0x1f>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @supports_eci(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 92, label %5
i32 71, label %5
i32 57, label %5
i32 84, label %5
i32 55, label %5
i32 56, label %5
i32 58, label %5
i32 115, label %5
i32 142, label %5
i32 116, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %6
6: ; preds = %1, %5
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @supports_eci(i32 %0) {
switch i32 %0, label %3 [
i32 92, label %2
i32 71, label %2
i32 57, label %2
i32 84, label %2
i32 55, label %2
i32 56, label %2
i32 58, label %2
i32 115, label %2
i32 142, label %2
i32 116, label %2
]
2: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 0, %1 ], [ 1, %2 ]
ret i32 %4
}
void mysh_loop(void) {
  char *line;
  char **args;
  int status;
  do {
    printf("> ");
    line = mysh_get_line();
    args = mysh_split_line(line);
    status = mysh_execute(args);
    free(line);
    free(args);
  } while (status);
}


x86 assembly (clang, -O0):
<mysh_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <mysh_get_line@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <mysh_split_line@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <mysh_execute@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x14(%rbp)
jne    1158 <mysh_loop+0x8>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysh_loop>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xea2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <mysh_get_line@plt>
movslq %eax,%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <mysh_split_line@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <mysh_execute@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
test   %ebp,%ebp
jne    1160 <mysh_loop+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define void @mysh_loop() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @mysh_get_line()
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mysh_split_line to i32 (i8*, ...)*)(i8* %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8**
%9 = tail call i32 (i8**, ...) bitcast (i32 (...)* @mysh_execute to i32 (i8**, ...)*)(i8** %8)
tail call void @free(i8* %5)
%10 = inttoptr i64 %7 to i8*
tail call void @free(i8* %10)
%11 = icmp eq i32 %9, 0
br i1 %11, label %12, label %1
12: ; preds = %1
ret void
}
/* Type definitions */
struct url {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fetchXGetFile(struct url *, int /*<<< orphan*/ *,
                                  char const *);
FILE *fetchGetFile(struct url *u, const char *flags) {
  return (fetchXGetFile(u, NULL, flags));
}


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

x86 assembly (clang, -O2):
<fetchGetFile>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <fetchXGetFile@plt>

LLVM IR (-O0):
%struct.url = type { i32 }
define i32* @fetchGetFile(%struct.url* %0, i8* %1) {
%3 = alloca %struct.url*
%4 = alloca i8*
store %struct.url* %0, %struct.url** %3
store i8* %1, i8** %4
%5 = load %struct.url*, %struct.url** %3
%6 = load i8*, i8** %4
%7 = call i32* @fetchXGetFile(%struct.url* %5, i32* null, i8* %6)
ret i32* %7
}

LLVM IR (-O2):
%struct.url = type { i32 }
define i32* @fetchGetFile(%struct.url* %0, i8* %1) {
%3 = tail call i32* @fetchXGetFile(%struct.url* %0, i32* null, i8* %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int, int);
int main() {
  if (foo(1, sizeof(unsigned int) * 8 + 1) != 2)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x21,%esi
call   1040 <foo@plt>
cmp    $0x2,%eax
je     114e <main+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x21,%esi
call   1040 <foo@plt>
cmp    $0x2,%eax
jne    1139 <main+0x19>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1, i32 33)
%3 = icmp ne i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 33)
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
double f6(double x) { return __builtin_exp(x); }


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

x86 assembly (clang, -O2):
<f6>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @f6(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ LCD_Out(int, int, char);
void mostraslinha(char slinha) { LCD_Out(2, 1, slinha); }


x86 assembly (clang, -O0):
<mostraslinha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
movsbl -0x1(%rbp),%edx
call   1030 <LCD_Out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostraslinha>:
mov    %edi,%edx
mov    $0x2,%edi
mov    $0x1,%esi
jmp    1030 <LCD_Out@plt>

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

LLVM IR (-O2):
define void @mostraslinha(i8 signext %0) {
%2 = tail call i32 @LCD_Out(i32 2, i32 1, i8 signext %0)
ret void
}
int iscntrl(int c) { return (c == '\0') || (c == 31) || (c == 127); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <iscntrl+0x2f>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <iscntrl+0x2f>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
mov    $0x1,%eax
test   %edi,%edi
je     110e <iscntrl+0xe>
cmp    $0x1f,%edi
jne    110f <iscntrl+0xf>
ret
xor    %eax,%eax
cmp    $0x7f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 31
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ true, %5 ], [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
switch i32 %0, label %2 [
i32 31, label %5
i32 0, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 127
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_longdouble_put(long double *dest, const long double *src,
                                 size_t len, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_longdouble_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_longdouble_put(x86_fp80* %0, x86_fp80* %1, i64 %2, i32 %3) {
%5 = alloca x86_fp80*
%6 = alloca x86_fp80*
%7 = alloca i64
%8 = alloca i32
store x86_fp80* %0, x86_fp80** %5
store x86_fp80* %1, x86_fp80** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_longdouble_put(x86_fp80* nocapture readnone %0, x86_fp80* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int fftwf_alignment_of(float *p) {
  (void)p;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @fftwf_alignment_of(float* nocapture readnone %0) {
ret i32 0
}
int test_02(unsigned char *x, int y, int z) { return ((x[0] << 3) & 192) != 0; }


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x3,%eax
and    $0xc0,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
xor    %eax,%eax
testb  $0x18,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @test_02(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 3
%12 = and i32 %11, 192
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_02(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, 24
%6 = icmp ne i8 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XKeymapEvent;

/* Variables and functions */
void set_XKeymapEvent_type(void *_p, int _v) {
  ((XKeymapEvent *)_p)->type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XKeymapEvent_type>:
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_XKeymapEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeymapEvent_type(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_XKeymapEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void _writer_buffer(const void *wdest, char c) {
  char **dest = (char **)wdest;
  **dest = c;
  (*dest)++;
}


x86 assembly (clang, -O0):
<_writer_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_writer_buffer>:
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @_writer_buffer(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8**
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i8**
store i8** %7, i8*** %5
%8 = load i8, i8* %4
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
store i8 %8, i8* %10
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %11
ret void
}

LLVM IR (-O2):
define void @_writer_buffer(i8* nocapture %0, i8 signext %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closegpio(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<closegpio>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closegpio(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int test_imm_97uint32_reg(unsigned int val) {
  return ((val) & (0x97 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_97uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x97,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_97uint32_reg>:
test   $0x97,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_97uint32_reg(i32 %0) {
%2 = and i32 %0, 151
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int c, nl = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\n') {
      ++nl;
    }
    printf("%d\n", nl);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1176 <main+0x56>
cmpl   $0xa,-0x8(%rbp)
jne    1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
je     1160 <main+0x40>
lea    0xec2(%rip),%rbx
xor    %ebp,%ebp
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %14, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %11, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = tail call i32 (...) @getchar()
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %4
14: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printTri();
int main() {
  printTri();
  printTri();
  printTri();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <printTri@plt>
xor    %eax,%eax
call   1030 <printTri@plt>
xor    %eax,%eax
call   1030 <printTri@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printTri()
%2 = tail call i32 (...) @printTri()
%3 = tail call i32 (...) @printTri()
ret i32 0
}
__attribute__((always_)) int PageHighMem(struct page *page) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define i32 @PageHighMem(%struct.page* nocapture readnone %0) {
ret i32 0
}