xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int, size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  assert(ptr);
  memset(ptr, 0x00, size);
  return ptr;
}


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

LLVM IR (-O2):
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @assert(i8* %2)
%4 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void unregisterObject() { printf("Unregistered !"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Unregistered !\00"
define void @unregisterObject() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Unregistered !\00"
define void @unregisterObject() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put(int /*<<< orphan*/);
void puts(const char *str) {
  while (*str)
    put(*str++);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <put@plt>
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <put@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @put(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ parentheses(int);
int main() {
  parentheses(3);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <parentheses@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <parentheses@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @parentheses(i32 3)
%2 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @parentheses(i32 3)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int compare(char *char1, char *char2) { return strcmp(char1, char2); }


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

x86 assembly (clang, -O2):
<compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t EEPROMBlockCountGet(void) {
  return (((((*((volatile unsigned long *)(0x400AF000)))) & 0x07FF0000) >> 16));
}


x86 assembly (clang, -O0):
<EEPROMBlockCountGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400af000,%eax
mov    (%rax),%rax
and    $0x7ff0000,%rax
shr    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMBlockCountGet>:
mov    0x400af000,%rax
40
shr    $0x10,%eax
and    $0x7ff,%eax
ret

LLVM IR (-O0):
define i64 @EEPROMBlockCountGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074458624 to i64*)
%2 = and i64 %1, 134152192
%3 = lshr i64 %2, 16
ret i64 %3
}

LLVM IR (-O2):
define i64 @EEPROMBlockCountGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074458624 to i64*)
%2 = lshr i64 %1, 16
%3 = and i64 %2, 2047
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ random_double_range(double, double);
double tan(int /*<<< orphan*/);
double random_cauchy(void) {
  return tan(random_double_range(-3.1415926536 / 2, 3.1415926536 / 2));
}


x86 assembly (clang, -O0):
<random_cauchy>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
call   1030 <random_double_range@plt>
mov    %eax,%edi
call   1040 <tan@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_cauchy>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <random_double_range@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <tan@plt>

LLVM IR (-O0):
define double @random_cauchy() {
%1 = call i32 @random_double_range(double 0xBFF921FB544486E0, double 0x3FF921FB544486E0)
%2 = call double @tan(i32 %1)
ret double %2
}

LLVM IR (-O2):
define double @random_cauchy() {
%1 = tail call i32 @random_double_range(double 0xBFF921FB544486E0, double 0x3FF921FB544486E0)
%2 = tail call double @tan(i32 %1)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int bar(int a, int b) {
  printf("barB\n");
  return a + b + 37;
}


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

x86 assembly (clang, -O2):
<bar>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    (%rbx,%r14,1),%eax
add    $0x25,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"barB\00"
define i32 @bar(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%4 = add i32 %0, 37
%5 = add i32 %4, %1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ watch_log(char *);
FILE *_IO_file_fopen(const char *path, const char *mode) {
  watch_log("io_open\n");
  return NULL;
}


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

x86 assembly (clang, -O2):
<_IO_file_fopen>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <watch_log@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"io_open\0A\00"
define i32* @_IO_file_fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32* null
}

LLVM IR (-O2):
@.str = [9 x i8] c"io_open\0A\00"
define noalias i32* @_IO_file_fopen(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32* null
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_open_remote_pipe_error(int);
int /*<<< orphan*/ fd_nrf8001_open_remote_pipe_success();
void fd_nrf8001_dispatch_open_remote_pipe_response(uint8_t status,
                                                   uint8_t *response_data
                                                   __attribute__((unused)),
                                                   uint32_t response_data_length
                                                   __attribute__((unused))) {
  if (status != 0x00) {
    fd_nrf8001_open_remote_pipe_error(status);
    return;
  }
  fd_nrf8001_open_remote_pipe_success();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <fd_nrf8001_dispatch_open_remote_pipe_response+0x29>
mov    -0x4(%rbp),%edi
call   1030 <fd_nrf8001_open_remote_pipe_error@plt>
jmp    1150 <fd_nrf8001_dispatch_open_remote_pipe_response+0x30>
mov    $0x0,%al
call   1040 <fd_nrf8001_open_remote_pipe_success@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
test   %edi,%edi
je     1129 <fd_nrf8001_dispatch_open_remote_pipe_response+0x9>
jmp    1030 <fd_nrf8001_open_remote_pipe_error@plt>
xor    %eax,%eax
jmp    1040 <fd_nrf8001_open_remote_pipe_success@plt>

LLVM IR (-O0):
define void @fd_nrf8001_dispatch_open_remote_pipe_response(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @fd_nrf8001_open_remote_pipe_error(i32 %10)
br label %14
12: ; preds = %3
%13 = call i32 (...) @fd_nrf8001_open_remote_pipe_success()
br label %14
14: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @fd_nrf8001_dispatch_open_remote_pipe_response(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fd_nrf8001_open_remote_pipe_error(i32 %0)
br label %9
7: ; preds = %3
%8 = tail call i32 (...) @fd_nrf8001_open_remote_pipe_success()
br label %9
9: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
int8_t sub_int8_t(int8_t a, int8_t b) { return a - b; }


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

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

LLVM IR (-O0):
define i64 @sub_int8_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @sub_int8_t(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 2 << 2;
}


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

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gui_gotoxy(int, int);
int /*<<< orphan*/ printf(char *);
void gui_flush() {
  gui_gotoxy(1, 22);
  printf("\n");
}


x86 assembly (clang, -O0):
<gui_flush>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x16,%esi
call   1030 <gui_gotoxy@plt>
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_flush>:
push   %rax
mov    $0x1,%edi
mov    $0x16,%esi
call   1040 <gui_gotoxy@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @gui_flush() {
%1 = call i32 @gui_gotoxy(i32 1, i32 22)
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @gui_flush() {
%1 = tail call i32 @gui_gotoxy(i32 1, i32 22)
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct pqueue_t {
  int dummy;
};

/* Variables and functions */
int _pq_find_last(struct pqueue_t *);
int pq_size(struct pqueue_t *pq) { return _pq_find_last(pq); }


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

x86 assembly (clang, -O2):
<pq_size>:
jmp    1030 <_pq_find_last@plt>

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

LLVM IR (-O2):
%struct.pqueue_t = type { i32 }
define i32 @pq_size(%struct.pqueue_t* %0) {
%2 = tail call i32 @_pq_find_last(%struct.pqueue_t* %0)
ret i32 %2
}
/* Type definitions */
typedef size_t off_t;

/* Variables and functions */
unsigned char rand_r(unsigned int *);
void tu_rand_fill(void *mem, size_t size, unsigned seed) {
  unsigned char *mp = (unsigned char *)mem;
  off_t i;
  for (i = 0; i < (off_t)size; i++) {
    mp[i] = rand_r(&seed);
  }
}


x86 assembly (clang, -O0):
<tu_rand_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1168 <tu_rand_fill+0x58>
lea    -0x14(%rbp),%rdi
call   1030 <rand_r@plt>
mov    %al,%dl
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1133 <tu_rand_fill+0x23>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tu_rand_fill>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,0x4(%rsp)
test   %rsi,%rsi
je     1145 <tu_rand_fill+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0x4(%rsp),%r15
xchg   %ax,%ax
mov    %r15,%rdi
call   1030 <rand_r@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <tu_rand_fill+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @tu_rand_fill(i8* nocapture writeonly %0, i64 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = icmp eq i64 %1, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = call zeroext i8 @rand_r(i32* %4)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %8, i8* %9
%10 = add nuw i64 %7, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %6
12: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void afficherBonusNouveauLvlPersonnage(void) {
  printf("Choisissez la categorie que vous voulez ameliorer :\n\n");
  printf("\t1 - Sante (+1)\n");
  printf("\t2 - Degat (+1)\n");
  printf("\t3 - Protection (+1)\n\n");
}


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

x86 assembly (clang, -O2):
<afficherBonusNouveauLvlPersonnage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Choisissez la categorie que vous voulez ameliorer :\0A\0A\00"
@.str.1 = [17 x i8] c"\091 - Sante (+1)\0A\00"
@.str.2 = [17 x i8] c"\092 - Degat (+1)\0A\00"
@.str.3 = [23 x i8] c"\093 - Protection (+1)\0A\0A\00"
define void @afficherBonusNouveauLvlPersonnage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [53 x i8] c"Choisissez la categorie que vous voulez ameliorer :\0A\00"
@str.4 = [16 x i8] c"\091 - Sante (+1)\00"
@str.5 = [16 x i8] c"\092 - Degat (+1)\00"
@str.6 = [22 x i8] c"\093 - Protection (+1)\0A\00"
define void @afficherBonusNouveauLvlPersonnage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int read32(int);
int /*<<< orphan*/ write32(int, int);
void blink(void) { write32(0x0d8000c0, read32(0x0d8000c0) ^ 0x20); }


x86 assembly (clang, -O0):
<blink>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd8000c0,%edi
call   1040 <read32@plt>
mov    %eax,%esi
xor    $0x20,%esi
mov    $0xd8000c0,%edi
call   1030 <write32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink>:
push   %rax
mov    $0xd8000c0,%edi
call   1040 <read32@plt>
xor    $0x20,%eax
mov    $0xd8000c0,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <write32@plt>

LLVM IR (-O0):
define void @blink() {
%1 = call i32 @read32(i32 226492608)
%2 = xor i32 %1, 32
%3 = call i32 @write32(i32 226492608, i32 %2)
ret void
}

LLVM IR (-O2):
define void @blink() {
%1 = tail call i32 @read32(i32 226492608)
%2 = xor i32 %1, 32
%3 = tail call i32 @write32(i32 226492608, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ rv;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(unsigned int *, int, int, int /*<<< orphan*/ *);
unsigned my_rand() {
  FILE *f = fopen("/dev/random", "r");
  unsigned rv;
  fread(&rv, sizeof(rv), 1, f);
  fclose(f);
  return rv;
}


x86 assembly (clang, -O0):
<my_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/random\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @my_rand() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %4)
%6 = load i32*, i32** %1
%7 = call i32 @fclose(i32* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/random\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @my_rand() {
%1 = alloca i32
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @fread(i32* %1, i32 4, i32 1, i32* %2)
%5 = tail call i32 @fclose(i32* %2)
%6 = load i32, i32* %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main(int argc, char *argv[]) { f(100); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x64,%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @f(i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @f(i32 100)
ret i32 0
}
void string_init_int(int string) {}


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

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

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

LLVM IR (-O2):
define void @string_init_int(i32 %0) {
ret void
}
void glBindTexture(int a, int b) {}


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

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

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

LLVM IR (-O2):
define void @glBindTexture(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
char *strdup(char *);
char *strrchr(char const *, char);
char *basename(const char *filename) {
  char *bn = strrchr(filename, '/');
  return strdup(bn ? bn + 1 : filename);
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115a <basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1162 <basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = tail call i8* @strdup(i8* %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ s3c2410_write_cmd(int);
int /*<<< orphan*/ s3c2440_write_cmd(int);
void write_cmd(int cmd) {
  if (((*(volatile unsigned int *)0x560000B0) == 0x32410000) ||
      ((*(volatile unsigned int *)0x560000B0) == 0x32410002)) {
    s3c2410_write_cmd(cmd);
  } else {
    s3c2440_write_cmd(cmd);
  }
}


x86 assembly (clang, -O0):
<write_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x560000b0,%eax
mov    (%rax),%eax
cmp    $0x32410000,%eax
je     114f <write_cmd+0x2f>
mov    $0x560000b0,%eax
mov    (%rax),%eax
cmp    $0x32410002,%eax
jne    115c <write_cmd+0x3c>
mov    -0x4(%rbp),%edi
call   1040 <s3c2410_write_cmd@plt>
jmp    1164 <write_cmd+0x44>
mov    -0x4(%rbp),%edi
call   1030 <s3c2440_write_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_cmd>:
mov    0x560000b0,%eax
cmp    $0x32410000,%eax
je     113c <write_cmd+0x1c>
mov    0x560000b0,%eax
cmp    $0x32410002,%eax
jne    1141 <write_cmd+0x21>
jmp    1040 <s3c2410_write_cmd@plt>
jmp    1030 <s3c2440_write_cmd@plt>

LLVM IR (-O0):
define void @write_cmd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%4 = icmp eq i32 %3, 843120640
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%7 = icmp eq i32 %6, 843120642
br i1 %7, label %8, label %11
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = call i32 @s3c2410_write_cmd(i32 %9)
br label %14
11: ; preds = %5
%12 = load i32, i32* %2
%13 = call i32 @s3c2440_write_cmd(i32 %12)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
define void @write_cmd(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%3 = icmp eq i32 %2, 843120640
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%6 = icmp eq i32 %5, 843120642
br i1 %6, label %7, label %9
7: ; preds = %4, %1
%8 = tail call i32 @s3c2410_write_cmd(i32 %0)
br label %11
9: ; preds = %4
%10 = tail call i32 @s3c2440_write_cmd(i32 %0)
br label %11
11: ; preds = %9, %7
ret void
}
void doNothing() { return; }


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

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

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

LLVM IR (-O2):
define void @doNothing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i, j = 0;
  for (i = 0; !i; i++)
    j++;
  printf("%d", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1143 <main+0x33>
jmp    115a <main+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
void _M2_Strings_init(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


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

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

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

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

/* Variables and functions */
struct stack *create_stack();
int /*<<< orphan*/ stack_dispose(struct stack *);
int /*<<< orphan*/ stack_pop(struct stack *);
int /*<<< orphan*/ stack_push(struct stack *, int);
int main() {
  struct stack *s = create_stack();
  stack_push(s, 10);
  stack_push(s, 20);
  stack_pop(s);
  stack_pop(s);
  stack_dispose(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <create_stack@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <stack_push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1040 <stack_push@plt>
mov    -0x10(%rbp),%rdi
call   1050 <stack_pop@plt>
mov    -0x10(%rbp),%rdi
call   1050 <stack_pop@plt>
mov    -0x10(%rbp),%rdi
call   1060 <stack_dispose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <create_stack@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1040 <stack_push@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <stack_push@plt>
mov    %rbx,%rdi
call   1050 <stack_pop@plt>
mov    %rbx,%rdi
call   1050 <stack_pop@plt>
mov    %rbx,%rdi
call   1060 <stack_dispose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.stack = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stack*
store i32 0, i32* %1
%3 = call %struct.stack* (...) @create_stack()
store %struct.stack* %3, %struct.stack** %2
%4 = load %struct.stack*, %struct.stack** %2
%5 = call i32 @stack_push(%struct.stack* %4, i32 10)
%6 = load %struct.stack*, %struct.stack** %2
%7 = call i32 @stack_push(%struct.stack* %6, i32 20)
%8 = load %struct.stack*, %struct.stack** %2
%9 = call i32 @stack_pop(%struct.stack* %8)
%10 = load %struct.stack*, %struct.stack** %2
%11 = call i32 @stack_pop(%struct.stack* %10)
%12 = load %struct.stack*, %struct.stack** %2
%13 = call i32 @stack_dispose(%struct.stack* %12)
ret i32 0
}

LLVM IR (-O2):
%struct.stack = type { i32 }
define i32 @main() {
%1 = tail call %struct.stack* (...) @create_stack()
%2 = tail call i32 @stack_push(%struct.stack* %1, i32 10)
%3 = tail call i32 @stack_push(%struct.stack* %1, i32 20)
%4 = tail call i32 @stack_pop(%struct.stack* %1)
%5 = tail call i32 @stack_pop(%struct.stack* %1)
%6 = tail call i32 @stack_dispose(%struct.stack* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ naturalNums(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  printf("Enter the interval in whic to print the natural nums\n");
  printf("Enter it like: a:b, where a and b are natural nums\n");
  int num, max;
  scanf("%d:%d", &num, &max);
  naturalNums(num, max);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <naturalNums@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <naturalNums@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"Enter the interval in whic to print the natural nums\0A\00"
@.str.1 = [52 x i8] c"Enter it like: a:b, where a and b are natural nums\0A\00"
@.str.2 = [6 x i8] c"%d:%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @naturalNums(i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"%d:%d\00"
@str = [53 x i8] c"Enter the interval in whic to print the natural nums\00"
@str.3 = [51 x i8] c"Enter it like: a:b, where a and b are natural nums\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.3, i64 0, i64 0))
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @naturalNums(i32 %8, i32 %9)
ret i32 0
}
void printMsg(int num) {
  int i, b;
  int a = 16;
  for (i = 0; i < 230000000; i++) {
    b = a * a;
  }
}


x86 assembly (clang, -O0):
<printMsg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x10,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xdb58580,-0x8(%rbp)
jge    113a <printMsg+0x3a>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <printMsg+0x15>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @printMsg(i32 %0) {
ret void
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
extern int c_getTermCols() {
  struct winsize w;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  return w.ws_col;
}


x86 assembly (clang, -O0):
<c_getTermCols>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_getTermCols>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @c_getTermCols() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @c_getTermCols() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Serial_beginEnergia(int, long);
void serialInitializeEnergia(int port, long baud) {
  Serial_beginEnergia(port, baud);
}


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

x86 assembly (clang, -O2):
<serialInitializeEnergia>:
jmp    1030 <Serial_beginEnergia@plt>

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

LLVM IR (-O2):
define void @serialInitializeEnergia(i32 %0, i64 %1) {
%3 = tail call i32 @Serial_beginEnergia(i32 %0, i64 %1)
ret void
}
int main(void) { return !42; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @authnone_destroy() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int before(uint32_t seq1, uint32_t seq2) { return (int32_t)(seq1 - seq2) < 0; }


x86 assembly (clang, -O0):
<before>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<before>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @before(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @before(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned long EEPROMBlockProtectSet(unsigned long ulBlock,
                                    unsigned long ulProtect) {
  ;
  (*((volatile unsigned long *)(0x400AF004))) = ulBlock;
  (*((volatile unsigned long *)(0x400AF030))) = ulProtect;
  while ((*((volatile unsigned long *)(0x400AF018))) & 0x00000001) {
  }
  return ((*((volatile unsigned long *)(0x400AF018))));
}


x86 assembly (clang, -O0):
<EEPROMBlockProtectSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400af004,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    $0x400af030,%eax
mov    %rcx,(%rax)
mov    $0x400af018,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     113f <EEPROMBlockProtectSet+0x3f>
jmp    1124 <EEPROMBlockProtectSet+0x24>
mov    $0x400af018,%eax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMBlockProtectSet>:
mov    %rdi,0x400af004
40
mov    %rsi,0x400af030
40
mov    0x400af018,%rax
40
test   $0x1,%al
jne    1110 <EEPROMBlockProtectSet+0x10>
mov    0x400af018,%rax
40
ret

LLVM IR (-O0):
define i64 @EEPROMBlockProtectSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
store volatile i64 %5, i64* inttoptr (i64 1074458628 to i64*)
%6 = load i64, i64* %4
store volatile i64 %6, i64* inttoptr (i64 1074458672 to i64*)
br label %7
7: ; preds = %11, %2
%8 = load volatile i64, i64* inttoptr (i64 1074458648 to i64*)
%9 = and i64 %8, 1
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
%13 = load volatile i64, i64* inttoptr (i64 1074458648 to i64*)
ret i64 %13
}

LLVM IR (-O2):
define i64 @EEPROMBlockProtectSet(i64 %0, i64 %1) {
store volatile i64 %0, i64* inttoptr (i64 1074458628 to i64*)
store volatile i64 %1, i64* inttoptr (i64 1074458672 to i64*)
br label %3
3: ; preds = %3, %2
%4 = load volatile i64, i64* inttoptr (i64 1074458648 to i64*)
%5 = and i64 %4, 1
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
%8 = load volatile i64, i64* inttoptr (i64 1074458648 to i64*)
ret i64 %8
}
void d2i_PKCS8_PRIV_KEY_INFO(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_PKCS8_PRIV_KEY_INFO() {
ret void
}
char interval_subtract(char a, char x, char range_min, char range_max) {
  a -= range_min;
  if (a < x) {
    x -= a + 1;
    a = range_max - range_min;
  }
  return (a - x) + range_min;
}


x86 assembly (clang, -O0):
<interval_subtract>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movsbl -0x3(%rbp),%ecx
movsbl -0x1(%rbp),%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    1155 <interval_subtract+0x55>
movsbl -0x1(%rbp),%ecx
add    $0x1,%ecx
movsbl -0x2(%rbp),%eax
sub    %ecx,%eax
mov    %al,-0x2(%rbp)
movsbl -0x4(%rbp),%eax
movsbl -0x3(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    %ecx,%eax
movsbl -0x3(%rbp),%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interval_subtract>:
sub    %dl,%dil
lea    0x1(%rdi),%eax
sub    %dl,%cl
xor    %r8d,%r8d
cmp    %sil,%dil
movzbl %al,%eax
cmovge %r8d,%eax
movzbl %cl,%ecx
movzbl %dil,%edi
cmovl  %ecx,%edi
sub    %sil,%dl
add    %dl,%al
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @interval_subtract(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, %10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %5
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = load i8, i8* %6
%18 = sext i8 %17 to i32
%19 = icmp slt i32 %16, %18
br i1 %19, label %20, label %34
20: ; preds = %4
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 1
%24 = load i8, i8* %6
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, %23
%27 = trunc i32 %26 to i8
store i8 %27, i8* %6
%28 = load i8, i8* %8
%29 = sext i8 %28 to i32
%30 = load i8, i8* %7
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %29, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %5
br label %34
34: ; preds = %20, %4
%35 = load i8, i8* %5
%36 = sext i8 %35 to i32
%37 = load i8, i8* %6
%38 = sext i8 %37 to i32
%39 = sub nsw i32 %36, %38
%40 = load i8, i8* %7
%41 = sext i8 %40 to i32
%42 = add nsw i32 %39, %41
%43 = trunc i32 %42 to i8
ret i8 %43
}

LLVM IR (-O2):
define signext i8 @interval_subtract(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = sub i8 %0, %2
%6 = icmp slt i8 %5, %1
%7 = add i8 %5, 1
%8 = sub i8 %3, %2
%9 = select i1 %6, i8 %7, i8 0
%10 = select i1 %6, i8 %8, i8 %5
%11 = sub i8 %2, %1
%12 = add i8 %11, %9
%13 = add i8 %12, %10
ret i8 %13
}
/* Variables and functions */
void *_malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *_calloc(size_t num, size_t size) {
  void *retval = _malloc(num * size);
  if (retval) {
    memset(retval, 0, num * size);
  }
  return retval;
}


x86 assembly (clang, -O0):
<_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <_calloc+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <_calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
void nuc970_init_suspend(void) {}


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

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

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

LLVM IR (-O2):
define void @nuc970_init_suspend() {
ret void
}
__typeof__(isspace(1)) test_isspace_55(void) { return isspace(1); }


x86 assembly (clang, -O0):
<test_isspace_55>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <isspace@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isspace_55>:
mov    $0x1,%edi
jmp    1030 <isspace@plt>

LLVM IR (-O0):
define i32 @test_isspace_55() {
%1 = call i32 @isspace(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_isspace_55() {
%1 = tail call i32 @isspace(i32 1)
ret i32 %1
}