xunge/DecIR huggingface dataset:
int tdefault_is_async_p(struct target_ops *self) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.target_ops = type opaque
define i32 @tdefault_is_async_p(%struct.target_ops* nocapture readnone %0) {
ret i32 0
}
int checkBit(int bitVector, int pos) {
  int bit = 0;
  bit = bitVector & (1 << pos);
  return bit;
}


x86 assembly (clang, -O0):
<checkBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkBit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @checkBit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @checkBit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
ret i32 %4
}
void foo312(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo312(i32 %0) {
ret void
}
int get_temp(void) {
  int temp = 0;
  return temp;
}


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

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

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

LLVM IR (-O2):
define i32 @get_temp() {
ret i32 0
}
/* Variables and functions */
double exp(double);
double sqrt(double);
double qTU(double TU) {
  if (TU > 100)
    return 5.0;
  double e = -0.01139 * TU + -0.04917 * sqrt(TU);
  return 97.34 * exp(e);
}


x86 assembly (clang, -O0):
<qTU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1156 <qTU+0x36>
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b1 <qTU+0x91>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe8a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe60(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qTU>:
push   %rax
ucomisd 0xedf(%rip),%xmm0
jbe    1135 <qTU+0x15>
movsd  0xecd(%rip),%xmm0
pop    %rax
ret
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     114c <qTU+0x2c>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    115f <qTU+0x3f>
movapd %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm1
mulsd  0xea9(%rip),%xmm0
mulsd  0xea9(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xe9c(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qTU(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp ogt double %5, 1.000000e+02
br i1 %6, label %7, label %8
7: ; preds = %1
store double 5.000000e+00, double* %2
br label %17
8: ; preds = %1
%9 = load double, double* %3
%10 = load double, double* %3
%11 = call double @sqrt(double %10)
%12 = fmul double -4.917000e-02, %11
%13 = call double @llvm.fmuladd.f64(double -1.139000e-02, double %9, double %12)
store double %13, double* %4
%14 = load double, double* %4
%15 = call double @exp(double %14)
%16 = fmul double 9.734000e+01, %15
store double %16, double* %2
br label %17
17: ; preds = %8, %7
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @qTU(double %0) {
%2 = fcmp ogt double %0, 1.000000e+02
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call double @sqrt(double %0)
%5 = fmul double %4, -4.917000e-02
%6 = tail call double @llvm.fmuladd.f64(double %0, double -1.139000e-02, double %5)
%7 = tail call double @exp(double %6)
%8 = fmul double %7, 9.734000e+01
br label %9
9: ; preds = %1, %3
%10 = phi double [ %8, %3 ], [ 5.000000e+00, %1 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void printspaces(int spaces) {
  while (spaces--)
    putchar(' ');
}


x86 assembly (clang, -O0):
<printspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <printspaces+0x2e>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    111b <printspaces+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printspaces>:
push   %rbx
test   %edi,%edi
je     112f <printspaces+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printspaces+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printspaces(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 32)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
unsigned int nfall0(unsigned int k, unsigned int n) {
  if (n == 1)
    return k;
  if (k == 1)
    return 1;
  return nfall0(k - 1, n) + nfall0(k, n - 1);
}


x86 assembly (clang, -O0):
<nfall0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1133 <nfall0+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <nfall0+0x62>
cmpl   $0x1,-0x8(%rbp)
jne    1149 <nfall0+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1172 <nfall0+0x62>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1030 <nfall0@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <nfall0@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfall0>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
xor    %ebx,%ebx
cmp    $0x1,%esi
je     114e <nfall0+0x3e>
mov    %esi,%ebp
lea    -0x1(%r14),%r15d
xor    %ebx,%ebx
nopl   0x0(%rax)
cmp    $0x1,%r14d
je     114c <nfall0+0x3c>
mov    %r15d,%edi
mov    %ebp,%esi
call   1030 <nfall0@plt>
add    $0xffffffff,%ebp
add    %eax,%ebx
cmp    $0x1,%ebp
jne    1130 <nfall0+0x20>
jmp    114e <nfall0+0x3e>
xor    %ebx,%ebx
add    %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @nfall0(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, 1
%6 = add i32 %0, -1
br label %7
7: ; preds = %4, %10
%8 = phi i32 [ %1, %4 ], [ %12, %10 ]
%9 = phi i32 [ 0, %4 ], [ %13, %10 ]
br i1 %5, label %15, label %10
10: ; preds = %7
%11 = tail call i32 @nfall0(i32 %6, i32 %8)
%12 = add i32 %8, -1
%13 = add i32 %11, %9
%14 = icmp eq i32 %12, 1
br i1 %14, label %15, label %7
15: ; preds = %10, %7, %2
%16 = phi i32 [ 0, %2 ], [ 0, %7 ], [ %13, %10 ]
%17 = add i32 %16, %0
ret i32 %17
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  char *pChar;
  printf("%d", add(2, 3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @add(i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ free(void *);
void pfree(void *p) {
  if (p == NULL)
    error("freeing null");
  free(p);
}


x86 assembly (clang, -O0):
<pfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1143 <pfree+0x23>
lea    0xec2(%rip),%rdi
call   1040 <error@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfree>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1135 <pfree+0x15>
lea    0xed0(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"freeing null\00"
define void @pfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"freeing null\00"
define void @pfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @free(i8* %0)
ret void
}
void save_xattrs() {}


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

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

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

LLVM IR (-O2):
define void @save_xattrs() {
ret void
}
void ff_hevc_put_hevc_uni_epel_v64_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v64_8_avx2() {
ret void
}
int UCase(char in[]) {
  int i;
  for (i = 0; in[i]; i++)
    if (in[i] >= 'a' && in[i] <= 'z')
      in[i] -= 32;
  return 1;
}


x86 assembly (clang, -O0):
<UCase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1170 <UCase+0x70>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
jl     115d <UCase+0x5d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7a,%eax
jg     115d <UCase+0x5d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
sub    $0x20,%edx
mov    %dl,(%rax,%rcx,1)
jmp    1162 <UCase+0x62>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <UCase+0xf>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UCase>:
mov    (%rdi),%al
test   %al,%al
je     112a <UCase+0x2a>
add    $0x1,%rdi
jmp    111b <UCase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <UCase+0x2a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <UCase+0x10>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1110 <UCase+0x10>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @UCase(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %37, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %40
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 97
br i1 %18, label %19, label %36
19: ; preds = %11
%20 = load i8*, i8** %2
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 122
br i1 %26, label %27, label %36
27: ; preds = %19
%28 = load i8*, i8** %2
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = sub nsw i32 %33, 32
%35 = trunc i32 %34 to i8
store i8 %35, i8* %31
br label %36
36: ; preds = %27, %19, %11
br label %37
37: ; preds = %36
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %4
40: ; preds = %4
ret i32 1
}

LLVM IR (-O2):
define i32 @UCase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %12
%5 = phi i64 [ %13, %12 ], [ 0, %1 ]
%6 = phi i8 [ %15, %12 ], [ %2, %1 ]
%7 = phi i8* [ %14, %12 ], [ %0, %1 ]
%8 = add i8 %6, -97
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = add nsw i8 %6, -32
store i8 %11, i8* %7
br label %12
12: ; preds = %4, %10
%13 = add nuw i64 %5, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %12, %1
ret i32 1
}
/* Variables and functions */
int fork();
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int valeur;
  valeur = fork();
  printf(" Valeur retournee par la fonction fork: %d\n", (int)valeur);
  printf("Je suis le processus numero %d\n", (int)getpid());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed8(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c" Valeur retournee par la fonction fork: %d\0A\00"
@.str.1 = [32 x i8] c"Je suis le processus numero %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i64 (...) @getpid()
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c" Valeur retournee par la fonction fork: %d\0A\00"
@.str.1 = [32 x i8] c"Je suis le processus numero %d\0A\00"
define void @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i64 (...) @getpid()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int w5100_write(int, int /*<<< orphan*/ *, int);
unsigned w5100_writeSHAR(uint8_t *buff) { return w5100_write(0x0009, buff, 6); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x9,%edi
mov    $0x6,%edx
call   1030 <w5100_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %rdi,%rsi
mov    $0x9,%edi
mov    $0x6,%edx
jmp    1030 <w5100_write@plt>

LLVM IR (-O0):
define i32 @w5100_writeSHAR(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @w5100_write(i32 9, i32* %3, i32 6)
ret i32 %4
}

LLVM IR (-O2):
define i32 @w5100_writeSHAR(i32* %0) {
%2 = tail call i32 @w5100_write(i32 9, i32* %0, i32 6)
ret i32 %2
}
int TrustMe(int returnaddr1, const char *path, char *const argv[],
            char *const envp[]) {
  asm("mov   $11, %eax");
  asm("mov   28(%esp), %ebx");
  asm("mov   32(%esp), %ecx");
  asm("mov   36(%esp), %edx");
  asm("mov   %esp, %ebp");
  asm("jmp   *12(%ebp)");
  return 0;
}


x86 assembly (clang, -O0):
<TrustMe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xb,%eax
mov    0x1c(%esp),%ebx
mov    0x20(%esp),%ecx
mov    0x24(%esp),%edx
mov    %esp,%ebp
jmp    *0xc(%ebp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrustMe>:
mov    $0xb,%eax
mov    0x1c(%esp),%ebx
mov    0x20(%esp),%ecx
mov    0x24(%esp),%edx
mov    %esp,%ebp
jmp    *0xc(%ebp)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @TrustMe(i32 %0, i8* %1, i8** %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8**
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @TrustMe(i32 %0, i8* nocapture readnone %1, i8** nocapture readnone %2, i8** nocapture readnone %3) {
tail call void asm sideeffect "mov $$11, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov 28(%esp), %ebx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov 32(%esp), %ecx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov 36(%esp), %edx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov %esp, %ebp", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "jmp *12(%ebp)", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("getopt [-d?] [-c count]\n");
  errno = 0;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb9(%rip),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
movq   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"getopt [-d?] [-c count]\0A\00"
@errno = global i64 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* @errno
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@str = [24 x i8] c"getopt [-d?] [-c count]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
store i64 0, i64* @errno
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR49_set(void) { return U_WMRCORENONE_set("U_WMR49"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR49\00"
define i8* @U_WMR49_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR49\00"
define i8* @U_WMR49_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
_mark(long unsigned int obj, int i, char *a) {
  (char *)&(((long *)(obj))[i]) - a;
}


x86 assembly (clang, -O0):
<_mark>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_mark(i64 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
char const *weak_n3();
const char *__attribute__((section(".test.c"))) sibcall_weak_n3(void) {
  return weak_n3();
}


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

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

LLVM IR (-O0):
define i8* @sibcall_weak_n3() section ".test.c" {
%1 = call i8* (...) @weak_n3()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sibcall_weak_n3() section ".test.c" {
%1 = tail call i8* (...) @weak_n3()
ret i8* %1
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return ((double)t.tv_sec + ((double)(t.tv_usec) / 1000000));
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateTamperIODisable(uint32_t ui32Input) {
  ;
  (*((volatile unsigned long *)(0x400FC360))) = 0xA3359554;
  _HibernateWriteComplete();
  (*((volatile unsigned long *)(0x400FC410))) &=
      ((~0x00000001) << (ui32Input << 3));
  _HibernateWriteComplete();
  (*((volatile unsigned long *)(0x400FC360))) = 0;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateTamperIODisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x400fc360,%eax
mov    $0xa3359554,%ecx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
mov    $0xfffffffe,%eax
shl    %cl,%eax
cltq
mov    $0x400fc410,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400fc410,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc360,%eax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperIODisable>:
push   %rbx
mov    %edi,%ebx
mov    $0xa3359554,%eax
mov    %rax,0x400fc360
40
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
shl    $0x3,%ebx
mov    $0xfffffffe,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
and    %rax,0x400fc410
40
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
movq   $0x0,0x400fc360
xor    %eax,%eax
pop    %rbx
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateTamperIODisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i64 2738197844, i64* inttoptr (i64 1074774880 to i64*)
%3 = call i32 (...) @_HibernateWriteComplete()
%4 = load i32, i32* %2
%5 = shl i32 %4, 3
%6 = shl i32 -2, %5
%7 = sext i32 %6 to i64
%8 = load volatile i64, i64* inttoptr (i64 1074775056 to i64*)
%9 = and i64 %8, %7
store volatile i64 %9, i64* inttoptr (i64 1074775056 to i64*)
%10 = call i32 (...) @_HibernateWriteComplete()
store volatile i64 0, i64* inttoptr (i64 1074774880 to i64*)
%11 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateTamperIODisable(i32 %0) {
store volatile i64 2738197844, i64* inttoptr (i64 1074774880 to i64*)
%2 = tail call i32 (...) @_HibernateWriteComplete()
%3 = shl i32 %0, 3
%4 = shl i32 -2, %3
%5 = sext i32 %4 to i64
%6 = load volatile i64, i64* inttoptr (i64 1074775056 to i64*)
%7 = and i64 %6, %5
store volatile i64 %7, i64* inttoptr (i64 1074775056 to i64*)
%8 = tail call i32 (...) @_HibernateWriteComplete()
store volatile i64 0, i64* inttoptr (i64 1074774880 to i64*)
%9 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ psw_write_bit(int, int /*<<< orphan*/);
void psw_clr_ov(void) { psw_write_bit(2, 0); }


x86 assembly (clang, -O0):
<psw_clr_ov>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <psw_write_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<psw_clr_ov>:
mov    $0x2,%edi
xor    %esi,%esi
jmp    1030 <psw_write_bit@plt>

LLVM IR (-O0):
define void @psw_clr_ov() {
%1 = call i32 @psw_write_bit(i32 2, i32 0)
ret void
}

LLVM IR (-O2):
define void @psw_clr_ov() {
%1 = tail call i32 @psw_write_bit(i32 2, i32 0)
ret void
}
int rho_ruby_is_array(unsigned long val) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rho_ruby_is_array(i64 %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ind_str_hash(const void *vstr) {
  const char *str = *(const char **)vstr;
  uint32_t hash = 5381;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<ind_str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     114c <ind_str_hash+0x4c>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    111a <ind_str_hash+0x1a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind_str_hash>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
test   %dl,%dl
je     1138 <ind_str_hash+0x38>
add    $0x1,%rcx
mov    $0x1505,%esi
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %dl,%edx
shl    $0x5,%eax
add    %esi,%eax
add    %edx,%eax
movzbl (%rcx),%edx
add    $0x1,%rcx
mov    %eax,%esi
test   %dl,%dl
jne    1120 <ind_str_hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @ind_str_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1, %6
%7 = phi i8 [ %14, %6 ], [ %4, %1 ]
%8 = phi i8* [ %11, %6 ], [ %3, %1 ]
%9 = phi i32 [ %13, %6 ], [ 5381, %1 ]
%10 = sext i8 %7 to i32
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = mul i32 %9, 33
%13 = add nsw i32 %12, %10
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %1
%17 = phi i32 [ 5381, %1 ], [ %13, %6 ]
ret i32 %17
}
/* Variables and functions */
int strlen(char const *);
int stringStat(const char *string, int multiplier, int *count) {
  int len = strlen(string);
  *count = (*count) + 1;
  return len * multiplier;
}


x86 assembly (clang, -O0):
<stringStat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
imul   -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringStat>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1030 <strlen@plt>
addl   $0x1,(%rbx)
imul   %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @stringStat(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
%13 = load i32*, i32** %6
store i32 %12, i32* %13
%14 = load i32, i32* %7
%15 = load i32, i32* %5
%16 = mul nsw i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @stringStat(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = mul nsw i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int const, char *, int);
int /*<<< orphan*/ printf(char *, int const, int, char *);
main() {
  const int n = 1024;
  char s[1000];
  int width = 10;
  itoa(n, s, width);
  printf("n=%d, width=%d, s=%s\n", n, width, s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x400,-0x8(%rbp)
movl   $0xa,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rsi
mov    -0x3f4(%rbp),%edx
mov    $0x400,%edi
call   1040 <itoa@plt>
mov    -0x3f4(%rbp),%edx
lea    -0x3f0(%rbp),%rcx
lea    0xe92(%rip),%rdi
mov    $0x400,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    $0x400,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <itoa@plt>
lea    0xebc(%rip),%rdi
mov    $0x400,%esi
mov    $0xa,%edx
mov    %rbx,%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"n=%d, width=%d, s=%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 1024, i8* %2, i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1024, i32 10, i8* %2)
ret i32 0
}
/* Type definitions */
struct iterator {
  int dummy;
};
struct genhash_iter {
  int dummy;
};
struct genhash {
  int dummy;
};
struct entry_hash_iter {
  int dummy;
};
struct entry_hash {
  int dummy;
};

/* Variables and functions */
struct iterator *genhash_key_iter_init(struct genhash_iter *,
                                       struct genhash const *);
struct iterator *entry_hash_key_iter_init(struct entry_hash_iter *iter,
                                          const struct entry_hash *tthis) {
  return genhash_key_iter_init((struct genhash_iter *)iter,
                               (const struct genhash *)tthis);
}


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

x86 assembly (clang, -O2):
<entry_hash_key_iter_init>:
jmp    1030 <genhash_key_iter_init@plt>

LLVM IR (-O0):
%struct.iterator = type { i32 }
%struct.entry_hash_iter = type { i32 }
%struct.entry_hash = type { i32 }
%struct.genhash_iter = type { i32 }
%struct.genhash = type { i32 }
define %struct.iterator* @entry_hash_key_iter_init(%struct.entry_hash_iter* %0, %struct.entry_hash* %1) {
%3 = alloca %struct.entry_hash_iter*
%4 = alloca %struct.entry_hash*
store %struct.entry_hash_iter* %0, %struct.entry_hash_iter** %3
store %struct.entry_hash* %1, %struct.entry_hash** %4
%5 = load %struct.entry_hash_iter*, %struct.entry_hash_iter** %3
%6 = bitcast %struct.entry_hash_iter* %5 to %struct.genhash_iter*
%7 = load %struct.entry_hash*, %struct.entry_hash** %4
%8 = bitcast %struct.entry_hash* %7 to %struct.genhash*
%9 = call %struct.iterator* @genhash_key_iter_init(%struct.genhash_iter* %6, %struct.genhash* %8)
ret %struct.iterator* %9
}

LLVM IR (-O2):
%struct.iterator = type { i32 }
%struct.entry_hash_iter = type { i32 }
%struct.entry_hash = type { i32 }
%struct.genhash_iter = type { i32 }
%struct.genhash = type { i32 }
define %struct.iterator* @entry_hash_key_iter_init(%struct.entry_hash_iter* %0, %struct.entry_hash* %1) {
%3 = bitcast %struct.entry_hash_iter* %0 to %struct.genhash_iter*
%4 = bitcast %struct.entry_hash* %1 to %struct.genhash*
%5 = tail call %struct.iterator* @genhash_key_iter_init(%struct.genhash_iter* %3, %struct.genhash* %4)
ret %struct.iterator* %5
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
bool cmp8(const void *a, const void *b) {
  return *(uint64_t *)a == *(uint64_t *)b;
}


x86 assembly (clang, -O0):
<cmp8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp8>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @cmp8(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
signed long cturn(signed long angle0, signed long angle1) {
  signed long de = (angle1 - angle0);
  if (de > 2048)
    de = -4096 + de;
  else if (de < -2048)
    de = 4096 + de;
  return de;
}


x86 assembly (clang, -O0):
<cturn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x800,-0x18(%rbp)
jle    1139 <cturn+0x39>
mov    -0x18(%rbp),%rax
add    $0xfffffffffffff000,%rax
mov    %rax,-0x18(%rbp)
jmp    115a <cturn+0x5a>
cmpq   $0xfffffffffffff800,-0x18(%rbp)
ff
jge    1155 <cturn+0x55>
mov    -0x18(%rbp),%rax
add    $0x1000,%rax
mov    %rax,-0x18(%rbp)
jmp    115a <cturn+0x5a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cturn>:
sub    %rdi,%rsi
lea    0x1000(%rsi),%rax
cmp    $0xfffffffffffff800,%rsi
cmovge %rsi,%rax
lea    -0x1000(%rsi),%rcx
cmp    $0x801,%rsi
cmovge %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @cturn(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = icmp sgt i64 %3, 2048
%5 = add nsw i64 %3, -4096
%6 = icmp slt i64 %3, -2048
%7 = add nsw i64 %3, 4096
%8 = select i1 %6, i64 %7, i64 %3
%9 = select i1 %4, i64 %5, i64 %8
ret i64 %9
}
/* Type definitions */
struct linux_binprm {
  int dummy;
};

/* Variables and functions */
int cap_bprm_set_security(struct linux_binprm *);
int security_bprm_set(struct linux_binprm *bprm) {
  return cap_bprm_set_security(bprm);
}


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

x86 assembly (clang, -O2):
<security_bprm_set>:
jmp    1030 <cap_bprm_set_security@plt>

LLVM IR (-O0):
%struct.linux_binprm = type { i32 }
define i32 @security_bprm_set(%struct.linux_binprm* %0) {
%2 = alloca %struct.linux_binprm*
store %struct.linux_binprm* %0, %struct.linux_binprm** %2
%3 = load %struct.linux_binprm*, %struct.linux_binprm** %2
%4 = call i32 @cap_bprm_set_security(%struct.linux_binprm* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.linux_binprm = type { i32 }
define i32 @security_bprm_set(%struct.linux_binprm* %0) {
%2 = tail call i32 @cap_bprm_set_security(%struct.linux_binprm* %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned char byte1;
};
typedef TYPE_1__ XChar2b;

/* Variables and functions */
void set_XChar2b_byte1(void *_p, unsigned char _v) {
  ((XChar2b *)_p)->byte1 = (unsigned char)_v;
}


x86 assembly (clang, -O0):
<set_XChar2b_byte1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XChar2b_byte1>:
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XChar2b_byte1(i8* nocapture writeonly %0, i8 zeroext %1) {
store i8 %1, i8* %0
ret void
}
/* Type definitions */
struct StridedFunctionObject {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct StridedFunctionObject *);
void stdlib_strided_function_free(struct StridedFunctionObject *obj) {
  if (obj == NULL) {
    return;
  }
  free(obj);
}


x86 assembly (clang, -O0):
<stdlib_strided_function_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <stdlib_strided_function_free+0x1c>
jmp    1135 <stdlib_strided_function_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.StridedFunctionObject = type { i32 }
define void @stdlib_strided_function_free(%struct.StridedFunctionObject* %0) {
%2 = icmp eq %struct.StridedFunctionObject* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.StridedFunctionObject* %0)
br label %5
5: ; preds = %1, %3
ret void
}
float maxf(float x, float y) {
  if (y > x)
    return y;
  else
    return x;
}


x86 assembly (clang, -O0):
<maxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <maxf+0x2c>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <maxf+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxf>:
maxss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @maxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %5
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %4
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @maxf(float %0, float %1) {
%3 = fcmp ogt float %1, %0
%4 = select i1 %3, float %1, float %0
ret float %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t htolel(uint32_t value) {
  uint32_t tmp;
  ((uint8_t *)&tmp)[0] = (uint8_t)(value >> 0);
  ((uint8_t *)&tmp)[1] = (uint8_t)(value >> 8);
  ((uint8_t *)&tmp)[2] = (uint8_t)(value >> 16);
  ((uint8_t *)&tmp)[3] = (uint8_t)(value >> 24);
  return tmp;
}


x86 assembly (clang, -O0):
<htolel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
cltq
mov    %rax,0x0(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
cltq
mov    %rax,0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
cltq
mov    %rax,0x10(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @htolel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 0
%6 = sext i32 %5 to i64
%7 = bitcast i32* %3 to i64*
%8 = getelementptr inbounds i64, i64* %7, i64 0
store i64 %6, i64* %8
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = sext i32 %10 to i64
%12 = bitcast i32* %3 to i64*
%13 = getelementptr inbounds i64, i64* %12, i64 1
store i64 %11, i64* %13
%14 = load i32, i32* %2
%15 = ashr i32 %14, 16
%16 = sext i32 %15 to i64
%17 = bitcast i32* %3 to i64*
%18 = getelementptr inbounds i64, i64* %17, i64 2
store i64 %16, i64* %18
%19 = load i32, i32* %2
%20 = ashr i32 %19, 24
%21 = sext i32 %20 to i64
%22 = bitcast i32* %3 to i64*
%23 = getelementptr inbounds i64, i64* %22, i64 3
store i64 %21, i64* %23
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @htolel(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ checkCorrect();
int /*<<< orphan*/ myseed();
int /*<<< orphan*/ timeIt();
int main() {
  myseed();
  checkCorrect();
  timeIt();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @myseed()
%2 = tail call i32 (...) @checkCorrect()
%3 = tail call i32 (...) @timeIt()
ret i32 0
}