xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void exit_failure(void) {
  printf("FAILURE\n");
  fflush(NULL);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<exit_failure>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exit_failure>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"FAILURE\0A\00"
@EXIT_FAILURE = global i32 0
define void @exit_failure() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @fflush(i32* null)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [8 x i8] c"FAILURE\00"
define void @exit_failure() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @fflush(i32* null)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *newstr(char *str) {
  char *str2 = (char *)malloc(strlen(str) + 1);
  if (str2 == NULL)
    return NULL;
  strcpy(str2, str);
  return str2;
}


x86 assembly (clang, -O0):
<newstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <newstr+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <newstr+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115a <newstr+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115c <newstr+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @newstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %1
store i8* null, i8** %2
br label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %13, %12
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @newstr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
int fib(int x, int *n_calls) {
  if (x == 0) {
    ++(*n_calls);
    return 0;
  } else if (x == 1) {
    ++(*n_calls);
    return 1;
  } else {
    ++(*n_calls);
    return (fib(x - 1, n_calls) + fib(x - 2, n_calls));
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1140 <fib+0x30>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1197 <fib+0x87>
cmpl   $0x1,-0x8(%rbp)
jne    1161 <fib+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1197 <fib+0x87>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fib@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1139 <fib+0x29>
addl   $0x1,(%r14)
lea    -0x1(%rbx),%edi
mov    %r14,%rsi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
addl   $0x1,(%r14)
add    %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0, i32* %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32 [ 0, %2 ], [ %13, %7 ]
%5 = phi i32 [ %0, %2 ], [ %12, %7 ]
%6 = icmp ult i32 %5, 2
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = add nsw i32 %5, -1
%11 = tail call i32 @fib(i32 %10, i32* %1)
%12 = add nsw i32 %5, -2
%13 = add nsw i32 %11, %4
br label %3
14: ; preds = %3
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
%17 = add nsw i32 %5, %4
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, char const *, int const);
void smmAbortWithMessage(const char *msg, const char *filename,
                         const int line) {
  printf("Compiler Error: %s (at %s:%d)\n", msg, filename, line);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<smmAbortWithMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<smmAbortWithMessage>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Compiler Error: %s (at %s:%d)\0A\00"
@EXIT_FAILURE = global i32 0
define void @smmAbortWithMessage(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"Compiler Error: %s (at %s:%d)\0A\00"
@EXIT_FAILURE = global i32 0
define void @smmAbortWithMessage(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ g();
void f(int a, int b) {
  int c = 0;
  if (a == 0)
    c = 1;
  if (c)
    return;
  if (c == 1)
    c = 0;
  if (b == 0)
    c = 1;
  if (c)
    g();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <f+0x26>
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1145 <f+0x35>
jmp    1178 <f+0x68>
cmpl   $0x1,-0xc(%rbp)
jne    1156 <f+0x46>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1167 <f+0x57>
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1178 <f+0x68>
mov    $0x0,%al
call   1030 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
je     111f <f+0xf>
test   %esi,%esi
jne    111f <f+0xf>
xor    %eax,%eax
jmp    1030 <g@plt>
ret

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

LLVM IR (-O2):
define void @f(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @g()
br label %8
8: ; preds = %6, %2
ret void
}
void noop(char *ignored) {}


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

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

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

LLVM IR (-O2):
define void @noop(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sgg_execcmd0(int, int, int, int const, int /*<<< orphan*/,
                                int, int, int const, int);
void sgg_format(const int sub_cmd, const int sig) {
  sgg_execcmd0(0x0020, 0x80000000 + 6, 0x1245, sub_cmd, 0, 0x4242, 0x7f000001,
               sig, 0x0000);
  return;
}


x86 assembly (clang, -O0):
<sgg_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
mov    $0x20,%edi
mov    $0x80000006,%esi
mov    $0x1245,%edx
xor    %r8d,%r8d
mov    $0x4242,%r9d
movl   $0x7f000001,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <sgg_execcmd0@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgg_format>:
push   %rax
mov    %esi,%eax
mov    %edi,%ecx
sub    $0x8,%rsp
mov    $0x20,%edi
mov    $0x80000006,%esi
mov    $0x1245,%edx
xor    %r8d,%r8d
mov    $0x4242,%r9d
push   $0x0
push   %rax
push   $0x7f000001
call   1030 <sgg_execcmd0@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @sgg_format(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 @sgg_execcmd0(i32 32, i32 -2147483642, i32 4677, i32 %5, i32 0, i32 16962, i32 2130706433, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @sgg_format(i32 %0, i32 %1) {
%3 = tail call i32 @sgg_execcmd0(i32 32, i32 -2147483642, i32 4677, i32 %0, i32 0, i32 16962, i32 2130706433, i32 %1, i32 0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr8setBank0(int);
int /*<<< orphan*/ prg32setBank0(int);
void m148_setParams(uint16_t addr, uint8_t val) {
  (void)addr;
  chr8setBank0((val & 7) << 13);
  prg32setBank0(((val >> 3) & 1) << 15);
}


x86 assembly (clang, -O0):
<m148_setParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xd,%edi
call   1040 <chr8setBank0@plt>
mov    -0x8(%rbp),%edi
sar    $0x3,%edi
and    $0x1,%edi
shl    $0xf,%edi
call   1030 <prg32setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m148_setParams>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%eax
shl    $0xd,%eax
movzwl %ax,%edi
call   1040 <chr8setBank0@plt>
and    $0x8,%ebx
shl    $0xc,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <prg32setBank0@plt>

LLVM IR (-O0):
define void @m148_setParams(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 = and i32 %6, 7
%8 = shl i32 %7, 13
%9 = call i32 @chr8setBank0(i32 %8)
%10 = load i32, i32* %4
%11 = ashr i32 %10, 3
%12 = and i32 %11, 1
%13 = shl i32 %12, 15
%14 = call i32 @prg32setBank0(i32 %13)
ret void
}

LLVM IR (-O2):
define void @m148_setParams(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = and i32 %3, 57344
%5 = tail call i32 @chr8setBank0(i32 %4)
%6 = shl i32 %1, 12
%7 = and i32 %6, 32768
%8 = tail call i32 @prg32setBank0(i32 %7)
ret void
}
/* Variables and functions */
scalar_t__ ceilf(int /*<<< orphan*/);
float ldexpf(double, int);
int /*<<< orphan*/ log2f(float);
float frexpf(float x, int *exponent) {
  *exponent = (int)ceilf(log2f(x));
  return x / ldexpf(1.0, *exponent);
}


x86 assembly (clang, -O0):
<frexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log2f@plt>
mov    %eax,%edi
call   1040 <ceilf@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
movsd  0xe8e(%rip),%xmm0
call   1050 <ldexpf@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frexpf>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
call   1030 <log2f@plt>
mov    %eax,%edi
call   1040 <ceilf@plt>
mov    %eax,(%rbx)
movsd  0xeac(%rip),%xmm0
mov    %eax,%edi
call   1050 <ldexpf@plt>
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @frexpf(float %0, i32* %1) {
%3 = alloca float
%4 = alloca i32*
store float %0, float* %3
store i32* %1, i32** %4
%5 = load float, float* %3
%6 = call i32 @log2f(float %5)
%7 = call i64 @ceilf(i32 %6)
%8 = trunc i64 %7 to i32
%9 = load i32*, i32** %4
store i32 %8, i32* %9
%10 = load float, float* %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = call float @ldexpf(double 1.000000e+00, i32 %12)
%14 = fdiv float %10, %13
ret float %14
}

LLVM IR (-O2):
define float @frexpf(float %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @log2f(float %0)
%4 = tail call i64 @ceilf(i32 %3)
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = tail call float @ldexpf(double 1.000000e+00, i32 %5)
%7 = fdiv float %0, %6
ret float %7
}
char *langRomTypeMoonsound() { return "Moonsound"; }


x86 assembly (clang, -O0):
<langRomTypeMoonsound>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeMoonsound>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Moonsound\00"
define i8* @langRomTypeMoonsound() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"Moonsound\00"
define i8* @langRomTypeMoonsound() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
void Init_ext(void) {}


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

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

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

LLVM IR (-O2):
define void @Init_ext() {
ret void
}
/* Variables and functions */
bool ishex(unsigned char i) {
  if ((i >= '0' && i <= '9') || (i >= 'a' && i <= 'f') ||
      (i >= 'A' && i <= 'F')) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <ishex+0x24>
movzbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1158 <ishex+0x58>
movzbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     113e <ishex+0x3e>
movzbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jle    1158 <ishex+0x58>
movzbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1164 <ishex+0x64>
movzbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1164 <ishex+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <ishex+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ishex(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %27, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = icmp sle i32 %17, 102
br i1 %18, label %27, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = zext i8 %20 to i32
%22 = icmp sge i32 %21, 65
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = zext i8 %24 to i32
%26 = icmp sle i32 %25, 70
br i1 %26, label %27, label %28
27: ; preds = %23, %15, %7
store i32 1, i32* %2
br label %29
28: ; preds = %23, %19
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @ishex(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int am_getconfig_bool(const char *path) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @am_getconfig_bool(i8* nocapture readnone %0) {
ret i32 -1
}
int rename(from, to)
char *from, *to;
{
  (void)unlink(to);
  if (link(from, to) < 0)
    return -1;
  (void)unlink(from);
  return 0;
}


x86 assembly (clang, -O0):
<rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <link@plt>
cmp    $0x0,%eax
jge    115f <rename+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <rename+0x51>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <unlink@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbp
mov    %rdi,%rbx
xor    %r14d,%r14d
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <unlink@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <link@plt>
test   %eax,%eax
js     1154 <rename+0x34>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <unlink@plt>
jmp    115a <rename+0x3a>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rename(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %6)
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @link to i32 (i8*, i8*, ...)*)(i8* %8, i8* %9)
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %16
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @rename(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %1)
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @link to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%5 = icmp slt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %0)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int);
off_t __lseek(int fd, off_t offset, int whence) {
  return lseek(fd, offset, whence);
}


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

x86 assembly (clang, -O2):
<__lseek>:
jmp    1030 <lseek@plt>

LLVM IR (-O0):
define i32 @__lseek(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @lseek(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @__lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
unsigned int u32to_buf(unsigned int num, unsigned char *buf) {
  buf[0] = (num & 0xFF);
  buf[1] = ((num >> 8) & 0xFF);
  buf[2] = ((num >> 16) & 0xFF);
  buf[3] = ((num >> 24) & 0xFF);
}


x86 assembly (clang, -O0):
<u32to_buf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u32to_buf>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define i32 @u32to_buf(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = lshr i32 %17, 16
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %4
%24 = lshr i32 %23, 24
%25 = and i32 %24, 255
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 3
store i8 %26, i8* %28
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @u32to_buf(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
void dev_refresh() { refresh(); }


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

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

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

LLVM IR (-O2):
define void @dev_refresh() {
%1 = tail call i32 (...) @refresh()
ret void
}
const char *fsStrSkipSpaces(const char *psz) {
  while (*psz == ' ')
    psz++;
  return psz;
}


x86 assembly (clang, -O0):
<fsStrSkipSpaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1129 <fsStrSkipSpaces+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <fsStrSkipSpaces+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsStrSkipSpaces>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <fsStrSkipSpaces+0x10>
ret

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

LLVM IR (-O2):
define i8* @fsStrSkipSpaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
hibyte(i) int i;
{ return ((i >> 8) & 0xFF); }


x86 assembly (clang, -O0):
<hibyte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hibyte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @hibyte(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
int c_toupper(int c) { return (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c); }


x86 assembly (clang, -O0):
<c_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     112c <c_toupper+0x2c>
cmpl   $0x7a,-0x4(%rbp)
jg     112c <c_toupper+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <c_toupper+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @c_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 %10, 65
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @c_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *hello(void *_) {
  printf("hello...");
  return (void *)1;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"hello...\00"
define i8* @hello(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
@.str = [9 x i8] c"hello...\00"
define i8* @hello(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
char *c_malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *int_to_str(int nbr) {
  int lenght;
  char *str =
      c_malloc((lenght = (snprintf(NULL, 0, "%d", nbr) + 1)) * sizeof(char));
  snprintf(str, lenght, "%d", nbr);
  return str;
}


x86 assembly (clang, -O0):
<int_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xec5(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <c_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%ecx
lea    0xe98(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_str>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
lea    0xecf(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
call   1030 <snprintf@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1040 <c_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @int_to_str(i32 %0) {
%2 = tail call i32 @snprintf(i8* null, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @c_malloc(i32 %3)
%5 = tail call i32 @snprintf(i8* %4, i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ printf(char *);
int main(void) {
  bar();
  printf("OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bar()
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int bit_popcount(unsigned int v) { return __builtin_popcount(v); }


x86 assembly (clang, -O0):
<bit_popcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%ecx
mov    %ecx,%eax
and    $0x33333333,%eax
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_popcount>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @bit_popcount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctpop.i32(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @bit_popcount(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
ret i32 %2
}
void keystore_forget_secret(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @keystore_forget_secret(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void printUsageAndExit() {
  printf("usage: ./c_n_queens [-d] board_size\n");
  exit(1);
}


x86 assembly (clang, -O0):
<printUsageAndExit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printUsageAndExit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"usage: ./c_n_queens [-d] board_size\0A\00"
define void @printUsageAndExit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [36 x i8] c"usage: ./c_n_queens [-d] board_size\00"
define void @printUsageAndExit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool sjis_is_mb_start(uint8_t c) {
  if (0x81 <= c && c <= 0x9f)
    return true;
  if (0xe0 <= c && c <= 0xef)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<sjis_is_mb_start>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x81,%eax
cmp    -0x8(%rbp),%eax
jg     112e <sjis_is_mb_start+0x2e>
cmpl   $0x9f,-0x8(%rbp)
jg     112e <sjis_is_mb_start+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    115c <sjis_is_mb_start+0x5c>
mov    $0xe0,%eax
cmp    -0x8(%rbp),%eax
jg     1155 <sjis_is_mb_start+0x55>
cmpl   $0xef,-0x8(%rbp)
jg     1155 <sjis_is_mb_start+0x55>
movl   $0x1,-0x4(%rbp)
jmp    115c <sjis_is_mb_start+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sjis_is_mb_start>:
lea    -0x81(%rdi),%eax
cmp    $0x1f,%eax
setb   %al
and    $0xfffffff0,%edi
cmp    $0xe0,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @sjis_is_mb_start(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 129, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 159
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %18
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = icmp sle i32 224, %11
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 239
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %2
br label %18
17: ; preds = %13, %10
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @sjis_is_mb_start(i32 %0) {
%2 = add i32 %0, -129
%3 = icmp ult i32 %2, 31
%4 = and i32 %0, -16
%5 = icmp eq i32 %4, 224
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int as31(int a) { return (a >> 31) != 0; }


x86 assembly (clang, -O0):
<as31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<as31>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @as31(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 31
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @as31(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__11__GeneralIO__makeOutput();
void OneWireMasterC__Pin__makeOutput(void) {
  Msp430GpioC__11__GeneralIO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @OneWireMasterC__Pin__makeOutput() {
%1 = tail call i32 (...) @Msp430GpioC__11__GeneralIO__makeOutput()
ret void
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_position_unmask_le(void) {
  char ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1C, &ctrl_reg2, 1) == 0) {
    ctrl_reg2 &= ~0x20;
    KIONIX_ACCEL_write_byte(0x1C, ctrl_reg2);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_position_unmask_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1c,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_position_unmask_le+0x4d>
movsbl -0x1(%rbp),%eax
and    $0xffffffdf,%eax
mov    %al,-0x1(%rbp)
mov    $0x1c,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_position_unmask_le+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_position_unmask_le>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1c,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_position_unmask_le+0x41>
movsbl 0xf(%rsp),%esi
and    $0xffffffdf,%esi
mov    %sil,0xf(%rsp)
mov    $0x1c,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_position_unmask_le() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %7, -33
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_position_unmask_le() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = and i8 %5, -33
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 123;
  if (i > 0) {
    while (1) {
      if (i == 456)
        printf("1\n");
      i++;
    }
  } else {
    while (1) {
      if (i == 123)
        printf("2\n");
      i++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115c <main+0x4c>
jmp    1135 <main+0x25>
cmpl   $0x1c8,-0x8(%rbp)
jne    114e <main+0x3e>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <main+0x25>
jmp    1161 <main+0x51>
cmpl   $0x7b,-0x8(%rbp)
jne    1177 <main+0x67>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <main+0x51>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x14d,%ebp
lea    0xee1(%rip),%rbx
nop
sub    $0x1,%ebp
jae    1120 <main+0x10>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@str = [2 x i8] c"1\00"
define i32 @main() {
br label %1
1: ; preds = %0, %6
%2 = phi i32 [ 123, %0 ], [ %7, %6 ]
%3 = icmp eq i32 %2, 456
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = add nuw nsw i32 %2, 1
br label %1
}
/* Variables and functions */
int modular_pow(int, int, int);
int main() { return modular_pow(4, 13, 497); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
mov    $0xd,%esi
mov    $0x1f1,%edx
call   1030 <modular_pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x4,%edi
mov    $0xd,%esi
mov    $0x1f1,%edx
jmp    1030 <modular_pow@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @modular_pow(i32 4, i32 13, i32 497)
ret i32 %1
}
void g_date_get_days_in_month() {}


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

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

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

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

/* Variables and functions */
uint32_t gs_get_total_levels(uint32_t width, uint32_t height) {
  uint32_t size = width > height ? width : height;
  uint32_t num_levels = 0;
  while (size > 1) {
    size /= 2;
    num_levels++;
  }
  return num_levels;
}


x86 assembly (clang, -O0):
<gs_get_total_levels>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <gs_get_total_levels+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    112f <gs_get_total_levels+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x18(%rbp)
jle    116d <gs_get_total_levels+0x6d>
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113f <gs_get_total_levels+0x3f>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs_get_total_levels>:
cmp    %rsi,%rdi
cmovg  %rdi,%rsi
xor    %eax,%eax
cmp    $0x2,%rsi
jl     1130 <gs_get_total_levels+0x30>
mov    %rsi,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
shr    %rcx
add    $0x1,%rax
cmp    $0x3,%rsi
mov    %rcx,%rsi
ja     1120 <gs_get_total_levels+0x20>
ret

LLVM IR (-O0):
define i64 @gs_get_total_levels(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = icmp sgt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i64, i64* %3
br label %14
12: ; preds = %2
%13 = load i64, i64* %4
br label %14
14: ; preds = %12, %10
%15 = phi i64 [ %11, %10 ], [ %13, %12 ]
store i64 %15, i64* %5
store i64 0, i64* %6
br label %16
16: ; preds = %19, %14
%17 = load i64, i64* %5
%18 = icmp sgt i64 %17, 1
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i64, i64* %5
%21 = sdiv i64 %20, 2
store i64 %21, i64* %5
%22 = load i64, i64* %6
%23 = add nsw i64 %22, 1
store i64 %23, i64* %6
br label %16
24: ; preds = %16
%25 = load i64, i64* %6
ret i64 %25
}

LLVM IR (-O2):
define i64 @gs_get_total_levels(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
%5 = icmp sgt i64 %4, 1
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = phi i64 [ %10, %6 ], [ 0, %2 ]
%8 = phi i64 [ %9, %6 ], [ %4, %2 ]
%9 = lshr i64 %8, 1
%10 = add nuw nsw i64 %7, 1
%11 = icmp ugt i64 %8, 3
br i1 %11, label %6, label %12
12: ; preds = %6, %2
%13 = phi i64 [ 0, %2 ], [ %10, %6 ]
ret i64 %13
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateCounterMode(uint32_t ui32Config) {
  (*((volatile unsigned long *)(0x400FC300))) = ui32Config;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateCounterMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fc300,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateCounterMode>:
mov    %rdi,0x400fc300
40
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateCounterMode(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074774784 to i64*)
%4 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateCounterMode(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074774784 to i64*)
%2 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}