xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int strlen(char const *);
int32_t string_size(const char *str) { return str ? strlen(str) : -1; }


x86 assembly (clang, -O0):
<string_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <string_size+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
jmp    1145 <string_size+0x35>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <string_size+0x35>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_size>:
test   %rdi,%rdi
je     111a <string_size+0xa>
jmp    1030 <strlen@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @string_size(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ -1, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @string_size(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
char *nextspace(const char *s) {
  while (*s && !isspace(*s))
    ++s;
  return (char *)s;
}


x86 assembly (clang, -O0):
<nextspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <nextspace+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <nextspace+0x48>
jmp    1169 <nextspace+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <nextspace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextspace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <nextspace+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <nextspace+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <nextspace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @nextspace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @isspace(i8 signext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @nextspace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ systemReset();
void systemResetToBootloader(void) {
  *((uint32_t *)0x20009FFC) = 0xDEADBEEF;
  systemReset();
}


x86 assembly (clang, -O0):
<systemResetToBootloader>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20009ffc,%eax
movl   $0xdeadbeef,(%rax)
mov    $0x0,%al
call   1030 <systemReset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<systemResetToBootloader>:
movl   $0xdeadbeef,0x20009ffc
ef be ad de
xor    %eax,%eax
jmp    1030 <systemReset@plt>

LLVM IR (-O0):
define void @systemResetToBootloader() {
store i32 -559038737, i32* inttoptr (i64 536911868 to i32*)
%1 = call i32 (...) @systemReset()
ret void
}

LLVM IR (-O2):
define void @systemResetToBootloader() {
store i32 -559038737, i32* inttoptr (i64 536911868 to i32*)
%1 = tail call i32 (...) @systemReset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  long long int x = 987698807;
  int y = x;
  printf("%d", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x3adf1677,-0x10(%rbp)
3a
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @icl_stop_energy_measurement() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_SOFTWARE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ pgp_show_stacktrace();
int /*<<< orphan*/ stderr;
void __pgp_nodata(const char *_function_name, const char *_file_name,
                  int _line_number) {
  fprintf(stderr,
          "Data expected but got nothing: file=%s, function=%s, line=%d\n",
          _file_name, _function_name, _line_number);
  pgp_show_stacktrace();
  exit(EX_SOFTWARE);
}


x86 assembly (clang, -O0):
<__pgp_nodata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <pgp_show_stacktrace@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<__pgp_nodata>:
push   %rax
mov    %edx,%r8d
mov    %rsi,%rdx
mov    %rdi,%rcx
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <pgp_show_stacktrace@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"Data expected but got nothing: file=%s, function=%s, line=%d\0A\00"
@EX_SOFTWARE = global i32 0
define void @__pgp_nodata(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 i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
%12 = call i32 (...) @pgp_show_stacktrace()
%13 = load i32, i32* @EX_SOFTWARE
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"Data expected but got nothing: file=%s, function=%s, line=%d\0A\00"
@EX_SOFTWARE = global i32 0
define void @__pgp_nodata(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0, i32 %2)
%6 = tail call i32 (...) @pgp_show_stacktrace()
%7 = load i32, i32* @EX_SOFTWARE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
double my_double_random(rndmin, rndmax)
double rndmin, rndmax;
{
  double rnd, rnddouble;
  do {
    rnddouble = random() / 2147483649.;
    rnd = 1. * rndmin + rnddouble * (rndmax - rndmin);
  } while (rnd < rndmin || rnd > rndmax);
  return (rnd);
}


x86 assembly (clang, -O0):
<my_double_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %eax,%xmm0
movsd  0xecb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
ucomisd %xmm1,%xmm0
mov    %al,-0x21(%rbp)
ja     1188 <my_double_random+0x78>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1122 <my_double_random+0x12>
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_double_random>:
sub    $0x18,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <random@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xeba(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
ucomisd %xmm0,%xmm1
ja     1130 <my_double_random+0x20>
ucomisd (%rsp),%xmm0
ja     1130 <my_double_random+0x20>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @my_double_random(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
br label %7
7: ; preds = %26, %2
%8 = call i32 (...) @random()
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 0x41E0000000200000
store double %10, double* %6
%11 = load double, double* %3
%12 = load double, double* %6
%13 = load double, double* %4
%14 = load double, double* %3
%15 = fsub double %13, %14
%16 = fmul double %12, %15
%17 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %11, double %16)
store double %17, double* %5
br label %18
18: ; preds = %7
%19 = load double, double* %5
%20 = load double, double* %3
%21 = fcmp olt double %19, %20
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load double, double* %5
%24 = load double, double* %4
%25 = fcmp ogt double %23, %24
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ true, %18 ], [ %25, %22 ]
br i1 %27, label %7, label %28
28: ; preds = %26
%29 = load double, double* %5
ret double %29
}

LLVM IR (-O2):
define double @my_double_random(double %0, double %1) {
%3 = fsub double %1, %0
br label %4
4: ; preds = %4, %2
%5 = tail call i32 (...) @random()
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 0x41E0000000200000
%8 = fmul double %3, %7
%9 = fadd double %8, %0
%10 = fcmp olt double %9, %0
%11 = fcmp ogt double %9, %1
%12 = or i1 %10, %11
br i1 %12, label %4, label %13
13: ; preds = %4
ret double %9
}
int qsort_uintcmp(const unsigned int *a, const unsigned int *b) {
  return *a - *b;
}


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

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

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

LLVM IR (-O2):
define i32 @qsort_uintcmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int diminuto_ipc_set_socket(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int diminuto_ipc_set_reuseaddress(int fd, int enable) {
  return diminuto_ipc_set_socket(fd, SOL_SOCKET, SO_REUSEADDR, !!enable);
}


x86 assembly (clang, -O0):
<diminuto_ipc_set_reuseaddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
call   1030 <diminuto_ipc_set_socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_ipc_set_reuseaddress>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%edx
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
mov    %eax,%esi
jmp    1030 <diminuto_ipc_set_socket@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @diminuto_ipc_set_reuseaddress(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* @SOL_SOCKET
%7 = load i32, i32* @SO_REUSEADDR
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = call i32 @diminuto_ipc_set_socket(i32 %5, i32 %6, i32 %7, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @diminuto_ipc_set_reuseaddress(i32 %0, i32 %1) {
%3 = load i32, i32* @SOL_SOCKET
%4 = load i32, i32* @SO_REUSEADDR
%5 = icmp ne i32 %1, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @diminuto_ipc_set_socket(i32 %0, i32 %3, i32 %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int a;
  char *s = "hello, world";
  printf("%s\n", &s[7]);
  a = 5;
  foo(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
add    $0x7,%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"hello, world\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 7))
%2 = tail call i32 @foo(i32 5)
ret i32 0
}
double f4_sum_pre_int_short(int v0, short v) {
  return (double)v0 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movswl -0x6(%rbp),%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_short>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_short(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load i16, i16* %4
%8 = sitofp i16 %7 to double
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f4_sum_pre_int_short(i32 %0, i16 signext %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i16 %1 to double
%5 = fadd double %3, %4
ret double %5
}
void genlwc1() {}


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

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

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

LLVM IR (-O2):
define void @genlwc1() {
ret void
}
int count_V_flip_reverse(unsigned long long P, int ofs) {
  return ((__builtin_clzll((P << ofs) | 1) + 1) >> 2) & 0x0E;
}


x86 assembly (clang, -O0):
<count_V_flip_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    %cl,%rax
or     $0x1,%rax
bsr    %rax,%rax
xor    $0x3f,%rax
add    $0x1,%eax
sar    $0x2,%eax
and    $0xe,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_V_flip_reverse>:
mov    %esi,%ecx
shl    %cl,%rdi
or     $0x1,%rdi
bsr    %rdi,%rax
neg    %eax
shr    $0x2,%eax
and    $0xe,%eax
ret

LLVM IR (-O0):
define i32 @count_V_flip_reverse(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = shl i64 %5, %7
%9 = or i64 %8, 1
%10 = call i64 @llvm.ctlz.i64(i64 %9, i1 true)
%11 = trunc i64 %10 to i32
%12 = add nsw i32 %11, 1
%13 = ashr i32 %12, 2
%14 = and i32 %13, 14
ret i32 %14
}

LLVM IR (-O2):
define i32 @count_V_flip_reverse(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = shl i64 %0, %3
%5 = or i64 %4, 1
%6 = tail call i64 @llvm.ctlz.i64(i64 %5, i1 true)
%7 = trunc i64 %6 to i32
%8 = add nuw nsw i32 %7, 1
%9 = lshr i32 %8, 2
%10 = and i32 %9, 14
ret i32 %10
}
void delay(int ms) {
  int limit = ms / 20;
  if (limit == 0)
    limit = 1;
  for (int i = 0; i < limit; i++) {
    for (char j = 0; j < 13; j++)
      for (char k = 0; k < 255; k++)
        ;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1126 <delay+0x26>
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1194 <delay+0x94>
movb   $0x0,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0xd,%eax
jge    1181 <delay+0x81>
movb   $0x0,-0xe(%rbp)
movsbl -0xe(%rbp),%eax
cmp    $0xff,%eax
jge    116f <delay+0x6f>
jmp    1162 <delay+0x62>
mov    -0xe(%rbp),%al
add    $0x1,%al
mov    %al,-0xe(%rbp)
jmp    114e <delay+0x4e>
jmp    1174 <delay+0x74>
mov    -0xd(%rbp),%al
add    $0x1,%al
mov    %al,-0xd(%rbp)
jmp    113d <delay+0x3d>
jmp    1186 <delay+0x86>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <delay+0x2d>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = icmp slt i32 %0, -19
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getpriority(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ setpriority(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
main() {
  getpriority(0, 0);
  setpriority(0, 0, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <getpriority@plt>
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <setpriority@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <getpriority@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <setpriority@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @getpriority(i32 0, i32 0)
%2 = call i32 @setpriority(i32 0, i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @getpriority(i32 0, i32 0)
%2 = tail call i32 @setpriority(i32 0, i32 0, i32 0)
ret i32 0
}
/* Type definitions */
typedef void AMCMemUnit;
struct AMCMemPool {
  int dummy;
};

/* Variables and functions */
void *_memPool_Alloc_WithLock(struct AMCMemPool *);
struct AMCMemUnit *AMCMemPool_Alloc(struct AMCMemPool *pool) {
  if (pool) {
    return _memPool_Alloc_WithLock(pool);
  } else {
    return ((void *)0);
  }
}


x86 assembly (clang, -O0):
<AMCMemPool_Alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <AMCMemPool_Alloc+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <_memPool_Alloc_WithLock@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <AMCMemPool_Alloc+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.AMCMemUnit = type opaque
%struct.AMCMemPool = type { i32 }
define %struct.AMCMemUnit* @AMCMemPool_Alloc(%struct.AMCMemPool* %0) {
%2 = alloca %struct.AMCMemUnit*
%3 = alloca %struct.AMCMemPool*
store %struct.AMCMemPool* %0, %struct.AMCMemPool** %3
%4 = load %struct.AMCMemPool*, %struct.AMCMemPool** %3
%5 = icmp ne %struct.AMCMemPool* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.AMCMemPool*, %struct.AMCMemPool** %3
%8 = call i8* @_memPool_Alloc_WithLock(%struct.AMCMemPool* %7)
%9 = bitcast i8* %8 to %struct.AMCMemUnit*
store %struct.AMCMemUnit* %9, %struct.AMCMemUnit** %2
br label %11
10: ; preds = %1
store %struct.AMCMemUnit* null, %struct.AMCMemUnit** %2
br label %11
11: ; preds = %10, %6
%12 = load %struct.AMCMemUnit*, %struct.AMCMemUnit** %2
ret %struct.AMCMemUnit* %12
}

LLVM IR (-O2):
%struct.AMCMemUnit = type opaque
%struct.AMCMemPool = type { i32 }
define %struct.AMCMemUnit* @AMCMemPool_Alloc(%struct.AMCMemPool* %0) {
%2 = icmp eq %struct.AMCMemPool* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @_memPool_Alloc_WithLock(%struct.AMCMemPool* %0)
%5 = bitcast i8* %4 to %struct.AMCMemUnit*
br label %6
6: ; preds = %1, %3
%7 = phi %struct.AMCMemUnit* [ %5, %3 ], [ null, %1 ]
ret %struct.AMCMemUnit* %7
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strclone(char *str) {
  int len = strlen(str);
  char *clone = (char *)malloc(sizeof(char) * (len + 1));
  strcpy(clone, str);
  return clone;
}


x86 assembly (clang, -O0):
<strclone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strclone>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strclone(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @strclone(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
__attribute__((__weak__, __always___)) void
softboundcets_perror(const char *s) {
  perror(s);
}


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

x86 assembly (clang, -O2):
<softboundcets_perror>:
jmp    1030 <perror@plt>

LLVM IR (-O0):
define weak void @softboundcets_perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
ret void
}

LLVM IR (-O2):
define weak void @softboundcets_perror(i8* %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
int test_imm_53uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x53 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_53uint64_highword_reg>:
movabs $0x5300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_53uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 83
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_53uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 356482285568
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int primitiveProtoObject_Identical_(int receiver, int *arguments) {
  return receiver == arguments[0] ? (10 << 2) : (20 << 2);
}


x86 assembly (clang, -O0):
<primitiveProtoObject_Identical_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x50,%eax
mov    $0x28,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitiveProtoObject_Identical_>:
cmp    %edi,(%rsi)
mov    $0x28,%ecx
mov    $0x50,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @primitiveProtoObject_Identical_(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 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = icmp eq i32 %5, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 40, i32 80
ret i32 %11
}

LLVM IR (-O2):
define i32 @primitiveProtoObject_Identical_(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, %0
%5 = select i1 %4, i32 40, i32 80
ret i32 %5
}
int test_imm_04int8_reg(signed char val) {
  return ((val) & (0x04 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_04int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_04int8_reg>:
test   $0x4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_04int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_04int8_reg(i8 signext %0) {
%2 = and i8 %0, 4
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void calcular_puntos(int cont_sim, int cont_exp) {
  int punts = 0;
  printf("\n\nFI DEL JOC.");
  punts = 500 / (cont_sim + (cont_exp * 2));
  printf("\nHas aconseguit %d punts.\n\n", punts);
}


x86 assembly (clang, -O0):
<calcular_puntos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    %eax,%ecx
mov    $0x1f4,%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcular_puntos>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%rbx,%r14,2),%ecx
mov    $0x1f4,%eax
xor    %edx,%edx
idiv   %ecx
lea    0xed3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0A\0AFI DEL JOC.\00"
@.str.1 = [28 x i8] c"\0AHas aconseguit %d punts.\0A\0A\00"
define void @calcular_puntos(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 2
%10 = add nsw i32 %7, %9
%11 = sdiv i32 500, %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0A\0AFI DEL JOC.\00"
@.str.1 = [28 x i8] c"\0AHas aconseguit %d punts.\0A\0A\00"
define void @calcular_puntos(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = shl nsw i32 %1, 1
%5 = add nsw i32 %4, %0
%6 = sdiv i32 500, %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}
int test_imm_E0int8_mem(signed char *val) {
  return ((*val) & (-0xE0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E0int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff20,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E0int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff20,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E0int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -224
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_E0int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -224
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ putch_tty(int /*<<< orphan*/);
void puts0(char *s) {
  while (*s)
    putch_tty(*s++);
}


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

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

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

LLVM IR (-O2):
define void @puts0(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putch_tty(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void OCSP_REQUEST_new(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_REQUEST_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ xmouse();
void basXMouse() { pushNumber(xmouse()); }


x86 assembly (clang, -O0):
<basXMouse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <xmouse@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basXMouse>:
push   %rax
xor    %eax,%eax
call   1030 <xmouse@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basXMouse() {
%1 = call i32 (...) @xmouse()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basXMouse() {
%1 = tail call i32 (...) @xmouse()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
void EVP_CIPHER_CTX_new(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ recoverableError(char *);
int /*<<< orphan*/ stderr;
void labelSizeError(const char *label) {
  recoverableError("Label name size is too big");
  fprintf(stderr, "     LABEL: %s , the current size limit is %d characters\n",
          label, 50);
  exit(1);
}


x86 assembly (clang, -O0):
<labelSizeError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <recoverableError@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
mov    $0x32,%ecx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<labelSizeError>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <recoverableError@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
mov    %rbx,%rdx
mov    $0x32,%ecx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Label name size is too big\00"
@stderr = global i32 0
@.str.1 = [58 x i8] c" LABEL: %s , the current size limit is %d characters\0A\00"
define void @labelSizeError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @recoverableError(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 50)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Label name size is too big\00"
@stderr = global i32 0
@.str.1 = [58 x i8] c" LABEL: %s , the current size limit is %d characters\0A\00"
define void @labelSizeError(i8* %0) {
%2 = tail call i32 @recoverableError(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 50)
%5 = tail call i32 @exit(i32 1)
unreachable
}
double simpleAbs(double number) {
  return (number > 0) ? number : (-1) * number;
}


x86 assembly (clang, -O0):
<simpleAbs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <simpleAbs+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    113c <simpleAbs+0x3c>
movsd  0xece(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpleAbs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @simpleAbs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fmul double -1.000000e+00, %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @simpleAbs(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int GetFreeSpace(char *);
int /*<<< orphan*/ printf(char *, int);
int GetFreeSpace_test() {
  int size = GetFreeSpace("/boot");
  printf("/boot free space is %d\n", size);
  return 0;
}


x86 assembly (clang, -O0):
<GetFreeSpace_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <GetFreeSpace@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFreeSpace_test>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <GetFreeSpace@plt>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"/boot\00"
@.str.1 = [24 x i8] c"/boot free space is %d\0A\00"
define i32 @GetFreeSpace_test() {
%1 = alloca i32
%2 = call i32 @GetFreeSpace(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"/boot\00"
@.str.1 = [24 x i8] c"/boot free space is %d\0A\00"
define i32 @GetFreeSpace_test() {
%1 = tail call i32 @GetFreeSpace(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
void *get_mp_table_start(void) {
  char *bios_mem;
  for (bios_mem = (char *)0x000F0000;
       bios_mem != (char *)(0x000F0000 + 0x00010000); bios_mem++) {
    if (strncmp(bios_mem, "___HVMMP", 8) == 0)
      return bios_mem;
  }
  return ((void *)0);
}


x86 assembly (clang, -O0):
<get_mp_table_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf0000,%eax
mov    %rax,-0x10(%rbp)
mov    $0x100000,%eax
cmp    %rax,-0x10(%rbp)
je     1171 <get_mp_table_start+0x61>
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    115b <get_mp_table_start+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <get_mp_table_start+0x69>
jmp    1160 <get_mp_table_start+0x50>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1121 <get_mp_table_start+0x11>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mp_table_start>:
push   %r14
push   %rbx
push   %rax
mov    $0xf0000,%ebx
lea    0xee0(%rip),%r14
mov    $0x8,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strncmp@plt>
test   %eax,%eax
je     1143 <get_mp_table_start+0x33>
add    $0x1,%rbx
cmp    $0x100000,%rbx
jne    1120 <get_mp_table_start+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"___HVMMP\00"
define i8* @get_mp_table_start() {
%1 = alloca i8*
%2 = alloca i8*
store i8* inttoptr (i64 983040 to i8*), i8** %2
br label %3
3: ; preds = %13, %0
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, inttoptr (i64 1048576 to i8*)
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = load i8*, i8** %2
store i8* %11, i8** %1
br label %17
12: ; preds = %6
br label %13
13: ; preds = %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %3
16: ; preds = %3
store i8* null, i8** %1
br label %17
17: ; preds = %16, %10
%18 = load i8*, i8** %1
ret i8* %18
}

LLVM IR (-O2):
@.str = [9 x i8] c"___HVMMP\00"
define i8* @get_mp_table_start() {
br label %1
1: ; preds = %0, %5
%2 = phi i8* [ inttoptr (i64 983040 to i8*), %0 ], [ %6, %5 ]
%3 = tail call i32 @strncmp(i8* %2, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = icmp eq i8* %6, inttoptr (i64 1048576 to i8*)
br i1 %7, label %8, label %1
8: ; preds = %5, %1
%9 = phi i8* [ %2, %1 ], [ null, %5 ]
ret i8* %9
}
void g_completion_set_compare() {}


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

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

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

LLVM IR (-O2):
define void @g_completion_set_compare() {
ret void
}
void element2LF() {}


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

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

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

LLVM IR (-O2):
define void @element2LF() {
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t signum_fun_int8_t(int8_t a) { return (a != 0) | (a >> 7); }


x86 assembly (clang, -O0):
<signum_fun_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
sar    $0x7,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_int8_t>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
sar    $0x7,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @signum_fun_int8_t(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 7
%5 = or i32 %4, %3
ret i32 %5
}
void __attribute__((weak)) exti0_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<exti0_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exti0_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.exti0_isr = [10 x i8] c"exti0_isr\00"
define weak void @exti0_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.exti0_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.exti0_isr = [10 x i8] c"exti0_isr\00"
define weak void @exti0_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.exti0_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int compvar(char *const, char *const, int /*<<< orphan*/);
int compenv(const void *a, const void *b) {
  return compvar(*(char *const *)a, *(char *const *)b, 0);
}


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

x86 assembly (clang, -O2):
<compenv>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
xor    %edx,%edx
jmp    1030 <compvar@plt>

LLVM IR (-O0):
define i32 @compenv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @compvar(i8* %7, i8* %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compenv(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @compvar(i8* %4, i8* %6, i32 0)
ret i32 %7
}
/* Variables and functions */
int parse_coarse(char const *, unsigned int *, char const **, size_t *,
                 char const **, size_t *);
int version_validate(const char *v) {
  unsigned e;
  const char *us, *rev;
  size_t usl, revl;
  return parse_coarse(v, &e, &us, &usl, &rev, &revl);
}


x86 assembly (clang, -O0):
<version_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x20(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1030 <parse_coarse@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version_validate>:
sub    $0x28,%rsp
lea    0x4(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x18(%rsp),%r8
lea    0x8(%rsp),%r9
call   1030 <parse_coarse@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @version_validate(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @parse_coarse(i8* %8, i32* %3, i8** %4, i64* %6, i8** %5, i64* %7)
ret i32 %9
}

LLVM IR (-O2):
define i32 @version_validate(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = bitcast i32* %2 to i8*
%8 = bitcast i8** %3 to i8*
%9 = bitcast i8** %4 to i8*
%10 = bitcast i64* %5 to i8*
%11 = bitcast i64* %6 to i8*
%12 = call i32 @parse_coarse(i8* %0, i32* %2, i8** %3, i64* %5, i8** %4, i64* %6)
ret i32 %12
}