xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ getpid();
unsigned long mix(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ srand(unsigned long);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void seed_random(void) {
  unsigned long seed = mix(clock(), time(NULL), getpid());
  srand(seed);
}


x86 assembly (clang, -O0):
<seed_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clock@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
call   1050 <mix@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed_random>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <clock@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <mix@plt>
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <srand@plt>

LLVM IR (-O0):
define void @seed_random() {
%1 = alloca i64
%2 = call i32 (...) @clock()
%3 = call i32 @time(i32* null)
%4 = call i32 (...) @getpid()
%5 = call i64 @mix(i32 %2, i32 %3, i32 %4)
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = call i32 @srand(i64 %6)
ret void
}

LLVM IR (-O2):
define void @seed_random() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 (...) @getpid()
%4 = tail call i64 @mix(i32 %1, i32 %2, i32 %3)
%5 = tail call i32 @srand(i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int errx(int exv, char *str) {
  fprintf(stderr, "cal: %s\n", str);
  exit(exv);
}


x86 assembly (clang, -O0):
<errx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errx>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%ebx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"cal: %s\0A\00"
define i32 @errx(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %3
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"cal: %s\0A\00"
define i32 @errx(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
char const *ERR_getErrorName(size_t);
const char *ZBUFF_getErrorName(size_t errorCode) {
  return ERR_getErrorName(errorCode);
}


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

x86 assembly (clang, -O2):
<ZBUFF_getErrorName>:
jmp    1030 <ERR_getErrorName@plt>

LLVM IR (-O0):
define i8* @ZBUFF_getErrorName(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @ERR_getErrorName(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @ZBUFF_getErrorName(i64 %0) {
%2 = tail call i8* @ERR_getErrorName(i64 %0)
ret i8* %2
}
void nxtd_bt_shutdown() {}


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

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

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

LLVM IR (-O2):
define void @nxtd_bt_shutdown() {
ret void
}
int init_dummy(int side, float skill) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_dummy(i32 %0, float %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ _uname(char *);
int main(int argc, char *argv[]) {
  int ret = 0;
  (void)argc;
  ret += _uname(argv[0]);
  return (ret == 0) ? 0 : 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <_uname@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1030 <_uname@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i64 @_uname(i8* %10)
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 0, i32 2
ret i32 %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @_uname(i8* %3)
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 0, i32 2
ret i32 %7
}
/* Variables and functions */
int nvidia_mcp_gpio_set(int, int);
int nvidia_mcp_gpio4_raise(void) { return nvidia_mcp_gpio_set(0x04, 1); }


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

x86 assembly (clang, -O2):
<nvidia_mcp_gpio4_raise>:
mov    $0x4,%edi
mov    $0x1,%esi
jmp    1030 <nvidia_mcp_gpio_set@plt>

LLVM IR (-O0):
define i32 @nvidia_mcp_gpio4_raise() {
%1 = call i32 @nvidia_mcp_gpio_set(i32 4, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @nvidia_mcp_gpio4_raise() {
%1 = tail call i32 @nvidia_mcp_gpio_set(i32 4, i32 1)
ret i32 %1
}
int checkAlive(int *current, int length) {
  for (int i = 0; i < length - 1; i++)
    if (*(current + i) != 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<checkAlive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1154 <checkAlive+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1141 <checkAlive+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <checkAlive+0x5b>
jmp    1146 <checkAlive+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <checkAlive+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkAlive>:
xor    %eax,%eax
cmp    $0x2,%esi
jl     1111 <checkAlive+0x11>
mov    $0x1,%eax
cmpl   $0x0,(%rdi)
je     1112 <checkAlive+0x12>
ret
add    $0xffffffff,%esi
mov    %esi,%ecx
mov    $0x1,%eax
nopl   0x0(%rax)
mov    %rax,%rdx
cmp    %rax,%rcx
je     1132 <checkAlive+0x32>
lea    0x1(%rdx),%rax
cmpl   $0x0,(%rdi,%rdx,4)
je     1120 <checkAlive+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @checkAlive(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %21
5: ; preds = %2
%6 = zext i32 %3 to i64
%7 = zext i32 %3 to i64
%8 = load i32, i32* %0
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %5, %13
%11 = phi i64 [ %17, %13 ], [ 1, %5 ]
%12 = icmp eq i64 %11, %7
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, i32* %0, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %10, label %18
18: ; preds = %10, %13
%19 = icmp ult i64 %11, %6
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %5, %2
%22 = phi i32 [ 0, %2 ], [ 1, %5 ], [ %20, %18 ]
ret i32 %22
}
/* Variables and functions */
void *realloc(char *, unsigned int);
int alloc_vector_memory(char **data, unsigned int *capacity,
                        unsigned int data_size, unsigned int new_capacity) {
  void *ptr;
  if ((ptr = realloc(*data, new_capacity * data_size)) == NULL)
    return -1;
  *data = ptr;
  *capacity = new_capacity;
  return 0;
}


x86 assembly (clang, -O0):
<alloc_vector_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%esi
imul   -0x1c(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1153 <alloc_vector_memory+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <alloc_vector_memory+0x5e>
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_vector_memory>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
imul   %ecx,%edx
mov    %edx,%esi
call   1030 <realloc@plt>
test   %rax,%rax
je     1138 <alloc_vector_memory+0x28>
mov    %rax,(%rbx)
mov    %ebp,(%r14)
xor    %eax,%eax
jmp    113d <alloc_vector_memory+0x2d>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @alloc_vector_memory(i8** nocapture %0, i32* nocapture writeonly %1, i32 %2, i32 %3) {
%5 = load i8*, i8** %0
%6 = mul i32 %3, %2
%7 = tail call i8* @realloc(i8* %5, i32 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %4
store i8* %7, i8** %0
store i32 %3, i32* %1
br label %10
10: ; preds = %4, %9
%11 = phi i32 [ 0, %9 ], [ -1, %4 ]
ret i32 %11
}
/* Variables and functions */
int cube(int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 2;
  printf("x is now %d\n", x);
  printf("Cubing...\n");
  x = cube(x);
  printf("Cubed!\n");
  printf("x is now %d\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <cube@plt>
mov    %eax,-0x4(%rbp)
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1050 <cube@plt>
mov    %eax,%ebp
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"x is now %d\0A\00"
@.str.1 = [11 x i8] c"Cubing...\0A\00"
@.str.2 = [8 x i8] c"Cubed!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 2, i32* %1
%2 = load i32, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = call i32 @cube(i32 %5)
store i32 %6, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"x is now %d\0A\00"
@str = [10 x i8] c"Cubing...\00"
@str.3 = [7 x i8] c"Cubed!\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @cube(i32 2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void *sspm_default_end_part(void *part) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @sspm_default_end_part(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
struct queue {
  int dummy;
};
struct el {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
struct el *q_pop_error(struct queue *q) {
  printf("q_pop_error()\n");
  abort();
}


x86 assembly (clang, -O0):
<q_pop_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<q_pop_error>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.el = type { i32 }
%struct.queue = type { i32 }
@.str = [15 x i8] c"q_pop_error()\0A\00"
define %struct.el* @q_pop_error(%struct.queue* %0) {
%2 = alloca %struct.queue*
store %struct.queue* %0, %struct.queue** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.el = type { i32 }
%struct.queue = type { i32 }
@str = [14 x i8] c"q_pop_error()\00"
define noalias %struct.el* @q_pop_error(%struct.queue* nocapture readnone %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 (...) @abort()
unreachable
}
unsigned int rol(const unsigned int value, const unsigned int steps) {
  return ((value << steps) | (value >> (32 - steps)));
}


x86 assembly (clang, -O0):
<rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rol(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
double potencia(double x, int n) {
  int i;
  double potencia = 1;
  for (i = 0; i < n; i++)
    potencia = potencia * x;
  return potencia;
}


x86 assembly (clang, -O0):
<potencia>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1149 <potencia+0x49>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <potencia+0x20>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<potencia>:
test   %edi,%edi
jle    111b <potencia+0x1b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1124 <potencia+0x24>
movsd  0xee7(%rip),%xmm1
jmp    1155 <potencia+0x55>
movsd  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%edi
movsd  0xed1(%rip),%xmm1
nop
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
jne    1130 <potencia+0x30>
test   %eax,%eax
je     1169 <potencia+0x69>
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1160 <potencia+0x60>
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @potencia(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi double [ 1.000000e+00, %8 ], [ %20, %10 ]
%12 = phi i32 [ 0, %8 ], [ %21, %10 ]
%13 = fmul double %11, %0
%14 = fmul double %13, %0
%15 = fmul double %14, %0
%16 = fmul double %15, %0
%17 = fmul double %16, %0
%18 = fmul double %17, %0
%19 = fmul double %18, %0
%20 = fmul double %19, %0
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi double [ undef, %4 ], [ %20, %10 ]
%25 = phi double [ 1.000000e+00, %4 ], [ %20, %10 ]
%26 = icmp eq i32 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi double [ %30, %27 ], [ %25, %23 ]
%29 = phi i32 [ %31, %27 ], [ 0, %23 ]
%30 = fmul double %28, %0
%31 = add i32 %29, 1
%32 = icmp eq i32 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi double [ 1.000000e+00, %2 ], [ %24, %23 ], [ %30, %27 ]
ret double %34
}
int letter(char c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_';
}


x86 assembly (clang, -O0):
<letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <letter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <letter+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <letter+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <letter+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letter>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
cmp    $0x5f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @letter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %22, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %22, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 95
br label %22
22: ; preds = %18, %14, %6
%23 = phi i1 [ true, %14 ], [ true, %6 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @letter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = icmp eq i8 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
unsigned long GET_BITS(unsigned long, int, int);
unsigned long __vaddr_bounds_directory_index(void *vaddr) {
  return GET_BITS((unsigned long)vaddr, 20, 47);
}


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

x86 assembly (clang, -O2):
<__vaddr_bounds_directory_index>:
mov    $0x14,%esi
mov    $0x2f,%edx
jmp    1030 <GET_BITS@plt>

LLVM IR (-O0):
define i64 @__vaddr_bounds_directory_index(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i64 @GET_BITS(i64 %4, i32 20, i32 47)
ret i64 %5
}

LLVM IR (-O2):
define i64 @__vaddr_bounds_directory_index(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i64 @GET_BITS(i64 %2, i32 20, i32 47)
ret i64 %3
}
char gearChar(int g) {
  switch (g) {
  case 0:
    return 'r';
  case 1:
    return 'n';
  case 2:
    return '1';
  case 3:
    return '2';
  case 4:
    return '3';
  case 5:
    return '4';
  case 6:
    return '5';
  case 7:
    return '6';
  case 8:
    return '7';
  }
  return '*';
}


x86 assembly (clang, -O0):
<gearChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x8,%rax
ja     117d <gearChar+0x7d>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x72,-0x1(%rbp)
jmp    1181 <gearChar+0x81>
movb   $0x6e,-0x1(%rbp)
jmp    1181 <gearChar+0x81>
movb   $0x31,-0x1(%rbp)
jmp    1181 <gearChar+0x81>
movb   $0x32,-0x1(%rbp)
jmp    1181 <gearChar+0x81>
movb   $0x33,-0x1(%rbp)
jmp    1181 <gearChar+0x81>
movb   $0x34,-0x1(%rbp)
jmp    1181 <gearChar+0x81>
movb   $0x35,-0x1(%rbp)
jmp    1181 <gearChar+0x81>
movb   $0x36,-0x1(%rbp)
jmp    1181 <gearChar+0x81>
movb   $0x37,-0x1(%rbp)
jmp    1181 <gearChar+0x81>
movb   $0x2a,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gearChar>:
mov    $0x2a,%al
cmp    $0x8,%edi
ja     1114 <gearChar+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
define signext i8 @gearChar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %14 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
]
5: ; preds = %1
store i8 114, i8* %2
br label %15
6: ; preds = %1
store i8 110, i8* %2
br label %15
7: ; preds = %1
store i8 49, i8* %2
br label %15
8: ; preds = %1
store i8 50, i8* %2
br label %15
9: ; preds = %1
store i8 51, i8* %2
br label %15
10: ; preds = %1
store i8 52, i8* %2
br label %15
11: ; preds = %1
store i8 53, i8* %2
br label %15
12: ; preds = %1
store i8 54, i8* %2
br label %15
13: ; preds = %1
store i8 55, i8* %2
br label %15
14: ; preds = %1
store i8 42, i8* %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
@switch.table.gearChar = [9 x i8] c"rn1234567"
define signext i8 @gearChar(i32 %0) {
%2 = icmp ult i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [9 x i8], [9 x i8]* @switch.table.gearChar, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 42, %1 ]
ret i8 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_ENUMERATED;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ENUMERATED_it;
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
ASN1_ENUMERATED *ASN1_ENUMERATED_new(void) {
  return (ASN1_ENUMERATED *)ASN1_item_new(&ASN1_ENUMERATED_it);
}


x86 assembly (clang, -O0):
<ASN1_ENUMERATED_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_ENUMERATED_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@ASN1_ENUMERATED_it = global i32 0
define i32* @ASN1_ENUMERATED_new() {
%1 = call i64 @ASN1_item_new(i32* @ASN1_ENUMERATED_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@ASN1_ENUMERATED_it = global i32 0
define i32* @ASN1_ENUMERATED_new() {
%1 = tail call i64 @ASN1_item_new(i32* @ASN1_ENUMERATED_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void eighteen(const int k) {
  int _k = k * k;
  _k += _k;
  _k *= _k;
  _k -= 1;
  printf("Result: %d\n", _k);
}


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

x86 assembly (clang, -O2):
<eighteen>:
imul   %edi,%edi
lea    (%rdi,%rdi,1),%esi
imul   %esi,%esi
add    $0xffffffff,%esi
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"Result: %d\0A\00"
define void @eighteen(i32 %0) {
%2 = shl i32 %0, 1
%3 = mul i32 %2, %0
%4 = mul nsw i32 %3, %3
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
int bsp_sec_check(unsigned int image_addr, unsigned int image_length) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @bsp_sec_check(i32 %0, i32 %1) {
ret i32 0
}
char *strcat(char *dest, const char *src) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @strcat(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
int map(int rms) {
  int v = rms / 8;
  if (v >= (80 - 1)) {
    v = 80 - 1;
  }
  return v;
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x4f,-0x8(%rbp)
jl     1126 <map+0x26>
movl   $0x4f,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
mov    $0x4f,%eax
cmp    $0x277,%edi
jg     1118 <map+0x18>
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @map(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 8
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 79
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 79, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @map(i32 %0) {
%2 = sdiv i32 %0, 8
%3 = icmp sgt i32 %0, 631
%4 = select i1 %3, i32 79, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  for (a = 0; a <= 256; a++) {
    printf("%d - ", a);
    printf("%c\n", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     115f <main+0x4f>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xee2(%rip),%r14
lea    0xee1(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x101,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d - \00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 257
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void exit_function(int signal) {
  printf("I cought a signal. It's number is %d\n", signal);
  printf("Will exit now\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exit_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_function>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"I cought a signal. It's number is %d\0A\00"
@.str.1 = [15 x i8] c"Will exit now\0A\00"
define void @exit_function(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"I cought a signal. It's number is %d\0A\00"
@str = [14 x i8] c"Will exit now\00"
define void @exit_function(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ japi_setdanger(int, int);
void j_setdanger(int arg0, int arg1) { japi_setdanger(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_setdanger>:
jmp    1030 <japi_setdanger@plt>

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

LLVM IR (-O2):
define void @j_setdanger(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setdanger(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int test_eval2(int);
int lisp_test5() { return test_eval2(3); }


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

x86 assembly (clang, -O2):
<lisp_test5>:
mov    $0x3,%edi
jmp    1030 <test_eval2@plt>

LLVM IR (-O0):
define i32 @lisp_test5() {
%1 = call i32 @test_eval2(i32 3)
ret i32 %1
}

LLVM IR (-O2):
define i32 @lisp_test5() {
%1 = tail call i32 @test_eval2(i32 3)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ b_function();
int /*<<< orphan*/ c_function();
void a_function(void) {
  b_function();
  c_function();
}


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

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

LLVM IR (-O0):
define void @a_function() {
%1 = call i32 (...) @b_function()
%2 = call i32 (...) @c_function()
ret void
}

LLVM IR (-O2):
define void @a_function() {
%1 = tail call i32 (...) @b_function()
%2 = tail call i32 (...) @c_function()
ret void
}
int foo(void) {
  int x;
  {
    x = 5;
    return (0);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void safer_free(void **mem) {
  if (mem && *mem) {
    free(*mem);
    *mem = NULL;
  }
  return;
}


x86 assembly (clang, -O0):
<safer_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <safer_free+0x3c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <safer_free+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safer_free>:
push   %rbx
test   %rdi,%rdi
je     112d <safer_free+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <safer_free+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @safer_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %6, %3, %1
ret void
}
int compareInt(const void *ap, const void *bp) {
  const int *a = ap, *b = bp;
  if (*a > *b)
    return 1;
  if (*a < *b)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<compareInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    113a <compareInt+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115f <compareInt+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <compareInt+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <compareInt+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareInt>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compareInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp slt i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
struct hostent *gethostbyname(name) const char *name;
{
  return 0;
}


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

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

LLVM IR (-O0):
%struct.hostent = type opaque
define %struct.hostent* @gethostbyname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.hostent* null
}

LLVM IR (-O2):
%struct.hostent = type opaque
define noalias %struct.hostent* @gethostbyname(i8* nocapture readnone %0) {
ret %struct.hostent* null
}
/* Variables and functions */
int /*<<< orphan*/ jv_test();
int /*<<< orphan*/ run_jq_tests(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int jq_testsuite(int argc, char *argv[]) {
  jv_test();
  run_jq_tests(stdin);
  return 0;
}


x86 assembly (clang, -O0):
<jq_testsuite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <jv_test@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <run_jq_tests@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jq_testsuite>:
push   %rax
xor    %eax,%eax
call   1030 <jv_test@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1040 <run_jq_tests@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @jq_testsuite(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @jv_test()
%6 = load i32, i32* @stdin
%7 = call i32 @run_jq_tests(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @jq_testsuite(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @jv_test()
%4 = load i32, i32* @stdin
%5 = tail call i32 @run_jq_tests(i32 %4)
ret i32 0
}
void NV12ToRGB24Row_C() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToRGB24Row_C() {
ret void
}
int omap_mux_init_gpio(int gpio, int val) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap_mux_init_gpio(i32 %0, i32 %1) {
ret i32 0
}
void Prep_fft_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @Prep_fft_terminate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ testprintenv();
int /*<<< orphan*/ unsetenv(char const *);
void testunsetenv(const char *name) {
  printf("unsetenv (\"%s\"):\n", name);
  unsetenv(name);
  testprintenv();
}


x86 assembly (clang, -O0):
<testunsetenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <unsetenv@plt>
mov    $0x0,%al
call   1040 <testprintenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testunsetenv>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <unsetenv@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <testprintenv@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"unsetenv (\22%s\22):\0A\00"
define void @testunsetenv(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @unsetenv(i8* %0)
%4 = tail call i32 (...) @testprintenv()
ret void
}
/* Variables and functions */
int writeStr(char const *, char *);
bool setKernelOptionEnable(const char *filename, bool enable) {
  return writeStr(filename, enable ? "1" : "0");
}


x86 assembly (clang, -O0):
<setKernelOptionEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xed5(%rip),%rsi
lea    0xecc(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
call   1030 <writeStr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setKernelOptionEnable>:
test   %esi,%esi
lea    0xee9(%rip),%rax
lea    0xee0(%rip),%rsi
cmove  %rax,%rsi
jmp    1030 <writeStr@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @setKernelOptionEnable(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%10 = call i32 @writeStr(i8* %5, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @setKernelOptionEnable(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @writeStr(i8* %0, i8* %4)
ret i32 %5
}