xunge/DecIR huggingface dataset:
double acos(double x) {
  return ({
    extern __typeof__(acos) module_libc_acos;
    &module_libc_acos;
  })(x);
}


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
jmp    1030 <module_libc_acos@plt>

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

LLVM IR (-O2):
define double @acos(double %0) {
%2 = tail call double @module_libc_acos(double %0)
ret double %2
}
/* Variables and functions */
int binomialCoeff(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int n = 5, k = 2;
  printf("Value of C(%d, %d) is %d ", n, k, binomialCoeff(n, k));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <binomialCoeff@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [26 x i8] c"Value of C(%d, %d) is %d \00"
define i32 @main() {
%1 = tail call i32 @binomialCoeff(i32 5, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 5, i32 2, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_number(int);
int /*<<< orphan*/ output_with_tab(char *);
void gnargs(int d) {
  output_with_tab("ldaa ");
  output_number(d);
  newline();
}


x86 assembly (clang, -O0):
<gnargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    -0x4(%rbp),%edi
call   1050 <output_number@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnargs>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    %ebx,%edi
call   1050 <output_number@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ldaa \00"
define void @gnargs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @output_number(i32 %4)
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ldaa \00"
define void @gnargs(i32 %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @output_number(i32 %0)
%4 = tail call i32 (...) @newline()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u32;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_2_le(int, int /*<<< orphan*/ *);
void __put_unaligned_4_le(__u32 __v, register __u8 *__p) {
  __put_unaligned_2_le(__v >> 16, __p + 2);
  __put_unaligned_2_le(__v, __p);
}


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

x86 assembly (clang, -O2):
<__put_unaligned_4_le>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x10,%edi
add    $0x8,%rsi
call   1030 <__put_unaligned_2_le@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_2_le@plt>

LLVM IR (-O0):
define void @__put_unaligned_4_le(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 = ashr i32 %5, 16
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = call i32 @__put_unaligned_2_le(i32 %6, i32* %8)
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @__put_unaligned_2_le(i32 %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_4_le(i32 %0, i32* %1) {
%3 = ashr i32 %0, 16
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = tail call i32 @__put_unaligned_2_le(i32 %3, i32* %4)
%6 = tail call i32 @__put_unaligned_2_le(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a = 10;
  switch (a) {
  case 10:
    printf("10\n");
  case 11:
    printf("11\n");
  default:
    printf("default\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xa,%eax
je     114b <main+0x3b>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0xb,%eax
je     1157 <main+0x47>
jmp    1163 <main+0x53>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [3 x i8] c"10\00"
@str.3 = [3 x i8] c"11\00"
@str.4 = [8 x i8] c"default\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
void singlebuffer_() { singlebuffer_(); }


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

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

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

LLVM IR (-O2):
define void @singlebuffer_() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("EOF: %d\n", EOF);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"EOF: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @EOF
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"EOF: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%i\n", fib(36));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fib(i32 36)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @fib(i32 36)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int fn4(int n) { return (1 & (1 << n)) == 0; }


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn4>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @fn4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = and i32 1, %4
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @fn4(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ kill_cur_item();
int /*<<< orphan*/ spawn(char *);
void use(void) {
  spawn("dam-bom");
  kill_cur_item();
}


x86 assembly (clang, -O0):
<use>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <spawn@plt>
mov    $0x0,%al
call   1030 <kill_cur_item@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<use>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <spawn@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <kill_cur_item@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"dam-bom\00"
define void @use() {
%1 = call i32 @spawn(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @kill_cur_item()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"dam-bom\00"
define void @use() {
%1 = tail call i32 @spawn(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @kill_cur_item()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int idx_to_dna(char c) {
  assert(c >= 0 && c <= 3);
  switch (c) {
  case 0:
    return 'A';
  case 1:
    return 'C';
  case 2:
    return 'G';
  }
  return 'T';
}


x86 assembly (clang, -O0):
<idx_to_dna>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x6(%rbp)
jl     113d <idx_to_dna+0x2d>
movsbl -0x5(%rbp),%eax
cmp    $0x3,%eax
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
movzbl %al,%edi
and    $0x1,%edi
call   1030 <assert@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1181 <idx_to_dna+0x71>
jmp    115f <idx_to_dna+0x4f>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     118d <idx_to_dna+0x7d>
jmp    1170 <idx_to_dna+0x60>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1199 <idx_to_dna+0x89>
jmp    11a5 <idx_to_dna+0x95>
movl   $0x41,-0x4(%rbp)
jmp    11ac <idx_to_dna+0x9c>
movl   $0x43,-0x4(%rbp)
jmp    11ac <idx_to_dna+0x9c>
movl   $0x47,-0x4(%rbp)
jmp    11ac <idx_to_dna+0x9c>
movl   $0x54,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idx_to_dna>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x4,%bl
setb   %dil
call   1030 <assert@plt>
mov    $0x54,%eax
cmp    $0x2,%bl
ja     1139 <idx_to_dna+0x29>
movsbq %bl,%rax
lea    0xeca(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @idx_to_dna(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 3
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
switch i32 %16, label %20 [
i32 0, label %17
i32 1, label %18
i32 2, label %19
]
17: ; preds = %11
store i32 65, i32* %2
br label %21
18: ; preds = %11
store i32 67, i32* %2
br label %21
19: ; preds = %11
store i32 71, i32* %2
br label %21
20: ; preds = %11
store i32 84, i32* %2
br label %21
21: ; preds = %20, %19, %18, %17
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@switch.table.idx_to_dna = [3 x i32] [i32 65, i32 67, i32 71]
define i32 @idx_to_dna(i8 signext %0) {
%2 = icmp ult i8 %0, 4
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp ult i8 %0, 3
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = sext i8 %0 to i64
%8 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.idx_to_dna, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 84, %1 ]
ret i32 %11
}
/* Variables and functions */
int hash_sdbm(char const *);
unsigned hash_str(const void *str) { return hash_sdbm((const char *)str); }


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

x86 assembly (clang, -O2):
<hash_str>:
jmp    1030 <hash_sdbm@plt>

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

LLVM IR (-O2):
define i32 @hash_str(i8* %0) {
%2 = tail call i32 @hash_sdbm(i8* %0)
ret i32 %2
}
int test_imm_CDint16_mem(short *val) {
  return ((*val) & (-0xCD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CDint16_mem>:
movzwl (%rdi),%eax
test   $0xff33,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CDint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -205
%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_CDint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -205
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t list_meter_double(const void *el) { return sizeof(double); }


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

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

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

LLVM IR (-O2):
define i64 @list_meter_double(i8* nocapture readnone %0) {
ret i64 8
}
int test_imm_FEuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xFE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FEuint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 254
%5 = icmp ne i64 %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_FEuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 254
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void g_rand_int_range() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ntohs(int const);
uint16_t get_unaligned_u16(const uint16_t *p_) {
  const uint8_t *p = (const uint8_t *)p_;
  return ntohs((p[0] << 8) | p[1]);
}


x86 assembly (clang, -O0):
<get_unaligned_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
shl    $0x8,%edi
mov    -0x10(%rbp),%rax
or     0x4(%rax),%edi
call   1030 <ntohs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unaligned_u16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
mov    %eax,%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
define i32 @get_unaligned_u16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = shl i32 %7, 8
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = or i32 %8, %11
%13 = call i32 @ntohs(i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_unaligned_u16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
%7 = tail call i32 @ntohs(i32 %6)
ret i32 %7
}
void fldcw_precision(void) {
  asm(" pushw $0x007F ; fldcw (%esp) ; addl $2, %esp");
}


x86 assembly (clang, -O0):
<fldcw_precision>:
push   %rbp
mov    %rsp,%rbp
pushw  $0x7f
fldcw  (%esp)
add    $0x2,%esp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fldcw_precision>:
pushw  $0x7f
fldcw  (%esp)
add    $0x2,%esp
ret

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

LLVM IR (-O2):
define void @fldcw_precision() {
tail call void asm sideeffect " pushw $$0x007F ; fldcw (%esp) ; addl $$2, %esp", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *, void *, void *);
int /*<<< orphan*/ free(void *);
void *malloc(int);
void test_3(void *q, void *r) {
  void *p = malloc(1024);
  foo(p, q, r);
  foo(p, q, r);
  free(p);
}


x86 assembly (clang, -O0):
<test_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <foo@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <foo@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_3>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <foo@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <foo@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @test_3(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @malloc(i32 1024)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @foo(i8* %7, i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @foo(i8* %11, i8* %12, i8* %13)
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
define void @test_3(i8* %0, i8* %1) {
%3 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%4 = tail call i32 @foo(i8* %3, i8* %0, i8* %1)
%5 = tail call i32 @foo(i8* %3, i8* %0, i8* %1)
%6 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, char *, int /*<<< orphan*/);
int main() { execlp("login", "login", "-f", "root", 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rsi
lea    0xee4(%rip),%rdx
lea    0xee0(%rip),%rcx
xor    %r8d,%r8d
mov    %rsi,%rdi
call   1030 <execlp@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee7(%rip),%rdx
lea    0xee3(%rip),%rcx
mov    %rdi,%rsi
xor    %r8d,%r8d
call   1030 <execlp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"login\00"
@.str.1 = [3 x i8] c"-f\00"
@.str.2 = [5 x i8] c"root\00"
define i32 @main() {
%1 = call i32 @execlp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"login\00"
@.str.1 = [3 x i8] c"-f\00"
@.str.2 = [5 x i8] c"root\00"
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ testPlotInt();
int /*<<< orphan*/ testPlotRgb();
int /*<<< orphan*/ testRgbTransforms();
int main(int argc, char **argv) {
  testPlotRgb();
  testPlotInt();
  testRgbTransforms();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <testPlotRgb@plt>
mov    $0x0,%al
call   1040 <testPlotInt@plt>
mov    $0x0,%al
call   1030 <testRgbTransforms@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @testPlotRgb()
%6 = call i32 (...) @testPlotInt()
%7 = call i32 (...) @testRgbTransforms()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testPlotRgb()
%4 = tail call i32 (...) @testPlotInt()
%5 = tail call i32 (...) @testRgbTransforms()
ret i32 0
}
/* Variables and functions */
int EOF;
int scalanative_libc_eof() { return EOF; }


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

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

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @scalanative_libc_eof() {
%1 = load i32, i32* @EOF
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_packs_epi32(int /*<<< orphan*/ const,
                                   int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_unpackhi_epi32(int /*<<< orphan*/ const,
                                      int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_unpacklo_epi32(int /*<<< orphan*/ const,
                                      int /*<<< orphan*/ const);
__m128i mm_zip_epi32_sse2(const __m128i *const src_1,
                          const __m128i *const src_2) {
  const __m128i tmp_1 = _mm_unpacklo_epi32(*src_1, *src_2);
  const __m128i tmp_2 = _mm_unpackhi_epi32(*src_1, *src_2);
  return _mm_packs_epi32(tmp_1, tmp_2);
}


x86 assembly (clang, -O0):
<mm_zip_epi32_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <_mm_unpacklo_epi32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1050 <_mm_unpackhi_epi32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <_mm_packs_epi32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_zip_epi32_sse2>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1040 <_mm_unpacklo_epi32@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    (%r14),%esi
call   1050 <_mm_unpackhi_epi32@plt>
mov    %ebp,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_mm_packs_epi32@plt>

LLVM IR (-O0):
define i32 @mm_zip_epi32_sse2(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* %7
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = call i32 @_mm_unpacklo_epi32(i32 %8, i32 %10)
store i32 %11, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = call i32 @_mm_unpackhi_epi32(i32 %13, i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = call i32 @_mm_packs_epi32(i32 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @mm_zip_epi32_sse2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @_mm_unpacklo_epi32(i32 %3, i32 %4)
%6 = load i32, i32* %0
%7 = load i32, i32* %1
%8 = tail call i32 @_mm_unpackhi_epi32(i32 %6, i32 %7)
%9 = tail call i32 @_mm_packs_epi32(i32 %5, i32 %8)
ret i32 %9
}
unsigned int *_ZN5small8RetTest6EPi(struct l_class_OC_small *llvm_cbe_this,
                                    unsigned int *llvm_cbe_pi) {
  unsigned int *llvm_cbe_retval;
  struct l_class_OC_small *llvm_cbe_this_2e_addr;
  unsigned int *llvm_cbe_pi_2e_addr;
  struct l_class_OC_small *llvm_cbe_this1;
  unsigned int *llvm_cbe_tmp;
  unsigned int *llvm_cbe_tmp__70;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  *(&llvm_cbe_pi_2e_addr) = llvm_cbe_pi;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  llvm_cbe_tmp = *(&llvm_cbe_pi_2e_addr);
  *(&llvm_cbe_retval) = llvm_cbe_tmp;
  llvm_cbe_tmp__70 = *(&llvm_cbe_retval);
  return llvm_cbe_tmp__70;
}


x86 assembly (clang, -O0):
<_ZN5small8RetTest6EPi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.l_class_OC_small = type opaque
define i32* @_ZN5small8RetTest6EPi(%struct.l_class_OC_small* %0, i32* %1) {
%3 = alloca %struct.l_class_OC_small*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca %struct.l_class_OC_small*
%7 = alloca i32*
%8 = alloca %struct.l_class_OC_small*
%9 = alloca i32*
%10 = alloca i32*
store %struct.l_class_OC_small* %0, %struct.l_class_OC_small** %3
store i32* %1, i32** %4
%11 = load %struct.l_class_OC_small*, %struct.l_class_OC_small** %3
store %struct.l_class_OC_small* %11, %struct.l_class_OC_small** %6
%12 = load i32*, i32** %4
store i32* %12, i32** %7
%13 = load %struct.l_class_OC_small*, %struct.l_class_OC_small** %6
store %struct.l_class_OC_small* %13, %struct.l_class_OC_small** %8
%14 = load i32*, i32** %7
store i32* %14, i32** %9
%15 = load i32*, i32** %9
store i32* %15, i32** %5
%16 = load i32*, i32** %5
store i32* %16, i32** %10
%17 = load i32*, i32** %10
ret i32* %17
}

LLVM IR (-O2):
%struct.l_class_OC_small = type opaque
define i32* @_ZN5small8RetTest6EPi(%struct.l_class_OC_small* nocapture readnone %0, i32* readnone returned %1) {
ret i32* %1
}
/* Variables and functions */
scalar_t__ isCapitalChar(char);
char getCapitalChar(char c) {
  if (isCapitalChar(c))
    return c;
  return c - 32;
}


x86 assembly (clang, -O0):
<getCapitalChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <isCapitalChar@plt>
cmp    $0x0,%rax
je     113c <getCapitalChar+0x2c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1146 <getCapitalChar+0x36>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCapitalChar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isCapitalChar@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @getCapitalChar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isCapitalChar(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8, i8* %3
store i8 %8, i8* %2
br label %14
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 32
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %9, %7
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @getCapitalChar(i8 signext %0) {
%2 = tail call i64 @isCapitalChar(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void display_version(void) {
  printf("nandwrite"
         " "
         "$Revision: 1.32 $"
         "\n"
         "\n"
         "Copyright (C) 2003 Thomas Gleixner \n"
         "\n"
         "nandwrite"
         " comes with NO WARRANTY\n"
         "to the extent permitted by law.\n"
         "\n"
         "You may redistribute copies of "
         "nandwrite"
         "\n"
         "under the terms of the GNU General Public Licence.\n"
         "See the file `COPYING' for more information.\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [270 x i8] c"nandwrite $Revision: 1.32 $\0A\0ACopyright (C) 2003 Thomas Gleixner \0A\0Anandwrite comes with NO WARRANTY\0Ato the extent permitted by law.\0A\0AYou may redistribute copies of nandwrite\0Aunder the terms of the GNU General Public Licence.\0ASee the file `COPYING' for more information.\0A\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([270 x i8], [270 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [269 x i8] c"nandwrite $Revision: 1.32 $\0A\0ACopyright (C) 2003 Thomas Gleixner \0A\0Anandwrite comes with NO WARRANTY\0Ato the extent permitted by law.\0A\0AYou may redistribute copies of nandwrite\0Aunder the terms of the GNU General Public Licence.\0ASee the file `COPYING' for more information.\00"
define void @display_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([269 x i8], [269 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int access(const char *pathname, int mode) {
  long __res;
  __asm__ volatile("int $0x80"
                   : "=a"(__res)
                   : "0"(33), "b"((long)(pathname)), "c"((long)(mode)));
  do {
    if ((unsigned long)(__res) >= (unsigned long)(-125)) {
      __res = -1;
    }
    return (int)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<access>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rbx
movslq -0x14(%rbp),%rcx
mov    $0x21,%eax
int    $0x80
mov    %rax,-0x20(%rbp)
cmpq   $0xffffffffffffff83,-0x20(%rbp)
jb     1132 <access+0x32>
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
mov    -0x20(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<access>:
push   %rbx
mov    %rdi,%rbx
movslq %esi,%rcx
mov    $0x21,%eax
int    $0x80
cmp    $0xffffffffffffff83,%rax
mov    $0xffffffff,%ecx
cmovae %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @access(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 33, i64 %7, i64 %9)
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
%13 = icmp uge i64 %12, -125
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 -1, i64* %5
br label %15
15: ; preds = %14, %11
%16 = load i64, i64* %5
%17 = trunc i64 %16 to i32
br label %18
18: ; preds = %15
ret i32 %17
}

LLVM IR (-O2):
define i32 @access(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = sext i32 %1 to i64
%5 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 33, i64 %3, i64 %4)
%6 = icmp ugt i64 %5, -126
%7 = trunc i64 %5 to i32
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int get_hex(char *, int, unsigned int *, int *);
int get_address_data(char *buf, unsigned int *address, unsigned int *data) {
  int found, length;
  found = get_hex(buf, 2, address, &length);
  if (found) {
    found = get_hex(buf, 3 + length, data, &length);
  }
  return found;
}


x86 assembly (clang, -O0):
<get_address_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x2,%esi
lea    -0x20(%rbp),%rcx
call   1030 <get_hex@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1161 <get_address_data+0x51>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
add    $0x3,%esi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <get_hex@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_address_data>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0x4(%rsp),%rcx
mov    $0x2,%esi
call   1030 <get_hex@plt>
test   %eax,%eax
je     1149 <get_address_data+0x39>
mov    0x4(%rsp),%esi
add    $0x3,%esi
lea    0x4(%rsp),%rcx
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <get_hex@plt>
jmp    114b <get_address_data+0x3b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @get_address_data(i8* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @get_hex(i8* %0, i32 2, i32* %1, i32* %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 3
%11 = call i32 @get_hex(i8* %0, i32 %10, i32* %2, i32* %4)
br label %12
12: ; preds = %8, %3
%13 = phi i32 [ %11, %8 ], [ 0, %3 ]
ret i32 %13
}
int uadd_ok(unsigned x, unsigned y) {
  unsigned sum = x + y;
  return sum >= x;
}


x86 assembly (clang, -O0):
<uadd_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uadd_ok>:
not    %edi
xor    %eax,%eax
cmp    %esi,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @uadd_ok(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp uge i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @uadd_ok(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = icmp uge i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
void clear_RnB() { *((unsigned volatile char *)0x70200028) |= (1 << 4); }


x86 assembly (clang, -O0):
<clear_RnB>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70200028,%eax
mov    (%rax),%al
movzbl %al,%eax
or     $0x10,%eax
mov    %al,%cl
mov    $0x70200028,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_RnB>:
orb    $0x10,0x70200028
10
ret

LLVM IR (-O0):
define void @clear_RnB() {
%1 = load volatile i8, i8* inttoptr (i64 1881145384 to i8*)
%2 = zext i8 %1 to i32
%3 = or i32 %2, 16
%4 = trunc i32 %3 to i8
store volatile i8 %4, i8* inttoptr (i64 1881145384 to i8*)
ret void
}

LLVM IR (-O2):
define void @clear_RnB() {
%1 = load volatile i8, i8* inttoptr (i64 1881145384 to i8*)
%2 = or i8 %1, 16
store volatile i8 %2, i8* inttoptr (i64 1881145384 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CgiHeader();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ ph7_lib_shutdown();
int /*<<< orphan*/ puts(char const *);
void Fatal(int status, const char *zMsg) {
  if (status)
    puts("Status: 404 Not Found");
  else
    puts("Status: 500 Internal Service Error");
  CgiHeader();
  puts(zMsg);
  ph7_lib_shutdown();
  exit(0);
}


x86 assembly (clang, -O0):
<Fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116a <Fatal+0x2a>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
jmp    1176 <Fatal+0x36>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <CgiHeader@plt>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <ph7_lib_shutdown@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<Fatal>:
push   %rbx
mov    %rsi,%rbx
test   %edi,%edi
lea    0xec9(%rip),%rax
lea    0xeac(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <CgiHeader@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <ph7_lib_shutdown@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Status: 404 Not Found\00"
@.str.1 = [35 x i8] c"Status: 500 Internal Service Error\00"
define void @Fatal(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = call i32 (...) @CgiHeader()
%13 = load i8*, i8** %4
%14 = call i32 @puts(i8* %13)
%15 = call i32 (...) @ph7_lib_shutdown()
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"Status: 404 Not Found\00"
@.str.1 = [35 x i8] c"Status: 500 Internal Service Error\00"
define void @Fatal(i32 %0, i8* nocapture %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
%6 = tail call i32 (...) @CgiHeader()
%7 = tail call i32 @puts(i8* dereferenceable(1) %1)
%8 = tail call i32 (...) @ph7_lib_shutdown()
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
main() {
  char nome[9];
  int tot;
  printf("Digite um nome: ");
  gets(nome);
  tot = strlen(nome);
  printf("strlen: %i\n", tot);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x9(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x9(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x7(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Digite um nome: \00"
@.str.1 = [12 x i8] c"strlen: %i\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Digite um nome: \00"
@.str.1 = [12 x i8] c"strlen: %i\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int add(int, int);
int main() { return add(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 1, i32 2)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ print_all_permutation(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  char str1[] = "cat";
  char str2[] = "1233";
  print_all_permutation(str1, strlen(str1));
  print_all_permutation(str2, strlen(str2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x19(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x15(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
call   1040 <print_all_permutation@plt>
lea    -0x19(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x19(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <print_all_permutation@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x746163,0xc(%rsp)
movb   $0x0,0x8(%rsp)
movl   $0x33333231,0x4(%rsp)
33
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <print_all_permutation@plt>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <print_all_permutation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str1 = [4 x i8] c"cat\00"
@__const.main.str2 = [5 x i8] c"1233\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8]
%7 = alloca [5 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [4 x i8]* %6 to i8*
%9 = bitcast [5 x i8]* %7 to i8*
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @print_all_permutation(i8* %10, i32 %12)
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%15 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
%17 = call i32 @print_all_permutation(i8* %14, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str2 = [5 x i8] c"1233\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [5 x i8]
%5 = bitcast i32* %3 to i8*
store i32 7627107, i32* %3
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%7 = call i32 @strlen(i8* %5)
%8 = call i32 @print_all_permutation(i8* %5, i32 %7)
%9 = call i32 @strlen(i8* %6)
%10 = call i32 @print_all_permutation(i8* %6, i32 %9)
ret i32 0
}
void end_unircvfr(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_load_ps1(float *);
__m128 test_mm_load_ps1(float *y) { return _mm_load_ps1(y); }


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

x86 assembly (clang, -O2):
<test_mm_load_ps1>:
jmp    1030 <_mm_load_ps1@plt>

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

LLVM IR (-O2):
define i32 @test_mm_load_ps1(float* %0) {
%2 = tail call i32 @_mm_load_ps1(float* %0)
ret i32 %2
}