xunge/DecIR huggingface dataset:
double sum_iter_fn(int inf_lim, int sup_lim, double (*f)(double, int),
                   double x) {
  double res = 0.0;
  for (int i = 0; i < sup_lim; i++) {
    res += (*f)(x, i);
  }
  return res;
}


x86 assembly (clang, -O0):
<sum_iter_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <sum_iter_fn+0x58>
mov    -0x10(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
mov    -0x24(%rbp),%edi
call   *%rax
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1126 <sum_iter_fn+0x26>
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_iter_fn>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %esi,%esi
jle    1143 <sum_iter_fn+0x43>
mov    %rdx,%r14
mov    %esi,%ebp
xorpd  %xmm1,%xmm1
xor    %ebx,%ebx
movsd  %xmm0,(%rsp)
nopl   0x0(%rax)
movsd  %xmm1,0x8(%rsp)
movsd  (%rsp),%xmm0
mov    %ebx,%edi
call   *%r14
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1120 <sum_iter_fn+0x20>
jmp    1147 <sum_iter_fn+0x47>
xorpd  %xmm1,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define double @sum_iter_fn(i32 %0, i32 %1, double (double, i32)* nocapture %2, double %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %8, %4
%7 = phi double [ 0.000000e+00, %4 ], [ %12, %8 ]
ret double %7
8: ; preds = %4, %8
%9 = phi i32 [ %13, %8 ], [ 0, %4 ]
%10 = phi double [ %12, %8 ], [ 0.000000e+00, %4 ]
%11 = tail call double %2(double %3, i32 %9)
%12 = fadd double %10, %11
%13 = add nuw nsw i32 %9, 1
%14 = icmp eq i32 %13, %1
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *llvm_gc_allocate(int);
int /*<<< orphan*/ stderr;
char *__tiger__chr(int i) {
  char *s;
  if (i < 0 || i >= 256) {
    fprintf(stderr, "chr: out of range\n");
    exit(2);
  }
  s = llvm_gc_allocate(2);
  s[0] = (char)i;
  s[1] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<__tiger__chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1152 <__tiger__chr+0x22>
cmpl   $0x100,-0x4(%rbp)
jl     1171 <__tiger__chr+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    $0x2,%edi
call   1040 <llvm_gc_allocate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tiger__chr>:
push   %rbx
cmp    $0x100,%edi
jae    114d <__tiger__chr+0x1d>
mov    %edi,%ebx
mov    $0x2,%edi
call   1040 <llvm_gc_allocate@plt>
mov    %bl,(%rax)
movb   $0x0,0x1(%rax)
pop    %rbx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"chr: out of range\0A\00"
define i8* @__tiger__chr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 256
br i1 %8, label %9, label %13
9: ; preds = %6, %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 2)
unreachable
13: ; preds = %6
%14 = call i8* @llvm_gc_allocate(i32 2)
store i8* %14, i8** %3
%15 = load i32, i32* %2
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 %16, i8* %18
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8 0, i8* %20
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"chr: out of range\0A\00"
define i8* @__tiger__chr(i32 %0) {
%2 = icmp ugt i32 %0, 255
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %1
%8 = tail call i8* @llvm_gc_allocate(i32 2)
%9 = trunc i32 %0 to i8
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 0, i8* %10
ret i8* %8
}
/* Type definitions */
struct utmpx {
  int dummy;
};

/* Variables and functions */
scalar_t__ __getutent();
struct utmpx *getutxent(void) {
  return (struct utmpx *)__getutent();
}


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

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

LLVM IR (-O0):
%struct.utmpx = type { i32 }
define %struct.utmpx* @getutxent() {
%1 = call i64 (...) @__getutent()
%2 = inttoptr i64 %1 to %struct.utmpx*
ret %struct.utmpx* %2
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
define %struct.utmpx* @getutxent() {
%1 = tail call i64 (...) @__getutent()
%2 = inttoptr i64 %1 to %struct.utmpx*
ret %struct.utmpx* %2
}
long long min(long long x, long long y) {
  if (x < y)
    return x;
  else
    return y;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <min+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int rand();
int random_wait(int minms, int maxms) {
  return minms + (rand() % (maxms - minms));
}


x86 assembly (clang, -O0):
<random_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_wait>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_wait(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = srem i32 %6, %9
%11 = add nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @random_wait(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
unsigned long scoreMax(char *seq, char *seq2, uint64_t len, int point) {
  if (seq + 1) {
  }
  if (seq2 + 1) {
  }
  return len * point;
}


x86 assembly (clang, -O0):
<scoreMax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
cmp    $0x0,%rax
je     1129 <scoreMax+0x29>
jmp    1129 <scoreMax+0x29>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
cmp    $0x0,%rax
je     1140 <scoreMax+0x40>
jmp    1140 <scoreMax+0x40>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<scoreMax>:
imul   %ecx,%edx
movslq %edx,%rax
ret

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

LLVM IR (-O2):
define i64 @scoreMax(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %2
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void say_something(void) { fprintf(stderr, "plugh\n"); }


x86 assembly (clang, -O0):
<say_something>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<say_something>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"plugh\0A\00"
define void @say_something() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"plugh\0A\00"
define void @say_something() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int backing_store;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
void set_Screen_backing_store(void *_p, int _v) {
  ((Screen *)_p)->backing_store = (int)_v;
}


x86 assembly (clang, -O0):
<set_Screen_backing_store>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_Screen_backing_store>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_Screen_backing_store(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
char *getEnumShareOp(int value) {
  switch (value) {
  case 0:
    return "NOLL_SHARE_IN";
  case 1:
    return "NOLL_SHARE_NI";
  case 2:
    return "NOLL_SHARE_SUBSET";
  default:
    return "NOLL_SHARE_OTHER";
  }
}


x86 assembly (clang, -O0):
<getEnumShareOp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <getEnumShareOp+0x3c>
jmp    111a <getEnumShareOp+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <getEnumShareOp+0x4c>
jmp    112b <getEnumShareOp+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <getEnumShareOp+0x5c>
jmp    116c <getEnumShareOp+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getEnumShareOp+0x77>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getEnumShareOp+0x77>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getEnumShareOp+0x77>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEnumShareOp>:
cmp    $0x2,%edi
ja     1117 <getEnumShareOp+0x17>
movslq %edi,%rax
lea    0xf31(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf10(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"NOLL_SHARE_IN\00"
@.str.1 = [14 x i8] c"NOLL_SHARE_NI\00"
@.str.2 = [18 x i8] c"NOLL_SHARE_SUBSET\00"
@.str.3 = [17 x i8] c"NOLL_SHARE_OTHER\00"
define i8* @getEnumShareOp(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"NOLL_SHARE_IN\00"
@.str.1 = [14 x i8] c"NOLL_SHARE_NI\00"
@.str.2 = [18 x i8] c"NOLL_SHARE_SUBSET\00"
@.str.3 = [17 x i8] c"NOLL_SHARE_OTHER\00"
@reltable.getEnumShareOp = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.getEnumShareOp to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.getEnumShareOp to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.getEnumShareOp to i64)) to i32)]
define i8* @getEnumShareOp(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.getEnumShareOp to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int *);
void g(int x, int *out) { f(x, out); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = load i32*, i32** %4
%7 = call i32 @f(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @g(i32 %0, i32* %1) {
%3 = tail call i32 @f(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int compare_entries(const void *a, const void *b) {
  char *s1, *s2;
  s1 = *((char **)a);
  s2 = *((char **)b);
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<compare_entries>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare_entries(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_entries(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ usleep(int);
void myCallback(char *cc) {
  usleep(2500);
  printf("%s\n", cc);
}


x86 assembly (clang, -O0):
<myCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x9c4,%edi
call   1040 <usleep@plt>
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myCallback>:
push   %rbx
mov    %rdi,%rbx
mov    $0x9c4,%edi
call   1040 <usleep@plt>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @myCallback(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @usleep(i32 2500)
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @myCallback(i8* %0) {
%2 = tail call i32 @usleep(i32 2500)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char **get_program_args(char **argv, int argc) {
  if (argc < 3) {
    return NULL;
  }
  return &argv[1];
}


x86 assembly (clang, -O0):
<get_program_args>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1122 <get_program_args+0x22>
movq   $0x0,-0x8(%rbp)
jmp    112e <get_program_args+0x2e>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_program_args>:
lea    0x8(%rdi),%rcx
xor    %eax,%eax
cmp    $0x3,%esi
cmovge %rcx,%rax
ret

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

LLVM IR (-O2):
define i8** @get_program_args(i8** readnone %0, i32 %1) {
%3 = icmp slt i32 %1, 3
%4 = getelementptr inbounds i8*, i8** %0, i64 1
%5 = select i1 %3, i8** null, i8** %4
ret i8** %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, c;
  printf("Ingrese una temperatura expresada en grados Farenheit:");
  scanf("%d", &a);
  c = (a - 32) * 50 / 90;
  printf("Eso son %d grados celcius.\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
imul   $0x32,%eax,%eax
mov    $0x5a,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
imul   $0x32,0x4(%rsp),%eax
mov    %eax,%ecx
add    $0xfffff9c0,%ecx
movslq %ecx,%rcx
imul   $0xffffffffb60b60b7,%rcx,%rcx
shr    $0x20,%rcx
lea    (%rcx,%rax,1),%esi
add    $0xfffff9c0,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0x6,%esi
add    %eax,%esi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"Ingrese una temperatura expresada en grados Farenheit:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Eso son %d grados celcius.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 32
%8 = mul nsw i32 %7, 50
%9 = sdiv i32 %8, 90
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"Ingrese una temperatura expresada en grados Farenheit:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Eso son %d grados celcius.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul i32 %5, 50
%7 = add i32 %6, -1600
%8 = sdiv i32 %7, 90
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
struct fdp1_context {
  int dummy;
};

/* Variables and functions */
scalar_t__ fdp1_format_tests(struct fdp1_context *);
scalar_t__ fdp1_open_close(struct fdp1_context *);
int fdp1_open_tests(struct fdp1_context *fdp1) {
  unsigned int fail = 0;
  fail += fdp1_open_close(fdp1);
  fail += fdp1_format_tests(fdp1);
  return fail;
}


x86 assembly (clang, -O0):
<fdp1_open_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fdp1_open_close@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fdp1_format_tests@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdp1_open_tests>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <fdp1_open_close@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fdp1_format_tests@plt>
add    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.fdp1_context = type { i32 }
define i32 @fdp1_open_tests(%struct.fdp1_context* %0) {
%2 = alloca %struct.fdp1_context*
%3 = alloca i32
store %struct.fdp1_context* %0, %struct.fdp1_context** %2
store i32 0, i32* %3
%4 = load %struct.fdp1_context*, %struct.fdp1_context** %2
%5 = call i64 @fdp1_open_close(%struct.fdp1_context* %4)
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = add nsw i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load %struct.fdp1_context*, %struct.fdp1_context** %2
%11 = call i64 @fdp1_format_tests(%struct.fdp1_context* %10)
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.fdp1_context = type { i32 }
define i32 @fdp1_open_tests(%struct.fdp1_context* %0) {
%2 = tail call i64 @fdp1_open_close(%struct.fdp1_context* %0)
%3 = tail call i64 @fdp1_format_tests(%struct.fdp1_context* %0)
%4 = add i64 %3, %2
%5 = trunc i64 %4 to i32
ret i32 %5
}
char *pri_node2str(int node) {
  switch (node) {
  case 0x0:
    return "Unknown node type";
  case 1:
    return "Network";
  case 2:
    return "CPE";
  default:
    return "Invalid value";
  }
}


x86 assembly (clang, -O0):
<pri_node2str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <pri_node2str+0x3c>
jmp    111a <pri_node2str+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <pri_node2str+0x4c>
jmp    112b <pri_node2str+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <pri_node2str+0x5c>
jmp    116c <pri_node2str+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <pri_node2str+0x77>
lea    0xebf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <pri_node2str+0x77>
lea    0xeb7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <pri_node2str+0x77>
lea    0xeab(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pri_node2str>:
cmp    $0x2,%edi
ja     1117 <pri_node2str+0x17>
movslq %edi,%rax
lea    0xf1d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf00(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Unknown node type\00"
@.str.1 = [8 x i8] c"Network\00"
@.str.2 = [4 x i8] c"CPE\00"
@.str.3 = [14 x i8] c"Invalid value\00"
define i8* @pri_node2str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [18 x i8] c"Unknown node type\00"
@.str.1 = [8 x i8] c"Network\00"
@.str.2 = [4 x i8] c"CPE\00"
@.str.3 = [14 x i8] c"Invalid value\00"
@reltable.pri_node2str = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.pri_node2str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.pri_node2str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.pri_node2str to i64)) to i32)]
define i8* @pri_node2str(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.pri_node2str to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int ENOSYS;
int xntrace_special_u64(unsigned char id, unsigned long long v) {
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<xntrace_special_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ed1(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @xntrace_special_u64(i8 zeroext %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
char *get_cpu_str_type(char *, int /*<<< orphan*/ *);
char *get_cpu_str(void) { return get_cpu_str_type("-core", NULL); }


x86 assembly (clang, -O0):
<get_cpu_str>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <get_cpu_str_type@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpu_str>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <get_cpu_str_type@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"-core\00"
define i8* @get_cpu_str() {
%1 = call i8* @get_cpu_str_type(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* null)
ret i8* %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"-core\00"
define i8* @get_cpu_str() {
%1 = tail call i8* @get_cpu_str_type(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* null)
ret i8* %1
}
struct bt_node *Nth_biggest_bt_node(struct bt_node *r, int nth) {}


x86 assembly (clang, -O0):
<Nth_biggest_bt_node>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bt_node = type opaque
define %struct.bt_node* @Nth_biggest_bt_node(%struct.bt_node* %0, i32 %1) {
%3 = alloca %struct.bt_node*
%4 = alloca %struct.bt_node*
%5 = alloca i32
store %struct.bt_node* %0, %struct.bt_node** %4
store i32 %1, i32* %5
%6 = load %struct.bt_node*, %struct.bt_node** %3
ret %struct.bt_node* %6
}

LLVM IR (-O2):
%struct.bt_node = type opaque
define noalias %struct.bt_node* @Nth_biggest_bt_node(%struct.bt_node* nocapture readnone %0, i32 %1) {
ret %struct.bt_node* undef
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_PW3_PIN() { clear_io_bit(0x40, 3); }


x86 assembly (clang, -O0):
<TOSH_CLR_PW3_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0x3,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_PW3_PIN>:
mov    $0x40,%edi
mov    $0x3,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_PW3_PIN() {
%1 = call i32 @clear_io_bit(i32 64, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_PW3_PIN() {
%1 = tail call i32 @clear_io_bit(i32 64, i32 3)
ret void
}
int yield(void) {
  static int yield_index;
  static int yield_state = 0;
  switch (yield_state) {
  case 0:;
    for (yield_index = 0; yield_index < 10; yield_index++)
      do {
        yield_state = 10;
        return yield_index;
      case 10:;
      } while (0);
  };
}


x86 assembly (clang, -O0):
<yield>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1e(%rip),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     112b <yield+0x2b>
jmp    111a <yield+0x1a>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
je     115f <yield+0x5f>
jmp    1182 <yield+0x82>
movl   $0x0,0x2eef(%rip)
cmpl   $0xa,0x2ee8(%rip)
jge    117d <yield+0x7d>
jmp    1147 <yield+0x47>
movl   $0xa,0x2ed7(%rip)
mov    0x2ecd(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <yield+0x82>
jmp    1164 <yield+0x64>
jmp    1169 <yield+0x69>
mov    0x2eb5(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eac(%rip)
jmp    1135 <yield+0x35>
jmp    1182 <yield+0x82>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yield>:
mov    0x2f1e(%rip),%ecx
add    $0x1,%ecx
xor    %eax,%eax
cmpb   $0x0,0x2f16(%rip)
cmovne %ecx,%eax
mov    %eax,0x2f09(%rip)
cmp    $0x9,%eax
jg     1127 <yield+0x27>
movb   $0x1,0x2f01(%rip)
ret

LLVM IR (-O0):
@yield.yield_index = internal global i32 0
@yield.yield_state = internal global i32 0
define i32 @yield() {
%1 = alloca i32
%2 = load i32, i32* @yield.yield_state
switch i32 %2, label %16 [
i32 0, label %3
i32 10, label %10
]
3: ; preds = %0
store i32 0, i32* @yield.yield_index
br label %4
4: ; preds = %12, %3
%5 = load i32, i32* @yield.yield_index
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %15
7: ; preds = %4
br label %8
8: ; preds = %7
store i32 10, i32* @yield.yield_state
%9 = load i32, i32* @yield.yield_index
store i32 %9, i32* %1
br label %16
10: ; preds = %0
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
%13 = load i32, i32* @yield.yield_index
%14 = add nsw i32 %13, 1
store i32 %14, i32* @yield.yield_index
br label %4
15: ; preds = %4
br label %16
16: ; preds = %8, %15, %0
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@yield.yield_index = internal unnamed_addr global i32 0
@yield.yield_state = internal unnamed_addr global i1 false
define i32 @yield() {
%1 = load i1, i1* @yield.yield_state
%2 = load i32, i32* @yield.yield_index
%3 = add nsw i32 %2, 1
%4 = select i1 %1, i32 %3, i32 0
store i32 %4, i32* @yield.yield_index
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %0
store i1 true, i1* @yield.yield_state
br label %7
7: ; preds = %0, %6
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void ZSTDv05_copy4(void *dst, const void *src) { memcpy(dst, src, 4); }


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

x86 assembly (clang, -O2):
<ZSTDv05_copy4>:
mov    $0x4,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @ZSTDv05_copy4(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int free_storage(char *fn) { abort(); }


x86 assembly (clang, -O0):
<free_storage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<free_storage>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @free_storage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @free_storage(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ FreeImages();
void FreeTextures(void) { FreeImages(); }


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

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

LLVM IR (-O0):
define void @FreeTextures() {
%1 = call i32 (...) @FreeImages()
ret void
}

LLVM IR (-O2):
define void @FreeTextures() {
%1 = tail call i32 (...) @FreeImages()
ret void
}
int test_imm_E1uint8_mem(unsigned char *val) {
  return ((*val) & (-0xE1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E1uint8_mem>:
testb  $0x1f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E1uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 31
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double _double() { return 3.1415926; }


x86 assembly (clang, -O0):
<_double>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_double>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_double() {
ret double 0x400921FB4D12D84A
}

LLVM IR (-O2):
define double @_double() {
ret double 0x400921FB4D12D84A
}
/* Variables and functions */
char *__unDNameEx(char *, char const *, int, int /*<<< orphan*/ *,
                  unsigned short);
char *__unDName(char *buffer, const char *mangled, int buflen,
                unsigned short int flags) {
  return __unDNameEx(buffer, mangled, buflen, NULL, flags);
}


x86 assembly (clang, -O0):
<__unDName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ax,-0x16(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
movzwl -0x16(%rbp),%r8d
call   1030 <__unDNameEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__unDName>:
mov    %ecx,%r8d
xor    %ecx,%ecx
jmp    1030 <__unDNameEx@plt>

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

LLVM IR (-O2):
define i8* @__unDName(i8* %0, i8* %1, i32 %2, i16 zeroext %3) {
%5 = tail call i8* @__unDNameEx(i8* %0, i8* %1, i32 %2, i32* null, i16 zeroext %3)
ret i8* %5
}
void ap_int(num) int num;
{
  char buf[((sizeof(num) * 8 - 1) * 302 / 1000 + 1 + 1) + 2];
  inttoa(num, buf);
  ap_str(buf);
}


x86 assembly (clang, -O0):
<ap_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1030 <inttoa@plt>
lea    -0x11(%rbp),%rdi
mov    $0x0,%al
call   1040 <ap_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_int>:
push   %rbx
sub    $0x10,%rsp
lea    0x3(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <inttoa@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <ap_str@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ap_int(i32 %0) {
%2 = alloca i32
%3 = alloca [13 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%6 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @inttoa to i32 (i32, i8*, ...)*)(i32 %4, i8* %5)
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @ap_str to i32 (i8*, ...)*)(i8* %7)
ret void
}

LLVM IR (-O2):
define void @ap_int(i32 %0) {
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%4 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @inttoa to i32 (i32, i8*, ...)*)(i32 %0, i8* %3)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @ap_str to i32 (i8*, ...)*)(i8* %3)
ret void
}
/* Variables and functions */
int MAX(int, int /*<<< orphan*/);
int /*<<< orphan*/ MIN(int, int);
int BETWEEN(int a, int b, int c) { return MAX(a, MIN(b, c)); }


x86 assembly (clang, -O0):
<BETWEEN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <MIN@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <MAX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BETWEEN>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <MIN@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <MAX@plt>

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

LLVM IR (-O2):
define i32 @BETWEEN(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @MIN(i32 %1, i32 %2)
%5 = tail call i32 @MAX(i32 %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ yas_lis331dlh_write_reg_byte(int, int);
int yas_lis331dlh_power_down(void) {
  yas_lis331dlh_write_reg_byte(0x20, 0x07);
  return (0);
}


x86 assembly (clang, -O0):
<yas_lis331dlh_power_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x7,%esi
call   1030 <yas_lis331dlh_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_lis331dlh_power_down>:
push   %rax
mov    $0x20,%edi
mov    $0x7,%esi
call   1030 <yas_lis331dlh_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_lis331dlh_power_down() {
%1 = call i32 @yas_lis331dlh_write_reg_byte(i32 32, i32 7)
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_lis331dlh_power_down() {
%1 = tail call i32 @yas_lis331dlh_write_reg_byte(i32 32, i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_ArgsFrom(int);
int /*<<< orphan*/ Com_Printf(char *, int /*<<< orphan*/);
void Cmd_Echo_f(void) {
  Com_Printf("\x03"
             "%s\n",
             Cmd_ArgsFrom(1));
}


x86 assembly (clang, -O0):
<Cmd_Echo_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <Cmd_ArgsFrom@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <Com_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_Echo_f>:
push   %rax
mov    $0x1,%edi
call   1030 <Cmd_ArgsFrom@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\03%s\0A\00"
define void @Cmd_Echo_f() {
%1 = call i32 @Cmd_ArgsFrom(i32 1)
%2 = call i32 @Com_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\03%s\0A\00"
define void @Cmd_Echo_f() {
%1 = tail call i32 @Cmd_ArgsFrom(i32 1)
%2 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void endTest(void) {
  printf("Test successfully finished\n");
  printf("\n*************************************************************\n");
}


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

x86 assembly (clang, -O2):
<endTest>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Test successfully finished\0A\00"
@.str.1 = [64 x i8] c"\0A*************************************************************\0A\00"
define void @endTest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Test successfully finished\00"
@str.2 = [63 x i8] c"\0A*************************************************************\00"
define void @endTest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void delay(uint32_t count) { (void)count; }


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

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
char *bottle_s(int);
char *no_or_number(int);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void on_the_wall(int number) {
  printf("%s %s of beer on the wall, %s %s of beer.\n", no_or_number(number),
         bottle_s(number), no_or_number(number), bottle_s(number));
}


x86 assembly (clang, -O0):
<on_the_wall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <no_or_number@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <bottle_s@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <no_or_number@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <bottle_s@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    %rax,%r8
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_the_wall>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <no_or_number@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1050 <bottle_s@plt>
mov    %rax,%r15
mov    %ebx,%edi
call   1040 <no_or_number@plt>
mov    %rax,%r12
mov    %ebx,%edi
call   1050 <bottle_s@plt>
lea    0xe9c(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rax,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"%s %s of beer on the wall, %s %s of beer.\0A\00"
define void @on_the_wall(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @no_or_number(i32 %3)
%5 = load i32, i32* %2
%6 = call i8* @bottle_s(i32 %5)
%7 = load i32, i32* %2
%8 = call i8* @no_or_number(i32 %7)
%9 = load i32, i32* %2
%10 = call i8* @bottle_s(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6, i8* %8, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"%s %s of beer on the wall, %s %s of beer.\0A\00"
define void @on_the_wall(i32 %0) {
%2 = tail call i8* @no_or_number(i32 %0)
%3 = tail call i8* @bottle_s(i32 %0)
%4 = tail call i8* @no_or_number(i32 %0)
%5 = tail call i8* @bottle_s(i32 %0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* %4, i8* %5)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int sexit(char **, struct tm);
int quitsession(char **command, struct tm start) {
  return sexit(command, start);
}


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

x86 assembly (clang, -O2):
<quitsession>:
jmp    1030 <sexit@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @quitsession(i8** %0, i32 %1) {
%3 = alloca %struct.tm
%4 = alloca i8**
%5 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i32 %1, i32* %5
store i8** %0, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @sexit(i8** %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @quitsession(i8** %0, i32 %1) {
%3 = tail call i32 @sexit(i8** %0, i32 %1)
ret i32 %3
}