xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int sigprocmask(int how, const sigset_t *restrict set,
                sigset_t *restrict oset) {
  (void)how;
  (void)set;
  (void)oset;
  puts("sigprocmask: not implemented");
  return -1;
}


x86 assembly (clang, -O0):
<sigprocmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"sigprocmask: not implemented\00"
define i32 @sigprocmask(i32 %0, i32* noalias %1, i32* noalias %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 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [29 x i8] c"sigprocmask: not implemented\00"
define i32 @sigprocmask(i32 %0, i32* noalias nocapture readnone %1, i32* noalias nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
unsigned int rgb_shift(unsigned int, int);
unsigned rgb_nibble_insert(unsigned value, int shift, unsigned mask) {
  return rgb_shift(value, -shift) & mask;
}


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

x86 assembly (clang, -O2):
<rgb_nibble_insert>:
push   %rbx
mov    %edx,%ebx
neg    %esi
call   1030 <rgb_shift@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rgb_nibble_insert(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 = sub nsw i32 0, %8
%10 = call i32 @rgb_shift(i32 %7, i32 %9)
%11 = load i32, i32* %6
%12 = and i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rgb_nibble_insert(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 0, %1
%5 = tail call i32 @rgb_shift(i32 %0, i32 %4)
%6 = and i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
int dtoa_calcsign(char *p, int str_size) {
  if (p[0] == '-') {
    memmove(p, p + 1, str_size - 1);
    return (1 == 1);
  } else
    return (1 == 0);
}


x86 assembly (clang, -O0):
<dtoa_calcsign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1152 <dtoa_calcsign+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <memmove@plt>
movl   $0x1,-0x4(%rbp)
jmp    1159 <dtoa_calcsign+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtoa_calcsign>:
push   %rax
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
jne    112b <dtoa_calcsign+0x1b>
mov    %esi,%edx
lea    0x1(%rdi),%rsi
add    $0xffffffff,%edx
call   1030 <memmove@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dtoa_calcsign(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = call i32 @memmove(i8* %12, i8* %14, i32 %16)
store i32 1, i32* %3
br label %19
18: ; preds = %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @dtoa_calcsign(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 45
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = add nsw i32 %1, -1
%8 = tail call i32 @memmove(i8* %0, i8* %6, i32 %7)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %10
}
int tegra_get_cpu_speedo_value(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tegra_get_cpu_speedo_value() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *);
int main() {
  char *some_memory = (char *)0;
  printf("A read from null %s\n", some_memory);
  sprintf(some_memory, "A write to null\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <sprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movups 0xedf(%rip),%xmm0
movups %xmm0,0x0
movb   $0x0,0x10
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"A read from null %s\0A\00"
@.str.1 = [17 x i8] c"A write to null\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"A read from null %s\0A\00"
@.str.1 = [17 x i8] c"A write to null\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* null)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4294967296 dereferenceable(17) null, i8* align 1 dereferenceable(17) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 17, i1 false)
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void computeRates(double voi, double *states, double *rates,
                  double *variables) {}


x86 assembly (clang, -O0):
<computeRates>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @computeRates(double %0, double* %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
ret void
}

LLVM IR (-O2):
define void @computeRates(double %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bitcount(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  if (argc < 2)
    return 1;
  printf("%lu\n", bitcount(strtoul(argv[1], NULL, 10)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    118e <main+0x5e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %eax,%edi
call   1040 <bitcount@plt>
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
cmp    $0x2,%edi
jl     1162 <main+0x32>
mov    0x8(%rsi),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %eax,%edi
call   1040 <bitcount@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strtoul(i8* nocapture %6, i32* null, i32 10)
%8 = tail call i32 @bitcount(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %11
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void EPIModeSet(uint32_t ui32Base, uint32_t ui32Mode) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000000))) = ui32Mode;
}


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

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

LLVM IR (-O0):
define void @EPIModeSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @EPIModeSet(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ term_color(char *);
int /*<<< orphan*/ term_reset();
void logger_debug(char *message) {
  term_color("yellow");
  printf("  debug: ");
  term_reset();
  puts(message);
}


x86 assembly (clang, -O0):
<logger_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1060 <term_color@plt>
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <term_reset@plt>
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_debug>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
call   1060 <term_color@plt>
lea    0xeb0(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <term_reset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"yellow\00"
@.str.1 = [10 x i8] c" debug: \00"
define void @logger_debug(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @term_color(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @term_reset()
%6 = load i8*, i8** %2
%7 = call i32 @puts(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"yellow\00"
@.str.1 = [10 x i8] c" debug: \00"
define void @logger_debug(i8* nocapture %0) {
%2 = tail call i32 @term_color(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @term_reset()
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
void rtc_dev_init(void) {}


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

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

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

LLVM IR (-O2):
define void @rtc_dev_init() {
ret void
}
int gcd(int a, int b) {
  int r;
  if (a < b) {
    r = a;
    a = b;
    b = r;
  }
  while ((r = a % b) != 0) {
    a = b;
    b = r;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1128 <gcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmp    $0x0,%edx
je     1151 <gcd+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
cmp    %esi,%edi
mov    %edi,%eax
cmovl  %esi,%eax
cmovl  %edi,%edx
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 %0, i32 %1
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %4, %2 ], [ %8, %6 ]
%8 = phi i32 [ %5, %2 ], [ %9, %6 ]
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 %8
}
nullf() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nullf() {
ret i32 0
}
int fan53555_restart_config(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fan53555_restart_config() {
ret i32 0
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t pack_g16(unsigned int g16) { return g16 << 16; }


x86 assembly (clang, -O0):
<pack_g16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_g16>:
mov    %edi,%eax
shl    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @pack_g16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
ret i32 %4
}

LLVM IR (-O2):
define i32 @pack_g16(i32 %0) {
%2 = shl i32 %0, 16
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ pthread_cond_init(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_condattr_init(int /*<<< orphan*/ *);
pthread_cond_t *hybris_alloc_init_cond(void) {
  pthread_cond_t *realcond = malloc(sizeof(pthread_cond_t));
  pthread_condattr_t attr;
  pthread_condattr_init(&attr);
  pthread_cond_init(realcond, &attr);
  return realcond;
}


x86 assembly (clang, -O0):
<hybris_alloc_init_cond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <pthread_condattr_init@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <pthread_cond_init@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32* @hybris_alloc_init_cond() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = call i32 @pthread_condattr_init(i32* %2)
%5 = load i32*, i32** %1
%6 = call i32 @pthread_cond_init(i32* %5, i32* %2)
%7 = load i32*, i32** %1
ret i32* %7
}

LLVM IR (-O2):
define i32* @hybris_alloc_init_cond() {
%1 = alloca i32
%2 = tail call i32* @malloc(i32 4)
%3 = bitcast i32* %1 to i8*
%4 = call i32 @pthread_condattr_init(i32* %1)
%5 = call i32 @pthread_cond_init(i32* %2, i32* %1)
ret i32* %2
}
/* Variables and functions */
scalar_t__ _jwObj(char *);
int /*<<< orphan*/ jwPutstr(char *);
void jwObj_string(char *key, char *value) {
  if (_jwObj(key) == 0)
    jwPutstr(value);
}


x86 assembly (clang, -O0):
<jwObj_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_jwObj@plt>
cmp    $0x0,%rax
jne    114c <jwObj_string+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <jwPutstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jwObj_string>:
push   %rbx
mov    %rsi,%rbx
call   1040 <_jwObj@plt>
test   %rax,%rax
je     1130 <jwObj_string+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <jwPutstr@plt>

LLVM IR (-O0):
define void @jwObj_string(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 = call i64 @_jwObj(i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @jwPutstr(i8* %9)
br label %11
11: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @jwObj_string(i8* %0, i8* %1) {
%3 = tail call i64 @_jwObj(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @jwPutstr(i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
void X509_REVOKED_get_ext_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REVOKED_get_ext_by_NID() {
ret void
}
void v2f(vec) float vec[2];
{ vcall(vec, 2); }


x86 assembly (clang, -O0):
<v2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2f>:
mov    $0x2,%esi
xor    %eax,%eax
jmp    1030 <vcall@plt>

LLVM IR (-O0):
define void @v2f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %3, i32 2)
ret void
}

LLVM IR (-O2):
define void @v2f(float* %0) {
%2 = tail call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %0, i32 2)
ret void
}
/* Variables and functions */
scalar_t__ doKeyTests(int /*<<< orphan*/);
int testCipherUtils();
scalar_t__ testElite();
scalar_t__ testMAC();
int unitTests() {
  int errors = testCipherUtils();
  errors += testMAC();
  errors += doKeyTests(0);
  errors += testElite();
  return errors;
}


x86 assembly (clang, -O0):
<unitTests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <testCipherUtils@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <testMAC@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
call   1040 <doKeyTests@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testElite@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unitTests>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <testCipherUtils@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <testMAC@plt>
mov    %rax,%rbx
add    %ebp,%ebx
xor    %edi,%edi
call   1040 <doKeyTests@plt>
mov    %rax,%rbp
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <testElite@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @unitTests() {
%1 = alloca i32
%2 = call i32 (...) @testCipherUtils()
store i32 %2, i32* %1
%3 = call i64 (...) @testMAC()
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
%8 = call i64 @doKeyTests(i32 0)
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %1
%13 = call i64 (...) @testElite()
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %1
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @unitTests() {
%1 = tail call i32 (...) @testCipherUtils()
%2 = tail call i64 (...) @testMAC()
%3 = trunc i64 %2 to i32
%4 = add i32 %1, %3
%5 = tail call i64 @doKeyTests(i32 0)
%6 = trunc i64 %5 to i32
%7 = add i32 %4, %6
%8 = tail call i64 (...) @testElite()
%9 = trunc i64 %8 to i32
%10 = add i32 %7, %9
ret i32 %10
}
int add_two_numbs_without_using_airthmetic_ops(int a, int b) {
  int index;
  int result, carry;
  int a_bit_index;
  int b_bit_index;
  result = 0;
  for (index = 0; index < sizeof(int); ++index) {
    a_bit_index = a & (1 << index);
    b_bit_index = b & (1 << index);
    carry = b_bit_index & a_bit_index;
  }
}


x86 assembly (clang, -O0):
<add_two_numbs_without_using_airthmetic_ops>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
cmp    $0x4,%rax
jae    1165 <add_two_numbs_without_using_airthmetic_ops+0x65>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <add_two_numbs_without_using_airthmetic_ops+0x18>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @add_two_numbs_without_using_airthmetic_ops(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
unsigned long spi_read_reg(int);
void spi_wait_idle(void) {
  unsigned long xfer_ctrl;
  do {
    xfer_ctrl = spi_read_reg(0x2);
  } while (xfer_ctrl & (1 << 17));
}


x86 assembly (clang, -O0):
<spi_wait_idle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1030 <spi_read_reg@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x20000,%rax
cmp    $0x0,%rax
jne    1118 <spi_wait_idle+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_wait_idle>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
call   1030 <spi_read_reg@plt>
test   $0x20000,%eax
jne    1120 <spi_wait_idle+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @spi_wait_idle() {
%1 = alloca i64
br label %2
2: ; preds = %4, %0
%3 = call i64 @spi_read_reg(i32 2)
store i64 %3, i64* %1
br label %4
4: ; preds = %2
%5 = load i64, i64* %1
%6 = and i64 %5, 131072
%7 = icmp ne i64 %6, 0
br i1 %7, label %2, label %8
8: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @spi_wait_idle() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @spi_read_reg(i32 2)
%3 = and i64 %2, 131072
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ADC1_DriverIRQHandler();
__attribute__((weak)) void ADC1_IRQHandler(void) { ADC1_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @ADC1_IRQHandler() {
%1 = call i32 (...) @ADC1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ADC1_IRQHandler() {
%1 = tail call i32 (...) @ADC1_DriverIRQHandler()
ret void
}
OP(ed, f7) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
void XcmsTekHVCQueryMaxVC() {}


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

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

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

LLVM IR (-O2):
define void @XcmsTekHVCQueryMaxVC() {
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double millitime() {
  struct timeval now;
  gettimeofday(&now, NULL);
  double ret = now.tv_sec + now.tv_usec / 1000.0 / 1000.0;
  return ret;
}


x86 assembly (clang, -O0):
<millitime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xebd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millitime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @millitime() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+03
%9 = fdiv double %8, 1.000000e+03
%10 = fadd double %5, %9
store double %10, double* %2
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @millitime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+03
%9 = fdiv double %8, 1.000000e+03
%10 = fadd double %5, %9
ret double %10
}
/* Variables and functions */
int random();
long long int randomnum() { return (1000000000 + random() % 800000000); }


x86 assembly (clang, -O0):
<randomnum>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x2faf0800,%ecx
cltd
idiv   %ecx
add    $0x3b9aca00,%edx
movslq %edx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomnum>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cltq
imul   $0x55e63b89,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x3c,%rcx
add    %edx,%ecx
imul   $0x2faf0800,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x3b9aca00,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @randomnum() {
%1 = call i32 (...) @random()
%2 = srem i32 %1, 800000000
%3 = add nsw i32 1000000000, %2
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @randomnum() {
%1 = tail call i32 (...) @random()
%2 = srem i32 %1, 800000000
%3 = add nsw i32 %2, 1000000000
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ intro();
int /*<<< orphan*/ lvl1();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  intro();
  getchar();
  printf(
      " \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n");
  lvl1();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <intro@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <lvl1@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <intro@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xeaa(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <lvl1@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c" \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @intro()
%7 = call i32 (...) @getchar()
%8 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @lvl1()
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [46 x i8] c" \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \0A \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @intro()
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @lvl1()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int errno;
int __getlogin_r(char *name, size_t name_len) {
  __set_errno(ENOSYS);
  return errno;
}


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

x86 assembly (clang, -O2):
<__getlogin_r>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @__getlogin_r(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
%7 = load i32, i32* @errno
ret i32 %7
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @__getlogin_r(i8* nocapture readnone %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
%5 = load i32, i32* @errno
ret i32 %5
}
int min(int a1, int a2) {
  if (a1 > a2)
    return a2;
  else
    return a1;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <min+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %5
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void usage(void) {
  write(1,
        "usage: cjdc [options] [command]\n"
        "\n"
        "commands:\n"
        "dump\t\tdumps the routing table\n"
        "peers\t\tlists connected nodes\n"
        "<pub.k>\t\tpublic key to ipv6\n"
        "\n"
        "options:\n"
        "-v\t\tverbose output\n",
        sizeof("usage: cjdc [options] [command]\n"
               "\n"
               "commands:\n"
               "dump\t\tdumps the routing table\n"
               "peers\t\tlists connected nodes\n"
               "<pub.k>\t\tpublic key to ipv6\n"
               "\n"
               "options:\n"
               "-v\t\tverbose output\n") -
            1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x9f,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x9f,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"usage: cjdc [options] [command]\0A\0Acommands:\0Adump\09\09dumps the routing table\0Apeers\09\09lists connected nodes\0A<pub.k>\09\09public key to ipv6\0A\0Aoptions:\0A-v\09\09verbose output\0A\00"
define void @usage() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 159)
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"usage: cjdc [options] [command]\0A\0Acommands:\0Adump\09\09dumps the routing table\0Apeers\09\09lists connected nodes\0A<pub.k>\09\09public key to ipv6\0A\0Aoptions:\0A-v\09\09verbose output\0A\00"
define void @usage() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 159)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA1_Channel3_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA1_Channel3_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA1_Channel3_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void clear_screen(void) {
  fputs("\x1B[2J\x1B[H", stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<clear_screen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_screen>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
@stdout = global i32 0
define void @clear_screen() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
@stdout = global i32 0
define void @clear_screen() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
float dot(float a[3], float b[3]) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @dot(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @dot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
void hgetfontsize(cw, ch) float *cw, *ch;
{
  check_loaded("hgetfontsize");
  *cw = hgetfontwidth();
  *ch = hgetfontheight();
}


x86 assembly (clang, -O0):
<hgetfontsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1050 <check_loaded@plt>
mov    $0x0,%al
call   1030 <hgetfontwidth@plt>
cvtsi2ss %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    $0x0,%al
call   1040 <hgetfontheight@plt>
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hgetfontsize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1050 <check_loaded@plt>
xor    %eax,%eax
call   1030 <hgetfontwidth@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%rbx)
xor    %eax,%eax
call   1040 <hgetfontheight@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hgetfontsize\00"
define void @hgetfontsize(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @check_loaded to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @hgetfontwidth()
%7 = sitofp i32 %6 to float
%8 = load float*, float** %3
store float %7, float* %8
%9 = call i32 (...) @hgetfontheight()
%10 = sitofp i32 %9 to float
%11 = load float*, float** %4
store float %10, float* %11
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"hgetfontsize\00"
define void @hgetfontsize(float* nocapture writeonly %0, float* nocapture writeonly %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @check_loaded to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @hgetfontwidth()
%5 = sitofp i32 %4 to float
store float %5, float* %0
%6 = tail call i32 (...) @hgetfontheight()
%7 = sitofp i32 %6 to float
store float %7, float* %1
ret void
}
float CG_OpFuncCompareGreaterOrEqual(const float a, const float b) {
  return (a >= b);
}


x86 assembly (clang, -O0):
<CG_OpFuncCompareGreaterOrEqual>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_OpFuncCompareGreaterOrEqual>:
cmpless %xmm0,%xmm1
movss  0xef3(%rip),%xmm0
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @CG_OpFuncCompareGreaterOrEqual(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oge float %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @CG_OpFuncCompareGreaterOrEqual(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = uitofp i1 %3 to float
ret float %4
}
/* Variables and functions */
int ft_putchar_fd(int, int);
int ft_putchar(int c) { return (ft_putchar_fd(c, 1)); }


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

x86 assembly (clang, -O2):
<ft_putchar>:
mov    $0x1,%esi
jmp    1030 <ft_putchar_fd@plt>

LLVM IR (-O0):
define i32 @ft_putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ft_putchar_fd(i32 %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @ft_putchar(i32 %0) {
%2 = tail call i32 @ft_putchar_fd(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int rex;
  printf("%d", is_prime(rex));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <is_prime@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%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 = load i32, i32* %1
%3 = call i32 @is_prime(i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @is_prime(i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
double calculate_sum(double number1, double number2, double number3,
                     double number4, double number5) {
  double value = number1 + number2 + number3 + number4 + number5;
  return value;
}


x86 assembly (clang, -O0):
<calculate_sum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_sum>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @calculate_sum(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fadd double %12, %13
%15 = load double, double* %8
%16 = fadd double %14, %15
%17 = load double, double* %9
%18 = fadd double %16, %17
%19 = load double, double* %10
%20 = fadd double %18, %19
store double %20, double* %11
%21 = load double, double* %11
ret double %21
}

LLVM IR (-O2):
define double @calculate_sum(double %0, double %1, double %2, double %3, double %4) {
%6 = fadd double %0, %1
%7 = fadd double %6, %2
%8 = fadd double %7, %3
%9 = fadd double %8, %4
ret double %9
}