xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ say_hi();
int main() {
  printf("Hello from C\n");
  say_hi();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <say_hi@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <say_hi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello from C\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @say_hi()
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello from C\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @say_hi()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GaussJordan(int, double *, double *, double *);
extern void SolveGJ(int n, double *A, double *x, double *b) {
  GaussJordan(n, A, x, b);
  return;
}


x86 assembly (clang, -O0):
<SolveGJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <GaussJordan@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SolveGJ>:
jmp    1030 <GaussJordan@plt>

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

LLVM IR (-O2):
define void @SolveGJ(i32 %0, double* %1, double* %2, double* %3) {
%5 = tail call i32 @GaussJordan(i32 %0, double* %1, double* %2, double* %3)
ret void
}
/* Variables and functions */
const char *strchr(const char *s, int c) {
  size_t i = 0;
  int ch;
  while ((ch = s[i]) != 0) {
    if (ch == c) {
      return s + i;
    }
    i++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1159 <strchr+0x59>
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1148 <strchr+0x48>
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <strchr+0x61>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <strchr+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %13, %10 ], [ %3, %2 ]
%7 = phi i64 [ %11, %10 ], [ 0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = add i64 %7, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %17, label %5
15: ; preds = %5
%16 = getelementptr inbounds i8, i8* %0, i64 %7
br label %17
17: ; preds = %10, %2, %15
%18 = phi i8* [ %16, %15 ], [ null, %2 ], [ null, %10 ]
ret i8* %18
}
int evaluate_ctr_for_aes(void) {
  _log_fn(5, (1u << 1), __PRETTY_FUNCTION__,
          "This version of OpenSSL has a slow implementation of "
          "counter mode; not using it.");
  return 0;
}


x86 assembly (clang, -O0):
<evaluate_ctr_for_aes>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x2,%esi
lea    0xedb(%rip),%rdx
lea    0xef3(%rip),%rcx
mov    $0x0,%al
call   1030 <_log_fn@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaluate_ctr_for_aes>:
push   %rax
lea    0xee8(%rip),%rdx
lea    0xf00(%rip),%rcx
mov    $0x5,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <_log_fn@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__PRETTY_FUNCTION__.evaluate_ctr_for_aes = [31 x i8] c"int evaluate_ctr_for_aes(void)\00"
@.str = [81 x i8] c"This version of OpenSSL has a slow implementation of counter mode; not using it.\00"
define i32 @evaluate_ctr_for_aes() {
%1 = call i32 (i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_log_fn to i32 (i32, i32, i8*, i8*, ...)*)(i32 5, i32 2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @__PRETTY_FUNCTION__.evaluate_ctr_for_aes, i64 0, i64 0), i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__PRETTY_FUNCTION__.evaluate_ctr_for_aes = [31 x i8] c"int evaluate_ctr_for_aes(void)\00"
@.str = [81 x i8] c"This version of OpenSSL has a slow implementation of counter mode; not using it.\00"
define i32 @evaluate_ctr_for_aes() {
%1 = tail call i32 (i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_log_fn to i32 (i32, i32, i8*, i8*, ...)*)(i32 5, i32 2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @__PRETTY_FUNCTION__.evaluate_ctr_for_aes, i64 0, i64 0), i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSTRL(const char *the_title) { return any_decrqss(the_title, "\"u"); }


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

x86 assembly (clang, -O2):
<rpt_DECSTRL>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\22u\00"
define i32 @rpt_DECSTRL(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("\n%d", n * n);
  printf("\n%d", n * n * n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
imul   -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
imul   -0x4(%rbp),%esi
imul   -0x4(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
imul   %esi,%esi
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%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)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
int f_i12(int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7,
          int i8, int i9, int i10, int i11) {
  return i11;
}


x86 assembly (clang, -O0):
<f_i12>:
push   %rbp
mov    %rsp,%rbp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    0x38(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_i12>:
mov    0x30(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @f_i12(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 returned %11) {
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ mcfioC_Init();
void mcfio_init_(void) { mcfioC_Init(); }


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

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

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

LLVM IR (-O2):
define void @mcfio_init_() {
%1 = tail call i32 (...) @mcfioC_Init()
ret void
}
int testParamTaintAssign(char *ptr) { *ptr = 1; }


x86 assembly (clang, -O0):
<testParamTaintAssign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testParamTaintAssign>:
movb   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @testParamTaintAssign(i8* nocapture writeonly %0) {
store i8 1, i8* %0
ret i32 undef
}
void stdio_write_menu(void) {}


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

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

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

LLVM IR (-O2):
define void @stdio_write_menu() {
ret void
}
/* Variables and functions */
int stat_main(int, char **);
int main(int argc, char *argv[]) { return stat_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <stat_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @stat_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double rand1() { return ((float)rand()) / ((float)RAND_MAX); }


x86 assembly (clang, -O0):
<rand1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand1>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand1() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
%6 = fpext float %5 to double
ret double %6
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand1() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
%6 = fpext float %5 to double
ret double %6
}
int test_imm_5Bint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x5B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Bint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 390842023936
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ transfer(int, int /*<<< orphan*/);
void f_call(void) { transfer(0x88000000, 0); }


x86 assembly (clang, -O0):
<f_call>:
push   %rbp
mov    %rsp,%rbp
mov    $0x88000000,%edi
xor    %esi,%esi
call   1030 <transfer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_call>:
mov    $0x88000000,%edi
xor    %esi,%esi
jmp    1030 <transfer@plt>

LLVM IR (-O0):
define void @f_call() {
%1 = call i32 @transfer(i32 -2013265920, i32 0)
ret void
}

LLVM IR (-O2):
define void @f_call() {
%1 = tail call i32 @transfer(i32 -2013265920, i32 0)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
int stat(char const *, struct stat *);
bool is_file(const char *path) {
  struct stat st;
  int err;
  err = stat(path, &st);
  if (err)
    return false;
  return S_ISREG(st.st_mode);
}


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1152 <is_file+0x32>
movl   $0x0,-0x4(%rbp)
jmp    115d <is_file+0x3d>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
je     1131 <is_file+0x11>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%edi
pop    %rax
jmp    1040 <S_ISREG@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ mav(int, int);
void lib_mav(int mtrnum, int v) { mav(mtrnum, v); }


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

x86 assembly (clang, -O2):
<lib_mav>:
jmp    1030 <mav@plt>

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

LLVM IR (-O2):
define void @lib_mav(i32 %0, i32 %1) {
%3 = tail call i32 @mav(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_next(int /*<<< orphan*/ *);
void null_ptr_deref2_bad() { check_next(NULL); }


x86 assembly (clang, -O0):
<null_ptr_deref2_bad>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <check_next@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_ptr_deref2_bad>:
xor    %edi,%edi
jmp    1030 <check_next@plt>

LLVM IR (-O0):
define void @null_ptr_deref2_bad() {
%1 = call i32 @check_next(i32* null)
ret void
}

LLVM IR (-O2):
define void @null_ptr_deref2_bad() {
%1 = tail call i32 @check_next(i32* null)
ret void
}
/* Variables and functions */
int getFactorial(int);
int getBinomialCoefficient(int n, int k) {
  int nFact = getFactorial(n);
  int kFact = getFactorial(k);
  int n_kFact = getFactorial(n - k);
  return nFact / (kFact * n_kFact);
}


x86 assembly (clang, -O0):
<getBinomialCoefficient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getFactorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <getFactorial@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <getFactorial@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cltd
idiv   %ecx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBinomialCoefficient>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <getFactorial@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <getFactorial@plt>
mov    %eax,%r15d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <getFactorial@plt>
mov    %eax,%ecx
imul   %r15d,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getBinomialCoefficient(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @getFactorial(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @getFactorial(i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = call i32 @getFactorial(i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = mul nsw i32 %17, %18
%20 = sdiv i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @getBinomialCoefficient(i32 %0, i32 %1) {
%3 = tail call i32 @getFactorial(i32 %0)
%4 = tail call i32 @getFactorial(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i32 @getFactorial(i32 %5)
%7 = mul nsw i32 %6, %4
%8 = sdiv i32 %3, %7
ret i32 %8
}
void _gp_Unwind() {}


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

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

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

LLVM IR (-O2):
define void @_gp_Unwind() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ease8InOutCubic(int /*<<< orphan*/);
int /*<<< orphan*/ triwave8(int /*<<< orphan*/);
uint8_t cubicwave8(uint8_t in) { return ease8InOutCubic(triwave8(in)); }


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

x86 assembly (clang, -O2):
<cubicwave8>:
push   %rax
call   1040 <triwave8@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ease8InOutCubic@plt>

LLVM IR (-O0):
define i32 @cubicwave8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @triwave8(i32 %3)
%5 = call i32 @ease8InOutCubic(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @cubicwave8(i32 %0) {
%2 = tail call i32 @triwave8(i32 %0)
%3 = tail call i32 @ease8InOutCubic(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  if (num >= 3500)
    printf("YES");
  else
    printf("NO");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xdac,-0x8(%rbp)
jl     115d <main+0x3d>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x49>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0xdac,0x4(%rsp)
lea    0xec2(%rip),%rax
lea    0xebf(%rip),%rdi
cmovge %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\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)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 3499
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *diminuto_string_basename(const char *argvzero) {
  const char *basename;
  return ((basename = strrchr(argvzero, '/')) == (char *)0) ? argvzero
                                                            : basename + 1;
}


x86 assembly (clang, -O0):
<diminuto_string_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1145 <diminuto_string_basename+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <diminuto_string_basename+0x41>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_string_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @diminuto_string_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %2
br label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
br label %12
12: ; preds = %9, %7
%13 = phi i8* [ %8, %7 ], [ %11, %9 ]
ret i8* %13
}

LLVM IR (-O2):
define i8* @diminuto_string_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ DestroyTargetUDPInterface(void *);
void DestroyUDPInterface(void *hl) { DestroyTargetUDPInterface(hl); }


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

x86 assembly (clang, -O2):
<DestroyUDPInterface>:
jmp    1030 <DestroyTargetUDPInterface@plt>

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

LLVM IR (-O2):
define void @DestroyUDPInterface(i8* %0) {
%2 = tail call i32 @DestroyTargetUDPInterface(i8* %0)
ret void
}
void __kern_isrvec(unsigned char __intno, void (*__israddr)(void)) {
  void (**ivec)(void) = 0x0000;
  *(ivec + __intno) = __israddr;
}


x86 assembly (clang, -O0):
<__kern_isrvec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
movzbl -0x1(%rbp),%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__kern_isrvec(i8 zeroext %0, void ()* %1) {
%3 = alloca i8
%4 = alloca void ()*
%5 = alloca void ()**
store i8 %0, i8* %3
store void ()* %1, void ()** %4
store void ()** null, void ()*** %5
%6 = load void ()*, void ()** %4
%7 = load void ()**, void ()*** %5
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds void ()*, void ()** %7, i64 %10
store void ()* %6, void ()** %11
ret void
}

LLVM IR (-O2):
define void @__kern_isrvec(i8 zeroext %0, void ()* nocapture readnone %1) {
%3 = zext i8 %0 to i64
%4 = getelementptr inbounds void ()*, void ()** null, i64 %3
store void ()* poison, void ()** %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void cccsp_outfilehook_free(void *hook) {
  if (!hook) {
    return;
  }
  sfree(hook);
}


x86 assembly (clang, -O0):
<cccsp_outfilehook_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <cccsp_outfilehook_free+0x1c>
jmp    1135 <cccsp_outfilehook_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <sfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cccsp_outfilehook_free>:
test   %rdi,%rdi
je     111a <cccsp_outfilehook_free+0xa>
jmp    1030 <sfree@plt>
ret

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

LLVM IR (-O2):
define void @cccsp_outfilehook_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t return_uint8() { return 42; }


x86 assembly (clang, -O0):
<return_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_uint8>:
mov    $0x2a,%eax
ret

LLVM IR (-O0):
define i32 @return_uint8() {
ret i32 42
}

LLVM IR (-O2):
define i32 @return_uint8() {
ret i32 42
}
int compare(unsigned int x, unsigned int y) {
  if (x == y)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <compare+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1129 <compare+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @compare(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 eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %11
10: ; preds = %2
store i32 1, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ pr_array(int *, int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int array[] = {10, -111, -52, 333, -2, 200, 55, 22, 1, 3};
  int size;
  extern void sort();
  size = sizeof(array) / sizeof(int);
  printf("size=%d\n", size);
  pr_array(array, size);
  sort(array, size);
  pr_array(array, size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
movl   $0xa,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <pr_array@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    $0x0,%al
call   1050 <sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <pr_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <pr_array@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <sort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <pr_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.array = [10 x i32] [i32 10, i32 -111, i32 -52, i32 333, i32 -2, i32 200, i32 55, i32 22, i32 1, i32 3]
@.str = [9 x i8] c"size=%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @pr_array(i32* %4, i32 10)
%6 = call i32 @pr_array(i32* %4, i32 10)
ret i32 0
}
int is_bigendian() {
  static int n = 1;
  if (*(char *)&n == 1) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<is_bigendian>:
push   %rbp
mov    %rsp,%rbp
movsbl 0x2f15(%rip),%eax
cmp    $0x1,%eax
jne    1120 <is_bigendian+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1127 <is_bigendian+0x27>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@is_bigendian.n = internal global i32 1
define i32 @is_bigendian() {
%1 = alloca i32
%2 = load i8, i8* bitcast (i32* @is_bigendian.n to i8*)
%3 = sext i8 %2 to i32
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_bigendian() {
ret i32 0
}
/* Type definitions */
struct event_signal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ es_fire(struct event_signal *, int);
void es_signal(struct event_signal *es) { es_fire(es, false); }


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

x86 assembly (clang, -O2):
<es_signal>:
xor    %esi,%esi
jmp    1030 <es_fire@plt>

LLVM IR (-O0):
%struct.event_signal = type { i32 }
define void @es_signal(%struct.event_signal* %0) {
%2 = alloca %struct.event_signal*
store %struct.event_signal* %0, %struct.event_signal** %2
%3 = load %struct.event_signal*, %struct.event_signal** %2
%4 = call i32 @es_fire(%struct.event_signal* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.event_signal = type { i32 }
define void @es_signal(%struct.event_signal* %0) {
%2 = tail call i32 @es_fire(%struct.event_signal* %0, i32 0)
ret void
}
int _mon_getc(int canblock) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_mon_getc(i32 %0) {
ret i32 0
}
/* Type definitions */
struct umsgpack_packer_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct umsgpack_packer_buf *);
int umsgpack_free(struct umsgpack_packer_buf *buf) {
  free(buf);
  buf = NULL;
  return 1;
}


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

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

LLVM IR (-O0):
%struct.umsgpack_packer_buf = type { i32 }
define i32 @umsgpack_free(%struct.umsgpack_packer_buf* %0) {
%2 = alloca %struct.umsgpack_packer_buf*
store %struct.umsgpack_packer_buf* %0, %struct.umsgpack_packer_buf** %2
%3 = load %struct.umsgpack_packer_buf*, %struct.umsgpack_packer_buf** %2
%4 = call i32 @free(%struct.umsgpack_packer_buf* %3)
store %struct.umsgpack_packer_buf* null, %struct.umsgpack_packer_buf** %2
ret i32 1
}

LLVM IR (-O2):
%struct.umsgpack_packer_buf = type { i32 }
define i32 @umsgpack_free(%struct.umsgpack_packer_buf* nocapture %0) {
%2 = tail call i32 @free(%struct.umsgpack_packer_buf* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int change;
  scanf("%d", &change);
  int cdstr(int);
  cdstr(change);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <cdstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <cdstr@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @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)
%4 = load i32, i32* %1
%5 = call i32 @cdstr(i32 %4)
ret void
}
void gravity_calculate_acceleration() {}


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

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

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

LLVM IR (-O2):
define void @gravity_calculate_acceleration() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_swap_first(char **, char, char);
char *strtok(char *, char *);
char *cmd_parse_line(char **line) {
  char *chunk = strtok(*line, "\t ");
  chunk = strtok(NULL, "\t ");
  if (chunk != NULL) {
    gen_swap_first(&chunk, '\n', '\0');
  }
  return chunk;
}


x86 assembly (clang, -O0):
<cmd_parse_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb2(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <cmd_parse_line+0x52>
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1040 <gen_swap_first@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_parse_line>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rdi
lea    0xed2(%rip),%r14
mov    %r14,%rsi
call   1030 <strtok@plt>
xor    %ebx,%ebx
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     115e <cmd_parse_line+0x3e>
mov    %rsp,%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1040 <gen_swap_first@plt>
mov    (%rsp),%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"\09 \00"
define i8* @cmd_parse_line(i8** nocapture %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = load i8*, i8** %0
%5 = tail call i8* @strtok(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %2
%7 = icmp eq i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @gen_swap_first(i8** %2, i8 signext 10, i8 signext 0)
%10 = load i8*, i8** %2
br label %11
11: ; preds = %8, %1
%12 = phi i8* [ %10, %8 ], [ null, %1 ]
ret i8* %12
}
/* Variables and functions */
int _str_split(char *, char const *, char ***, int /*<<< orphan*/);
extern char **str_split_big(char *s, const char *delims, int *parts) {
  char **res = NULL;
  *parts = _str_split(s, delims, &res, 0);
  return res;
}


x86 assembly (clang, -O0):
<str_split_big>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <_str_split@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_split_big>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdx
xor    %ecx,%ecx
call   1030 <_str_split@plt>
mov    %eax,(%rbx)
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8** @str_split_big(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = alloca i8**
%5 = bitcast i8*** %4 to i8*
store i8** null, i8*** %4
%6 = call i32 @_str_split(i8* %0, i8* %1, i8*** %4, i32 0)
store i32 %6, i32* %2
%7 = load i8**, i8*** %4
ret i8** %7
}
void test15() {
  int i = 0;
  switch (1) {
  case 0:
    i = 0;
    break;
  case 2:
    i++;
    break;
  }
}


x86 assembly (clang, -O0):
<test15>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test15() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
int main() {
  printf("S=%zu I=%zu L=%zu LL=%zu P=%zu\n", sizeof(short), sizeof(int),
         sizeof(long), sizeof(long long), sizeof(char *));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
mov    $0x8,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"S=%zu I=%zu L=%zu LL=%zu P=%zu\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 2, i32 4, i32 8, i32 8, i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"S=%zu I=%zu L=%zu LL=%zu P=%zu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 2, i32 4, i32 8, i32 8, i32 8)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void I2CSlaveIntClear(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000818))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x818,%eax
cltq
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntClear>:
movslq %edi,%rax
movl   $0x1,0x818(%rax)
ret

LLVM IR (-O0):
define void @I2CSlaveIntClear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2072
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntClear(i32 %0) {
%2 = add nsw i32 %0, 2072
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 1, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputc(int, int /*<<< orphan*/ *);
int dofputc(int ch, void *stream) {
  FILE *str = (FILE *)stream;
  return fputc(ch, str);
}


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

x86 assembly (clang, -O2):
<dofputc>:
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define i32 @dofputc(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @fputc(i32 %0, i32* %3)
ret i32 %4
}
/* Variables and functions */
double RAND_MAX;
double rand();
int damage_bit(void) { return (int)(7 + (40.0 * (rand() / (RAND_MAX + 1.0)))); }


x86 assembly (clang, -O0):
<damage_bit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xeed(%rip),%xmm1
mov    0x2ebe(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<damage_bit>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  0xed1(%rip),%xmm0
addsd  0xed1(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @damage_bit() {
%1 = call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %1, %3
%5 = call double @llvm.fmuladd.f64(double 4.000000e+01, double %4, double 7.000000e+00)
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @damage_bit() {
%1 = tail call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %1, %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double 4.000000e+01, double 7.000000e+00)
%6 = fptosi double %5 to i32
ret i32 %6
}
void js_ConsoleDisabled() {}


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

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

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

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