xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t getpagesize();
size_t get_page_size(void) {
  static size_t pagesize = 0;
  if (!pagesize) {
    pagesize = getpagesize();
  }
  return pagesize;
}


x86 assembly (clang, -O0):
<get_page_size>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f14(%rip)
jne    1130 <get_page_size+0x20>
mov    $0x0,%al
call   1030 <getpagesize@plt>
mov    %rax,0x2f00(%rip)
mov    0x2ef9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_page_size>:
push   %rax
mov    0x2f18(%rip),%rax
test   %rax,%rax
je     111f <get_page_size+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <getpagesize@plt>
mov    %rax,0x2f03(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@get_page_size.pagesize = internal global i64 0
define i64 @get_page_size() {
%1 = load i64, i64* @get_page_size.pagesize
%2 = icmp ne i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i64 (...) @getpagesize()
store i64 %4, i64* @get_page_size.pagesize
br label %5
5: ; preds = %3, %0
%6 = load i64, i64* @get_page_size.pagesize
ret i64 %6
}

LLVM IR (-O2):
@get_page_size.pagesize = internal unnamed_addr global i64 0
define i64 @get_page_size() {
%1 = load i64, i64* @get_page_size.pagesize
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i64 (...) @getpagesize()
store i64 %4, i64* @get_page_size.pagesize
br label %5
5: ; preds = %3, %0
%6 = phi i64 [ %4, %3 ], [ %1, %0 ]
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t const);
void printf_bits(const size_t *bits, const size_t size) {
  size_t i;
  for (i = 0; i < size; i++) {
    printf("%d", bits[i]);
  }
}


x86 assembly (clang, -O0):
<printf_bits>:
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    115f <printf_bits+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printf_bits+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_bits>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1145 <printf_bits+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printf_bits+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @printf_bits(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %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 i64*, i64** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = load i64, i64* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %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
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printf_bits(i64* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __ieee754_sqrtl(long double x) {
  fputs("__ieee754_sqrtl not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__ieee754_sqrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ieee754_sqrtl>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"__ieee754_sqrtl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_sqrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [33 x i8] c"__ieee754_sqrtl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_sqrtl(x86_fp80 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret x86_fp80 0xK00000000000000000000
}
void glDeleteTextures(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDeleteTextures() {
ret void
}
/* Variables and functions */
double DBL_EPSILON;
int is_zero(double x) { return x <= DBL_EPSILON && x >= -DBL_EPSILON; }


x86 assembly (clang, -O0):
<is_zero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
mov    0x2ed3(%rip),%rax
movsd  (%rax),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jb     1159 <is_zero+0x59>
movsd  -0x8(%rbp),%xmm0
mov    0x2eb4(%rip),%rax
movsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_zero>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
xorpd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@DBL_EPSILON = global double 0.000000e+00
define i32 @is_zero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @DBL_EPSILON
%5 = fcmp ole double %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %2
%8 = load double, double* @DBL_EPSILON
%9 = fneg double %8
%10 = fcmp oge double %7, %9
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@DBL_EPSILON = global double 0.000000e+00
define i32 @is_zero(double %0) {
%2 = load double, double* @DBL_EPSILON
%3 = fcmp oge double %2, %0
%4 = fneg double %2
%5 = fcmp ole double %4, %0
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
char *RCSid() {
  return RCSid("$Id: checkdoc.c,v 1.15 2007/11/13 17:56:15 sfeam Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [55 x i8] c"$Id: checkdoc.c,v 1.15 2007/11/13 17:56:15 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct defined_networks {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ io_error();
int save_defined(struct defined_networks *def, char *filename) {
  io_error();
  return 0;
}


x86 assembly (clang, -O0):
<save_defined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <io_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_defined>:
push   %rax
xor    %eax,%eax
call   1030 <io_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.defined_networks = type { i32 }
define i32 @save_defined(%struct.defined_networks* %0, i8* %1) {
%3 = alloca %struct.defined_networks*
%4 = alloca i8*
store %struct.defined_networks* %0, %struct.defined_networks** %3
store i8* %1, i8** %4
%5 = call i32 (...) @io_error()
ret i32 0
}

LLVM IR (-O2):
%struct.defined_networks = type { i32 }
define i32 @save_defined(%struct.defined_networks* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @io_error()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_tanh();
scalar_t__ tanh(double);
void test_tanh(double d) {
  if (tanh(d) != tanh(d))
    link_failure_tanh();
}


x86 assembly (clang, -O0):
<test_tanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <tanh@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <tanh@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_tanh+0x3c>
mov    $0x0,%al
call   1030 <link_failure_tanh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tanh>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <tanh@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <tanh@plt>
cmp    %rax,%rbx
jne    1149 <test_tanh+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_tanh@plt>

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

LLVM IR (-O2):
define void @test_tanh(double %0) {
%2 = tail call i64 @tanh(double %0)
%3 = tail call i64 @tanh(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_tanh()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int max(int x, int y) {
  if (x > y)
    printf("%d", x);
  else
    printf("%d", y);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113e <max+0x2e>
mov    -0x8(%rbp),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <max+0x3d>
mov    -0xc(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
cmp    %esi,%edi
cmovg  %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 undef
}
/* Variables and functions */
int M_PI;
double sin(double);
double func9(double x) { return sin(x - M_PI / 42); }


x86 assembly (clang, -O0):
<func9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func9>:
mov    0x2ed1(%rip),%rax
movslq (%rax),%rax
imul   $0x30c30c31,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
@M_PI = global i32 0
define double @func9(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = sdiv i32 %4, 42
%6 = sitofp i32 %5 to double
%7 = fsub double %3, %6
%8 = call double @sin(double %7)
ret double %8
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @func9(double %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 42
%4 = sitofp i32 %3 to double
%5 = fsub double %0, %4
%6 = tail call double @sin(double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage() {
  printf("\nUsage:\n   %s\n\n",
         "metadata"
         " <option> <infile> [-license] [-version] [-help]\n");
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"\0AUsage:\0A %s\0A\0A\00"
@.str.1 = [58 x i8] c"metadata <option> <infile> [-license] [-version] [-help]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AUsage:\0A %s\0A\0A\00"
@.str.1 = [58 x i8] c"metadata <option> <infile> [-license] [-version] [-help]\0A\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ branch(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  branch(0);
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <branch@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <branch@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @branch(i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @branch(i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
OP(fd, ab) { op_ab(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ab()
ret i32 undef
}
int clamp(int x, int a, int b) {
  if (x < a)
    x = a;
  if (x > b)
    x = b;
  return x;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    111f <clamp+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1131 <clamp+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ds_free_callback(void *data, void *param) {
  if (data)
    free(data);
  return 0;
}


x86 assembly (clang, -O0):
<ds_free_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <ds_free_callback+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds_free_callback>:
test   %rdi,%rdi
je     111f <ds_free_callback+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ds_free_callback(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @ds_free_callback(i8* %0, i8* nocapture readnone %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret i32 0
}
int ar71xx_pci_init(unsigned nr_irqs, struct ar71xx_pci_irq *map) { return 0; }


x86 assembly (clang, -O0):
<ar71xx_pci_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ar71xx_pci_irq = type opaque
define i32 @ar71xx_pci_init(i32 %0, %struct.ar71xx_pci_irq* %1) {
%3 = alloca i32
%4 = alloca %struct.ar71xx_pci_irq*
store i32 %0, i32* %3
store %struct.ar71xx_pci_irq* %1, %struct.ar71xx_pci_irq** %4
ret i32 0
}

LLVM IR (-O2):
%struct.ar71xx_pci_irq = type opaque
define i32 @ar71xx_pci_init(i32 %0, %struct.ar71xx_pci_irq* nocapture readnone %1) {
ret i32 0
}
void USART3_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @USART3_IRQHandler() {
ret void
}
void foo_2_1_1_1_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_1_2_1_2_1() {
ret void
}
int ld_blg_rc1(long double a1) { return (__builtin_islessgreater(a1, 100)); }


x86 assembly (clang, -O0):
<ld_blg_rc1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blg_rc1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setne  %al
ret

LLVM IR (-O0):
define i32 @ld_blg_rc1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp one x86_fp80 %3, 0xK4005C800000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_blg_rc1(x86_fp80 %0) {
%2 = fcmp one x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
void setval_267(unsigned *p) { *p = 3224945289U; }


x86 assembly (clang, -O0):
<setval_267>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xc038c289,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval_267>:
movl   $0xc038c289,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_267(i32* nocapture writeonly %0) {
store i32 -1070022007, i32* %0
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  printf("Ingrese un numero para calcular su factorial:\nn=");
  scanf("%d", &n);
  printf("%d!=%d\n", n, factorial(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1030 <factorial@plt>
lea    0xece(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Ingrese un numero para calcular su factorial:\0An=\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"%d!=%d\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %4, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Ingrese un numero para calcular su factorial:\0An=\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"%d!=%d\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int errno;
int Platform_Error(void) {
  int _o_result;
  _o_result = errno;
  return _o_result;
}


x86 assembly (clang, -O0):
<Platform_Error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Platform_Error>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @Platform_Error() {
%1 = load i32, i32* @errno
ret i32 %1
}
void CS_start(void) { ; }


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

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

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

LLVM IR (-O2):
define void @CS_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kore_parse_config_file(char *);
int configure_include(char *path) {
  kore_parse_config_file(path);
  return (1);
}


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

x86 assembly (clang, -O2):
<configure_include>:
push   %rax
call   1030 <kore_parse_config_file@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @configure_include(i8* %0) {
%2 = tail call i32 @kore_parse_config_file(i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t HibernateRTCMatchGet(uint32_t ui32Match) {
  ;
  return ((*((volatile uint32_t *)(0x400FC004))));
}


x86 assembly (clang, -O0):
<HibernateRTCMatchGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x400fc004,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCMatchGet>:
mov    %edi,-0x4(%rsp)
mov    0x400fc004,%eax
ret

LLVM IR (-O0):
define i32 @HibernateRTCMatchGet(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 1074774020 to i32*)
ret i32 %3
}

LLVM IR (-O2):
define i32 @HibernateRTCMatchGet(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 1074774020 to i32*)
ret i32 %3
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ node_free(struct node *);
void heap_free(struct node **heap, int nr) {
  if (nr <= 0)
    return;
  int i;
  for (i = 0; i < nr; i++)
    node_free(heap[i]);
}


x86 assembly (clang, -O0):
<heap_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     112e <heap_free+0x1e>
jmp    1160 <heap_free+0x50>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <heap_free+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <node_free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <heap_free+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_free>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <heap_free+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <node_free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <heap_free+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @heap_free(%struct.node** %0, i32 %1) {
%3 = alloca %struct.node**
%4 = alloca i32
%5 = alloca i32
store %struct.node** %0, %struct.node*** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %24
9: ; preds = %2
store i32 0, i32* %5
br label %10
10: ; preds = %21, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load %struct.node**, %struct.node*** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds %struct.node*, %struct.node** %15, i64 %17
%19 = load %struct.node*, %struct.node** %18
%20 = call i32 @node_free(%struct.node* %19)
br label %21
21: ; preds = %14
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %10
24: ; preds = %8, %10
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @heap_free(%struct.node** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds %struct.node*, %struct.node** %0, i64 %7
%9 = load %struct.node*, %struct.node** %8
%10 = tail call i32 @node_free(%struct.node* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_printmsg(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void error_printmsgln(int code, int line) {
  error_printmsg(code);
  if (code)
    fprintf(stderr, "at line %d\n", line);
}


x86 assembly (clang, -O0):
<error_printmsgln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <error_printmsg@plt>
cmpl   $0x0,-0x4(%rbp)
je     1158 <error_printmsgln+0x38>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xead(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_printmsgln>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <error_printmsg@plt>
test   %ebp,%ebp
je     114d <error_printmsgln+0x2d>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"at line %d\0A\00"
define void @error_printmsgln(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @error_printmsg(i32 %5)
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i32, i32* %4
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"at line %d\0A\00"
define void @error_printmsgln(i32 %0, i32 %1) {
%3 = tail call i32 @error_printmsg(i32 %0)
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assign(int *, int);
int /*<<< orphan*/ free(int *);
int *unsafe_allocate();
void function_call_can_return_null_pointer() {
  int *p = NULL;
  p = unsafe_allocate();
  assign(p, 42);
  free(p);
}


x86 assembly (clang, -O0):
<function_call_can_return_null_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <unsafe_allocate@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2a,%esi
call   1050 <assign@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_call_can_return_null_pointer>:
push   %rbx
xor    %eax,%eax
call   1040 <unsafe_allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2a,%esi
call   1050 <assign@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @function_call_can_return_null_pointer() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = call i32* (...) @unsafe_allocate()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @assign(i32* %3, i32 42)
%5 = load i32*, i32** %1
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @function_call_can_return_null_pointer() {
%1 = tail call i32* (...) @unsafe_allocate()
%2 = tail call i32 @assign(i32* %1, i32 42)
%3 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t, i, j, k;
  char str1[2001], str2[2001], str3[2001];
  scanf("%d", &t);
  while (t--) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x17b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     114b <main+0x3b>
jmp    1132 <main+0x22>
xor    %eax,%eax
add    $0x17b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@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
%5 = alloca i32
%6 = alloca [2001 x i8]
%7 = alloca [2001 x i8]
%8 = alloca [2001 x i8]
store i32 0, i32* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %10
10: ; preds = %14, %0
%11 = load i32, i32* %2
%12 = add nsw i32 %11, -1
store i32 %12, i32* %2
%13 = icmp ne i32 %11, 0
br i1 %13, label %14, label %15
14: ; preds = %10
br label %10
15: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ArbiterP__0__ResourceDefaultOwner__default__granted();
void ArbiterP__0__ResourceDefaultOwner__granted(void) {
  ArbiterP__0__ResourceDefaultOwner__default__granted();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__0__ResourceDefaultOwner__granted() {
%1 = tail call i32 (...) @ArbiterP__0__ResourceDefaultOwner__default__granted()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdout;
int vfscanf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vscanf(const char *restrict format, va_list args) {
  return vfscanf(stdout, format, args);
}


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

x86 assembly (clang, -O2):
<vscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfscanf@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @vscanf(i8* noalias %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @vfscanf(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @vscanf(i8* noalias %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfscanf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int k;
  int n;
  if (!(i == 0 && k == 0))
    return 0;
  while (i < n) {
    i++;
    k++;
  }
  assert(k >= n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <main+0x23>
cmpl   $0x0,-0xc(%rbp)
je     113f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1181 <main+0x71>
jmp    1144 <main+0x34>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1167 <main+0x57>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x34>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void gtk_menu_item_new_with_mnemonic() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_item_new_with_mnemonic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ clang_analyzer_warnIfReached();
void condition_constrained_true_in_loop() {
  int i = 0;
  while (i < 50) {
    clang_analyzer_eval(i < 50);
    ++i;
  }
  clang_analyzer_warnIfReached();
}


x86 assembly (clang, -O0):
<condition_constrained_true_in_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1158 <condition_constrained_true_in_loop+0x38>
cmpl   $0x32,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <condition_constrained_true_in_loop+0xf>
mov    $0x0,%al
call   1040 <clang_analyzer_warnIfReached@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_constrained_true_in_loop>:
push   %rbx
mov    $0x32,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0xffffffff,%ebx
jne    1130 <condition_constrained_true_in_loop+0x10>
xor    %eax,%eax
pop    %rbx
jmp    1040 <clang_analyzer_warnIfReached@plt>

LLVM IR (-O0):
define void @condition_constrained_true_in_loop() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 50
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 50
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %2
12: ; preds = %2
%13 = call i32 (...) @clang_analyzer_warnIfReached()
ret void
}

LLVM IR (-O2):
define void @condition_constrained_true_in_loop() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @clang_analyzer_eval(i32 1)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 50
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 (...) @clang_analyzer_warnIfReached()
ret void
}
unsigned hash_name(const char *name) {
  unsigned r = 0;
  while (*name) {
    r <<= 1;
    if (r & 0x400) {
      r ^= 0x401;
    }
    r += (unsigned char)*(name++);
  }
  return r & 0x3FF;
}


x86 assembly (clang, -O0):
<hash_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <hash_name+0x5e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
je     1141 <hash_name+0x41>
mov    -0xc(%rbp),%eax
xor    $0x401,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_name+0xf>
mov    -0xc(%rbp),%eax
and    $0x3ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_name>:
mov    (%rdi),%cl
test   %cl,%cl
je     1139 <hash_name+0x39>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,1),%edx
mov    %edx,%esi
xor    $0x401,%esi
test   $0x200,%eax
cmove  %edx,%esi
movzbl %cl,%eax
add    %esi,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_name+0x10>
and    $0x3ff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %24
8: ; preds = %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = and i32 %11, 1024
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i32, i32* %3
%16 = xor i32 %15, 1025
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %8
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
%20 = load i8, i8* %18
%21 = zext i8 %20 to i32
%22 = load i32, i32* %3
%23 = add i32 %22, %21
store i32 %23, i32* %3
br label %4
24: ; preds = %4
%25 = load i32, i32* %3
%26 = and i32 %25, 1023
ret i32 %26
}

LLVM IR (-O2):
define i32 @hash_name(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %20, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %16, %4 ], [ %2, %1 ]
%6 = phi i32 [ %15, %4 ], [ 0, %1 ]
%7 = phi i8* [ %13, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = and i32 %6, 512
%10 = icmp eq i32 %9, 0
%11 = xor i32 %8, 1025
%12 = select i1 %10, i32 %8, i32 %11
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = zext i8 %5 to i32
%15 = add i32 %12, %14
%16 = load i8, i8* %13
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %4
18: ; preds = %4
%19 = and i32 %15, 1023
br label %20
20: ; preds = %18, %1
%21 = phi i32 [ 0, %1 ], [ %19, %18 ]
ret i32 %21
}
int AddReg(int a, int b) {
  asm("add %%ebx, %%eax" : "=a"(a) : "b"(b), "a"(a));
  return a;
}


x86 assembly (clang, -O0):
<AddReg>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%ebx
mov    -0xc(%rbp),%eax
add    %ebx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddReg>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%eax
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @AddReg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 asm "add %ebx, %eax", "={ax},{bx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @AddReg(i32 %0, i32 %1) {
%3 = tail call i32 asm "add %ebx, %eax", "={ax},{bx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ strncmp(char *, char *, int);
void strncmp_equal() {
  Assert_real((strncmp("equal", "equal", 5) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/string/strncmp.c",
              9, ("Should be == 0"));
}


x86 assembly (clang, -O0):
<strncmp_equal>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
mov    %rsi,%rdi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebb(%rip),%rsi
mov    $0x9,%edx
lea    0xf53(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_equal>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec1(%rip),%rsi
lea    0xf5e(%rip),%rcx
mov    $0x9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"equal\00"
@.str.1 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/strncmp.c\00"
@.str.2 = [15 x i8] c"Should be == 0\00"
define void @strncmp_equal() {
%1 = call i64 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i32 9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"equal\00"
@.str.1 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/strncmp.c\00"
@.str.2 = [15 x i8] c"Should be == 0\00"
define void @strncmp_equal() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i32 9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int yyselect();
null() {
  switch (yyselect()) {
  case 3: {
  } break;
  }
}


x86 assembly (clang, -O0):
<null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
sub    $0x3,%eax
jne    1132 <null+0x22>
jmp    112d <null+0x1d>
jmp    1132 <null+0x22>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @null() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %4 [
i32 3, label %3
]
3: ; preds = %0
br label %4
4: ; preds = %0, %3
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @null() {
%1 = tail call i32 (...) @yyselect()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
__attribute__((__unused__)) ptrdiff_t __nacl_tp_tdb_offset(size_t tdb_size) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @__nacl_tp_tdb_offset(i64 %0) {
ret i32 0
}
void gtk_text_buffer_get_iter_at_mark() {}


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

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

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

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