xunge/DecIR huggingface dataset:
/* Variables and functions */
long long roundf(float);
void round_l_s(float *source, long long *dest) { *dest = roundf(*source); }


x86 assembly (clang, -O0):
<round_l_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <roundf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_l_s>:
push   %rbx
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <roundf@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @round_l_s(float* %0, i64* %1) {
%3 = alloca float*
%4 = alloca i64*
store float* %0, float** %3
store i64* %1, i64** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = call i64 @roundf(float %6)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @round_l_s(float* nocapture %0, i64* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = tail call i64 @roundf(float %3)
store i64 %4, i64* %1
ret void
}
/* Variables and functions */
int createUinputDevice();
int device_open() {
  int fd = createUinputDevice();
  return fd;
}


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

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

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

LLVM IR (-O2):
define i32 @device_open() {
%1 = tail call i32 (...) @createUinputDevice()
ret i32 %1
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ write_word(int /*<<< orphan*/, int);
int rand_number() {
  int rnd = rand();
  write_word(0, rnd);
  return rnd;
}


x86 assembly (clang, -O0):
<rand_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <write_word@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_number>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    %eax,%esi
call   1030 <write_word@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_number() {
%1 = alloca i32
%2 = call i32 (...) @rand()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @write_word(i32 0, i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @rand_number() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 @write_word(i32 0, i32 %1)
ret i32 %1
}
int main() {
  1 + 2 * 15 / 2;
  return 1 - 1;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *strerror(long);
char *abstract_text___Int_strerror_ext___impl(long self) {
  return strerror(self);
}


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

x86 assembly (clang, -O2):
<abstract_text___Int_strerror_ext___impl>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @abstract_text___Int_strerror_ext___impl(i64 %0) {
%2 = tail call i8* @strerror(i64 %0)
ret i8* %2
}
int isneg(const char **s) {
  if (**s == '-') {
    (*s)++;
    return 1;
  } else if (**s == '+')
    (*s)++;
  return 0;
}


x86 assembly (clang, -O0):
<isneg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1135 <isneg+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1162 <isneg+0x62>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1156 <isneg+0x56>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    115b <isneg+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isneg>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
cmp    $0x2d,%dl
je     1115 <isneg+0x15>
xor    %eax,%eax
cmp    $0x2b,%dl
jne    1121 <isneg+0x21>
xor    %eax,%eax
jmp    111a <isneg+0x1a>
mov    $0x1,%eax
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @isneg(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
switch i8 %3, label %8 [
i8 45, label %5
i8 43, label %4
]
4: ; preds = %1
br label %5
5: ; preds = %1, %4
%6 = phi i32 [ 0, %4 ], [ 1, %1 ]
%7 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %7, i8** %0
br label %8
8: ; preds = %5, %1
%9 = phi i32 [ 0, %1 ], [ %6, %5 ]
ret i32 %9
}
/* Variables and functions */
double _kf_gammap(double, double);
double _kf_gammaq(double, double);
double kf_gammaq(double s, double z) {
  return z <= 1. || z < s ? 1. - _kf_gammap(s, z) : _kf_gammaq(s, z);
}


x86 assembly (clang, -O0):
<kf_gammaq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xec6(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jae    1159 <kf_gammaq+0x39>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1181 <kf_gammaq+0x61>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <_kf_gammap@plt>
movaps %xmm0,%xmm1
movsd  0xe8d(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1195 <kf_gammaq+0x75>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <_kf_gammaq@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kf_gammaq>:
push   %rax
movsd  0xed7(%rip),%xmm2
ucomisd %xmm1,%xmm2
jae    113b <kf_gammaq+0x1b>
ucomisd %xmm1,%xmm0
ja     113b <kf_gammaq+0x1b>
pop    %rax
jmp    1030 <_kf_gammaq@plt>
call   1040 <_kf_gammap@plt>
movsd  0xeb8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @kf_gammaq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp ole double %5, 1.000000e+00
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load double, double* %4
%9 = load double, double* %3
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7, %2
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call double @_kf_gammap(double %12, double %13)
%15 = fsub double 1.000000e+00, %14
br label %20
16: ; preds = %7
%17 = load double, double* %3
%18 = load double, double* %4
%19 = call double @_kf_gammaq(double %17, double %18)
br label %20
20: ; preds = %16, %11
%21 = phi double [ %15, %11 ], [ %19, %16 ]
ret double %21
}

LLVM IR (-O2):
define double @kf_gammaq(double %0, double %1) {
%3 = fcmp ole double %1, 1.000000e+00
%4 = fcmp olt double %1, %0
%5 = or i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call double @_kf_gammap(double %0, double %1)
%8 = fsub double 1.000000e+00, %7
br label %11
9: ; preds = %2
%10 = tail call double @_kf_gammaq(double %0, double %1)
br label %11
11: ; preds = %9, %6
%12 = phi double [ %8, %6 ], [ %10, %9 ]
ret double %12
}
int test_imm_6Eint16_reg(short val) {
  return ((val) & (-0x6E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Eint16_reg(i16 signext %0) {
%2 = and i16 %0, -110
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printIndent(const unsigned int indent) {
  int i;
  printf("\n");
  for (i = indent; i > 0; --i) {
    printf("*");
  }
}


x86 assembly (clang, -O0):
<printIndent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1151 <printIndent+0x41>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <printIndent+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIndent>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jle    1142 <printIndent+0x32>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <printIndent+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printIndent(i32 %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @putchar(i32 42)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
char *ultoa(unsigned int, char *, int);
char *utoa(unsigned int val, char *s, int radix) {
  return ultoa(val, s, radix);
}


x86 assembly (clang, -O0):
<utoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ultoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utoa>:
jmp    1030 <ultoa@plt>

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

LLVM IR (-O2):
define i8* @utoa(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @ultoa(i32 %0, i8* %1, i32 %2)
ret i8* %4
}
int HelpItem167(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem167() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem167() {
ret i32 0
}
int cleanup_pathfinder() { return 0; }


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

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

LLVM IR (-O0):
define i32 @cleanup_pathfinder() {
ret i32 0
}

LLVM IR (-O2):
define i32 @cleanup_pathfinder() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ pthread_exit(void *);
scalar_t__ strlen(void *);
void thread_t1_stop(void *ret) {
  printf("%s\n", (char *)ret);
  pthread_exit((void *)strlen(ret));
}


x86 assembly (clang, -O0):
<thread_t1_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
call   1050 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_t1_stop>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @thread_t1_stop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = inttoptr i64 %6 to i8*
%8 = call i32 @pthread_exit(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @thread_t1_stop(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @pthread_exit(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int has_n_args(char *argv[], const int num, const char *restrict message) {
  if (*(argv + num) != NULL) {
    return 1;
  } else {
    printf("%s", message);
    return 0;
  }
}


x86 assembly (clang, -O0):
<has_n_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1142 <has_n_args+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1159 <has_n_args+0x49>
mov    -0x20(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_n_args>:
push   %rax
movslq %esi,%rcx
mov    $0x1,%eax
cmpq   $0x0,(%rdi,%rcx,8)
je     1122 <has_n_args+0x12>
pop    %rcx
ret
lea    0xed7(%rip),%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @has_n_args(i8** nocapture %0, i32 %1, i8* noalias %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void printAllArguments(int argc, char *argvs[]) {
  for (int i = 0; i < argc; i++) {
    printf("%d: %s\n", i, argvs[i]);
  }
}


x86 assembly (clang, -O0):
<printAllArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <printAllArguments+0x4b>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <printAllArguments+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printAllArguments>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <printAllArguments+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printAllArguments+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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


x86 assembly (clang, -O0):
<call_access_index_1_on_malloced_array_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <access_index_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_access_index_1_on_malloced_array_Good>:
push   %rax
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <access_index_1@plt>

LLVM IR (-O0):
define void @call_access_index_1_on_malloced_array_Good() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 16)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @access_index_1(i32* %3)
ret void
}

LLVM IR (-O2):
define void @call_access_index_1_on_malloced_array_Good() {
%1 = tail call i32* @malloc(i32 16)
%2 = tail call i32 @access_index_1(i32* %1)
ret void
}
/* Variables and functions */
int bitonic(int *, int);
int test_inverse_bitonic() {
  int input[] = {5, 4, 3, 2, 1, 2, 3, 4, 5};
  return 5 == bitonic(input, 9);
}


x86 assembly (clang, -O0):
<test_inverse_bitonic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1040 <bitonic@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_inverse_bitonic>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <bitonic@plt>
xor    %ecx,%ecx
cmp    $0x5,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_inverse_bitonic.input = [9 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @test_inverse_bitonic() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @bitonic(i32* %3, i32 9)
%5 = icmp eq i32 5, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_inverse_bitonic.input = [9 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @test_inverse_bitonic() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @bitonic(i32* %3, i32 9)
%5 = icmp eq i32 %4, 5
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void free_int32_t(int32_t _val) { return; }


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

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

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

LLVM IR (-O2):
define void @free_int32_t(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ crc32(int /*<<< orphan*/, unsigned char const *,
                         unsigned int);
uint32_t crc32_wd(uint32_t crc, const unsigned char *buf, unsigned int len,
                  unsigned int chunk_sz) {
  crc = crc32(crc, buf, len);
  return crc;
}


x86 assembly (clang, -O0):
<crc32_wd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <crc32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32_wd>:
jmp    1030 <crc32@plt>

LLVM IR (-O0):
define i32 @crc32_wd(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @crc32(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @crc32_wd(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @crc32(i32 %0, i8* %1, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
scalar_t__ fclose(int /*<<< orphan*/ *);
int wait(int *);
int pclose(FILE *fd) {
  int waitstat;
  if (fclose(fd) != 0)
    return EOF;
  return wait(&waitstat);
}


x86 assembly (clang, -O0):
<pclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     1150 <pclose+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <pclose+0x3c>
lea    -0x14(%rbp),%rdi
call   1040 <wait@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pclose>:
push   %rax
call   1030 <fclose@plt>
test   %rax,%rax
je     1136 <pclose+0x16>
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @pclose(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i64 @fclose(i32* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* @EOF
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = call i32 @wait(i32* %4)
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @pclose(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i64 @fclose(i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = load i32, i32* @EOF
br label %10
8: ; preds = %1
%9 = call i32 @wait(i32* %2)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int clearCommand(char **args) {
  printf("\033[2J");
  printf("\033[1;1H");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[1;1H\00"
define i32 @clearCommand(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[1;1H\00"
define i32 @clearCommand(i8** nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int main() {
  unsigned long u = 1, k = 0;
  for (; k < 32; k++)
    u += u;
  if (!u)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x20,-0x18(%rbp)
jae    1143 <main+0x43>
mov    -0x10(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <main+0x1b>
cmpq   $0x0,-0x10(%rbp)
jne    115a <main+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1161 <main+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
int minof(int x, int y) { return (x < y ? x : y); }


x86 assembly (clang, -O0):
<minof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <minof+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <minof+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minof>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @minof(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 slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @minof(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void set_byte(addr, data) {
  addr &= 0x0000ffff;
  memory_write_byte(data, addr);
}


x86 assembly (clang, -O0):
<set_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x0,%al
call   1030 <memory_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_byte>:
mov    %esi,%eax
movzwl %di,%esi
mov    %eax,%edi
xor    %eax,%eax
jmp    1030 <memory_write_byte@plt>

LLVM IR (-O0):
define void @set_byte(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 = and i32 %5, 65535
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @memory_write_byte to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @set_byte(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @memory_write_byte to i32 (i32, i32, ...)*)(i32 %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_DrawWindowedImageFromFile(int, int, char *, int, int,
                                                 int, int);
void _gui_draw_background(int x, int y, int w, int h) {
  LCD_DrawWindowedImageFromFile(x, y, "media/devo12.bmp", w, h, x, y);
}


x86 assembly (clang, -O0):
<_gui_draw_background>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x4(%rbp),%r9d
mov    -0x8(%rbp),%eax
lea    0xec1(%rip),%rdx
mov    %eax,(%rsp)
call   1030 <LCD_DrawWindowedImageFromFile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gui_draw_background>:
push   %rax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,(%rsp)
lea    0xee0(%rip),%rdx
mov    %edi,%r9d
call   1030 <LCD_DrawWindowedImageFromFile@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"media/devo12.bmp\00"
define void @_gui_draw_background(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @LCD_DrawWindowedImageFromFile(i32 %9, i32 %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"media/devo12.bmp\00"
define void @_gui_draw_background(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @LCD_DrawWindowedImageFromFile(i32 %0, i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %0, i32 %1)
ret void
}
int fastatan(int q) {
  int q2 = q * q;
  int q3 = q2 * q;
  return (82 * q >> 8) - (62 * q2 >> 19) - (10 * q3 >> 24);
}


x86 assembly (clang, -O0):
<fastatan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x52,-0x4(%rbp),%eax
sar    $0x8,%eax
imul   $0x3e,-0x8(%rbp),%ecx
sar    $0x13,%ecx
sub    %ecx,%eax
imul   $0xa,-0xc(%rbp),%ecx
sar    $0x18,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastatan>:
mov    %edi,%ecx
imul   %ecx,%ecx
imul   $0x52,%edi,%eax
sar    $0x8,%eax
mov    %ecx,%edx
shl    $0x6,%edx
sub    %ecx,%edx
sub    %ecx,%edx
shr    $0x13,%edx
imul   %edi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sar    $0x18,%ecx
add    %edx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fastatan(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = mul nsw i32 82, %11
%13 = ashr i32 %12, 8
%14 = load i32, i32* %3
%15 = mul nsw i32 62, %14
%16 = ashr i32 %15, 19
%17 = sub nsw i32 %13, %16
%18 = load i32, i32* %4
%19 = mul nsw i32 10, %18
%20 = ashr i32 %19, 24
%21 = sub nsw i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @fastatan(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %0, 82
%4 = ashr i32 %3, 8
%5 = mul nsw i32 %2, 62
%6 = lshr i32 %5, 19
%7 = mul i32 %0, 10
%8 = mul i32 %7, %2
%9 = ashr i32 %8, 24
%10 = add nsw i32 %9, %6
%11 = sub nsw i32 %4, %10
ret i32 %11
}
/* Variables and functions */
void _sincosf(float, float *, float *);
void sincosf(float angle, float *sinx, float *cosx) {
  return _sincosf(angle, sinx, cosx);
}


x86 assembly (clang, -O0):
<sincosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_sincosf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincosf>:
jmp    1030 <_sincosf@plt>

LLVM IR (-O0):
define void @sincosf(float %0, float* %1, float* %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca float*
store float %0, float* %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float*, float** %5
%9 = load float*, float** %6
ret void
}

LLVM IR (-O2):
define void @sincosf(float %0, float* %1, float* %2) {
tail call void @_sincosf(float %0, float* %1, float* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_pid_get_unit(pid_t pid,
                                                           char **unit) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_pid_get_unit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_pid_get_unit>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_pid_get_unit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_pid_get_unit(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void av_aes_crypt() {}


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

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

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

LLVM IR (-O2):
define void @av_aes_crypt() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotleft(uint32_t val, uint32_t shift) {
  return val << shift | val >> (32 - shift);
}


x86 assembly (clang, -O0):
<rotleft>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotleft>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotleft(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotleft(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int reverse(int x) {
  int y = 0;
  while (x) {
    y = y * 10 + x % 10;
    x /= 10;
  }
  return y;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <reverse+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
je     113f <reverse+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
int synaptics_pt_open(struct serio *port) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.serio = type opaque
define i32 @synaptics_pt_open(%struct.serio* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ main_work(char, char, char, char);
int /*<<< orphan*/ print_num_e(char, char, char, char);
void ft_print_comb2(void) {
  char a;
  char i;
  char b;
  char c;
  main_work(a, i, b, c);
  print_num_e('9', '8', '9', '9');
}


x86 assembly (clang, -O0):
<ft_print_comb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x1(%rbp),%dl
mov    -0x2(%rbp),%cl
mov    -0x3(%rbp),%al
movsbl %dl,%edi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x4(%rbp),%ecx
call   1030 <main_work@plt>
mov    $0x39,%ecx
mov    $0x38,%esi
mov    %ecx,%edi
mov    %ecx,%edx
call   1040 <print_num_e@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_comb2>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <main_work@plt>
mov    $0x39,%edi
mov    $0x38,%esi
mov    $0x39,%edx
mov    $0x39,%ecx
pop    %rax
jmp    1040 <print_num_e@plt>

LLVM IR (-O0):
define void @ft_print_comb2() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = load i8, i8* %1
%6 = load i8, i8* %2
%7 = load i8, i8* %3
%8 = load i8, i8* %4
%9 = call i32 @main_work(i8 signext %5, i8 signext %6, i8 signext %7, i8 signext %8)
%10 = call i32 @print_num_e(i8 signext 57, i8 signext 56, i8 signext 57, i8 signext 57)
ret void
}

LLVM IR (-O2):
define void @ft_print_comb2() {
%1 = tail call i32 @main_work(i8 signext undef, i8 signext undef, i8 signext undef, i8 signext undef)
%2 = tail call i32 @print_num_e(i8 signext 57, i8 signext 56, i8 signext 57, i8 signext 57)
ret void
}
double absol(double x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<absol>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <absol+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <absol+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @absol(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
unsigned u8_strlen(char *s) {
  size_t i = 0, j = 0;
  while (s[i]) {
    if ((s[i] & 0xc0) != 0x80)
      j++;
    i++;
  }
  return j;
}


x86 assembly (clang, -O0):
<u8_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1163 <u8_strlen+0x63>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1152 <u8_strlen+0x52>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <u8_strlen+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8_strlen>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <u8_strlen+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
and    $0xc0,%cl
xor    %edx,%edx
cmp    $0x80,%cl
setne  %dl
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <u8_strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @u8_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
store i64 0, i64* %4
br label %5
5: ; preds = %22, %1
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = and i32 %16, 192
%18 = icmp ne i32 %17, 128
br i1 %18, label %19, label %22
19: ; preds = %11
%20 = load i64, i64* %4
%21 = add i64 %20, 1
store i64 %21, i64* %4
br label %22
22: ; preds = %19, %11
%23 = load i64, i64* %3
%24 = add i64 %23, 1
store i64 %24, i64* %3
br label %5
25: ; preds = %5
%26 = load i64, i64* %4
%27 = trunc i64 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @u8_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i64 [ %12, %4 ], [ 0, %1 ]
%8 = and i8 %5, -64
%9 = icmp ne i8 %8, -128
%10 = zext i1 %9 to i64
%11 = add i64 %6, %10
%12 = add i64 %7, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = trunc i64 %11 to i32
br label %18
18: ; preds = %16, %1
%19 = phi i32 [ 0, %1 ], [ %17, %16 ]
ret i32 %19
}
/* Variables and functions */
void *malloc(unsigned int);
void *yajl_internal_malloc(void *ctx, unsigned int sz) { return malloc(sz); }


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

x86 assembly (clang, -O2):
<yajl_internal_malloc>:
mov    %esi,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @yajl_internal_malloc(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 = call i8* @malloc(i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @yajl_internal_malloc(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
ret i8* %3
}
/* Variables and functions */
scalar_t__ isreach_bishop(int, int);
scalar_t__ isreach_king(int, int);
int isreach_horse(int dx, int dy) {
  return isreach_bishop(dx, dy) || isreach_king(dx, dy);
}


x86 assembly (clang, -O0):
<isreach_horse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <isreach_bishop@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1160 <isreach_horse+0x40>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <isreach_king@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreach_horse>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <isreach_bishop@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    114d <isreach_horse+0x2d>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <isreach_king@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isreach_horse(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @isreach_bishop(i32 %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i64 @isreach_king(i32 %10, i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ true, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isreach_horse(i32 %0, i32 %1) {
%3 = tail call i64 @isreach_bishop(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @isreach_king(i32 %0, i32 %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}