xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int y = 42;
  int change_y = 0;
  int save_y;
  scanf("%d", &change_y);
  if (change_y) {
    save_y = y;
    y = 10;
  }
  change_y++;
  printf("Doing some other work");
  change_y--;
  if (change_y)
    y = save_y;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
je     1164 <main+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1192 <main+0x72>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
addl   $0x1,0x4(%rsp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [22 x i8] c"Doing some other work\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%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 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("usage: mkdir dirname\n");
    return 1;
  }
  mkdir(argv[1], 755);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1171 <main+0x51>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x2f3,%esi
call   1030 <mkdir@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1138 <main+0x18>
mov    0x8(%rsi),%rdi
mov    $0x2f3,%esi
call   1030 <mkdir@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [21 x i8] c"usage: mkdir dirname\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @mkdir(i8* %8, i32 755)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %11
}
void cpuid(void) {
  asm volatile("push %%"
               "r"
               "bx; cpuid; pop %%"
               "r"
               "bx"
               :
               :
               : "eax", "ecx", "edx");
}


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

x86 assembly (clang, -O2):
<cpuid>:
push   %rbx
cpuid
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cpuid() {
tail call void asm sideeffect "push %rbx; cpuid; pop %rbx", "~{eax},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void free(__attribute__((unused)) void *p) {}


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

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

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

LLVM IR (-O2):
define void @free(i8* nocapture %0) {
ret void
}
int mod(int num, int base) {
  while (num >= base)
    num -= base;
  while (num < 0)
    num += base;
  return num;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1126 <mod+0x26>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    110a <mod+0xa>
jmp    112b <mod+0x2b>
cmpl   $0x0,-0x4(%rbp)
jge    1143 <mod+0x43>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112b <mod+0x2b>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
sub    %esi,%eax
jge    1110 <mod+0x10>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %esi,%eax
js     1120 <mod+0x20>
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = icmp slt i32 %4, %1
%6 = sub nsw i32 %4, %1
br i1 %5, label %7, label %3
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ %4, %3 ]
%9 = icmp slt i32 %8, 0
%10 = add nsw i32 %8, %1
br i1 %9, label %7, label %11
11: ; preds = %7
ret i32 %8
}
/* Type definitions */
struct timespec {
  unsigned long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long teredo_clock(void) {
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  return ts.tv_sec;
}


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

x86 assembly (clang, -O2):
<teredo_clock>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i64 }
@CLOCK_REALTIME = global i32 0
define i64 @teredo_clock() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
%struct.timespec = type { i64 }
@CLOCK_REALTIME = global i32 0
define i64 @teredo_clock() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ CRYPTO_malloc_init();
int /*<<< orphan*/ OpenSSL_add_all_digests();
void ecqv_initialize(void) {
  CRYPTO_malloc_init();
  OpenSSL_add_all_digests();
}


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

x86 assembly (clang, -O2):
<ecqv_initialize>:
push   %rax
xor    %eax,%eax
call   1040 <CRYPTO_malloc_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <OpenSSL_add_all_digests@plt>

LLVM IR (-O0):
define void @ecqv_initialize() {
%1 = call i32 (...) @CRYPTO_malloc_init()
%2 = call i32 (...) @OpenSSL_add_all_digests()
ret void
}

LLVM IR (-O2):
define void @ecqv_initialize() {
%1 = tail call i32 (...) @CRYPTO_malloc_init()
%2 = tail call i32 (...) @OpenSSL_add_all_digests()
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
scalar_t__ clock();
void delay100us(void) {
  clock_t then;
  then = (clock() + ((CLOCKS_PER_SEC / 10000) + 1));
  while (clock() < then) {
    ;
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
add    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
cmp    -0x8(%rbp),%rax
jge    115d <delay100us+0x4d>
jmp    1147 <delay100us+0x37>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
xor    %eax,%eax
call   1030 <clock@plt>
mov    0x2ec9(%rip),%rcx
movslq (%rcx),%rcx
imul   $0x68db8bad,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
lea    (%rcx,%rax,1),%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rbx,%rax
jl     1150 <delay100us+0x40>
pop    %rbx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define void @delay100us() {
%1 = alloca i64
%2 = call i64 (...) @clock()
%3 = load i32, i32* @CLOCKS_PER_SEC
%4 = sdiv i32 %3, 10000
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = add nsw i64 %2, %6
store i64 %7, i64* %1
br label %8
8: ; preds = %12, %0
%9 = call i64 (...) @clock()
%10 = load i64, i64* %1
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @delay100us() {
%1 = tail call i64 (...) @clock()
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 %2, 10000
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = add nsw i64 %1, %5
br label %7
7: ; preds = %7, %0
%8 = tail call i64 (...) @clock()
%9 = icmp slt i64 %8, %6
br i1 %9, label %7, label %10
10: ; preds = %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
void *thread(void *arg) {
  puts("thread start!");
  char *buf;
  buf = (char *)arg;
  printf("buffer is %s\n", buf);
  return (void *)0;
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"thread start!\00"
@.str.1 = [14 x i8] c"buffer is %s\0A\00"
define i8* @thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i8* null
}

LLVM IR (-O2):
@.str = [14 x i8] c"thread start!\00"
@.str.1 = [14 x i8] c"buffer is %s\0A\00"
define noalias i8* @thread(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ restore_ttymodes();
void close_tty(void) { restore_ttymodes(); }


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

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

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

LLVM IR (-O2):
define void @close_tty() {
%1 = tail call i32 (...) @restore_ttymodes()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void die(const char *msg) {
  perror("msg");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <perror@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <perror@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"msg\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"msg\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* nocapture readnone %0) {
%2 = tail call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int getpagesize();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ test_dummy();
int main(int argc, char *argv[]) {
  test_dummy();
  printf("pagesize : %d\n", getpagesize());
  printf("Finished!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <test_dummy@plt>
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_dummy@plt>
xor    %eax,%eax
call   1050 <getpagesize@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"pagesize : %d\0A\00"
@.str.1 = [11 x i8] c"Finished!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_dummy()
%7 = call i32 (...) @getpagesize()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"pagesize : %d\0A\00"
@str = [10 x i8] c"Finished!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_dummy()
%4 = tail call i32 (...) @getpagesize()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(void) {
  while (true) {
    fprintf(stdout, "Hey !\n");
    sleep(1);
    fprintf(stderr, "Ho !\n");
    sleep(1);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2ea9(%rip),%r15
lea    0xeca(%rip),%r14
mov    0x2ea3(%rip),%r12
lea    0xec3(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15),%edi
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"Hey !\0A\00"
@stderr = global i32 0
@.str.1 = [6 x i8] c"Ho !\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 1)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"Hey !\0A\00"
@stderr = global i32 0
@.str.1 = [6 x i8] c"Ho !\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 1)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @sleep(i32 1)
br label %1
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int read(int, char **, int);
char *battery(int batfd) {
  static char buf[8];
  ssize_t rd;
  rd = read(batfd, &buf, sizeof buf);
  buf[rd - 1] = '%';
  buf[rd] = 0;
  lseek(batfd, 0, SEEK_SET);
  return buf;
}


x86 assembly (clang, -O0):
<battery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2eff(%rip),%rsi
mov    $0x8,%edx
call   1040 <read@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2ee2(%rip),%rax
movb   $0x25,(%rax,%rcx,1)
movslq -0x8(%rbp),%rcx
lea    0x2ed3(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x4(%rbp),%edi
mov    0x2e71(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
lea    0x2eb5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<battery>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x2f07(%rip),%r14
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <read@plt>
cltq
movw   $0x25,-0x1(%rax,%r14,1)
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@battery.buf = internal global [8 x i8] zeroinitializer
@SEEK_SET = global i32 0
define i8* @battery(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @read(i32 %4, i8** bitcast ([8 x i8]* @battery.buf to i8**), i32 8)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [8 x i8], [8 x i8]* @battery.buf, i64 0, i64 %8
store i8 37, i8* %9
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [8 x i8], [8 x i8]* @battery.buf, i64 0, i64 %11
store i8 0, i8* %12
%13 = load i32, i32* %2
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @lseek(i32 %13, i32 0, i32 %14)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @battery.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@battery.buf = internal global [8 x i8] zeroinitializer
@SEEK_SET = global i32 0
define i8* @battery(i32 %0) {
%2 = tail call i32 @read(i32 %0, i8** bitcast ([8 x i8]* @battery.buf to i8**), i32 8)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [8 x i8], [8 x i8]* @battery.buf, i64 0, i64 %4
store i8 37, i8* %5
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds [8 x i8], [8 x i8]* @battery.buf, i64 0, i64 %6
store i8 0, i8* %7
%8 = load i32, i32* @SEEK_SET
%9 = tail call i32 @lseek(i32 %0, i32 0, i32 %8)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @battery.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(float, float, float, float);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(float, float, float, float, float, float);
void init(void) {
  glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 0.0f);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glLoadIdentity@plt>
xorps  %xmm5,%xmm5
movss  0xe8b(%rip),%xmm3
movss  0xe87(%rip),%xmm4
movaps %xmm5,%xmm0
movaps %xmm3,%xmm1
movaps %xmm5,%xmm2
call   1040 <glOrtho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
movss  0xe91(%rip),%xmm1
movss  0xe8d(%rip),%xmm4
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
xorps  %xmm5,%xmm5
movaps %xmm1,%xmm3
pop    %rax
jmp    1040 <glOrtho@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = call i32 @glMatrixMode(i32 %2)
%4 = call i32 (...) @glLoadIdentity()
%5 = call i32 @glOrtho(float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = tail call i32 @glMatrixMode(i32 %2)
%4 = tail call i32 (...) @glLoadIdentity()
%5 = tail call i32 @glOrtho(float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fls(unsigned long);
unsigned int find_first_set_bit(unsigned long word) {
  return ({
           unsigned long __t = (word);
           fls(__t & -__t);
         }) -
         1;
}


x86 assembly (clang, -O0):
<find_first_set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
sub    -0x10(%rbp),%rax
and    %rax,%rdi
call   1030 <fls@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_first_set_bit>:
push   %rax
mov    %rdi,%rax
neg    %rax
and    %rax,%rdi
call   1030 <fls@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @find_first_set_bit(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %2
%5 = load i64, i64* %2
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = sub i64 0, %7
%9 = and i64 %6, %8
%10 = call i32 @fls(i64 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
define i32 @find_first_set_bit(i64 %0) {
%2 = sub i64 0, %0
%3 = and i64 %2, %0
%4 = tail call i32 @fls(i64 %3)
%5 = add nsw i32 %4, -1
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ rnd;

/* Variables and functions */
int /*<<< orphan*/ __getrandom(unsigned char *, int);
bool chance(float f) {
  uint16_t rnd;
  float rnd_f;
  __getrandom((unsigned char *)&rnd, sizeof(rnd));
  rnd_f = ((float)rnd) / ((float)0xffff);
  return (f >= rnd_f);
}


x86 assembly (clang, -O0):
<chance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1030 <__getrandom@plt>
cvtsi2ssq -0x10(%rbp),%xmm0
movss  0xec7(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chance>:
sub    $0x18,%rsp
movss  %xmm0,0xc(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x8,%esi
call   1030 <__getrandom@plt>
xorps  %xmm0,%xmm0
cvtsi2ssq 0x10(%rsp),%xmm0
divss  0xec5(%rip),%xmm0
xor    %eax,%eax
movss  0xc(%rsp),%xmm1
ucomiss %xmm0,%xmm1
setae  %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @chance(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca float
store float %0, float* %2
%5 = bitcast i64* %3 to i8*
%6 = call i32 @__getrandom(i8* %5, i32 8)
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to float
%9 = fdiv float %8, 6.553500e+04
store float %9, float* %4
%10 = load float, float* %2
%11 = load float, float* %4
%12 = fcmp oge float %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @chance(float %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @__getrandom(i8* %3, i32 8)
%5 = load i64, i64* %2
%6 = sitofp i64 %5 to float
%7 = fdiv float %6, 6.553500e+04
%8 = fcmp ole float %7, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
bool nrf91_errata_29(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf91_errata_29() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf91_errata_29() {
ret i32 0
}
int findNextIdx(int **edgeLeft, int edgeIdx, int cVertex) {
  for (int i = 0; i < edgeIdx; i++) {
    if (edgeLeft[0][i] == cVertex)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<findNextIdx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1156 <findNextIdx+0x56>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1143 <findNextIdx+0x43>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <findNextIdx+0x5d>
jmp    1148 <findNextIdx+0x48>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <findNextIdx+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNextIdx>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <findNextIdx+0x1e>
mov    (%rdi),%rcx
mov    %esi,%edi
xor    %esi,%esi
cmp    %edx,(%rcx,%rsi,4)
je     111f <findNextIdx+0x1f>
add    $0x1,%rsi
cmp    %rsi,%rdi
jne    1110 <findNextIdx+0x10>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @findNextIdx(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = load i32*, i32** %0
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %5, %13
%9 = phi i64 [ 0, %5 ], [ %14, %13 ]
%10 = getelementptr inbounds i32, i32* %6, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %2
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %18, label %8
16: ; preds = %8
%17 = trunc i64 %9 to i32
br label %18
18: ; preds = %13, %16, %3
%19 = phi i32 [ -1, %3 ], [ %17, %16 ], [ -1, %13 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ KVM_CREATE_VM;
int ioctl(int, int /*<<< orphan*/, int);
int kvm_create_vm(int fd, int flags) { return ioctl(fd, KVM_CREATE_VM, flags); }


x86 assembly (clang, -O0):
<kvm_create_vm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_create_vm>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@KVM_CREATE_VM = global i32 0
define i32 @kvm_create_vm(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* @KVM_CREATE_VM
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@KVM_CREATE_VM = global i32 0
define i32 @kvm_create_vm(i32 %0, i32 %1) {
%3 = load i32, i32* @KVM_CREATE_VM
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
int char_to_int(char c) { return c - '0'; }


x86 assembly (clang, -O0):
<char_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_int>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @char_to_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @char_to_int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ CompileCondition();
int /*<<< orphan*/ ResetIf();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_LadderBelow(void) {
  WriteInstruction("call laddd");
  WriteInstruction("jp nz,      ");
  CompileCondition();
  ResetIf();
}


x86 assembly (clang, -O0):
<CR_LadderBelow>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec4(%rip),%rdi
call   1040 <WriteInstruction@plt>
mov    $0x0,%al
call   1050 <CompileCondition@plt>
mov    $0x0,%al
call   1030 <ResetIf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_LadderBelow>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec7(%rip),%rdi
call   1040 <WriteInstruction@plt>
xor    %eax,%eax
call   1050 <CompileCondition@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ResetIf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"call laddd\00"
@.str.1 = [13 x i8] c"jp nz, \00"
define void @CR_LadderBelow() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @CompileCondition()
%4 = call i32 (...) @ResetIf()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"call laddd\00"
@.str.1 = [13 x i8] c"jp nz, \00"
define void @CR_LadderBelow() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @CompileCondition()
%4 = tail call i32 (...) @ResetIf()
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR45_set(void) { return U_WMRCORENONE_set("U_WMR45"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR45\00"
define i8* @U_WMR45_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR45\00"
define i8* @U_WMR45_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
unsigned int next_coarse_offset(unsigned int x) {
  unsigned int mask;
  mask = (~0) << (10 - 2);
  mask = ~mask;
  while (x & mask)
    x++;
  return (x);
}


x86 assembly (clang, -O0):
<next_coarse_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffff00,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1134 <next_coarse_offset+0x34>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1117 <next_coarse_offset+0x17>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_coarse_offset>:
mov    %edi,%eax
neg    %eax
movzbl %al,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @next_coarse_offset(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -256, i32* %3
%4 = load i32, i32* %3
%5 = xor i32 %4, -1
store i32 %5, i32* %3
br label %6
6: ; preds = %11, %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add i32 %12, 1
store i32 %13, i32* %2
br label %6
14: ; preds = %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @next_coarse_offset(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, 255
%4 = add i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ allocator_default();
int /*<<< orphan*/ allocator_traced_init_stdout(int /*<<< orphan*/,
                                                int /*<<< orphan*/);
void _ensure_allocator_traced_init_stdout_copes_with_null_allocator(void) {
  allocator_traced_init_stdout(0, allocator_default());
}


x86 assembly (clang, -O0):
<_ensure_allocator_traced_init_stdout_copes_with_null_allocator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <allocator_default@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <allocator_traced_init_stdout@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_allocator_traced_init_stdout_copes_with_null_allocator>:
push   %rax
xor    %eax,%eax
call   1030 <allocator_default@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <allocator_traced_init_stdout@plt>

LLVM IR (-O0):
define void @_ensure_allocator_traced_init_stdout_copes_with_null_allocator() {
%1 = call i32 (...) @allocator_default()
%2 = call i32 @allocator_traced_init_stdout(i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
define void @_ensure_allocator_traced_init_stdout_copes_with_null_allocator() {
%1 = tail call i32 (...) @allocator_default()
%2 = tail call i32 @allocator_traced_init_stdout(i32 0, i32 %1)
ret void
}
/* Type definitions */
struct list_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ palindromic_reorder_aux(struct list_node *,
                                           struct list_node *);
struct list_node *palindromic_reorder(struct list_node *head) {
  if (head == NULL) {
    return NULL;
  }
  palindromic_reorder_aux(head, head);
  return head;
}


x86 assembly (clang, -O0):
<palindromic_reorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <palindromic_reorder+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1149 <palindromic_reorder+0x39>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <palindromic_reorder_aux@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<palindromic_reorder>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1124 <palindromic_reorder+0x14>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <palindromic_reorder_aux@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.list_node = type { i32 }
define %struct.list_node* @palindromic_reorder(%struct.list_node* %0) {
%2 = icmp eq %struct.list_node* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @palindromic_reorder_aux(%struct.list_node* %0, %struct.list_node* %0)
br label %5
5: ; preds = %1, %3
ret %struct.list_node* %0
}
/* Variables and functions */
int rand();
char getRandomNumber0To9() { return rand() % 10; }


x86 assembly (clang, -O0):
<getRandomNumber0To9>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomNumber0To9>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @getRandomNumber0To9() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 10
%3 = trunc i32 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @getRandomNumber0To9() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 10
%3 = trunc i32 %2 to i8
ret i8 %3
}
void foo292(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo292(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *xmemcpy(void *restrict dst, const void *restrict src, ssize_t size) {
  if (dst == NULL || src == NULL || size <= 0) {
    return (void *)dst;
  }
  return memcpy(dst, src, (size_t)size);
}


x86 assembly (clang, -O0):
<xmemcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <xmemcpy+0x35>
cmpq   $0x0,-0x18(%rbp)
je     1145 <xmemcpy+0x35>
cmpq   $0x0,-0x20(%rbp)
jg     1152 <xmemcpy+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <xmemcpy+0x5f>
mov    -0x10(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmemcpy>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     112b <xmemcpy+0x1b>
test   %rsi,%rsi
je     112b <xmemcpy+0x1b>
test   %rdx,%rdx
jle    112b <xmemcpy+0x1b>
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @xmemcpy(i8* noalias returned writeonly %0, i8* noalias %1, i64 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i8* %1, null
%6 = or i1 %4, %5
%7 = icmp slt i64 %2, 1
%8 = or i1 %6, %7
br i1 %8, label %10, label %9
9: ; preds = %3
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
br label %10
10: ; preds = %3, %9
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_line(char *);
int /*<<< orphan*/ output_string(char *);
int /*<<< orphan*/ print_label(int);
gen_jump(int label) {
  output_string("\tj\t");
  print_label(label);
  newline();
  output_line("nop");
}


x86 assembly (clang, -O0):
<gen_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xeae(%rip),%rdi
call   1050 <output_string@plt>
mov    -0x8(%rbp),%edi
call   1040 <print_label@plt>
mov    $0x0,%al
call   1030 <newline@plt>
lea    0xe97(%rip),%rdi
call   1060 <output_line@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_jump>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
call   1050 <output_string@plt>
mov    %ebx,%edi
call   1040 <print_label@plt>
xor    %eax,%eax
call   1030 <newline@plt>
lea    0xea0(%rip),%rdi
pop    %rbx
jmp    1060 <output_line@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\09j\09\00"
@.str.1 = [4 x i8] c"nop\00"
define i32 @gen_jump(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @output_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 @print_label(i32 %5)
%7 = call i32 (...) @newline()
%8 = call i32 @output_line(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"\09j\09\00"
@.str.1 = [4 x i8] c"nop\00"
define i32 @gen_jump(i32 %0) {
%2 = tail call i32 @output_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_label(i32 %0)
%4 = tail call i32 (...) @newline()
%5 = tail call i32 @output_line(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
int do_235() { return 235; }


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

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

LLVM IR (-O0):
define i32 @do_235() {
ret i32 235
}

LLVM IR (-O2):
define i32 @do_235() {
ret i32 235
}
/* Variables and functions */
void *kmalloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *kzalloc(size_t size) {
  void *buf = kmalloc(size);
  memset(buf, 0, size);
  return buf;
}


x86 assembly (clang, -O0):
<kzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <kmalloc@plt>
mov    %rax,-0x10(%rbp)
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):
<kzalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <kmalloc@plt>
mov    %rax,%rbx
mov    %rax,%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* @kzalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @kmalloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @kzalloc(i64 %0) {
%2 = tail call i8* @kmalloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}