xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char *argv[], char *envp[]) {
  char c[1024];
  printf("type some character \n");
  scanf("%s", c);
  printf("read char is %s \n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x420(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x420(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"type some character \0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"read char is %s \0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca [1024 x i8]
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"read char is %s \0A\00"
@str = [21 x i8] c"type some character \00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}
void get_key_info(int keytype, int *keylen, int *ivlen) {}


x86 assembly (clang, -O0):
<get_key_info>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @get_key_info(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
ret void
}

LLVM IR (-O2):
define void @get_key_info(i32 %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Type definitions */
struct message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ nosmime();
struct message *smime_decrypt(struct message *m, const char *to, const char *cc,
                              int signcall) {
  nosmime();
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.message = type { i32 }
define %struct.message* @smime_decrypt(%struct.message* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.message*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.message* %0, %struct.message** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = call i32 (...) @nosmime()
ret %struct.message* null
}

LLVM IR (-O2):
%struct.message = type { i32 }
define noalias %struct.message* @smime_decrypt(%struct.message* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 (...) @nosmime()
ret %struct.message* null
}
void delay(unsigned int z) {
  unsigned int x = 0, y = 0;
  for (; x < z; x++) {
    for (; y < 111; y++)
      ;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1156 <delay+0x56>
jmp    1126 <delay+0x26>
cmpl   $0x6f,-0xc(%rbp)
jae    1143 <delay+0x43>
jmp    1135 <delay+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <delay+0x26>
jmp    1148 <delay+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <delay+0x15>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
double symbolsToSeconds(double syms) { return (syms * 16.0) / 1000000.0; }


x86 assembly (clang, -O0):
<symbolsToSeconds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbolsToSeconds>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @symbolsToSeconds(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.600000e+01
%5 = fdiv double %4, 1.000000e+06
ret double %5
}

LLVM IR (-O2):
define double @symbolsToSeconds(double %0) {
%2 = fmul double %0, 1.600000e+01
%3 = fdiv double %2, 1.000000e+06
ret double %3
}
void grace_move_legend_up(double *legend_view_y, double up_increment) {
  *legend_view_y = *legend_view_y + up_increment;
}


x86 assembly (clang, -O0):
<grace_move_legend_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<grace_move_legend_up>:
addsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @grace_move_legend_up(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fadd double %6, %7
%9 = load double*, double** %3
store double %8, double* %9
ret void
}

LLVM IR (-O2):
define void @grace_move_legend_up(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fadd double %3, %1
store double %4, double* %0
ret void
}
void printsbuf(buf) char *buf;
{ buf = buf; }


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

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

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

LLVM IR (-O2):
define void @printsbuf(i8* nocapture %0) {
ret void
}
void setsoftnet() {}


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

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

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

LLVM IR (-O2):
define void @setsoftnet() {
ret void
}
/* Variables and functions */
int main1();
int main(void) { return main1(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <main1@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @main1()
ret i32 %2
}

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

/* Variables and functions */
int chinese_remainder(int *, int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n[] = {3, 5, 7};
  int a[] = {2, 3, 2};
  printf("%d\n", chinese_remainder(n, a, sizeof(n) / sizeof(n[0])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec0(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x3,%edx
call   1040 <chinese_remainder@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x20(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x18(%rsp)
mov    0xed4(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xec1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x3,%edx
call   1040 <chinese_remainder@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.n = [3 x i32] [i32 3, i32 5, i32 7]
@__const.main.a = [3 x i32] [i32 2, i32 3, i32 2]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @chinese_remainder(i32* %5, i32* %6, i32 3)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
void pci_iov_release(struct pci_dev *dev) {}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @pci_iov_release(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_iov_release(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_get_standard_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 0;
  ptos[1] = 1;
  fail = _ada_use_c2phc(619, ptos, &n, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_get_standard_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26b,%edi
lea    -0x4(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_get_standard_target>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movabs $0x100000000,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26b,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_get_standard_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 0, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 1, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc(i32 619, i32* %9, i32* %3, double* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_get_standard_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 1, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 619, i32* %6, i32* %3, double* %1)
ret i32 %8
}
/* Variables and functions */
int bar();
__attribute__((__always___)) int foo(void) { return bar(); }


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

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

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

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
void INT_Excep_MTU1_TGIU1(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strmode(int /*<<< orphan*/, char *);
void printmodes(mode_t md) {
  char buf[10];
  (void)strmode(md, buf);
  printf("%s", buf);
}


x86 assembly (clang, -O0):
<printmodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xe(%rbp),%rsi
call   1040 <strmode@plt>
lea    -0xe(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmodes>:
push   %rbx
sub    $0x10,%rsp
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <strmode@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printmodes(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strmode(i32 %0, i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrplane_x(int);
int /*<<< orphan*/ clrplane_y(int);
int /*<<< orphan*/ clrplane_z(int);
void clrplane(char axis, int i) {
  switch (axis) {
  case 1:
    clrplane_x(i);
    break;
  case 2:
    clrplane_y(i);
    break;
  case 3:
    clrplane_z(i);
    break;
  }
}


x86 assembly (clang, -O0):
<clrplane>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1178 <clrplane+0x48>
jmp    1156 <clrplane+0x26>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1185 <clrplane+0x55>
jmp    1167 <clrplane+0x37>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1192 <clrplane+0x62>
jmp    119a <clrplane+0x6a>
mov    -0x8(%rbp),%edi
call   1040 <clrplane_x@plt>
jmp    119a <clrplane+0x6a>
mov    -0x8(%rbp),%edi
call   1030 <clrplane_y@plt>
jmp    119a <clrplane+0x6a>
mov    -0x8(%rbp),%edi
call   1050 <clrplane_z@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrplane>:
cmp    $0x3,%edi
je     1146 <clrplane+0x16>
cmp    $0x2,%edi
je     114d <clrplane+0x1d>
cmp    $0x1,%edi
jne    1154 <clrplane+0x24>
mov    %esi,%edi
jmp    1040 <clrplane_x@plt>
mov    %esi,%edi
jmp    1050 <clrplane_z@plt>
mov    %esi,%edi
jmp    1030 <clrplane_y@plt>
ret

LLVM IR (-O0):
define void @clrplane(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %16 [
i32 1, label %7
i32 2, label %10
i32 3, label %13
]
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @clrplane_x(i32 %8)
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @clrplane_y(i32 %11)
br label %16
13: ; preds = %2
%14 = load i32, i32* %4
%15 = call i32 @clrplane_z(i32 %14)
br label %16
16: ; preds = %2, %13, %10, %7
ret void
}

LLVM IR (-O2):
define void @clrplane(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %2
%5 = tail call i32 @clrplane_x(i32 %1)
br label %10
6: ; preds = %2
%7 = tail call i32 @clrplane_y(i32 %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @clrplane_z(i32 %1)
br label %10
10: ; preds = %2, %8, %6, %4
ret void
}
int test_imm_F1uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xF1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F1uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 241
%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_F1uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15794176
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int ft_fact(int a, int b) { return (a * b); }


x86 assembly (clang, -O0):
<ft_fact>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_fact>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @ft_fact(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ft_fact(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int booltest1(bool x) { return x; }


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

x86 assembly (clang, -O2):
<booltest1>:
mov    %edi,%eax
ret

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

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

/* Variables and functions */
int depth(struct TreeNode *);
int minDepth(struct TreeNode *root) {
  if (!root) {
    return 0;
  }
  return depth(root);
}


x86 assembly (clang, -O0):
<minDepth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <minDepth+0x23>
movl   $0x0,-0x4(%rbp)
jmp    113f <minDepth+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <depth@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @minDepth(%struct.TreeNode* %0) {
%2 = icmp eq %struct.TreeNode* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @depth(%struct.TreeNode* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ lasvm_error(char *);
void *malloc(int);
void *realloc(void *, int);
void *xrealloc(void *ptr, int n) {
  if (!ptr)
    ptr = malloc(n);
  else
    ptr = realloc(ptr, n);
  if (!ptr)
    lasvm_error("Function realloc has returned zero\n");
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115b <xrealloc+0x2b>
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    116b <xrealloc+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1182 <xrealloc+0x52>
lea    0xe83(%rip),%rdi
call   1050 <lasvm_error@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
test   %rdi,%rdi
je     113d <xrealloc+0xd>
call   1040 <realloc@plt>
jmp    1144 <xrealloc+0x14>
mov    %esi,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1158 <xrealloc+0x28>
lea    0xead(%rip),%rdi
call   1050 <lasvm_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Function realloc has returned zero\0A\00"
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %3
br label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i8* @realloc(i8* %11, i32 %12)
store i8* %13, i8** %3
br label %14
14: ; preds = %10, %7
%15 = load i8*, i8** %3
%16 = icmp ne i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = call i32 @lasvm_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [36 x i8] c"Function realloc has returned zero\0A\00"
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @malloc(i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %7, %6 ], [ %5, %4 ]
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @lasvm_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
ret i8* %9
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int strlen(char *);
char *filePath(char *directory, char *fileName) {
  int sDirectory = strlen(directory);
  int sfileName = strlen(fileName);
  char *filepath = (char *)malloc(sizeof(char) + sDirectory + sfileName + 1);
  sprintf(filepath, "%s%s", directory, fileName);
  return filepath;
}


x86 assembly (clang, -O0):
<filePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
movslq -0x14(%rbp),%rax
add    $0x1,%rax
movslq -0x18(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe77(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filePath>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @filePath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = add i64 1, %13
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = add i64 %14, %16
%18 = add i64 %17, 1
%19 = trunc i64 %18 to i32
%20 = call i64 @malloc(i32 %19)
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %7
%22 = load i8*, i8** %7
%23 = load i8*, i8** %3
%24 = load i8*, i8** %4
%25 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23, i8* %24)
%26 = load i8*, i8** %7
ret i8* %26
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @filePath(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 2
%6 = add i32 %5, %4
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %8
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == ' ' || c == '\t')
      putchar('\n');
    else
      putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1178 <main+0x58>
cmpl   $0x20,-0x8(%rbp)
je     115c <main+0x3c>
cmpl   $0x9,-0x8(%rbp)
jne    116b <main+0x4b>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1173 <main+0x53>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
jmp    114c <main+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1163 <main+0x43>
mov    $0xa,%edi
cmp    $0x9,%eax
je     1140 <main+0x20>
cmp    $0x20,%eax
je     1140 <main+0x20>
mov    %eax,%edi
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %18, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %19
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 32
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 9
br i1 %12, label %13, label %15
13: ; preds = %10, %7
%14 = call i32 @putchar(i32 10)
br label %18
15: ; preds = %10
%16 = load i32, i32* %2
%17 = call i32 @putchar(i32 %16)
br label %18
18: ; preds = %15, %13
br label %3
19: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %7
%5 = phi i32 [ %10, %7 ], [ %1, %0 ]
switch i32 %5, label %6 [
i32 32, label %7
i32 9, label %7
]
6: ; preds = %4
br label %7
7: ; preds = %4, %4, %6
%8 = phi i32 [ %5, %6 ], [ 10, %4 ], [ 10, %4 ]
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ callFun(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  int x = 10;
  callFun(x);
  printf("hello,world\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <callFun@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <callFun@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"hello,world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @callFun(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int csperf_common_is_valid_ip(char *address) {
  struct sockaddr_in sa;
  return inet_pton(AF_INET, address, &(sa.sin_addr));
}


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

x86 assembly (clang, -O2):
<csperf_common_is_valid_ip>:
push   %rax
mov    %rdi,%rsi
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
call   1030 <inet_pton@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
define i32 @csperf_common_is_valid_ip(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.sockaddr_in
store i8* %0, i8** %2
%4 = load i32, i32* @AF_INET
%5 = load i8*, i8** %2
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%7 = call i32 @inet_pton(i32 %4, i8* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
define i32 @csperf_common_is_valid_ip(i8* %0) {
%2 = alloca %struct.sockaddr_in
%3 = bitcast %struct.sockaddr_in* %2 to i8*
%4 = load i32, i32* @AF_INET
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%6 = call i32 @inet_pton(i32 %4, i8* %0, i32* %5)
ret i32 %6
}
int intcmp(const void *v1, const void *v2) { return (*(int *)v1 - *(int *)v2); }


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intcmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void single() {
  while (1)
    assert(1);
}


x86 assembly (clang, -O0):
<single>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <single+0x9>
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1119 <single+0x9>

x86 assembly (clang, -O2):
<single>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1120 <single+0x10>

LLVM IR (-O0):
define void @single() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @assert(i32 1)
br label %1
}

LLVM IR (-O2):
define void @single() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @assert(i32 1)
br label %1
}
/* Variables and functions */
int ioDisableSocketAccess();
int secDisableSocketAccess(void) { return ioDisableSocketAccess(); }


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

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

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

LLVM IR (-O2):
define i32 @secDisableSocketAccess() {
%1 = tail call i32 (...) @ioDisableSocketAccess()
ret i32 %1
}
char *strcpy(char *dest, const char *src) {
  char *pos = dest;
  while ((*pos++ = *src++) != 0)
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ crc12_init();
int /*<<< orphan*/ crc16_init();
int /*<<< orphan*/ crc32_init();
void crc_init(void) {
  crc12_init();
  crc16_init();
  crc32_init();
}


x86 assembly (clang, -O0):
<crc_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <crc12_init@plt>
mov    $0x0,%al
call   1030 <crc16_init@plt>
mov    $0x0,%al
call   1040 <crc32_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_init>:
push   %rax
xor    %eax,%eax
call   1050 <crc12_init@plt>
xor    %eax,%eax
call   1030 <crc16_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <crc32_init@plt>

LLVM IR (-O0):
define void @crc_init() {
%1 = call i32 (...) @crc12_init()
%2 = call i32 (...) @crc16_init()
%3 = call i32 (...) @crc32_init()
ret void
}

LLVM IR (-O2):
define void @crc_init() {
%1 = tail call i32 (...) @crc12_init()
%2 = tail call i32 (...) @crc16_init()
%3 = tail call i32 (...) @crc32_init()
ret void
}
/* Variables and functions */
int ioCanOpenAsyncFileOfSizeWritable(char *, int, int);
int secCanOpenAsyncFileOfSizeWritable(char *fileName, int fileNameSize,
                                      int writeFlag) {
  return ioCanOpenAsyncFileOfSizeWritable(fileName, fileNameSize, writeFlag);
}


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

x86 assembly (clang, -O2):
<secCanOpenAsyncFileOfSizeWritable>:
jmp    1030 <ioCanOpenAsyncFileOfSizeWritable@plt>

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

LLVM IR (-O2):
define i32 @secCanOpenAsyncFileOfSizeWritable(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @ioCanOpenAsyncFileOfSizeWritable(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
int logicalShift(int x, int n) { return 2; }


x86 assembly (clang, -O0):
<logicalShift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @logicalShift(i32 %0, i32 %1) {
ret i32 2
}
int do_465() { return 465; }


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

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

LLVM IR (-O0):
define i32 @do_465() {
ret i32 465
}

LLVM IR (-O2):
define i32 @do_465() {
ret i32 465
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t const);
void *rws_malloc(size_t const);
void *rws_malloc_zero(const size_t size) {
  void *mem = rws_malloc(size);
  if (mem) {
    memset(mem, 0, size);
  }
  return mem;
}


x86 assembly (clang, -O0):
<rws_malloc_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rws_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <rws_malloc_zero+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rws_malloc_zero>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <rws_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <rws_malloc_zero+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @rws_malloc_zero(i64 %0) {
%2 = tail call i8* @rws_malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, oldx;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (4 * x - 5 * y > 0) {
    oldx = x;
    x = 2 * oldx + 4 * y;
    y = 4 * oldx;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
imul   $0x5,-0xc(%rbp),%ecx
sub    %ecx,%eax
cmp    $0x0,%eax
jle    116d <main+0x5d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
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 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %2
%9 = mul nsw i32 4, %8
%10 = load i32, i32* %3
%11 = mul nsw i32 5, %10
%12 = sub nsw i32 %9, %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %7
%15 = load i32, i32* %2
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = mul nsw i32 2, %16
%18 = load i32, i32* %3
%19 = mul nsw i32 4, %18
%20 = add nsw i32 %17, %19
store i32 %20, i32* %2
%21 = load i32, i32* %4
%22 = mul nsw i32 4, %21
store i32 %22, i32* %3
br label %7
23: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
help(str, swp) char *str;
{
  printf("syntax: %s\n", str);
  printf("  switches are:\n");
  printsw("", swp, "-");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xec3(%rip),%rdi
lea    0xebd(%rip),%rdx
mov    $0x0,%al
call   1040 <printsw@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
lea    0xeae(%rip),%rdx
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printsw@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"syntax: %s\0A\00"
@.str.1 = [17 x i8] c" switches are:\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"-\00"
define i32 @help(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %5
%10 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @printsw to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [12 x i8] c"syntax: %s\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"-\00"
@str = [16 x i8] c" switches are:\00"
define i32 @help(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @printsw to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}