xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ x_msg(int, char *, int, int, char const *, int);
int index_verify(int index, int size, const char *file, int line) {
  if (index < 0 || index >= size)
    x_msg((1 << 4),
          "Assertion Failed: Array index=%d out of bounds for array size=%d in "
          "%s:%d",
          index, size, file, line);
  return index;
}


x86 assembly (clang, -O0):
<index_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113b <index_verify+0x2b>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     115a <index_verify+0x4a>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    $0x10,%edi
lea    0xeab(%rip),%rsi
call   1030 <x_msg@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_verify>:
push   %rbx
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%ebx
test   %edi,%edi
js     1123 <index_verify+0x13>
cmp    %ecx,%ebx
jl     1136 <index_verify+0x26>
lea    0xed6(%rip),%rsi
mov    $0x10,%edi
mov    %ebx,%edx
call   1030 <x_msg@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [74 x i8] c"Assertion Failed: Array index=%d out of bounds for array size=%d in %s:%d\00"
define i32 @index_verify(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11, %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i8*, i8** %7
%19 = load i32, i32* %8
%20 = call i32 @x_msg(i32 16, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i8* %18, i32 %19)
br label %21
21: ; preds = %15, %11
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
@.str = [74 x i8] c"Assertion Failed: Array index=%d out of bounds for array size=%d in %s:%d\00"
define i32 @index_verify(i32 returned %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp sgt i32 %0, -1
%6 = icmp slt i32 %0, %1
%7 = and i1 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @x_msg(i32 16, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i8* %2, i32 %3)
br label %10
10: ; preds = %4, %8
ret i32 %0
}
int Is_zero(double value) {
  if (value < 0) {
    value = -value;
  }
  if (value < 1e-10) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<Is_zero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1138 <Is_zero+0x38>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec0(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1157 <Is_zero+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <Is_zero+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Is_zero>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
movsd  0xee3(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm3,%xmm0
seta   %al
ret

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

LLVM IR (-O2):
define i32 @Is_zero(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fcmp olt double %4, 1.000000e-10
%6 = zext i1 %5 to i32
ret i32 %6
}
int foo(int a, int b) {
  long long aa = a;
  long long bb = b;
  return aa + bb;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
store i64 %8, i64* %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
store i64 %10, i64* %6
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = add nsw i64 %11, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = add i32 %1, %0
ret i32 %3
}
int test_imm_01uint8_reg(unsigned char val) {
  return ((val) & (-0x01 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_01uint8_reg(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void f2xm1() {
  db(0xD9);
  db(0xF0);
}


x86 assembly (clang, -O0):
<f2xm1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xf0,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2xm1>:
push   %rax
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xf0,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @f2xm1() {
%1 = call i32 @db(i32 217)
%2 = call i32 @db(i32 240)
ret void
}

LLVM IR (-O2):
define void @f2xm1() {
%1 = tail call i32 @db(i32 217)
%2 = tail call i32 @db(i32 240)
ret void
}
int test_imm_69int64_lowword_reg(long long val) {
  return ((val) & (0x69 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_69int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x69,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_69int64_lowword_reg>:
test   $0x69,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_69int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 105
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int fatorial(int n) {
  while (n > 1) {
    return n * fatorial(n - 1);
  }
}


x86 assembly (clang, -O0):
<fatorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1141 <fatorial+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fatorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fatorial(i32 %0) {
ret i32 0
}
void splitfloat(unsigned int *wordlow, unsigned int *wordhigh, float value) {
  wordlow = ((int *)&value)[0];
  wordhigh = ((int *)&value)[1];
}


x86 assembly (clang, -O0):
<splitfloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    %rax,-0x8(%rbp)
movslq -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @splitfloat(i32* nocapture %0, i32* nocapture %1, float %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __p3dfft_MOD_p3dfft_get_dims(int *, int *, int *, int *);
void p3dfft_get_dims(int *start, int *end, int *size, int conf) {
  __p3dfft_MOD_p3dfft_get_dims(start, end, size, &conf);
}


x86 assembly (clang, -O0):
<p3dfft_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_MOD_p3dfft_get_dims@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @p3dfft_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_MOD_p3dfft_get_dims(i32* %9, i32* %10, i32* %11, i32* %8)
ret void
}

LLVM IR (-O2):
define void @p3dfft_get_dims(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32
store i32 %3, i32* %5
%6 = call i32 @__p3dfft_MOD_p3dfft_get_dims(i32* %0, i32* %1, i32* %2, i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ rand_test();
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  do {
    fprintf(
        stderr,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/jmesmon/trifles/refs/heads/master/rb/rb.c"
        ":%d :: ",
        358);
    fprintf(stderr, "start\n");
  } while (0);
  rand_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
mov    $0x166,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xf29(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <rand_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
mov    $0x166,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf45(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <rand_test@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jmesmon/trifles/refs/heads/master/rb/rb.c:%d :: \00"
@.str.1 = [7 x i8] c"start\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 358)
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %6
%12 = call i32 (...) @rand_test()
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jmesmon/trifles/refs/heads/master/rb/rb.c:%d :: \00"
@.str.1 = [7 x i8] c"start\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 358)
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (...) @rand_test()
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *substr(char *str, size_t len) {
  char *temp = (char *)malloc(len * sizeof(char));
  strncpy(temp, str, len - 1);
  temp[len - 1] = '\0';
  return temp;
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    -0x1(%r15),%rdx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @substr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = mul i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = sub i64 %12, 1
%14 = call i32 @strncpy(i8* %10, i8* %11, i64 %13)
%15 = load i8*, i8** %5
%16 = load i64, i64* %4
%17 = sub i64 %16, 1
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @substr(i8* %0, i64 %1) {
%3 = tail call i64 @malloc(i64 %1)
%4 = inttoptr i64 %3 to i8*
%5 = add i64 %1, -1
%6 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %5)
%7 = getelementptr inbounds i8, i8* %4, i64 %5
store i8 0, i8* %7
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ check_all_len_0();
int /*<<< orphan*/ check_all_len_1();
int /*<<< orphan*/ check_all_len_2();
int /*<<< orphan*/ check_all_len_3();
int main() {
  check_all_len_0();
  check_all_len_1();
  check_all_len_2();
  check_all_len_3();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <check_all_len_0@plt>
xor    %eax,%eax
call   1030 <check_all_len_1@plt>
xor    %eax,%eax
call   1060 <check_all_len_2@plt>
xor    %eax,%eax
call   1040 <check_all_len_3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_all_len_0()
%3 = call i32 (...) @check_all_len_1()
%4 = call i32 (...) @check_all_len_2()
%5 = call i32 (...) @check_all_len_3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_all_len_0()
%2 = tail call i32 (...) @check_all_len_1()
%3 = tail call i32 (...) @check_all_len_2()
%4 = tail call i32 (...) @check_all_len_3()
ret i32 0
}
int elegirResultadoParaRecorrido(int resProcess, int resIzq, int resDer) {
  if (resProcess != 0) {
    return resProcess;
  }
  if (resIzq != 0) {
    return resIzq;
  }
  if (resDer != 0) {
    return resDer;
  }
  return 0;
}


x86 assembly (clang, -O0):
<elegirResultadoParaRecorrido>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <elegirResultadoParaRecorrido+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <elegirResultadoParaRecorrido+0x53>
cmpl   $0x0,-0xc(%rbp)
je     1137 <elegirResultadoParaRecorrido+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <elegirResultadoParaRecorrido+0x53>
cmpl   $0x0,-0x10(%rbp)
je     114c <elegirResultadoParaRecorrido+0x4c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <elegirResultadoParaRecorrido+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elegirResultadoParaRecorrido>:
mov    %edx,%eax
test   %esi,%esi
cmovne %esi,%eax
test   %edi,%edi
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @elegirResultadoParaRecorrido(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %6, i32 %0
ret i32 %7
}
void silly(int *w) { w[1]++; }


x86 assembly (clang, -O0):
<silly>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<silly>:
addl   $0x1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @silly(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @silly(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int child_fn() {
  printf("New `net` Namespace:\n");
  system("ip link");
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<child_fn>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <system@plt>
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_fn>:
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <system@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"New `net` Namespace:\0A\00"
@.str.1 = [8 x i8] c"ip link\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define i32 @child_fn() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"ip link\00"
@str = [21 x i8] c"New `net` Namespace:\00"
@str.3 = [2 x i8] c"\0A\00"
define i32 @child_fn() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
int cmpaddr(const void *ap, const void *bp) {
  return ap < bp ? -1 : (ap > bp ? 1 : 0);
}


x86 assembly (clang, -O0):
<cmpaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <cmpaddr+0x27>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <cmpaddr+0x3f>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpaddr>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpaddr(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 = icmp ult i8* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = icmp ugt i8* %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ -1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @cmpaddr(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
void insert_buf(sp, buf, n) struct slot *sp;
char *buf;
int n;
{
  while (--n >= 0)
    insert(sp, *buf++);
}


x86 assembly (clang, -O0):
<insert_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     1157 <insert_buf+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
mov    $0x0,%al
call   1030 <insert@plt>
jmp    1123 <insert_buf+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_buf>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1149 <insert_buf+0x39>
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rbx),%esi
add    $0x1,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <insert@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <insert_buf+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.slot = type opaque
define void @insert_buf(%struct.slot* %0, i8* %1, i32 %2) {
%4 = alloca %struct.slot*
%5 = alloca i8*
%6 = alloca i32
store %struct.slot* %0, %struct.slot** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %11, %3
%8 = load i32, i32* %6
%9 = add nsw i32 %8, -1
store i32 %9, i32* %6
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load %struct.slot*, %struct.slot** %4
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = call i32 (%struct.slot*, i32, ...) bitcast (i32 (...)* @insert to i32 (%struct.slot*, i32, ...)*)(%struct.slot* %12, i32 %16)
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.slot = type opaque
define void @insert_buf(%struct.slot* %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %2, %3 ]
%7 = phi i8* [ %9, %5 ], [ %1, %3 ]
%8 = add nsw i32 %6, -1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = tail call i32 (%struct.slot*, i32, ...) bitcast (i32 (...)* @insert to i32 (%struct.slot*, i32, ...)*)(%struct.slot* %0, i32 %11)
%13 = icmp ugt i32 %6, 1
br i1 %13, label %5, label %14
14: ; preds = %5, %3
ret void
}
int isspace(int c) {
  switch (c) {
  case ' ':
  case '\f':
  case '\n':
  case '\r':
  case '\t':
  case '\v':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     112f <isspace+0x2f>
jmp    111e <isspace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    113b <isspace+0x3b>
jmp    112f <isspace+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1142 <isspace+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 32, label %5
i32 12, label %5
i32 10, label %5
i32 13, label %5
i32 9, label %5
i32 11, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 12, label %3
i32 10, label %3
i32 13, label %3
i32 9, label %3
i32 11, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void consoleSetState(int state) {}


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

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

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

LLVM IR (-O2):
define void @consoleSetState(i32 %0) {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ foo(int);
int /*<<< orphan*/ lib_a(int);
int main(int argc, char *argv[]) {
  int n = 1;
  if (argc > 1)
    n = atoi(argv[1]);
  lib_a(n);
  foo(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1167 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <lib_a@plt>
mov    -0x14(%rbp),%edi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
cmp    $0x2,%edi
jl     1146 <main+0x16>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %ebx,%edi
call   1030 <lib_a@plt>
mov    %ebx,%edi
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %6
%16 = call i32 @lib_a(i32 %15)
%17 = load i32, i32* %6
%18 = call i32 @foo(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 1, %2 ]
%10 = tail call i32 @lib_a(i32 %9)
%11 = tail call i32 @foo(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stdout_tx_strn(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void stdout_tx_str(const char *str) { stdout_tx_strn(str, strlen(str)); }


x86 assembly (clang, -O0):
<stdout_tx_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <stdout_tx_strn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdout_tx_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <stdout_tx_strn@plt>

LLVM IR (-O0):
define void @stdout_tx_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @stdout_tx_strn(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @stdout_tx_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @stdout_tx_strn(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pipe_cloexec() {
  printf("NOT IMPLEMENTED:"
         "pa_pipe_cloexec"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_pipe_cloexec\0A\00"
define i32 @pa_pipe_cloexec() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_pipe_cloexec\00"
define i32 @pa_pipe_cloexec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf2(char *, int);
void GenPrintNumLabel(int label) { printf2(".L%d", label); }


x86 assembly (clang, -O0):
<GenPrintNumLabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenPrintNumLabel>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf2@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c".L%d\00"
define void @GenPrintNumLabel(i32 %0) {
%2 = tail call i32 @printf2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int renamex_np(char const *, char const *, unsigned int);
int rename_ext(const char *old, const char *new, unsigned int flags) {
  return renamex_np(old, new, flags);
}


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

x86 assembly (clang, -O2):
<rename_ext>:
jmp    1030 <renamex_np@plt>

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

LLVM IR (-O2):
define i32 @rename_ext(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @renamex_np(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
void early_puts(const char *string) {}


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

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

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

LLVM IR (-O2):
define void @early_puts(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t
hci_event_extended_inquiry_response_get_clock_offset(const uint8_t *event) {
  return little_endian_read_16(event, 14);
}


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

x86 assembly (clang, -O2):
<hci_event_extended_inquiry_response_get_clock_offset>:
mov    $0xe,%esi
jmp    1030 <little_endian_read_16@plt>

LLVM IR (-O0):
define i32 @hci_event_extended_inquiry_response_get_clock_offset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @little_endian_read_16(i32* %3, i32 14)
ret i32 %4
}

LLVM IR (-O2):
define i32 @hci_event_extended_inquiry_response_get_clock_offset(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 14)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int i = 0, s = 0;
  while (s < 100) {
    s += ++i;
  };
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x64,-0x18(%rbp)
jge    1152 <main+0x42>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 14)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
time_t time(time_t *foo) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  if (foo)
    *foo = tv.tv_sec;
  return tv.tv_sec;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cmpq   $0x0,-0x8(%rbp)
je     113b <time+0x2b>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%eax
test   %rbx,%rbx
je     112f <time+0x1f>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @time(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.timeval
store i32* %0, i32** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load i32*, i32** %2
store i32 %9, i32* %10
br label %11
11: ; preds = %7, %1
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%13 = load i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @time(i32* writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = icmp eq i32* %0, null
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%7 = load i32, i32* %6
br i1 %5, label %9, label %8
8: ; preds = %1
store i32 %7, i32* %0
br label %9
9: ; preds = %1, %8
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ XCB_ATOM_WINDOW;
int /*<<< orphan*/ XCB_ATOM_WM_TRANSIENT_FOR;
int /*<<< orphan*/
xcb_get_property_unchecked(int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/, int);
xcb_get_property_cookie_t
xcb_icccm_get_wm_transient_for_unchecked(xcb_connection_t *c,
                                         xcb_window_t window) {
  return xcb_get_property_unchecked(c, 0, window, XCB_ATOM_WM_TRANSIENT_FOR,
                                    XCB_ATOM_WINDOW, 0, 1);
}


x86 assembly (clang, -O0):
<xcb_icccm_get_wm_transient_for_unchecked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec2(%rip),%rax
mov    (%rax),%r8d
xor    %r9d,%r9d
mov    %r9d,%esi
movl   $0x1,(%rsp)
call   1030 <xcb_get_property_unchecked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_wm_transient_for_unchecked>:
push   %rax
mov    %esi,%edx
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ed5(%rip),%rax
mov    (%rax),%r8d
movl   $0x1,(%rsp)
xor    %esi,%esi
xor    %r9d,%r9d
call   1030 <xcb_get_property_unchecked@plt>
pop    %rcx
ret

LLVM IR (-O0):
@XCB_ATOM_WM_TRANSIENT_FOR = global i32 0
@XCB_ATOM_WINDOW = global i32 0
define i32 @xcb_icccm_get_wm_transient_for_unchecked(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 = load i32, i32* @XCB_ATOM_WM_TRANSIENT_FOR
%8 = load i32, i32* @XCB_ATOM_WINDOW
%9 = call i32 @xcb_get_property_unchecked(i32* %5, i32 0, i32 %6, i32 %7, i32 %8, i32 0, i32 1)
ret i32 %9
}

LLVM IR (-O2):
@XCB_ATOM_WM_TRANSIENT_FOR = global i32 0
@XCB_ATOM_WINDOW = global i32 0
define i32 @xcb_icccm_get_wm_transient_for_unchecked(i32* %0, i32 %1) {
%3 = load i32, i32* @XCB_ATOM_WM_TRANSIENT_FOR
%4 = load i32, i32* @XCB_ATOM_WINDOW
%5 = tail call i32 @xcb_get_property_unchecked(i32* %0, i32 0, i32 %1, i32 %3, i32 %4, i32 0, i32 1)
ret i32 %5
}
/* Variables and functions */
int main_best_match(int, char **);
int main(int argc, char **argv) {
  int istat = main_best_match(argc, argv);
  return istat;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main_best_match@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main_best_match@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_best_match(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 900;
  int b = 3;
  int c;
  c = a / b;
  printf("%d", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x384,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 300)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ problem2();
void problem1() { problem2(); }


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

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

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

LLVM IR (-O2):
define void @problem1() {
%1 = tail call i32 (...) @problem2()
ret void
}
/* Variables and functions */
long CDRclose();
long CDRshutdown(void) { return CDRclose(); }


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

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

LLVM IR (-O0):
define i64 @CDRshutdown() {
%1 = call i64 (...) @CDRclose()
ret i64 %1
}

LLVM IR (-O2):
define i64 @CDRshutdown() {
%1 = tail call i64 (...) @CDRclose()
ret i64 %1
}
/* Variables and functions */
int fillWithMaxUTF8Chars(char *, int, int);
int fillWithMinUTF8Chars(char *, int, int);
int fillWithMinMaxUTF8Chars(char *bufr, int in_len, int max_chars, int is_max) {
  if (is_max)
    return fillWithMaxUTF8Chars(bufr, in_len, max_chars);
  else
    return fillWithMinUTF8Chars(bufr, in_len, max_chars);
}


x86 assembly (clang, -O0):
<fillWithMinMaxUTF8Chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1156 <fillWithMinMaxUTF8Chars+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <fillWithMaxUTF8Chars@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <fillWithMinMaxUTF8Chars+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <fillWithMinUTF8Chars@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillWithMinMaxUTF8Chars>:
test   %ecx,%ecx
je     1129 <fillWithMinMaxUTF8Chars+0x9>
jmp    1030 <fillWithMaxUTF8Chars@plt>
jmp    1040 <fillWithMinUTF8Chars@plt>

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

LLVM IR (-O2):
define i32 @fillWithMinMaxUTF8Chars(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @fillWithMaxUTF8Chars(i8* %0, i32 %1, i32 %2)
br label %10
8: ; preds = %4
%9 = tail call i32 @fillWithMinUTF8Chars(i8* %0, i32 %1, i32 %2)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
int main() {
  int i;
  i = 0;
  do {
    i = i << 2;
  } while (i < 1024 && i > 512);
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x400,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    113a <main+0x3a>
cmpl   $0x200,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1112 <main+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = shl i32 %4, 2
store i32 %5, i32* %2
br label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 1024
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 512
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br i1 %13, label %3, label %14
14: ; preds = %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int LEFT(int i) { return 2 * i + 1; }


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

x86 assembly (clang, -O2):
<LEFT>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @LEFT(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}