xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int chunk_univ_multi_truncate(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/ *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ main_time();
int chunk_multi_truncate(uint64_t *nchunkid, uint64_t ochunkid, uint32_t length,
                         uint8_t lsetid) {
  return chunk_univ_multi_truncate(main_time(), 0, nchunkid, ochunkid, length,
                                   lsetid);
}


x86 assembly (clang, -O0):
<chunk_multi_truncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <main_time@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
xor    %esi,%esi
call   1030 <chunk_univ_multi_truncate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chunk_multi_truncate>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <main_time@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    %rbp,%rdx
mov    %ebx,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <chunk_univ_multi_truncate@plt>

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

LLVM IR (-O2):
define i32 @chunk_multi_truncate(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @main_time()
%6 = tail call i32 @chunk_univ_multi_truncate(i32 %5, i32 0, i32* %0, i32 %1, i32 %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void colorRes() { printf("%s", "\x1B[0m"); }


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

x86 assembly (clang, -O2):
<colorRes>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @colorRes() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @colorRes() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _error(char const *message, int ret) {
  fputs("resource: ", stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"resource: \00"
@stderr = global i32 0
define i32 @_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"resource: \00"
@stderr = global i32 0
define i32 @_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
float expand(float x) { return x * 2.0 - 1.0; }


x86 assembly (clang, -O0):
<expand>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand>:
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  0xef0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @expand(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double %4, double 2.000000e+00, double -1.000000e+00)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @expand(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double -1.000000e+00)
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void diep(char *err) {
  perror(err);
  exit(1);
}


x86 assembly (clang, -O0):
<diep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<diep>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @diep(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @diep(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
bool is_accepted(char c, const char *accept) {
  size_t i;
  for (i = 0; accept[i]; i++) {
    if (c == accept[i]) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<is_accepted>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1162 <is_accepted+0x62>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114c <is_accepted+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1169 <is_accepted+0x69>
jmp    1151 <is_accepted+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <is_accepted+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_accepted>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <is_accepted+0x20>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1121 <is_accepted+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <is_accepted+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_accepted(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %1, i64 %13
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2, %5
%10 = phi i8 [ %7, %5 ], [ %3, %2 ]
%11 = phi i64 [ %13, %5 ], [ 0, %2 ]
%12 = icmp eq i8 %10, %0
%13 = add i64 %11, 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %2
%15 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ expomax(short *, short *, short *);
short *LCM(short *e1, short *e2) {
  static short res[4000];
  expomax(e1, e2, res);
  return res;
}


x86 assembly (clang, -O0):
<LCM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0x2f11(%rip),%rdx
call   1030 <expomax@plt>
lea    0x2f05(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCM>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rdx
call   1030 <expomax@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@LCM.res = internal global [4000 x i16] zeroinitializer
define i16* @LCM(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = load i16*, i16** %4
%7 = call i32 @expomax(i16* %5, i16* %6, i16* getelementptr inbounds ([4000 x i16], [4000 x i16]* @LCM.res, i64 0, i64 0))
ret i16* getelementptr inbounds ([4000 x i16], [4000 x i16]* @LCM.res, i64 0, i64 0)
}

LLVM IR (-O2):
@LCM.res = internal global [4000 x i16] zeroinitializer
define i16* @LCM(i16* %0, i16* %1) {
%3 = tail call i32 @expomax(i16* %0, i16* %1, i16* getelementptr inbounds ([4000 x i16], [4000 x i16]* @LCM.res, i64 0, i64 0))
ret i16* getelementptr inbounds ([4000 x i16], [4000 x i16]* @LCM.res, i64 0, i64 0)
}
/* Variables and functions */
int npfa(int);
int npfar(int nmin) { return 2 * npfa((nmin + 1) / 2); }


x86 assembly (clang, -O0):
<npfar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <npfa@plt>
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<npfar>:
push   %rax
mov    %edi,%eax
add    $0x1,%eax
shr    $0x1f,%eax
add    %eax,%edi
add    $0x1,%edi
sar    %edi
call   1030 <npfa@plt>
add    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @npfar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = sdiv i32 %4, 2
%6 = call i32 @npfa(i32 %5)
%7 = mul nsw i32 2, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @npfar(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sdiv i32 %2, 2
%4 = tail call i32 @npfa(i32 %3)
%5 = shl nsw i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int max(int, int /*<<< orphan*/);
int padre(int i) { return max(i / 2 - 1, 0); }


x86 assembly (clang, -O0):
<padre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
sub    $0x1,%edi
xor    %esi,%esi
call   1030 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padre>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %eax,%edi
sar    %edi
add    $0xffffffff,%edi
xor    %esi,%esi
jmp    1030 <max@plt>

LLVM IR (-O0):
define i32 @padre(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
%5 = sub nsw i32 %4, 1
%6 = call i32 @max(i32 %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
define i32 @padre(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = add nsw i32 %2, -1
%4 = tail call i32 @max(i32 %3, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void CheatDatabase_Warning(char *pWarningText) { printf(pWarningText); }


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

x86 assembly (clang, -O2):
<CheatDatabase_Warning>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @CheatDatabase_Warning(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int count;
  for (count = 0; count < 10; count++) {
    printf("Hello World\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};
struct slInt {
  int dummy;
};

/* Variables and functions */
struct slInt *matchingExtId(struct sqlConnection *, char *, char *);
struct slInt *genePixSelectGenbank(struct sqlConnection *conn, char *acc) {
  return matchingExtId(conn, acc, "genbank");
}


x86 assembly (clang, -O0):
<genePixSelectGenbank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <matchingExtId@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genePixSelectGenbank>:
lea    0xee9(%rip),%rdx
jmp    1030 <matchingExtId@plt>

LLVM IR (-O0):
%struct.slInt = type { i32 }
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"genbank\00"
define %struct.slInt* @genePixSelectGenbank(%struct.sqlConnection* %0, i8* %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i8*
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i8* %1, i8** %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i8*, i8** %4
%7 = call %struct.slInt* @matchingExtId(%struct.sqlConnection* %5, i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.slInt* %7
}

LLVM IR (-O2):
%struct.slInt = type { i32 }
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"genbank\00"
define %struct.slInt* @genePixSelectGenbank(%struct.sqlConnection* %0, i8* %1) {
%3 = tail call %struct.slInt* @matchingExtId(%struct.sqlConnection* %0, i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.slInt* %3
}
unsigned int uint4(unsigned const char *p) {
  return ((p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3]);
}


x86 assembly (clang, -O0):
<uint4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @uint4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ simuHald2(int, double, int *, int *);
void simuHald2_R_wrapper(int *gen, double *mu, int *mut0, int *mut) {
  simuHald2(*gen, *mu, mut0, mut);
}


x86 assembly (clang, -O0):
<simuHald2_R_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <simuHald2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simuHald2_R_wrapper>:
mov    (%rdi),%edi
movsd  (%rsi),%xmm0
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <simuHald2@plt>

LLVM IR (-O0):
define void @simuHald2_R_wrapper(i32* %0, double* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store double* %1, double** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load double*, double** %6
%12 = load double, double* %11
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = call i32 @simuHald2(i32 %10, double %12, i32* %13, i32* %14)
ret void
}

LLVM IR (-O2):
define void @simuHald2_R_wrapper(i32* nocapture %0, double* nocapture %1, i32* %2, i32* %3) {
%5 = load i32, i32* %0
%6 = load double, double* %1
%7 = tail call i32 @simuHald2(i32 %5, double %6, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int /*<<< orphan*/ putchar(char);
void dumpptrarray(void **ptr, size_t len) {
  for (size_t i = 0; i < len; i++) {
    printf("%p ", ptr[i]);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<dumpptrarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116f <dumpptrarray+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <dumpptrarray+0x18>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpptrarray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1155 <dumpptrarray+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <dumpptrarray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p \00"
define void @dumpptrarray(i8** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i8 signext 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ swab(char *, char *, int);
void swapshort(short *si) {
  short tempc;
  tempc = *si;
  swab((char *)&tempc, (char *)si, sizeof(short));
}


x86 assembly (clang, -O0):
<swapshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0xa(%rbp)
lea    -0xa(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x2,%edx
call   1030 <swab@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapshort>:
push   %rax
mov    %rdi,%rsi
movzwl (%rdi),%eax
mov    %ax,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%edx
call   1030 <swab@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @swapshort(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = load i16, i16* %4
store i16 %5, i16* %3
%6 = bitcast i16* %3 to i8*
%7 = load i16*, i16** %2
%8 = bitcast i16* %7 to i8*
%9 = call i32 @swab(i8* %6, i8* %8, i32 2)
ret void
}

LLVM IR (-O2):
define void @swapshort(i16* %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = load i16, i16* %0
store i16 %4, i16* %2
%5 = bitcast i16* %0 to i8*
%6 = call i32 @swab(i8* %3, i8* %5, i32 2)
ret void
}
int test_checksum(const void *data, unsigned int length, unsigned short oldcrc,
                  unsigned short *pcrc) {
  unsigned short crc;
  crc = crc16(data, length);
  if (pcrc != ((void *)0)) {
    *pcrc = crc;
  }
  return crc != oldcrc && oldcrc != 0xA53C;
}


x86 assembly (clang, -O0):
<test_checksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <crc16@plt>
mov    %ax,-0x1a(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <test_checksum+0x42>
mov    -0x1a(%rbp),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
movzwl -0x1a(%rbp),%ecx
movzwl -0xe(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x1b(%rbp)
je     1176 <test_checksum+0x66>
movzwl -0xe(%rbp),%eax
cmp    $0xa53c,%eax
setne  %al
mov    %al,-0x1b(%rbp)
mov    -0x1b(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_checksum>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebx
xor    %eax,%eax
call   1030 <crc16@plt>
test   %r14,%r14
je     1129 <test_checksum+0x19>
mov    %ax,(%r14)
cmp    %bx,%ax
setne  %al
movzwl %bx,%ecx
cmp    $0xa53c,%ecx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @test_checksum(i8* %0, i32 %1, i16 zeroext %2, i16* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i16
%8 = alloca i16*
%9 = alloca i16
store i8* %0, i8** %5
store i32 %1, i32* %6
store i16 %2, i16* %7
store i16* %3, i16** %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @crc16 to i32 (i8*, i32, ...)*)(i8* %10, i32 %11)
%13 = trunc i32 %12 to i16
store i16 %13, i16* %9
%14 = load i16*, i16** %8
%15 = icmp ne i16* %14, null
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = load i16, i16* %9
%18 = load i16*, i16** %8
store i16 %17, i16* %18
br label %19
19: ; preds = %16, %4
%20 = load i16, i16* %9
%21 = zext i16 %20 to i32
%22 = load i16, i16* %7
%23 = zext i16 %22 to i32
%24 = icmp ne i32 %21, %23
br i1 %24, label %25, label %29
25: ; preds = %19
%26 = load i16, i16* %7
%27 = zext i16 %26 to i32
%28 = icmp ne i32 %27, 42300
br label %29
29: ; preds = %25, %19
%30 = phi i1 [ false, %19 ], [ %28, %25 ]
%31 = zext i1 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @test_checksum(i8* %0, i32 %1, i16 zeroext %2, i16* writeonly %3) {
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @crc16 to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%6 = icmp eq i16* %3, null
%7 = trunc i32 %5 to i16
br i1 %6, label %9, label %8
8: ; preds = %4
store i16 %7, i16* %3
br label %9
9: ; preds = %4, %8
%10 = icmp ne i16 %7, %2
%11 = icmp ne i16 %2, -23236
%12 = and i1 %11, %10
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ p3dfft_get_dims(int *, int *, int *, int *);
void Cp3dfft_get_dims(int *start, int *end, int *size, int conf) {
  p3dfft_get_dims(start, end, size, &conf);
}


x86 assembly (clang, -O0):
<Cp3dfft_get_dims>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <p3dfft_get_dims@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cp3dfft_get_dims>:
push   %rax
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%rcx
call   1030 <p3dfft_get_dims@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @Cp3dfft_get_dims(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32
store i32 %3, i32* %5
%6 = call i32 @p3dfft_get_dims(i32* %0, i32* %1, i32* %2, i32* %5)
ret void
}
/* Variables and functions */
int libA_func_impl();
int libA_func(void) { return libA_func_impl(); }


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

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

LLVM IR (-O0):
define i32 @libA_func() {
%1 = call i32 (...) @libA_func_impl()
ret i32 %1
}

LLVM IR (-O2):
define i32 @libA_func() {
%1 = tail call i32 (...) @libA_func_impl()
ret i32 %1
}
/* Variables and functions */
double Poisson(long, double);
double SumPoisson(long, double);
long floor(double);
double IntPoisson(double k, double ny) {
  long k1, k2;
  double y1;
  double value;
  k1 = floor(k);
  k2 = k1 + 1;
  y1 = SumPoisson(k1, ny);
  value = y1 + Poisson(k2, ny) * (k - k1);
  return (value);
}


x86 assembly (clang, -O0):
<IntPoisson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <floor@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <SumPoisson@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1040 <Poisson@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
cvtsi2sdq -0x18(%rbp),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntPoisson>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1050 <floor@plt>
mov    %rax,%rbx
lea    0x1(%rax),%r14
mov    %rax,%rdi
movsd  (%rsp),%xmm0
call   1030 <SumPoisson@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
movsd  (%rsp),%xmm0
call   1040 <Poisson@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rbx,%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @IntPoisson(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i64
%6 = alloca i64
%7 = alloca double
%8 = alloca double
store double %0, double* %3
store double %1, double* %4
%9 = load double, double* %3
%10 = call i64 @floor(double %9)
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = add nsw i64 %11, 1
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load double, double* %4
%15 = call double @SumPoisson(i64 %13, double %14)
store double %15, double* %7
%16 = load double, double* %7
%17 = load i64, i64* %6
%18 = load double, double* %4
%19 = call double @Poisson(i64 %17, double %18)
%20 = load double, double* %3
%21 = load i64, i64* %5
%22 = sitofp i64 %21 to double
%23 = fsub double %20, %22
%24 = call double @llvm.fmuladd.f64(double %19, double %23, double %16)
store double %24, double* %8
%25 = load double, double* %8
ret double %25
}

LLVM IR (-O2):
define double @IntPoisson(double %0, double %1) {
%3 = tail call i64 @floor(double %0)
%4 = add nsw i64 %3, 1
%5 = tail call double @SumPoisson(i64 %3, double %1)
%6 = tail call double @Poisson(i64 %4, double %1)
%7 = sitofp i64 %3 to double
%8 = fsub double %0, %7
%9 = tail call double @llvm.fmuladd.f64(double %6, double %8, double %5)
ret double %9
}
/* Variables and functions */
int strlen(const char *str) {
  int i = 0;
  char *tmp = (char *)str;
  while (*tmp != '\0') {
    tmp++;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <strlen+0x41>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <strlen+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int _link(char *old __attribute__((unused)),
          char *new __attribute__((unused))) {
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_link>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EPERM = global i32 0
@errno = global i32 0
define i32 @_link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EPERM
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
define i32 @_link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EPERM
store i32 %3, i32* @errno
ret i32 -1
}
void func_charp_string(char *p) {}


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

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

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

LLVM IR (-O2):
define void @func_charp_string(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void __kmalloc_hook(void *addr, unsigned int size, const char *file,
                    int lineno) {
  do {
    fprintf(stderr, "FAIL: "
                    "Function instrumented in uninstrumented file.\n");
    exit(1);
  } while (1);
}


x86 assembly (clang, -O0):
<__kmalloc_hook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<__kmalloc_hook>:
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 = [53 x i8] c"FAIL: Function instrumented in uninstrumented file.\0A\00"
define void @__kmalloc_hook(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
br label %9
9: ; preds = %13, %4
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; No predecessors!
br i1 true, label %9, label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"FAIL: Function instrumented in uninstrumented file.\0A\00"
define void @__kmalloc_hook(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void gen_scan_flat_bloop_stop(FILE *outfile) { fprintf(outfile, "}\n"); }


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

x86 assembly (clang, -O2):
<gen_scan_flat_bloop_stop>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"}\0A\00"
define void @gen_scan_flat_bloop_stop(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fdpathdb_register_mapped_path(char const *, int,
                                                 int /*<<< orphan*/ *,
                                                 int /*<<< orphan*/ *);
void close_postprocess_(const char *realfnname, int ret, int fd) {
  (void)ret;
  fdpathdb_register_mapped_path(realfnname, fd, NULL, NULL);
}


x86 assembly (clang, -O0):
<close_postprocess_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <fdpathdb_register_mapped_path@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_postprocess_>:
mov    %edx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <fdpathdb_register_mapped_path@plt>

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

LLVM IR (-O2):
define void @close_postprocess_(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @fdpathdb_register_mapped_path(i8* %0, i32 %2, i32* null, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printEpisodes(char **episodes, int epCount) {
  int i;
  printf("\n");
  for (i = 0; i < epCount; i++)
    printf("%s\n", episodes[i]);
}


x86 assembly (clang, -O0):
<printEpisodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <printEpisodes+0x58>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <printEpisodes+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printEpisodes>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
jle    1152 <printEpisodes+0x32>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1040 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <printEpisodes+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @printEpisodes(i8** nocapture %0, i32 %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Variables and functions */
char *strchr(char const *, char);
int count(const char *s, char c) {
  int rv = 0;
  char *x = strchr(s, c);
  while (x) {
    rv++;
    x = strchr(x + 1, c);
  }
  return rv;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1168 <count+0x58>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
jmp    113a <count+0x2a>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1146 <count+0x36>
movsbl %bpl,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
add    $0x1,%rax
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <count+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @count(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw nsw i32 %7, 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = tail call i8* @strchr(i8* %9, i8 signext %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
unsigned uint_range(unsigned min, unsigned max) {
  extern unsigned uint_value(void);
  unsigned n = uint_value();
  return n < min || max < n ? min : n;
}


x86 assembly (clang, -O0):
<uint_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
call   1030 <uint_value@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jb     113e <uint_range+0x2e>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1149 <uint_range+0x39>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114f <uint_range+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <uint_value@plt>
cmp    %ebx,%eax
mov    %eax,%ecx
cmova  %ebp,%ecx
cmp    %ebp,%eax
cmovb  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @uint_range(i32 %0, i32 %1) {
%3 = tail call i32 @uint_value()
%4 = icmp ult i32 %3, %0
%5 = icmp ugt i32 %3, %1
%6 = or i1 %4, %5
%7 = select i1 %6, i32 %0, i32 %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int cup(int p) {
  if (p > 50) {
    printf("too long\n");
    p = 50;
  } else
    ;
  return p;
}


x86 assembly (clang, -O0):
<cup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jle    113d <cup+0x2d>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x32,-0x4(%rbp)
jmp    1142 <cup+0x32>
jmp    1142 <cup+0x32>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cup>:
mov    %edi,%eax
cmp    $0x33,%edi
jl     112d <cup+0x1d>
push   %rax
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x32,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@str = [9 x i8] c"too long\00"
define i32 @cup(i32 %0) {
%2 = icmp sgt i32 %0, 50
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 50, %3 ], [ %0, %1 ]
ret i32 %6
}