xunge/DecIR huggingface dataset:
int foo(long x) { return ((short)x != 0) ? x : 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cwtl
cmp    $0x0,%eax
je     1123 <foo+0x23>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1131 <foo+0x31>
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
jmp    1131 <foo+0x31>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %di,%di
mov    $0x1,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
%5 = sext i16 %4 to i32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i64, i64* %2
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %7
%11 = phi i64 [ %8, %7 ], [ 1, %9 ]
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo(i64 %0) {
%2 = and i64 %0, 65535
%3 = icmp eq i64 %2, 0
%4 = trunc i64 %0 to i32
%5 = select i1 %3, i32 1, i32 %4
ret i32 %5
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ insert_internal(struct Node **, struct Node *, int);
void insert(struct Node **root, int data) {
  insert_internal(root, *root, data);
}


x86 assembly (clang, -O0):
<insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0xc(%rbp),%edx
call   1030 <insert_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert>:
mov    %esi,%edx
mov    (%rdi),%rsi
jmp    1030 <insert_internal@plt>

LLVM IR (-O0):
%struct.Node = type { i32 }
define void @insert(%struct.Node** %0, i32 %1) {
%3 = alloca %struct.Node**
%4 = alloca i32
store %struct.Node** %0, %struct.Node*** %3
store i32 %1, i32* %4
%5 = load %struct.Node**, %struct.Node*** %3
%6 = load %struct.Node**, %struct.Node*** %3
%7 = load %struct.Node*, %struct.Node** %6
%8 = load i32, i32* %4
%9 = call i32 @insert_internal(%struct.Node** %5, %struct.Node* %7, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define void @insert(%struct.Node** %0, i32 %1) {
%3 = load %struct.Node*, %struct.Node** %0
%4 = tail call i32 @insert_internal(%struct.Node** %0, %struct.Node* %3, i32 %1)
ret void
}
/* Type definitions */
struct msgbuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ msgbuf_end(struct msgbuf *);
scalar_t__ msgbuf_tail(struct msgbuf *);
size_t msgbuf_tailroom(struct msgbuf *b) {
  return (char *)msgbuf_end(b) - (char *)msgbuf_tail(b);
}


x86 assembly (clang, -O0):
<msgbuf_tailroom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <msgbuf_end@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <msgbuf_tail@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgbuf_tailroom>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <msgbuf_end@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <msgbuf_tail@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.msgbuf = type { i32 }
define i64 @msgbuf_tailroom(%struct.msgbuf* %0) {
%2 = alloca %struct.msgbuf*
store %struct.msgbuf* %0, %struct.msgbuf** %2
%3 = load %struct.msgbuf*, %struct.msgbuf** %2
%4 = call i64 @msgbuf_end(%struct.msgbuf* %3)
%5 = inttoptr i64 %4 to i8*
%6 = load %struct.msgbuf*, %struct.msgbuf** %2
%7 = call i64 @msgbuf_tail(%struct.msgbuf* %6)
%8 = inttoptr i64 %7 to i8*
%9 = ptrtoint i8* %5 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.msgbuf = type { i32 }
define i64 @msgbuf_tailroom(%struct.msgbuf* %0) {
%2 = tail call i64 @msgbuf_end(%struct.msgbuf* %0)
%3 = tail call i64 @msgbuf_tail(%struct.msgbuf* %0)
%4 = sub i64 %2, %3
ret i64 %4
}
double f4_sum_pre_int_int_int_int_double(int v0, int v1, int v2, int v3,
                                         double v) {
  return (double)v0 + (double)v1 + (double)v2 + (double)v3 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_int_int_int_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_int_int_int_double>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm2
addsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
addsd  %xmm2,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sd %ecx,%xmm2
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_int_int_int_double(i32 %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %7
%14 = sitofp i32 %13 to double
%15 = fadd double %12, %14
%16 = load i32, i32* %8
%17 = sitofp i32 %16 to double
%18 = fadd double %15, %17
%19 = load i32, i32* %9
%20 = sitofp i32 %19 to double
%21 = fadd double %18, %20
%22 = load double, double* %10
%23 = fadd double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @f4_sum_pre_int_int_int_int_double(i32 %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = sitofp i32 %0 to double
%7 = sitofp i32 %1 to double
%8 = fadd double %6, %7
%9 = sitofp i32 %2 to double
%10 = fadd double %8, %9
%11 = sitofp i32 %3 to double
%12 = fadd double %10, %11
%13 = fadd double %12, %4
ret double %13
}
/* Variables and functions */
double chiSquared(double **, int, int);
double chiSquaredDistribution(double, int);
int /*<<< orphan*/ printf(char *, double, int);
double chiProbability(double **observed, int categories, int dataTypes) {
  int dof = (categories - 1) * (dataTypes - 1);
  double chi;
  chi = chiSquared(observed, categories, dataTypes);
  printf("chisq: %4.2f dof: %d\n", chi, dof);
  return chiSquaredDistribution(chi, dof);
}


x86 assembly (clang, -O0):
<chiProbability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <chiSquared@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x14(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <chiSquaredDistribution@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chiProbability>:
push   %rbx
sub    $0x10,%rsp
lea    -0x1(%rsi),%eax
lea    -0x1(%rdx),%ebx
imul   %eax,%ebx
call   1050 <chiSquared@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <chiSquaredDistribution@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"chisq: %4.2f dof: %d\0A\00"
define double @chiProbability(double** %0, i32 %1, i32 %2) {
%4 = alloca double**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store double** %0, double*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 1
%13 = mul nsw i32 %10, %12
store i32 %13, i32* %7
%14 = load double**, double*** %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call double @chiSquared(double** %14, i32 %15, i32 %16)
store double %17, double* %8
%18 = load double, double* %8
%19 = load i32, i32* %7
%20 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %18, i32 %19)
%21 = load double, double* %8
%22 = load i32, i32* %7
%23 = call double @chiSquaredDistribution(double %21, i32 %22)
ret double %23
}

LLVM IR (-O2):
@.str = [22 x i8] c"chisq: %4.2f dof: %d\0A\00"
define double @chiProbability(double** %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = add nsw i32 %2, -1
%6 = mul nsw i32 %5, %4
%7 = tail call double @chiSquared(double** %0, i32 %1, i32 %2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %7, i32 %6)
%9 = tail call double @chiSquaredDistribution(double %7, i32 %6)
ret double %9
}
int argarray_test_func(argarray)
int argarray[4];
{ return (int)argarray[0] + argarray[1] + argarray[2] + argarray[3]; }


x86 assembly (clang, -O0):
<argarray_test_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argarray_test_func>:
movdqu (%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @argarray_test_func(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ vmi_cpuid(unsigned int, unsigned int *, unsigned int *,
                             unsigned int *, unsigned int *);
unsigned int cpuid_edx(unsigned int op) {
  unsigned int eax, ebx, ecx, edx;
  vmi_cpuid(op, &eax, &ebx, &ecx, &edx);
  return edx;
}


x86 assembly (clang, -O0):
<cpuid_edx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <vmi_cpuid@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_edx>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <vmi_cpuid@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_edx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @vmi_cpuid(i32 %7, i32* %3, i32* %4, i32* %5, i32* %6)
%9 = load i32, i32* %6
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_edx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @vmi_cpuid(i32 %0, i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %5
ret i32 %11
}
/* Variables and functions */
bool is_visible_ascii_character(int c) {
  if (c > 32 && c < 127) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_visible_ascii_character>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jle    1127 <is_visible_ascii_character+0x27>
cmpl   $0x7f,-0x8(%rbp)
jge    1127 <is_visible_ascii_character+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_visible_ascii_character+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_visible_ascii_character>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_visible_ascii_character(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 127
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_visible_ascii_character(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr) {
    perror("malloc");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <xmalloc+0x3a>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
int d_blt_rc1(double a1) { return (__builtin_isless(a1, 100)); }


x86 assembly (clang, -O0):
<d_blt_rc1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blt_rc1>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @d_blt_rc1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_blt_rc1(double %0) {
%2 = fcmp olt double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned int fib(unsigned int n) {
  if (n <= 2) {
    return 1;
  } else {
    int ret = fib(n - 1) + fib(n - 2);
    return ret;
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
ja     1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    115a <fib+0x4a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jb     1145 <fib+0x35>
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x2,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add i32 %4, -2
%9 = add i32 %7, %5
%10 = icmp ult i32 %8, 3
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ isEmpty(struct stack *);
int pop(struct stack **);
int /*<<< orphan*/ sortedInsert(struct stack **, int);
void sortStack(struct stack **s) {
  if (!isEmpty(*s)) {
    int x = pop(s);
    sortStack(s);
    sortedInsert(s, x);
  }
}


x86 assembly (clang, -O0):
<sortStack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <isEmpty@plt>
cmp    $0x0,%eax
jne    1182 <sortStack+0x42>
mov    -0x8(%rbp),%rdi
call   1030 <pop@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <sortStack@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <sortedInsert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortStack>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1040 <isEmpty@plt>
test   %eax,%eax
je     1159 <sortStack+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1030 <pop@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <sortStack@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <sortedInsert@plt>

LLVM IR (-O0):
%struct.stack = type { i32 }
define void @sortStack(%struct.stack** %0) {
%2 = alloca %struct.stack**
%3 = alloca i32
store %struct.stack** %0, %struct.stack*** %2
%4 = load %struct.stack**, %struct.stack*** %2
%5 = load %struct.stack*, %struct.stack** %4
%6 = call i32 @isEmpty(%struct.stack* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = load %struct.stack**, %struct.stack*** %2
%10 = call i32 @pop(%struct.stack** %9)
store i32 %10, i32* %3
%11 = load %struct.stack**, %struct.stack*** %2
%12 = load %struct.stack**, %struct.stack*** %2
%13 = load i32, i32* %3
%14 = call i32 @sortedInsert(%struct.stack** %12, i32 %13)
br label %15
15: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @sortStack(%struct.stack** %0) {
%2 = load %struct.stack*, %struct.stack** %0
%3 = tail call i32 @isEmpty(%struct.stack* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1, %6
ret void
6: ; preds = %1
%7 = tail call i32 @pop(%struct.stack** %0)
tail call void @sortStack(%struct.stack** %0)
%8 = tail call i32 @sortedInsert(%struct.stack** %0, i32 %7)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ stdio_helper_fake_printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void soru_1(char s1[], char s2[]) {
  strcpy(s1, "Kocaeli Universitesi");
  stdio_helper_fake_printf("%s", s1);
  strcat(s2, "...");
  stdio_helper_fake_printf("%s", s2);
}


x86 assembly (clang, -O0):
<soru_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1040 <stdio_helper_fake_printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <stdio_helper_fake_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_1>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebe(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xec7(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <stdio_helper_fake_printf@plt>
lea    0xeb8(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <stdio_helper_fake_printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Kocaeli Universitesi\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"...\00"
define void @soru_1(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 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%11 = load i8*, i8** %4
%12 = call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Kocaeli Universitesi\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"...\00"
define void @soru_1(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int parse_tests();
int run_tests();
int syntax_tests();
int main(int argc, char **argv) {
  return syntax_tests() & parse_tests() & run_tests();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <syntax_tests@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <parse_tests@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <run_tests@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
and    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <syntax_tests@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <parse_tests@plt>
mov    %eax,%ebp
and    %ebx,%ebp
xor    %eax,%eax
call   1040 <run_tests@plt>
and    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @syntax_tests()
%7 = call i32 (...) @parse_tests()
%8 = and i32 %6, %7
%9 = call i32 (...) @run_tests()
%10 = and i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @syntax_tests()
%4 = tail call i32 (...) @parse_tests()
%5 = and i32 %4, %3
%6 = tail call i32 (...) @run_tests()
%7 = and i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ClearONOFF();
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_86(void) {
  DeinitFields();
  ClearONOFF();
}


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

x86 assembly (clang, -O2):
<SwitchFrom_86>:
push   %rax
xor    %eax,%eax
call   1030 <DeinitFields@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ClearONOFF@plt>

LLVM IR (-O0):
define void @SwitchFrom_86() {
%1 = call i32 (...) @DeinitFields()
%2 = call i32 (...) @ClearONOFF()
ret void
}

LLVM IR (-O2):
define void @SwitchFrom_86() {
%1 = tail call i32 (...) @DeinitFields()
%2 = tail call i32 (...) @ClearONOFF()
ret void
}
int test_imm_B9int8_reg(signed char val) {
  return ((val) & (-0xB9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B9int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff47,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_B9int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -185
%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_B9int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -185
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  char *s;
  s = malloc(64);
  strcpy(s, "abcd");
  printf("%s", s);
  free(s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"abcd\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i8* @malloc(i32 64)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(64) i8* @malloc(i32 64)
%4 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = tail call i32 @free(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void show_version() {
  printf("fbtest 0.1 -- framebuffer test utility\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"fbtest 0.1 -- framebuffer test utility\0A\00"
define void @show_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [39 x i8] c"fbtest 0.1 -- framebuffer test utility\00"
define void @show_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_castsi128_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_epi32(int);
int /*<<< orphan*/ _mm_xor_ps(int /*<<< orphan*/ const,
                              int /*<<< orphan*/ const);
__attribute__((always_)) __m128 mm_ivtsign_ps(const __m128 xmm0) {
  const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
  return _mm_xor_ps(xmm0, mask);
}


x86 assembly (clang, -O0):
<mm_ivtsign_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80000000,%edi
call   1050 <_mm_set1_epi32@plt>
mov    %eax,%edi
call   1040 <_mm_castsi128_ps@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_xor_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_ivtsign_ps>:
push   %rbx
mov    %edi,%ebx
mov    $0x80000000,%edi
call   1050 <_mm_set1_epi32@plt>
mov    %eax,%edi
call   1040 <_mm_castsi128_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_mm_xor_ps@plt>

LLVM IR (-O0):
define i32 @mm_ivtsign_ps(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @_mm_set1_epi32(i32 -2147483648)
%5 = call i32 @_mm_castsi128_ps(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @_mm_xor_ps(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @mm_ivtsign_ps(i32 %0) {
%2 = tail call i32 @_mm_set1_epi32(i32 -2147483648)
%3 = tail call i32 @_mm_castsi128_ps(i32 %2)
%4 = tail call i32 @_mm_xor_ps(i32 %0, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS7_SIGNER_INFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS7_SIGNER_INFO_it;
PKCS7_SIGNER_INFO *d2i_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO **a,
                                         const unsigned char **in, long len) {
  return (PKCS7_SIGNER_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                            &PKCS7_SIGNER_INFO_it);
}


x86 assembly (clang, -O0):
<d2i_PKCS7_SIGNER_INFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_PKCS7_SIGNER_INFO>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@PKCS7_SIGNER_INFO_it = global i32 0
define i32* @d2i_PKCS7_SIGNER_INFO(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @PKCS7_SIGNER_INFO_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@PKCS7_SIGNER_INFO_it = global i32 0
define i32* @d2i_PKCS7_SIGNER_INFO(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @PKCS7_SIGNER_INFO_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t lsll1(uint64_t x) { return x << 1; }


x86 assembly (clang, -O0):
<lsll1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsll1>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @lsll1(i32 %0) {
%2 = shl i32 %0, 1
ret i32 %2
}
/* Variables and functions */
scalar_t__ strlen(char const *);
char *strstr(char const *, char const *);
bool endswith(const char *input, const char *suffix) {
  const char *hit = strstr(input, suffix);
  return (hit != NULL) && (strlen(hit) == strlen(suffix));
}


x86 assembly (clang, -O0):
<endswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1177 <endswith+0x57>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endswith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <strstr@plt>
test   %rax,%rax
je     1151 <endswith+0x31>
mov    %rax,%rdi
call   1030 <strlen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%r14
sete   %al
jmp    1153 <endswith+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @endswith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @strstr(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = call i64 @strlen(i8* %12)
%14 = load i8*, i8** %4
%15 = call i64 @strlen(i8* %14)
%16 = icmp eq i64 %13, %15
br label %17
17: ; preds = %11, %2
%18 = phi i1 [ false, %2 ], [ %16, %11 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @endswith(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i64 @strlen(i8* %3)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %2
%11 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ reportError(char const *);
void picAssert(uint8_t test, const char *message) {
  if (!test)
    reportError(message);
}


x86 assembly (clang, -O0):
<picAssert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1132 <picAssert+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <reportError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<picAssert>:
test   %edi,%edi
je     1115 <picAssert+0x5>
ret
mov    %rsi,%rdi
jmp    1030 <reportError@plt>

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

LLVM IR (-O2):
define void @picAssert(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @reportError(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int *alloca(int);
int main() {
  int length = __VERIFIER_nondet_int();
  if (length < 1 || length > 1000)
    length = 16;
  int *arr = alloca(length * sizeof(int));
  if (arr == 0)
    return 0;
  arr[0] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1150 <main+0x30>
cmpl   $0x3e8,-0x8(%rbp)
jle    1157 <main+0x37>
movl   $0x10,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <alloca@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1181 <main+0x61>
movl   $0x0,-0x4(%rbp)
jmp    1192 <main+0x72>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
lea    -0x3e9(%rax),%ecx
lea    0x0(,%rax,4),%eax
cmp    $0xfffffc18,%ecx
mov    $0x40,%edi
cmovae %eax,%edi
call   1030 <alloca@plt>
test   %rax,%rax
je     1153 <main+0x33>
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 1000
br i1 %9, label %10, label %11
10: ; preds = %7, %0
store i32 16, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = mul i64 %13, 4
%15 = trunc i64 %14 to i32
%16 = call i32* @alloca(i32 %15)
store i32* %16, i32** %3
%17 = load i32*, i32** %3
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %20
19: ; preds = %11
store i32 0, i32* %1
br label %23
20: ; preds = %11
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 0
store i32 0, i32* %22
store i32 0, i32* %1
br label %23
23: ; preds = %20, %19
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = add i32 %1, -1001
%3 = icmp ult i32 %2, -1000
%4 = shl i32 %1, 2
%5 = select i1 %3, i32 64, i32 %4
%6 = tail call i32* @alloca(i32 %5)
%7 = icmp eq i32* %6, null
br i1 %7, label %9, label %8
8: ; preds = %0
store i32 0, i32* %6
br label %9
9: ; preds = %0, %8
ret i32 0
}
void A_init_optional_attributes(struct A *_A) {}


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

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

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

LLVM IR (-O2):
%struct.A = type opaque
define void @A_init_optional_attributes(%struct.A* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ttputc(int);
tcapbeep() { ttputc(0x07); }


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

x86 assembly (clang, -O2):
<tcapbeep>:
mov    $0x7,%edi
jmp    1030 <ttputc@plt>

LLVM IR (-O0):
define i32 @tcapbeep() {
%1 = alloca i32
%2 = call i32 @ttputc(i32 7)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @tcapbeep() {
%1 = tail call i32 @ttputc(i32 7)
ret i32 undef
}
void foo183() {}


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

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

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

LLVM IR (-O2):
define void @foo183() {
ret void
}
unsigned int getuint(unsigned int x) {
  char *p1, *p2;
  unsigned int y;
  p1 = (char *)(&x);
  p2 = (char *)(&y);
  p2[3] = p1[0];
  p2[2] = p1[1];
  p2[1] = p1[2];
  p2[0] = p1[3];
  return (y);
}


x86 assembly (clang, -O0):
<getuint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getuint>:
mov    %edi,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @getuint(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: jfs_rm <volumename> <filename>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: jfs_rm <volumename> <filename>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: jfs_rm <volumename> <filename>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *argv0) {
  fprintf(stderr, "usage: %s filein1 [filein2 ... fileinN] fileout nx ny\n",
          argv0);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"usage: %s filein1 [filein2 ... fileinN] fileout nx ny\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"usage: %s filein1 [filein2 ... fileinN] fileout nx ny\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int hoge = 5;
  void *hoge_p;
  hoge_p = &hoge;
  printf("%d\n", *(int *)hoge_p);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
void *bf(size_t size) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @bf(i64 %0) {
ret i8* null
}
int test_imm_ADuint16_reg(unsigned short val) {
  return ((val) & (-0xAD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ADuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -173
%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_ADuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -173
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float HUGE_VAL;
float minus_infinity() { return -HUGE_VAL; }


x86 assembly (clang, -O0):
<minus_infinity>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
@HUGE_VAL = global float 0.000000e+00
define float @minus_infinity() {
%1 = load float, float* @HUGE_VAL
%2 = fneg float %1
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int u_int32_t;

/* Variables and functions */
int h2_u32(int /*<<< orphan*/ const *const);
__attribute__((__pure__)) u_int32_t h2_u31(const uint8_t *const s) {
  return h2_u32(s) & ~0x80000000u;
}


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

x86 assembly (clang, -O2):
<h2_u31>:
push   %rax
call   1030 <h2_u32@plt>
and    $0x7fffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @h2_u31(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h2_u32(i32* %3)
%5 = and i32 %4, 2147483647
ret i32 %5
}

LLVM IR (-O2):
define i32 @h2_u31(i32* %0) {
%2 = tail call i32 @h2_u32(i32* %0)
%3 = and i32 %2, 2147483647
ret i32 %3
}