xunge/DecIR huggingface dataset:
unsigned long sort_even(unsigned long w) {
  unsigned long x = w & 0x0f0f0f0f0f0f0f0f;
  unsigned long y = (w >> 4) & 0x0f0f0f0f0f0f0f0f;
  unsigned long d = ((x - y) >> 4) & (x ^ y);
  unsigned long r = ((x ^ d) << 4) | (y ^ d);
  return r;
}


x86 assembly (clang, -O0):
<sort_even>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xf0f0f0f0f0f0f0f,%rax
0f 0f 0f
and    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
shr    $0x4,%rax
mov    -0x10(%rbp),%rcx
xor    -0x18(%rbp),%rcx
and    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
xor    -0x20(%rbp),%rax
shl    $0x4,%rax
mov    -0x18(%rbp),%rcx
xor    -0x20(%rbp),%rcx
or     %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_even>:
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
mov    %rdi,%rdx
and    %rcx,%rdx
shr    $0x4,%rdi
and    %rdi,%rcx
mov    %rdx,%rsi
sub    %rcx,%rsi
shr    $0x4,%rsi
mov    %rcx,%rax
xor    %rdx,%rax
and    %rsi,%rax
xor    %rax,%rdx
shl    $0x4,%rdx
xor    %rcx,%rax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @sort_even(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = and i64 %7, 1085102592571150095
store i64 %8, i64* %3
%9 = load i64, i64* %2
%10 = lshr i64 %9, 4
%11 = and i64 %10, 1085102592571150095
store i64 %11, i64* %4
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = sub i64 %12, %13
%15 = lshr i64 %14, 4
%16 = load i64, i64* %3
%17 = load i64, i64* %4
%18 = xor i64 %16, %17
%19 = and i64 %15, %18
store i64 %19, i64* %5
%20 = load i64, i64* %3
%21 = load i64, i64* %5
%22 = xor i64 %20, %21
%23 = shl i64 %22, 4
%24 = load i64, i64* %4
%25 = load i64, i64* %5
%26 = xor i64 %24, %25
%27 = or i64 %23, %26
store i64 %27, i64* %6
%28 = load i64, i64* %6
ret i64 %28
}

LLVM IR (-O2):
define i64 @sort_even(i64 %0) {
%2 = and i64 %0, 1085102592571150095
%3 = lshr i64 %0, 4
%4 = and i64 %3, 1085102592571150095
%5 = sub nsw i64 %2, %4
%6 = lshr i64 %5, 4
%7 = xor i64 %4, %2
%8 = and i64 %6, %7
%9 = xor i64 %8, %2
%10 = shl nuw i64 %9, 4
%11 = xor i64 %8, %4
%12 = or i64 %10, %11
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int socket_tcp(void) {
  int s;
  s = socket(PF_INET, SOCK_STREAM, 0);
  if (s == -1)
    return -1;
  return s;
}


x86 assembly (clang, -O0):
<socket_tcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    114a <socket_tcp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <socket_tcp+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_tcp>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @socket_tcp() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @PF_INET
%4 = load i32, i32* @SOCK_STREAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @socket_tcp() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
float avrg(int nums, float sum) { return sum / nums; }


x86 assembly (clang, -O0):
<avrg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<avrg>:
cvtsi2ss %edi,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @avrg(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to float
%8 = fdiv float %5, %7
ret float %8
}

LLVM IR (-O2):
define float @avrg(i32 %0, float %1) {
%3 = sitofp i32 %0 to float
%4 = fdiv float %1, %3
ret float %4
}
/* Variables and functions */
int pow(int, int);
int BB_size(int size) {
  int i;
  int result = 0;
  for (i = 0; pow(2, i + 1) <= size; i++)
    ;
  result = pow(2, i);
  return result;
}


x86 assembly (clang, -O0):
<BB_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
cmp    -0x4(%rbp),%eax
jg     1155 <BB_size+0x45>
jmp    1147 <BB_size+0x37>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <BB_size+0x19>
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BB_size>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xffffffff,%ebx
nopw   0x0(%rax,%rax,1)
lea    0x2(%rbx),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
add    $0x1,%ebx
cmp    %ebp,%eax
jle    1120 <BB_size+0x10>
mov    $0x2,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define i32 @BB_size(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %4, %2 ]
%4 = add nuw nsw i32 %3, 1
%5 = tail call i32 @pow(i32 2, i32 %4)
%6 = icmp sgt i32 %5, %0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @pow(i32 2, i32 %3)
ret i32 %8
}
int fib(int x) {
  if (x < 2) {
    return x;
  } else {
    return fib(x - 1) + fib(x - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Type definitions */
typedef char *uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint64_t rte_rdtsc(void) {
  union {
    uint64_t tsc_64;
    struct {
      uint32_t lo_32;
      uint32_t hi_32;
    };
  } tsc;
  asm volatile("rdtsc" : "=a"(tsc.lo_32), "=d"(tsc.hi_32));
  return tsc.tsc_64;
}


x86 assembly (clang, -O0):
<rte_rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_rdtsc>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%union.anon = type { i8* }
%struct.anon = type { i32, i32 }
define i8* @rte_rdtsc() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to %struct.anon*
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%4 = bitcast %union.anon* %1 to %struct.anon*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 1
%6 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %5
%9 = bitcast %union.anon* %1 to i8**
%10 = load i8*, i8** %9
ret i8* %10
}

LLVM IR (-O2):
define i8* @rte_rdtsc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double microtime() {
  struct timeval tm;
  gettimeofday(&tm, 0);
  return tm.tv_sec + tm.tv_usec / 1000000.0;
}


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

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

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

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @microtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%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+06
%9 = fadd double %5, %8
ret double %9
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t hex_convert(const uint8_t c) { return (c & 15) + (c >> 6) * 9; }


x86 assembly (clang, -O0):
<hex_convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    -0x4(%rbp),%ecx
sar    $0x6,%ecx
imul   $0x9,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_convert>:
mov    %edi,%ecx
and    $0xf,%ecx
sar    $0x6,%edi
lea    (%rdi,%rdi,8),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hex_convert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = load i32, i32* %2
%6 = ashr i32 %5, 6
%7 = mul nsw i32 %6, 9
%8 = add nsw i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hex_convert(i32 %0) {
%2 = and i32 %0, 15
%3 = ashr i32 %0, 6
%4 = mul nsw i32 %3, 9
%5 = add nsw i32 %4, %2
ret i32 %5
}
setruid(ruid) { return (setuid(ruid & 0377 | getuid() & 0177600)); }


x86 assembly (clang, -O0):
<setruid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    -0x8(%rbp),%edi
and    $0xff80,%eax
or     %eax,%edi
mov    $0x0,%al
call   1040 <setuid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setruid>:
push   %rbx
movzbl %dil,%ebx
xor    %eax,%eax
call   1030 <getuid@plt>
and    $0xff80,%eax
or     %eax,%ebx
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <setuid@plt>

LLVM IR (-O0):
define i32 @setruid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 (...) @getuid()
%6 = and i32 %5, 65408
%7 = or i32 %4, %6
%8 = call i32 (i32, ...) bitcast (i32 (...)* @setuid to i32 (i32, ...)*)(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @setruid(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 (...) @getuid()
%4 = and i32 %3, 65408
%5 = or i32 %4, %2
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @setuid to i32 (i32, ...)*)(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *,
                           char const *, char const *, int);
char *get_libmsr_error_message(int);
int /*<<< orphan*/ stderr;
void libmsr_error_handler(const char *desc, int err, const char *host,
                          const char *filename, int line) {
  fprintf(stderr, "Error: %s: %s: %s:%s::%d\n", get_libmsr_error_message(err),
          desc, host, filename, line);
}


x86 assembly (clang, -O0):
<libmsr_error_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <get_libmsr_error_message@plt>
mov    -0x28(%rbp),%edi
mov    %rax,%rdx
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
lea    0xe95(%rip),%rsi
mov    %eax,(%rsp)
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libmsr_error_handler>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8d,%ebx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rdi,%r12
mov    0x2ea1(%rip),%rax
mov    (%rax),%ebp
mov    %esi,%edi
call   1030 <get_libmsr_error_message@plt>
mov    %ebx,(%rsp)
lea    0xeae(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Error: %s: %s: %s:%s::%d\0A\00"
define void @libmsr_error_handler(i8* %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* @stderr
%12 = load i32, i32* %7
%13 = call i8* @get_libmsr_error_message(i32 %12)
%14 = load i8*, i8** %6
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i32, i32* %10
%18 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14, i8* %15, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Error: %s: %s: %s:%s::%d\0A\00"
define void @libmsr_error_handler(i8* %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = load i32, i32* @stderr
%7 = tail call i8* @get_libmsr_error_message(i32 %1)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %0, i8* %2, i8* %3, i32 %4)
ret void
}
/* Type definitions */
struct bloom {
  int dummy;
};

/* Variables and functions */
int bloom_check_add(struct bloom *, void *, int, int);
int bloom_add(struct bloom *bloom, void *buffer, int len) {
  return bloom_check_add(bloom, buffer, len, 1);
}


x86 assembly (clang, -O0):
<bloom_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <bloom_check_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bloom_add>:
mov    $0x1,%ecx
jmp    1030 <bloom_check_add@plt>

LLVM IR (-O0):
%struct.bloom = type { i32 }
define i32 @bloom_add(%struct.bloom* %0, i8* %1, i32 %2) {
%4 = alloca %struct.bloom*
%5 = alloca i8*
%6 = alloca i32
store %struct.bloom* %0, %struct.bloom** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.bloom*, %struct.bloom** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @bloom_check_add(%struct.bloom* %7, i8* %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.bloom = type { i32 }
define i32 @bloom_add(%struct.bloom* %0, i8* %1, i32 %2) {
%4 = tail call i32 @bloom_check_add(%struct.bloom* %0, i8* %1, i32 %2, i32 1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ strerror_r(int, char *, int);
const char *strerror(int num) {
  static char buf[64];
  strerror_r(num, buf, sizeof(buf));
  return buf;
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f1b(%rip),%rsi
mov    $0x40,%edx
call   1030 <strerror_r@plt>
lea    0x2f0a(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
mov    $0x40,%edx
call   1030 <strerror_r@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@strerror.buf = internal global [64 x i8] zeroinitializer
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @strerror_r(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @strerror.buf, i64 0, i64 0), i32 64)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @strerror.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@strerror.buf = internal global [64 x i8] zeroinitializer
define i8* @strerror(i32 %0) {
%2 = tail call i32 @strerror_r(i32 %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @strerror.buf, i64 0, i64 0), i32 64)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @strerror.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wfe();
void wfe() { __builtin_arm_wfe(); }


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

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

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

LLVM IR (-O2):
define void @wfe() {
%1 = tail call i32 (...) @__builtin_arm_wfe()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__0__IO__toggle();
void LedsP__Led2__toggle(void) { HplAtm128GeneralIOPinP__0__IO__toggle(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led2__toggle() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__0__IO__toggle()
ret void
}
void marker3(a, b) char *a, *b;
{}


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

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

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

LLVM IR (-O2):
define void @marker3(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void dumpUARTRegs() {}


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

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

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

LLVM IR (-O2):
define void @dumpUARTRegs() {
ret void
}
void map_boot() { (*(unsigned int *)(0x40048000)) = 0; }


x86 assembly (clang, -O0):
<map_boot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40048000,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_boot>:
movl   $0x0,0x40048000
ret

LLVM IR (-O0):
define void @map_boot() {
store i32 0, i32* inttoptr (i64 1074036736 to i32*)
ret void
}

LLVM IR (-O2):
define void @map_boot() {
store i32 0, i32* inttoptr (i64 1074036736 to i32*)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t reverseEndian32(int32_t value) {
  uint32_t temp = (value << 16) | (value >> 16);
  return ((temp << 8) & 0xff00ff00) | ((temp >> 8) & 0x00ff00ff);
}


x86 assembly (clang, -O0):
<reverseEndian32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseEndian32>:
mov    %edi,%eax
shl    $0x10,%eax
sar    $0x10,%edi
or     %edi,%eax
bswap  %eax
ror    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @reverseEndian32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = or i32 %5, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = shl i32 %9, 8
%11 = and i32 %10, -16711936
%12 = load i32, i32* %3
%13 = ashr i32 %12, 8
%14 = and i32 %13, 16711935
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @reverseEndian32(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr i32 %0, 16
%4 = or i32 %2, %3
%5 = shl i32 %4, 8
%6 = and i32 %5, -16711936
%7 = lshr i32 %4, 8
%8 = and i32 %7, 16711935
%9 = or i32 %6, %8
ret i32 %9
}
int test_imm_45int16_reg(short val) {
  return ((val) & (0x45 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_45int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x45,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_45int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 69
%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_45int16_reg(i16 signext %0) {
%2 = and i16 %0, 69
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void invalid_encoder(const char *encoder) {
  printf("Error!\nThere is no %s encoder! Exiting...\n", encoder);
  exit(1);
}


x86 assembly (clang, -O0):
<invalid_encoder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [43 x i8] c"Error!\0AThere is no %s encoder! Exiting...\0A\00"
define void @invalid_encoder(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [43 x i8] c"Error!\0AThere is no %s encoder! Exiting...\0A\00"
define void @invalid_encoder(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_FCuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xFC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FCuint64_midword_reg>:
test   $0xfc0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FCuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 252
%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_FCuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 16515072
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void math_vector_zero(float *v, int n) {
  for (int i = 0; i < n; i++) {
    v[i] = 0.0f;
  }
}


x86 assembly (clang, -O0):
<math_vector_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <math_vector_zero+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <math_vector_zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_vector_zero>:
test   %esi,%esi
jle    1126 <math_vector_zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @math_vector_zero(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load float*, float** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float, float* %11, i64 %13
store float 0.000000e+00, float* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @math_vector_zero(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x45() {
  Assert_real((isprint(69)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              350, ("isprint should be 1 for E"));
}


x86 assembly (clang, -O0):
<t_isprint_0x45>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x15e,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x45>:
push   %rax
mov    $0x45,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x15e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for E\00"
define void @t_isprint_0x45() {
%1 = call i32 @isprint(i32 69)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for E\00"
define void @t_isprint_0x45() {
%1 = tail call i32 @isprint(i32 69)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fatorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("\nEntre com um numero interiro: ");
  scanf("%d", &num);
  printf("\n Fat de %d = %d \n", num, fatorial(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fatorial@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <fatorial@plt>
lea    0xebd(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0AEntre com um numero interiro: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"\0A Fat de %d = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @fatorial(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0AEntre com um numero interiro: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"\0A Fat de %d = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fatorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ init_gpio();
int /*<<< orphan*/ init_peripherals();
int /*<<< orphan*/ init_pwm();
scalar_t__ open_mem();
int /*<<< orphan*/ set_realtime();
void init() {
  set_realtime();
  if (open_mem() != EXIT_SUCCESS) {
    exit(EXIT_FAILURE);
  }
  init_peripherals();
  init_gpio();
  init_pwm();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <set_realtime@plt>
mov    $0x0,%al
call   1050 <open_mem@plt>
mov    0x2e5f(%rip),%rcx
cmp    (%rcx),%rax
je     1190 <init+0x30>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    $0x0,%al
call   1040 <init_peripherals@plt>
mov    $0x0,%al
call   1070 <init_gpio@plt>
mov    $0x0,%al
call   1060 <init_pwm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1030 <set_realtime@plt>
xor    %eax,%eax
call   1050 <open_mem@plt>
mov    0x2e62(%rip),%rcx
cmp    (%rcx),%rax
jne    1191 <init+0x31>
xor    %eax,%eax
call   1040 <init_peripherals@plt>
xor    %eax,%eax
call   1070 <init_gpio@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <init_pwm@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define void @init() {
%1 = call i32 (...) @set_realtime()
%2 = call i64 (...) @open_mem()
%3 = load i64, i64* @EXIT_SUCCESS
%4 = icmp ne i64 %2, %3
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
%9 = call i32 (...) @init_peripherals()
%10 = call i32 (...) @init_gpio()
%11 = call i32 (...) @init_pwm()
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define void @init() {
%1 = tail call i32 (...) @set_realtime()
%2 = tail call i64 (...) @open_mem()
%3 = load i64, i64* @EXIT_SUCCESS
%4 = icmp eq i64 %2, %3
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
%9 = tail call i32 (...) @init_peripherals()
%10 = tail call i32 (...) @init_gpio()
%11 = tail call i32 (...) @init_pwm()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_reportbug(char *);
void funcFB(void) { lua_reportbug("call expression not a function"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"call expression not a function\00"
define void @funcFB() {
%1 = call i32 @lua_reportbug(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"call expression not a function\00"
define void @funcFB() {
%1 = tail call i32 @lua_reportbug(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
void g_slist_remove() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_remove() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __bound_check(void *, size_t);
void *memset(void *, int, size_t);
void *__bound_memset(void *dst, int c, size_t size) {
  __bound_check(dst, size);
  return memset(dst, c, size);
}


x86 assembly (clang, -O0):
<__bound_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <__bound_check@plt>
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bound_memset>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rsi
call   1040 <__bound_check@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @__bound_memset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = call i32 @__bound_check(i8* %7, i64 %8)
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = trunc i32 %11 to i8
%13 = load i64, i64* %6
ret i8* %10
}

LLVM IR (-O2):
define i8* @__bound_memset(i8* returned %0, i32 %1, i64 %2) {
%4 = tail call i32 @__bound_check(i8* %0, i64 %2)
%5 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %5, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int puts(char *);
int test(void) {
  return puts("hello") + puts("hello"
                              ", world");
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    %eax,-0x4(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    %eax,%ebx
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [13 x i8] c"hello, world\00"
define i32 @test() {
%1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [13 x i8] c"hello, world\00"
define i32 @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = add nsw i32 %2, %1
ret i32 %3
}
void dec_zcache_pers_pageframes(void) {}


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

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

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

LLVM IR (-O2):
define void @dec_zcache_pers_pageframes() {
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int lmc_file_size(const char *fn) {
  struct stat st;
  if (stat(fn, &st) == -1)
    return 0;
  return st.st_size;
}


x86 assembly (clang, -O0):
<lmc_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <lmc_file_size+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1144 <lmc_file_size+0x34>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmc_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1125 <lmc_file_size+0x15>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @lmc_file_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @lmc_file_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void xerbla(char *srname, int *info) {
  fprintf(stderr,
          "** On entry to %6s parameter number %2u had an illegal value\n",
          srname, *info);
}


x86 assembly (clang, -O0):
<xerbla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xerbla>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%ecx
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"** On entry to %6s parameter number %2u had an illegal value\0A\00"
define void @xerbla(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"** On entry to %6s parameter number %2u had an illegal value\0A\00"
define void @xerbla(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i32, i32* %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  for (i = 0; i < 2; ++i) {
    fork();
    printf("-\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1161 <main+0x41>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [2 x i8] c"-\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void *print_message(void *ptr) {
  char *message;
  message = (char *)ptr;
  fprintf(stdout, "%s", message);
  fflush(stdout);
  pthread_exit(0);
}


x86 assembly (clang, -O0):
<print_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %edi,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_message>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define i8* @print_message(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i32, i32* @stdout
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
%11 = call i32 @pthread_exit(i32 0)
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define noalias i8* @print_message(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @pthread_exit(i32 0)
ret i8* undef
}
void foo619() {}


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

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

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

LLVM IR (-O2):
define void @foo619() {
ret void
}
/* Variables and functions */
unsigned int __udivmodsi4(unsigned int, unsigned int, int /*<<< orphan*/);
unsigned int __aeabi_uidiv(unsigned int num, unsigned int den) {
  return __udivmodsi4(num, den, 0);
}


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

x86 assembly (clang, -O2):
<__aeabi_uidiv>:
xor    %edx,%edx
jmp    1030 <__udivmodsi4@plt>

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

LLVM IR (-O2):
define i32 @__aeabi_uidiv(i32 %0, i32 %1) {
%3 = tail call i32 @__udivmodsi4(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _str_free_mem(void *ptr) {
  if (ptr != (void *)NULL) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<_str_free_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <_str_free_mem+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_str_free_mem(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 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @_str_free_mem(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}