xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, int, int);
int puzzle(int);
void dotest1(int s, int expr) {
  int act = puzzle(s);
  if (act != expr)
    printf("Expected %d, got %d\n", expr, act);
  assert(act == expr);
}


x86 assembly (clang, -O0):
<dotest1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <puzzle@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1167 <dotest1+0x37>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest1>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1050 <puzzle@plt>
mov    %eax,%ebp
cmp    %ebx,%eax
je     1150 <dotest1+0x20>
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
xor    %edi,%edi
cmp    %ebx,%ebp
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Expected %d, got %d\0A\00"
define void @dotest1(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 = call i32 @puzzle(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Expected %d, got %d\0A\00"
define void @dotest1(i32 %0, i32 %1) {
%3 = tail call i32 @puzzle(i32 %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
br label %7
7: ; preds = %5, %2
%8 = zext i1 %4 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, int, int);
int main(void) {
  foo(0, 1, 2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0, i32 1, i32 2)
ret i32 0
}
int debugger_iabr_match(struct pt_regs *regs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pt_regs = type opaque
define i32 @debugger_iabr_match(%struct.pt_regs* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *strdup(const char *str) {
  char *p;
  int len = strlen(str) + 1;
  if ((p = malloc(len)) == NULL)
    return NULL;
  memcpy(p, str, len);
  return p;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    116e <strdup+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1186 <strdup+0x56>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115d <strdup+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
int itemdb_isdropable(int nameid) {
  switch (nameid) {
  case 2634:
  case 2635:
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<itemdb_isdropable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffff5b6,%eax
sub    $0x1,%eax
ja     1129 <itemdb_isdropable+0x29>
jmp    111d <itemdb_isdropable+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1130 <itemdb_isdropable+0x30>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itemdb_isdropable>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0xa4a,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @itemdb_isdropable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 2634, label %5
i32 2635, label %5
]
5: ; preds = %1, %1
store i32 0, i32* %2
br label %7
6: ; preds = %1
store i32 1, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @itemdb_isdropable(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp ne i32 %2, 2634
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mtrace_toggle();
int /*<<< orphan*/ reset();
void sig_reset(int sig) {
  reset();
  mtrace_toggle();
}


x86 assembly (clang, -O0):
<sig_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <reset@plt>
mov    $0x0,%al
call   1030 <mtrace_toggle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_reset>:
push   %rax
xor    %eax,%eax
call   1040 <reset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mtrace_toggle@plt>

LLVM IR (-O0):
define void @sig_reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @reset()
%4 = call i32 (...) @mtrace_toggle()
ret void
}

LLVM IR (-O2):
define void @sig_reset(i32 %0) {
%2 = tail call i32 (...) @reset()
%3 = tail call i32 (...) @mtrace_toggle()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mcs_disconnect();
void sec_disconnect(void) { mcs_disconnect(); }


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

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

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

LLVM IR (-O2):
define void @sec_disconnect() {
%1 = tail call i32 (...) @mcs_disconnect()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pgp_crypto_finish();
void pgp_finish(void) { pgp_crypto_finish(); }


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

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

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

LLVM IR (-O2):
define void @pgp_finish() {
%1 = tail call i32 (...) @pgp_crypto_finish()
ret void
}
__attribute__((always_)) int
pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
%struct.msix_entry = type opaque
define i32 @pci_enable_msix(%struct.pci_dev* %0, %struct.msix_entry* %1, i32 %2) {
%4 = alloca %struct.pci_dev*
%5 = alloca %struct.msix_entry*
%6 = alloca i32
store %struct.pci_dev* %0, %struct.pci_dev** %4
store %struct.msix_entry* %1, %struct.msix_entry** %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
%struct.msix_entry = type opaque
define i32 @pci_enable_msix(%struct.pci_dev* nocapture readnone %0, %struct.msix_entry* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ MiiStationWrite(int, int, int);
void PhyReset(void) {
  MiiStationWrite(0x00, 1, (1 << (15)));
  MiiStationWrite(0x00, 1, (1 << (12)) | (1 << (9)));
}


x86 assembly (clang, -O0):
<PhyReset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
call   1030 <MiiStationWrite@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1200,%edx
call   1030 <MiiStationWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PhyReset>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
call   1030 <MiiStationWrite@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1200,%edx
pop    %rax
jmp    1030 <MiiStationWrite@plt>

LLVM IR (-O0):
define void @PhyReset() {
%1 = call i32 @MiiStationWrite(i32 0, i32 1, i32 32768)
%2 = call i32 @MiiStationWrite(i32 0, i32 1, i32 4608)
ret void
}

LLVM IR (-O2):
define void @PhyReset() {
%1 = tail call i32 @MiiStationWrite(i32 0, i32 1, i32 32768)
%2 = tail call i32 @MiiStationWrite(i32 0, i32 1, i32 4608)
ret void
}
void do_shell() {}


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

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

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

LLVM IR (-O2):
define void @do_shell() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a = 10, b = 4;
  int res = 0;
  res = a << (b / 2);
  if (b % 2) {
    res += a;
  }
  printf("result = %d\n", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1165 <main+0x55>
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x28,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"result = %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 40)
ret void
}
/* Variables and functions */
int flat_dev_read(void *, size_t);
int flat_read(void *buf, size_t len) { return flat_dev_read(buf, len); }


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

x86 assembly (clang, -O2):
<flat_read>:
jmp    1030 <flat_dev_read@plt>

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

LLVM IR (-O2):
define i32 @flat_read(i8* %0, i64 %1) {
%3 = tail call i32 @flat_dev_read(i8* %0, i64 %1)
ret i32 %3
}
int v_int_func() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @v_int_func() {
ret i32 0
}
void fp_regs_set(unsigned val) {
  unsigned i;
  for (i = 0; i < 8; i++)
    __asm__ __volatile__("fildl %0" : : "m"(val));
}


x86 assembly (clang, -O0):
<fp_regs_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jae    1129 <fp_regs_set+0x29>
fildl  -0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <fp_regs_set+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_regs_set>:
mov    %edi,-0x4(%rsp)
fildl  -0x4(%rsp)
fildl  -0x4(%rsp)
fildl  -0x4(%rsp)
fildl  -0x4(%rsp)
fildl  -0x4(%rsp)
fildl  -0x4(%rsp)
fildl  -0x4(%rsp)
fildl  -0x4(%rsp)
ret

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

LLVM IR (-O2):
define void @fp_regs_set(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
void signal_handler(int signum, siginfo_t *info, void *arg) {
  (void)signum;
  (void)info;
  (void)arg;
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @signal_handler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @signal_handler(i32 %0, i32* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void hal_abort() { abort(); }


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

x86 assembly (clang, -O2):
<hal_abort>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @hal_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @hal_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solve_with_double_doubles(int max, double eps, int *nit) {
  int fail = _ada_use_c2phc4c(273, &max, nit, &eps, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_with_double_doubles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x111,%edi
lea    -0x4(%rbp),%rsi
lea    -0x10(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_with_double_doubles>:
sub    $0x18,%rsp
mov    %rsi,%rdx
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rcx
mov    $0x111,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @solve_with_double_doubles(i32 %0, double %1, i32* %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store double %1, double* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @_ada_use_c2phc4c(i32 273, i32* %4, i32* %8, double* %5, i32 0)
store i32 %9, i32* %7
%10 = load i32, i32* %7
ret i32 %10
}

LLVM IR (-O2):
define i32 @solve_with_double_doubles(i32 %0, double %1, i32* %2) {
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
%6 = call i32 @_ada_use_c2phc4c(i32 273, i32* %4, i32* %2, double* %5, i32 0)
ret i32 %6
}
/* Variables and functions */
char tolower(char);
void sqchat_trie_strtolower(char *s) {
  for (int i = 0; s[i] != '\0'; i++)
    s[i] = tolower(s[i]);
}


x86 assembly (clang, -O0):
<sqchat_trie_strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <sqchat_trie_strtolower+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <sqchat_trie_strtolower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sqchat_trie_strtolower(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %23, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %26
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call signext i8 @tolower(i8 signext %17)
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 %18, i8* %22
br label %23
23: ; preds = %12
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %4
26: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @sqchat_trie_strtolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8 [ %12, %5 ], [ %2, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = tail call signext i8 @tolower(i8 signext %7)
store i8 %9, i8* %8
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void show_usage() {
  fprintf(stderr, "Usage: saveconfig [ -f filename ] [ -t raw/xml ]\n");
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: saveconfig [ -f filename ] [ -t raw/xml ]\0A\00"
define void @show_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: saveconfig [ -f filename ] [ -t raw/xml ]\0A\00"
define void @show_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printchar(char n) { printf(" %c |", n); }


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c" %c |\00"
define void @printchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %c |\00"
define void @printchar(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
void MEASUREMENT_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @MEASUREMENT_Init() {
ret void
}
int ints_enabled(void) {
  static const unsigned long RFLAGS_IF = (1ul << 9);
  unsigned long flags;
  __asm__ volatile("pushfq ; pop %0" : "=rm"(flags) : : "memory");
  return (flags & RFLAGS_IF) != 0;
}


x86 assembly (clang, -O0):
<ints_enabled>:
push   %rbp
mov    %rsp,%rbp
pushf
pop    -0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x200,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ints_enabled>:
pushf
pop    -0x8(%rsp)
mov    -0x8(%rsp),%eax
shr    $0x9,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
@ints_enabled.RFLAGS_IF = internal constant i64 512
define i32 @ints_enabled() {
%1 = alloca i64
%2 = load i64, i64* %1
%3 = and i64 %2, 512
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ints_enabled() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = lshr i32 %4, 9
%6 = and i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ update_ics_width();
void NotifyFrontendLogin() { update_ics_width(); }


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

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

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

LLVM IR (-O2):
define void @NotifyFrontendLogin() {
%1 = tail call i32 (...) @update_ics_width()
ret void
}
/* Variables and functions */
char *malloc(size_t);
char *strncpy(char *, char *, size_t);
char *_strcpy_partial(char *string, char *start, char *end) {
  char *result;
  size_t len = end - start + 1;
  result = malloc((len + 1) * sizeof(*result));
  result = strncpy(result, string, len);
  result[len] = '\0';
  return result;
}


x86 assembly (clang, -O0):
<_strcpy_partial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <strncpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strcpy_partial>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
sub    %rsi,%rbx
lea    0x1(%rbx),%r15
lea    0x2(%rbx),%rdi
call   1040 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,0x1(%r12,%rbx,1)
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @_strcpy_partial(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = add nsw i64 %13, 1
store i64 %14, i64* %8
%15 = load i64, i64* %8
%16 = add i64 %15, 1
%17 = mul i64 %16, 1
%18 = call i8* @malloc(i64 %17)
store i8* %18, i8** %7
%19 = load i8*, i8** %7
%20 = load i8*, i8** %4
%21 = load i64, i64* %8
%22 = call i8* @strncpy(i8* %19, i8* %20, i64 %21)
store i8* %22, i8** %7
%23 = load i8*, i8** %7
%24 = load i64, i64* %8
%25 = getelementptr inbounds i8, i8* %23, i64 %24
store i8 0, i8* %25
%26 = load i8*, i8** %7
ret i8* %26
}

LLVM IR (-O2):
define i8* @_strcpy_partial(i8* nocapture %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = sub i64 %4, %5
%7 = add nsw i64 %6, 1
%8 = add i64 %6, 2
%9 = tail call i8* @malloc(i64 %8)
%10 = tail call i8* @strncpy(i8* dereferenceable(1) %9, i8* %0, i64 %7)
%11 = getelementptr inbounds i8, i8* %9, i64 %7
store i8 0, i8* %11
ret i8* %9
}
void dv2_add(double *a, double *b) {
  a[0] += b[0];
  a[1] += b[1];
}


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

x86 assembly (clang, -O2):
<dv2_add>:
movsd  (%rsi),%xmm0
addsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
addsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @dv2_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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fadd double %10, %7
store double %11, double* %9
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fadd double %17, %14
store double %18, double* %16
ret void
}

LLVM IR (-O2):
define void @dv2_add(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = fadd double %3, %4
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fadd double %7, %9
store double %10, double* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("\r\nhello world!\r\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"\0D\0Ahello world!\0D\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"\0D\0Ahello world!\0D\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int mkdirat(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int mkdir(const char *path, mode_t mode) {
  return mkdirat(AT_FDCWD, path, mode);
}


x86 assembly (clang, -O0):
<mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <mkdirat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <mkdirat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
define i32 @mkdir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @AT_FDCWD
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @mkdirat(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
define i32 @mkdir(i8* %0, i32 %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = tail call i32 @mkdirat(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
double ran() {
  static long int iy = 100001;
  iy *= 125;
  iy -= (iy / 2796203) * 2796203;
  return (double)iy / 2796203.0;
}


x86 assembly (clang, -O0):
<ran>:
push   %rbp
mov    %rsp,%rbp
imul   $0x7d,0x2f14(%rip),%rax
7d
mov    %rax,0x2f0d(%rip)
mov    0x2f06(%rip),%rax
mov    $0x2aaaab,%ecx
cqto
idiv   %rcx
imul   $0x2aaaab,%rax,%rcx
mov    0x2eee(%rip),%rax
sub    %rcx,%rax
mov    %rax,0x2ee4(%rip)
cvtsi2sdq 0x2edb(%rip),%xmm0
movsd  0xeb3(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ran>:
imul   $0x7d,0x2f18(%rip),%rcx
7d
movabs $0xbffffe800003,%rdx
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x5,%rdx
add    %rax,%rdx
imul   $0x2aaaab,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,0x2ee9(%rip)
cvtsi2sd %rcx,%xmm0
divsd  0xebc(%rip),%xmm0
ret

LLVM IR (-O0):
@ran.iy = internal global i64 100001
define double @ran() {
%1 = load i64, i64* @ran.iy
%2 = mul nsw i64 %1, 125
store i64 %2, i64* @ran.iy
%3 = load i64, i64* @ran.iy
%4 = sdiv i64 %3, 2796203
%5 = mul nsw i64 %4, 2796203
%6 = load i64, i64* @ran.iy
%7 = sub nsw i64 %6, %5
store i64 %7, i64* @ran.iy
%8 = load i64, i64* @ran.iy
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 0x4145555580000000
ret double %10
}

LLVM IR (-O2):
@ran.iy = internal unnamed_addr global i64 100001
define double @ran() {
%1 = load i64, i64* @ran.iy
%2 = mul nsw i64 %1, 125
%3 = srem i64 %2, 2796203
store i64 %3, i64* @ran.iy
%4 = sitofp i64 %3 to double
%5 = fdiv double %4, 0x4145555580000000
ret double %5
}
IR0A1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*p0) <= (*((short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
mov    $0xa98ac7,%ecx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1142 <IR0A1+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <IR0A1+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0A1>:
movzwl (%r8),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%cx
setle  %al
ret

LLVM IR (-O0):
define i32 @IR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i16, i16* %16
%18 = sext i16 %17 to i32
%19 = load i16, i16* inttoptr (i64 11111111 to i16*)
%20 = sext i16 %19 to i32
%21 = icmp sle i32 %18, %20
br i1 %21, label %22, label %23
22: ; preds = %6
store i32 1, i32* %7
br label %24
23: ; preds = %6
store i32 0, i32* %7
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @IR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = load i16, i16* %4
%8 = load i16, i16* inttoptr (i64 11111111 to i16*)
%9 = icmp sle i16 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
int isPrim(int x) {
  int i = 2, flag = 1;
  while (flag && i * i < x) {
    if (x % i == 0) {
      flag = 0;
    } else {
      i++;
    }
  }
  if (flag == 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isPrim>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1134 <isPrim+0x34>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1144 <isPrim+0x44>
jmp    116e <isPrim+0x6e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1160 <isPrim+0x60>
movl   $0x0,-0x10(%rbp)
jmp    1169 <isPrim+0x69>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <isPrim+0x15>
cmpl   $0x0,-0x10(%rbp)
jne    1184 <isPrim+0x84>
movl   $0x0,-0x4(%rbp)
jmp    118b <isPrim+0x8b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrim>:
mov    $0x1,%eax
cmp    $0x5,%edi
jl     1129 <isPrim+0x29>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
xor    %eax,%eax
test   %edx,%edx
setne  %al
je     1129 <isPrim+0x29>
add    %eax,%ecx
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
jl     1110 <isPrim+0x10>
ret

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

LLVM IR (-O2):
define i32 @isPrim(i32 %0) {
%2 = icmp sgt i32 %0, 4
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = add nuw nsw i32 %4, %7
%9 = mul nsw i32 %8, %8
%10 = icmp slt i32 %9, %0
%11 = select i1 %6, i1 %10, i1 false
br i1 %11, label %3, label %12
12: ; preds = %3, %1
%13 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ log_do_comma();
int /*<<< orphan*/ log_do_indent();
void log_new_entry() {
  log_do_comma();
  log_do_indent();
}


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

x86 assembly (clang, -O2):
<log_new_entry>:
push   %rax
xor    %eax,%eax
call   1040 <log_do_comma@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <log_do_indent@plt>

LLVM IR (-O0):
define void @log_new_entry() {
%1 = call i32 (...) @log_do_comma()
%2 = call i32 (...) @log_do_indent()
ret void
}

LLVM IR (-O2):
define void @log_new_entry() {
%1 = tail call i32 (...) @log_do_comma()
%2 = tail call i32 (...) @log_do_indent()
ret void
}
void write_kernels_source_derivatives_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @write_kernels_source_derivatives_adios_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BMP_setFlags(int /*<<< orphan*/);
int /*<<< orphan*/ _bmp_end();
void BMP_end() {
  BMP_setFlags(0);
  _bmp_end();
}


x86 assembly (clang, -O0):
<BMP_end>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <BMP_setFlags@plt>
mov    $0x0,%al
call   1040 <_bmp_end@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMP_end>:
push   %rax
xor    %edi,%edi
call   1030 <BMP_setFlags@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <_bmp_end@plt>

LLVM IR (-O0):
define void @BMP_end() {
%1 = call i32 @BMP_setFlags(i32 0)
%2 = call i32 (...) @_bmp_end()
ret void
}

LLVM IR (-O2):
define void @BMP_end() {
%1 = tail call i32 @BMP_setFlags(i32 0)
%2 = tail call i32 (...) @_bmp_end()
ret void
}
int cl_dev_close(const void *cfg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cl_dev_close(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t VbExGetSwitches(uint32_t mask) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @VbExGetSwitches(i32 %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isIF_F(const char *comm) { return strcmp(comm, "if_f") == 0; }


x86 assembly (clang, -O0):
<isIF_F>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isIF_F>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"if_f\00"
define i32 @isIF_F(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"if_f\00"
define i32 @isIF_F(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void astringClear(char **data) {
  free(*data);
  *data = NULL;
}


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

x86 assembly (clang, -O2):
<astringClear>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @astringClear(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @free(i8* %4)
%6 = load i8**, i8*** %2
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @astringClear(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
void foo4(a) signed short a;
{}


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo4(i32 %0) {
%2 = alloca i16
%3 = trunc i32 %0 to i16
store i16 %3, i16* %2
ret void
}

LLVM IR (-O2):
define void @foo4(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nullf(char *);
int /*<<< orphan*/ output_byte(int);
void emit_fpop() {
  nullf("fpop\n");
  output_byte(0xdd);
  output_byte(0xd8);
}


x86 assembly (clang, -O0):
<emit_fpop>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <nullf@plt>
mov    $0xdd,%edi
call   1040 <output_byte@plt>
mov    $0xd8,%edi
call   1040 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fpop>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <nullf@plt>
mov    $0xdd,%edi
call   1040 <output_byte@plt>
mov    $0xd8,%edi
pop    %rax
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"fpop\0A\00"
define void @emit_fpop() {
%1 = call i32 @nullf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 221)
%3 = call i32 @output_byte(i32 216)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"fpop\0A\00"
define void @emit_fpop() {
%1 = tail call i32 @nullf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 221)
%3 = tail call i32 @output_byte(i32 216)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int _unlink(char *name) {
  errno = ENOENT;
  name = name;
  return -1;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
%4 = load i8*, i8** %2
store i8* %4, i8** %2
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
ret i32 -1
}
void ClearExtensionVariables(void) {}


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

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

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

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

/* Variables and functions */
int count4(uint32_t x) {
  uint64_t wtest = 10;
  int digits = 1;
  while (x / wtest) {
    wtest *= 10;
    digits++;
  }
  return digits;
}


x86 assembly (clang, -O0):
<count4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%eax
je     113a <count4+0x3a>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <count4+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count4>:
lea    0x9(%rdi),%eax
mov    $0x1,%ecx
cmp    $0x13,%eax
jb     1131 <count4+0x31>
mov    $0xa,%esi
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
add    %esi,%esi
lea    (%rsi,%rsi,4),%esi
add    $0x1,%ecx
mov    %edi,%eax
cltd
idiv   %esi
test   %eax,%eax
jne    1120 <count4+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @count4(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ 10, %1 ]
%7 = mul nuw nsw i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = sdiv i32 %0, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSKCV(const char *the_title) { return any_decrqss(the_title, " r"); }


x86 assembly (clang, -O0):
<rpt_DECSKCV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <any_decrqss@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpt_DECSKCV>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" r\00"
define i32 @rpt_DECSKCV(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @any_decrqss(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c" r\00"
define i32 @rpt_DECSKCV(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_SIV100B(unsigned short uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
movzbl %dil,%edi
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_SIV100B(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = trunc i16 %5 to i8
%7 = load i16, i16* %4
%8 = trunc i16 %7 to i8
%9 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %6, i8 zeroext %8)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_SIV100B(i16 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %0 to i8
%4 = trunc i16 %1 to i8
%5 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %3, i8 zeroext %4)
ret void
}