xunge/DecIR huggingface dataset:
int startend(int myid, int nodes, unsigned int totalsize, unsigned int *start,
             unsigned int *end) {
  int block_size;
  block_size = totalsize / nodes;
  if (totalsize % nodes != 0)
    block_size++;
  *start = myid * block_size;
  *end = *start + block_size;
  if (*end > totalsize)
    *end = totalsize;
  return 1;
}


x86 assembly (clang, -O0):
<startend>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
cmp    $0x0,%edx
je     113a <startend+0x3a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%ecx
imul   -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jbe    116e <startend+0x6e>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<startend>:
mov    %edx,%r9d
mov    %edx,%eax
xor    %edx,%edx
div    %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
imul   %eax,%edi
mov    %edi,(%rcx)
add    %eax,%edi
cmp    %r9d,%edi
cmova  %r9d,%edi
mov    %edi,(%r8)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @startend(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = udiv i32 %2, %1
%7 = urem i32 %2, %1
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = add nsw i32 %6, %9
%11 = mul nsw i32 %10, %0
store i32 %11, i32* %3
%12 = add i32 %11, %10
%13 = icmp ugt i32 %12, %2
%14 = select i1 %13, i32 %2, i32 %12
store i32 %14, i32* %4
ret i32 1
}
/* Variables and functions */
int rand();
int set_number() {
  int random = (rand() % 998) + 1;
  return random;
}


x86 assembly (clang, -O0):
<set_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_number>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x20d56b39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x3e6,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @set_number() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 998
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @set_number() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 998
%3 = add nsw i32 %2, 1
ret i32 %3
}
void sc_maybe_aa_change_onexec(struct sc_apparmor *apparmor,
                               const char *profile) {}


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

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

LLVM IR (-O0):
%struct.sc_apparmor = type opaque
define void @sc_maybe_aa_change_onexec(%struct.sc_apparmor* %0, i8* %1) {
%3 = alloca %struct.sc_apparmor*
%4 = alloca i8*
store %struct.sc_apparmor* %0, %struct.sc_apparmor** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.sc_apparmor = type opaque
define void @sc_maybe_aa_change_onexec(%struct.sc_apparmor* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ func();
char *malloc(int);
void main() {
  func();
  char *test = malloc(20);
  free(test);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <func@plt>
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <func@plt>
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8*
%2 = call i32 (...) @func()
%3 = call i8* @malloc(i32 20)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @func()
%2 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%3 = tail call i32 @free(i8* %2)
ret void
}
double very_smart_add(double a, double b) {
  a += b;
  return a;
}


x86 assembly (clang, -O0):
<very_smart_add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<very_smart_add>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @very_smart_add(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fadd double %6, %5
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @very_smart_add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *argv0) {
  fprintf(stderr, "usage: %s <filename> <size in byte>\n", argv0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"usage: %s <filename> <size in byte>\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"usage: %s <filename> <size in byte>\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int strcoll(const char *s1, const char *s2) {
  assert(!"strcoll");
  return 0;
}


x86 assembly (clang, -O0):
<strcoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcoll>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"strcoll\00"
define i32 @strcoll(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @strcoll(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_i2c(int /*<<< orphan*/);
void i2c_init(void) { test_i2c(0); }


x86 assembly (clang, -O0):
<i2c_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <test_i2c@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_init>:
xor    %edi,%edi
jmp    1030 <test_i2c@plt>

LLVM IR (-O0):
define void @i2c_init() {
%1 = call i32 @test_i2c(i32 0)
ret void
}

LLVM IR (-O2):
define void @i2c_init() {
%1 = tail call i32 @test_i2c(i32 0)
ret void
}
unsigned long __double_bits(double p) {
  union {
    double d;
    unsigned long bits;
  } conv;
  conv.d = p;
  return conv.bits;
}


x86 assembly (clang, -O0):
<__double_bits>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__double_bits>:
movq   %xmm0,%rax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i64 @__double_bits(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to i64*
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @__double_bits(double %0) {
%2 = bitcast double %0 to i64
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int resctrl_alloc_assoc_get_pid(int /*<<< orphan*/ const, unsigned int *);
int /*<<< orphan*/ resctrl_lock_release();
int resctrl_lock_shared();
int os_alloc_assoc_get_pid(const pid_t task, unsigned *class_id) {
  int ret;
  ;
  ret = resctrl_lock_shared();
  if (ret != 0)
    return ret;
  ret = resctrl_alloc_assoc_get_pid(task, class_id);
  resctrl_lock_release();
  return ret;
}


x86 assembly (clang, -O0):
<os_alloc_assoc_get_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <resctrl_lock_shared@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115e <os_alloc_assoc_get_pid+0x2e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <os_alloc_assoc_get_pid+0x4a>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <resctrl_alloc_assoc_get_pid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <resctrl_lock_release@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_alloc_assoc_get_pid>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <resctrl_lock_shared@plt>
test   %eax,%eax
jne    1158 <os_alloc_assoc_get_pid+0x28>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <resctrl_alloc_assoc_get_pid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <resctrl_lock_release@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @os_alloc_assoc_get_pid(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%7 = call i32 (...) @resctrl_lock_shared()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %6
store i32 %11, i32* %3
br label %18
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32*, i32** %5
%15 = call i32 @resctrl_alloc_assoc_get_pid(i32 %13, i32* %14)
store i32 %15, i32* %6
%16 = call i32 (...) @resctrl_lock_release()
%17 = load i32, i32* %6
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @os_alloc_assoc_get_pid(i32 %0, i32* %1) {
%3 = tail call i32 (...) @resctrl_lock_shared()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @resctrl_alloc_assoc_get_pid(i32 %0, i32* %1)
%7 = tail call i32 (...) @resctrl_lock_release()
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %9
}
int main() {
  int x, y, z;
  x = 0;
  y = 0;
  if (x < 5) {
    x = y + x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    112c <main+0x2c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ PN5180A_clearIRQStatus(int);
int PN5180A_getIRQStatus();
int /*<<< orphan*/ PN5180_transceiveCommand(int *, int, int /*<<< orphan*/,
                                            int /*<<< orphan*/);
bool PN5180A_setRF_on() {
  uint8_t cmd[2];
  cmd[0] = (0x16);
  cmd[1] = 0x00;
  PN5180_transceiveCommand(cmd, 2, 0, 0);
  while (0 == ((1 << 9) & PN5180A_getIRQStatus()))
    ;
  PN5180A_clearIRQStatus((1 << 9));
  return true;
}


x86 assembly (clang, -O0):
<PN5180A_setRF_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x16,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x2,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <PN5180_transceiveCommand@plt>
mov    $0x0,%al
call   1050 <PN5180A_getIRQStatus@plt>
mov    %eax,%ecx
and    $0x200,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1176 <PN5180A_setRF_on+0x46>
jmp    1158 <PN5180A_setRF_on+0x28>
mov    $0x200,%edi
call   1040 <PN5180A_clearIRQStatus@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PN5180A_setRF_on>:
push   %rax
movq   $0x16,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <PN5180_transceiveCommand@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <PN5180A_getIRQStatus@plt>
test   $0x200,%eax
je     1150 <PN5180A_setRF_on+0x20>
mov    $0x200,%edi
call   1040 <PN5180A_clearIRQStatus@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PN5180A_setRF_on() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 22, i32* %2
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
store i32 0, i32* %3
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = call i32 @PN5180_transceiveCommand(i32* %4, i32 2, i32 0, i32 0)
br label %6
6: ; preds = %10, %0
%7 = call i32 (...) @PN5180A_getIRQStatus()
%8 = and i32 512, %7
%9 = icmp eq i32 0, %8
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
%12 = call i32 @PN5180A_clearIRQStatus(i32 512)
ret i32 1
}

LLVM IR (-O2):
define i32 @PN5180A_setRF_on() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 22, i32* %3
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
store i32 0, i32* %4
%5 = call i32 @PN5180_transceiveCommand(i32* %3, i32 2, i32 0, i32 0)
br label %6
6: ; preds = %6, %0
%7 = call i32 (...) @PN5180A_getIRQStatus()
%8 = and i32 %7, 512
%9 = icmp eq i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6
%11 = call i32 @PN5180A_clearIRQStatus(i32 512)
ret i32 1
}
void swap(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}


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

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

LLVM IR (-O0):
define void @swap(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
void getCoeff(int *CoeffA, int *CoeffB, int *CoeffC) {
  printf("\nFor a polynomial of the form y = ax^2 + bx + c\n");
  printf("Enter the coefficients a, b, and c: ");
  scanf("%d %d %d", CoeffA, CoeffB, CoeffC);
  return;
}


x86 assembly (clang, -O0):
<getCoeff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xef7(%rip),%rdi
call   1040 <scanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCoeff>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <scanf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"\0AFor a polynomial of the form y = ax^2 + bx + c\0A\00"
@.str.1 = [37 x i8] c"Enter the coefficients a, b, and c: \00"
@.str.2 = [9 x i8] c"%d %d %d\00"
define void @getCoeff(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 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %9, i32* %10, i32* %11)
ret void
}

LLVM IR (-O2):
@.str.1 = [37 x i8] c"Enter the coefficients a, b, and c: \00"
@.str.2 = [9 x i8] c"%d %d %d\00"
@str = [48 x i8] c"\0AFor a polynomial of the form y = ax^2 + bx + c\00"
define void @getCoeff(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %0, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  double f = atof(argv[1]);
  printf("g: %g\n", f);
  printf("%%.2g: '%.2g'\n", f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
movsd  %xmm0,(%rsp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
movsd  (%rsp),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"g: %g\0A\00"
@.str.1 = [15 x i8] c"%%.2g: '%.2g'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call double @atof(i8* %8)
store double %9, double* %5
%10 = load double, double* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %10)
%12 = load double, double* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"g: %g\0A\00"
@.str.1 = [15 x i8] c"%%.2g: '%.2g'\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call double @atof(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_quaddobl_container_to_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(264, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_container_to_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x108,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_container_to_start_system>:
mov    $0x108,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_container_to_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 264, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_container_to_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 264, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ demarshal16(int /*<<< orphan*/ *);
uint16_t read16(uint8_t **b) {
  uint8_t *d = *b;
  *b += 2;
  return demarshal16(d);
}


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

x86 assembly (clang, -O2):
<read16>:
mov    (%rdi),%rax
lea    0x8(%rax),%rcx
mov    %rcx,(%rdi)
mov    %rax,%rdi
jmp    1030 <demarshal16@plt>

LLVM IR (-O0):
define i32 @read16(i32** %0) {
%2 = alloca i32**
%3 = alloca i32*
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
store i32* %5, i32** %3
%6 = load i32**, i32*** %2
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32* %8, i32** %6
%9 = load i32*, i32** %3
%10 = call i32 @demarshal16(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @read16(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 2
store i32* %3, i32** %0
%4 = tail call i32 @demarshal16(i32* %2)
ret i32 %4
}
/* Variables and functions */
int do_gotoline(int /*<<< orphan*/, int /*<<< orphan*/);
int do_gotoline_void(void) { return do_gotoline(0, 0); }


x86 assembly (clang, -O0):
<do_gotoline_void>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <do_gotoline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_gotoline_void>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <do_gotoline@plt>

LLVM IR (-O0):
define i32 @do_gotoline_void() {
%1 = call i32 @do_gotoline(i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @do_gotoline_void() {
%1 = tail call i32 @do_gotoline(i32 0, i32 0)
ret i32 %1
}
int test_imm_8Cint8_mem(signed char *val) {
  return ((*val) & (-0x8C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Cint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -140
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ set_PWM(double);
void PlayMelody(double note[], unsigned long pos) { set_PWM(note[pos]); }


x86 assembly (clang, -O0):
<PlayMelody>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <set_PWM@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PlayMelody>:
movsd  (%rdi,%rsi,8),%xmm0
jmp    1030 <set_PWM@plt>

LLVM IR (-O0):
define void @PlayMelody(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
%5 = load double*, double** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds double, double* %5, i64 %6
%8 = load double, double* %7
%9 = call i32 @set_PWM(double %8)
ret void
}

LLVM IR (-O2):
define void @PlayMelody(double* nocapture %0, i64 %1) {
%3 = getelementptr inbounds double, double* %0, i64 %1
%4 = load double, double* %3
%5 = tail call i32 @set_PWM(double %4)
ret void
}
unsigned xrop3_58_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_58_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_58_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
mov    %ecx,%eax
xor    $0xff,%eax
or     %edx,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_58_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_58_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = or i32 %6, %7
%9 = xor i32 %8, %4
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
scalar_t__ getpid();
int setpgid(pid_t _pid, pid_t _pgid) {
  if (_pgid != getpid()) {
    errno = EPERM;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<setpgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     115d <setpgid+0x4d>
mov    0x2e8a(%rip),%rax
mov    (%rax),%ecx
mov    0x2e91(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <setpgid+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setpgid>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
cmp    %r14,%rax
je     113c <setpgid+0x2c>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    0x2eab(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EPERM = global i32 0
@errno = global i32 0
define i32 @setpgid(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = call i64 (...) @getpid()
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* @EPERM
store i32 %10, i32* @errno
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
define i32 @setpgid(i64 %0, i64 %1) {
%3 = tail call i64 (...) @getpid()
%4 = icmp eq i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = load i32, i32* @EPERM
store i32 %6, i32* @errno
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
char *null_array_SINT64(int64_t *arr) {
  if (arr == NULL) {
    return "null";
  } else {
    return "non_null";
  }
}


x86 assembly (clang, -O0):
<null_array_SINT64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <null_array_SINT64+0x23>
lea    0xeea(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112e <null_array_SINT64+0x2e>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_array_SINT64>:
test   %rdi,%rdi
lea    0xefa(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"null\00"
@.str.1 = [9 x i8] c"non_null\00"
define i8* @null_array_SINT64(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
@.str.1 = [9 x i8] c"non_null\00"
define i8* @null_array_SINT64(i32* readnone %0) {
%2 = icmp eq i32* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ bjk_simple_abort(void (*)(), int);
void bjk_page_miss_handler() { bjk_simple_abort(bjk_page_miss_handler, 2); }


x86 assembly (clang, -O0):
<bjk_page_miss_handler>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
mov    $0x2,%esi
call   1030 <bjk_simple_abort@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bjk_page_miss_handler>:
mov    0x2ec9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <bjk_simple_abort@plt>

LLVM IR (-O0):
define void @bjk_page_miss_handler() {
%1 = call i32 @bjk_simple_abort(void (...)* bitcast (void ()* @bjk_page_miss_handler to void (...)*), i32 2)
ret void
}

LLVM IR (-O2):
define void @bjk_page_miss_handler() {
%1 = tail call i32 @bjk_simple_abort(void (...)* bitcast (void ()* @bjk_page_miss_handler to void (...)*), i32 2)
ret void
}
__attribute__((always_)) void cl_prefetch_t1(void *p) {
  asm volatile("prefetcht1 (%0)\n\t" : : "r"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<cl_prefetch_t1>:
prefetcht1 (%rdi)
ret

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

LLVM IR (-O2):
define void @cl_prefetch_t1(i8* %0) {
tail call void asm sideeffect "prefetcht1 ($0)\0A\09", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *strrchr(char *, char);
void mpeg3io_get_filename(char *filename, char *path) {
  char *ptr = strrchr(path, '/');
  if (!ptr)
    ptr = path;
  else
    ptr++;
  strcpy(filename, ptr);
}


x86 assembly (clang, -O0):
<mpeg3io_get_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <mpeg3io_get_filename+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1166 <mpeg3io_get_filename+0x46>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpeg3io_get_filename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rsi
test   %rax,%rax
cmove  %rbx,%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @mpeg3io_get_filename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i8* @strrchr(i8* %6, i8 signext 47)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = load i8*, i8** %4
store i8* %11, i8** %5
br label %15
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
br label %15
15: ; preds = %12, %10
%16 = load i8*, i8** %3
%17 = load i8*, i8** %5
%18 = call i32 @strcpy(i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
define void @mpeg3io_get_filename(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %1, i8 signext 47)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* %1, i8* %5
%7 = tail call i32 @strcpy(i8* %0, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xe6() {
  Assert_real((iscntrl(230) == 0),
              "/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_iscntrl.c",
              1155, ("iscntrl should be 0 for 0xe6"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xe6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe6,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x483,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xe6>:
push   %rax
mov    $0xe6,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x483,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xe6\00"
define void @t_iscntrl_0xe6() {
%1 = call i64 @iscntrl(i32 230)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1155, i8* getelementptr inbounds ([29 x i8], [29 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xe6\00"
define void @t_iscntrl_0xe6() {
%1 = tail call i64 @iscntrl(i32 230)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signum) { printf("Request timed out\n"); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"Request timed out\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Request timed out\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_82() {
  Assert_real((isqrt(82) == 9),
              "/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/stdlib/isqrt.c",
              415, ("Integer square root of 82 should be 9"));
}


x86 assembly (clang, -O0):
<t_sqrt_82>:
push   %rbp
mov    %rsp,%rbp
mov    $0x52,%edi
call   1030 <isqrt@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x19f,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_82>:
push   %rax
mov    $0x52,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x19f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 82 should be 9\00"
define void @t_sqrt_82() {
%1 = call i32 @isqrt(i32 82)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 415, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 82 should be 9\00"
define void @t_sqrt_82() {
%1 = tail call i32 @isqrt(i32 82)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 415, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ox820_gpioleds_release(struct device *dev) {}


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

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

LLVM IR (-O0):
%struct.device = type opaque
define void @ox820_gpioleds_release(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
define void @ox820_gpioleds_release(%struct.device* nocapture %0) {
ret void
}
/* Variables and functions */
int fchdir(int);
__attribute__((__weak__, __always___)) int softboundmpx_fchdir(int fd) {
  return fchdir(fd);
}


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

x86 assembly (clang, -O2):
<softboundmpx_fchdir>:
jmp    1030 <fchdir@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_fchdir(i32 %0) {
%2 = tail call i32 @fchdir(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void WC_Exit(int code) { exit(code); }


x86 assembly (clang, -O0):
<WC_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<WC_Exit>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @WC_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @WC_Exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(struct tm *, int /*<<< orphan*/, int);
struct tm *localtime(const time_t *timer) {
  struct tm *t = (struct tm *)malloc(sizeof(struct tm));
  memset(t, 0, sizeof(struct tm));
  return (t);
}


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

x86 assembly (clang, -O2):
<localtime>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @localtime(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.tm*
store i32* %0, i32** %2
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to %struct.tm*
store %struct.tm* %5, %struct.tm** %3
%6 = load %struct.tm*, %struct.tm** %3
%7 = call i32 @memset(%struct.tm* %6, i32 0, i32 4)
%8 = load %struct.tm*, %struct.tm** %3
ret %struct.tm* %8
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime(i32* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to %struct.tm*
%4 = tail call i32 @memset(%struct.tm* %3, i32 0, i32 4)
ret %struct.tm* %3
}
/* Variables and functions */
int foo3();
int bar3() { return foo3(); }


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

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

LLVM IR (-O0):
define i32 @bar3() {
%1 = call i32 (...) @foo3()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar3() {
%1 = tail call i32 (...) @foo3()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(char *);
void PrintErrorExit(char *prog, char *s) {
  fprintf(stderr, "Please check command, parameter \'%s\' wrong.\n\n", s);
  usage(prog);
  exit(1);
}


x86 assembly (clang, -O0):
<PrintErrorExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <usage@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<PrintErrorExit>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <usage@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Please check command, parameter '%s' wrong.\0A\0A\00"
define void @PrintErrorExit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @usage(i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Please check command, parameter '%s' wrong.\0A\0A\00"
define void @PrintErrorExit(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @usage(i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ warn(char const *);
void fatal(const char *error_msg) {
  warn(error_msg);
  warn("Fatal error encountered");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Fatal error encountered\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @warn(i8* %3)
%5 = call i32 @warn(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"Fatal error encountered\00"
define void @fatal(i8* %0) {
%2 = tail call i32 @warn(i8* %0)
%3 = tail call i32 @warn(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}