xunge/DecIR huggingface dataset:
__attribute__((no, noclone)) int f9(void *a, int b, long long c, long long d,
                                    long long e, char *f, int *g) {
  asm volatile("" : : "r"(a), "r"(b), "r"(c), "r"(d) : "memory");
  asm volatile("" : : "r"(e), "r"(f), "r"(g) : "memory");
  return 0;
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    0x10(%rbp),%rdx
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
mov    0x8(%rsp),%rax
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f9(i8* %0, i32 %1, i64 %2, i64 %3, i64 %4, i8* %5, i32* %6) {
tail call void asm sideeffect "", "r,r,r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %1, i64 %2, i64 %3)
tail call void asm sideeffect "", "r,r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %4, i8* %5, i32* %6)
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, char *, int);
int rand();
void *oom_malloc(char *file, int line, size_t size) {
  if ((rand() % 20) == 0) {
    printf("oom_malloc(): returning NULL at %s:%d\n", file, line);
    return NULL;
  }
  return malloc(size);
}


x86 assembly (clang, -O0):
<oom_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117b <oom_malloc+0x4b>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1188 <oom_malloc+0x58>
mov    -0x20(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oom_malloc>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbp
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <rand@plt>
imul   $0xcccccccd,%eax,%eax
add    $0x19999998,%eax
ror    $0x2,%eax
cmp    $0xccccccc,%eax
jbe    1165 <oom_malloc+0x35>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <malloc@plt>
lea    0xe94(%rip),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"oom_malloc(): returning NULL at %s:%d\0A\00"
define i8* @oom_malloc(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 20
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
store i8* null, i8** %4
br label %18
15: ; preds = %3
%16 = load i64, i64* %7
%17 = call i8* @malloc(i64 %16)
store i8* %17, i8** %4
br label %18
18: ; preds = %15, %11
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
@.str = [39 x i8] c"oom_malloc(): returning NULL at %s:%d\0A\00"
define noalias i8* @oom_malloc(i8* %0, i32 %1, i64 %2) {
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 20
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %11
9: ; preds = %3
%10 = tail call i8* @malloc(i64 %2)
br label %11
11: ; preds = %9, %7
%12 = phi i8* [ null, %7 ], [ %10, %9 ]
ret i8* %12
}
/* Type definitions */
struct timespec {
  long tv_sec;
  int tv_nsec;
};

/* Variables and functions */
long ms_diff(struct timespec start, struct timespec stop) {
  return 1000L * (stop.tv_sec - start.tv_sec) +
         (stop.tv_nsec - start.tv_nsec) / 1000000;
}


x86 assembly (clang, -O0):
<ms_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x10(%rbp),%rax
imul   $0x3e8,%rax,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_diff>:
sub    %rdi,%rdx
imul   $0x3e8,%rdx,%rdx
sub    %esi,%ecx
movslq %ecx,%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
cltq
add    %rdx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
define i64 @ms_diff(i64 %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = bitcast %struct.timespec* %5 to { i64, i32 }*
%8 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %7, i32 0, i32 1
store i32 %1, i32* %9
%10 = bitcast %struct.timespec* %6 to { i64, i32 }*
%11 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %10, i32 0, i32 0
store i64 %2, i64* %11
%12 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %10, i32 0, i32 1
store i32 %3, i32* %12
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%16 = load i64, i64* %15
%17 = sub nsw i64 %14, %16
%18 = mul nsw i64 1000, %17
%19 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%20 = load i32, i32* %19
%21 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%22 = load i32, i32* %21
%23 = sub nsw i32 %20, %22
%24 = sdiv i32 %23, 1000000
%25 = sext i32 %24 to i64
%26 = add nsw i64 %18, %25
ret i64 %26
}

LLVM IR (-O2):
define i64 @ms_diff(i64 %0, i32 %1, i64 %2, i32 %3) {
%5 = sub nsw i64 %2, %0
%6 = mul nsw i64 %5, 1000
%7 = sub nsw i32 %3, %1
%8 = sdiv i32 %7, 1000000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %6, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  do {
    if (0 == 0)
      fprintf(stderr, "Warning: EXP\n");
  } while (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <main+0x9>
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"Warning: EXP\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"Warning: EXP\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(int argc, char **argv) {
  fprintf(
      stderr,
      "usage: %s [options] <in.gb>\n"
      "  -h,--help               help\n"
      "  -j,--read-joypad FILE   read joypad input from FILE\n"
      "  -J,--write-joypad FILE  write joypad input to FILE\n"
      "  -s,--seed SEED          random seed used for initializing RAM\n"
      "  -P,--palette PAL        use a builtin palette for DMG\n"
      "  -x,--scale SCALE        render scale\n"
      "     --force-dmg          force running as a DMG (original gameboy)\n"
      "     --sgb-border         draw the super gameboy border\n",
      argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [450 x i8] c"usage: %s [options] <in.gb>\0A -h,--help help\0A -j,--read-joypad FILE read joypad input from FILE\0A -J,--write-joypad FILE write joypad input to FILE\0A -s,--seed SEED random seed used for initializing RAM\0A -P,--palette PAL use a builtin palette for DMG\0A -x,--scale SCALE render scale\0A --force-dmg force running as a DMG (original gameboy)\0A --sgb-border draw the super gameboy border\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([450 x i8], [450 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [450 x i8] c"usage: %s [options] <in.gb>\0A -h,--help help\0A -j,--read-joypad FILE read joypad input from FILE\0A -J,--write-joypad FILE write joypad input to FILE\0A -s,--seed SEED random seed used for initializing RAM\0A -P,--palette PAL use a builtin palette for DMG\0A -x,--scale SCALE render scale\0A --force-dmg force running as a DMG (original gameboy)\0A --sgb-border draw the super gameboy border\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([450 x i8], [450 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
int bitcount(unsigned int a) {
  a = (a & 0x55555555) + ((a >> 1) & 0x55555555);
  a = (a & 0x33333333) + ((a >> 2) & 0x33333333);
  a = (a + (a >> 4)) & 0x0f0f0f0f;
  a = (a + (a >> 8));
  a = (a + (a >> 16));
  return a & 0xff;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %edi
and    $0x55555555,%edi
add    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @bitcount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1431655765
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 1431655765
%8 = add i32 %4, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = lshr i32 %11, 2
%13 = and i32 %12, 858993459
%14 = add i32 %10, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = load i32, i32* %2
%17 = lshr i32 %16, 4
%18 = add i32 %15, %17
%19 = and i32 %18, 252645135
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 8
%23 = add i32 %20, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = load i32, i32* %2
%26 = lshr i32 %25, 16
%27 = add i32 %24, %26
store i32 %27, i32* %2
%28 = load i32, i32* %2
%29 = and i32 %28, 255
ret i32 %29
}

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = add nuw i32 %4, %2
%6 = and i32 %5, 858993459
%7 = lshr i32 %5, 2
%8 = and i32 %7, 858993459
%9 = add nuw nsw i32 %8, %6
%10 = lshr i32 %9, 4
%11 = add nuw nsw i32 %10, %9
%12 = and i32 %11, 252645135
%13 = lshr i32 %12, 8
%14 = add nuw nsw i32 %13, %12
%15 = lshr i32 %14, 16
%16 = add nuw nsw i32 %15, %14
%17 = and i32 %16, 63
ret i32 %17
}
int syscall(int number) {
  int result;
  asm volatile("movl %0, %%eax" ::"m"(number));
  asm volatile("int $80");
  asm volatile("movl %%eax, %0" : "=m"(result));
  return result;
}


x86 assembly (clang, -O0):
<syscall>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
int    $0x50
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
int    $0x50
mov    %eax,-0x8(%rsp)
mov    -0x8(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @syscall(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* %3
ret i32 %5
}
/* Variables and functions */
unsigned long BIT_MASK(int);
int BIT_WORD(int);
void __clear_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = BIT_MASK(nr);
  unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
  *p &= ~mask;
}


x86 assembly (clang, -O0):
<__clear_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <BIT_MASK@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <BIT_WORD@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x20(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__clear_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1030 <BIT_MASK@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1040 <BIT_WORD@plt>
cltq
not    %rbx
and    %rbx,(%r14,%rax,8)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @__clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = call i64 @BIT_MASK(i32 %7)
store i64 %8, i64* %5
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = call i32 @BIT_WORD(i32 %10)
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
store i64* %13, i64** %6
%14 = load i64, i64* %5
%15 = xor i64 %14, -1
%16 = load i64*, i64** %6
%17 = load i64, i64* %16
%18 = and i64 %17, %15
store i64 %18, i64* %16
ret void
}

LLVM IR (-O2):
define void @__clear_bit(i32 %0, i64* nocapture %1) {
%3 = tail call i64 @BIT_MASK(i32 %0)
%4 = tail call i32 @BIT_WORD(i32 %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %1, i64 %5
%7 = xor i64 %3, -1
%8 = load i64, i64* %6
%9 = and i64 %8, %7
store i64 %9, i64* %6
ret void
}
void kb_init() {}


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

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

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

LLVM IR (-O2):
define void @kb_init() {
ret void
}
long long longlong_ignoring_signedlongint(long long x, signed long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<longlong_ignoring_signedlongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @longlong_ignoring_signedlongint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlong_ignoring_signedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_MD_C and/or "
         "MBEDTLS_SHA256_C and/or MBEDTLS_PK_PARSE_C and/or "
         "MBEDTLS_FS_IO not defined.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [122 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_MD_C and/or MBEDTLS_SHA256_C and/or MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [121 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_MD_C and/or MBEDTLS_SHA256_C and/or MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([121 x i8], [121 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SSUB16(uint32_t x, uint32_t y) {
  int32_t r, s;
  r = ((((int32_t)x << 16) >> 16) - (((int32_t)y << 16) >> 16)) &
      (int32_t)0x0000FFFF;
  s = ((((int32_t)x) >> 16) - (((int32_t)y) >> 16)) & (int32_t)0x0000FFFF;
  return ((uint32_t)((s << 16) | (r)));
}


x86 assembly (clang, -O0):
<__SSUB16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
sub    %ecx,%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
sub    %ecx,%eax
and    $0xffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SSUB16>:
mov    %edi,%eax
sub    %esi,%eax
movzwl %ax,%eax
and    $0xffff0000,%esi
sub    %esi,%edi
and    $0xffff0000,%edi
or     %eax,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @__SSUB16(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = ashr i32 %13, 16
%15 = sub nsw i32 %10, %14
%16 = and i32 %15, 65535
store i32 %16, i32* %5
%17 = load i64, i64* %3
%18 = trunc i64 %17 to i32
%19 = ashr i32 %18, 16
%20 = load i64, i64* %4
%21 = trunc i64 %20 to i32
%22 = ashr i32 %21, 16
%23 = sub nsw i32 %19, %22
%24 = and i32 %23, 65535
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = shl i32 %25, 16
%27 = load i32, i32* %5
%28 = or i32 %26, %27
%29 = sext i32 %28 to i64
ret i64 %29
}

LLVM IR (-O2):
define i64 @__SSUB16(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
%4 = and i64 %3, 65535
%5 = and i64 %1, 4294901760
%6 = sub i64 %0, %5
%7 = and i64 %6, 4294901760
%8 = or i64 %7, %4
%9 = shl nuw i64 %8, 32
%10 = ashr exact i64 %9, 32
ret i64 %10
}
_Noreturn void f() {}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  int i;
  for (i = 0; i < 10; i++) {
    puts("Hello, World!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int hammingWeight(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int cnt = hammingWeight(2147483648);
  printf("\n----------\n%d\n------------", cnt);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"\0A----------\0A%d\0A------------\00"
define i32 @main() {
%1 = tail call i32 @hammingWeight(i32 -2147483648)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strstr(char *, int /*<<< orphan*/ *);
void findAndChange(FILE *temp, char *searching, char *replacing) {
  if (strstr(searching, temp))
    printf("%s", searching);
  return;
}


x86 assembly (clang, -O0):
<findAndChange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     115b <findAndChange+0x3b>
mov    -0x10(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findAndChange>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     1144 <findAndChange+0x24>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @findAndChange(i32* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i64 @strstr(i8* %1, i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ll1_init(int, char **);
int main(int argc, char *argv[]) {
  ll1_init(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ll1_init(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int ax2ho(double *, double *, int);
int om2ax(double *, double *, int);
int om2ho(double *om, double *ho, int p) {
  double ax[4];
  int trash;
  trash = om2ax(om, ax, p);
  trash = ax2ho(ax, ho, p);
  return 1;
}


x86 assembly (clang, -O0):
<om2ho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <om2ax@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ax2ho@plt>
mov    %eax,-0x44(%rbp)
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om2ho>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1040 <om2ax@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <ax2ho@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @om2ho(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [4 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @om2ax(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @ax2ho(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @om2ho(double* %0, double* %1, i32 %2) {
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %4 to i8*
%6 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%7 = call i32 @om2ax(double* %0, double* %6, i32 %2)
%8 = call i32 @ax2ho(double* %6, double* %1, i32 %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int *);
scalar_t__ realloc(int *, int);
int *resize_ivector(int *vec, int minx, int maxx) {
  int *m;
  m = (int *)realloc(vec + minx, (maxx - minx + 1) * sizeof(int));
  assert(m);
  m -= minx;
  return m;
}


x86 assembly (clang, -O0):
<resize_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <assert@plt>
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize_ivector>:
push   %r14
push   %rbx
push   %rax
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
lea    0x0(,%rax,4),%r14
sub    %eax,%edx
lea    0x4(,%rdx,4),%esi
call   1040 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @resize_ivector(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = mul i64 %16, 4
%18 = trunc i64 %17 to i32
%19 = call i64 @realloc(i32* %11, i32 %18)
%20 = inttoptr i64 %19 to i32*
store i32* %20, i32** %7
%21 = load i32*, i32** %7
%22 = call i32 @assert(i32* %21)
%23 = load i32, i32* %5
%24 = load i32*, i32** %7
%25 = sext i32 %23 to i64
%26 = sub i64 0, %25
%27 = getelementptr inbounds i32, i32* %24, i64 %26
store i32* %27, i32** %7
%28 = load i32*, i32** %7
ret i32* %28
}

LLVM IR (-O2):
define i32* @resize_ivector(i32* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = sub nsw i32 %2, %1
%7 = shl i32 %6, 2
%8 = add i32 %7, 4
%9 = tail call i64 @realloc(i32* %5, i32 %8)
%10 = inttoptr i64 %9 to i32*
%11 = tail call i32 @assert(i32* %10)
%12 = sub nsw i64 0, %4
%13 = getelementptr inbounds i32, i32* %10, i64 %12
ret i32* %13
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int fuzix_iscntrl(int c) {
  return (((uint8_t)c >= 0) && ((uint8_t)c <= 31)) || ((uint8_t)c == 127);
}


x86 assembly (clang, -O0):
<fuzix_iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0x0,%rax
jl     1128 <fuzix_iscntrl+0x28>
movslq -0x4(%rbp),%rcx
mov    $0x1,%al
cmp    $0x1f,%rcx
mov    %al,-0x5(%rbp)
jle    1136 <fuzix_iscntrl+0x36>
movslq -0x4(%rbp),%rax
cmp    $0x7f,%rax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzix_iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @fuzix_iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = icmp sge i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = icmp sle i64 %8, 31
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = icmp eq i64 %12, 127
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @fuzix_iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void welcome(void) {
  printf("This is free software with ABSOLUTELY NO WARRANTY.\n");
  printf("For details type . \n");
}


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

x86 assembly (clang, -O2):
<welcome>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"This is free software with ABSOLUTELY NO WARRANTY.\0A\00"
@.str.1 = [21 x i8] c"For details type . \0A\00"
define void @welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"This is free software with ABSOLUTELY NO WARRANTY.\00"
@str.2 = [20 x i8] c"For details type . \00"
define void @welcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ nocbreak();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ start_color();
void initScreen(void) {
  initscr();
  noecho();
  nocbreak();
  start_color();
}


x86 assembly (clang, -O0):
<initScreen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
mov    $0x0,%al
call   1050 <nocbreak@plt>
mov    $0x0,%al
call   1040 <start_color@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initScreen>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
xor    %eax,%eax
call   1050 <nocbreak@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <start_color@plt>

LLVM IR (-O0):
define void @initScreen() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
%3 = call i32 (...) @nocbreak()
%4 = call i32 (...) @start_color()
ret void
}

LLVM IR (-O2):
define void @initScreen() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 (...) @nocbreak()
%4 = tail call i32 (...) @start_color()
ret void
}
unsigned int readl_es(unsigned short offset) {
  unsigned int val;
  asm("addr32 "
      "movl %%es:(%1), %0"
      : "=r"(val)
      : "r"((unsigned int)offset));
  asm("" : : : "memory");
  return val;
}


x86 assembly (clang, -O0):
<readl_es>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
addr32 es mov (%eax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readl_es>:
addr32 es mov (%edi),%eax
ret

LLVM IR (-O0):
define i32 @readl_es(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = call i32 asm "addr32 movl %es:($1), $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @readl_es(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = tail call i32 asm "addr32 movl %es:($1), $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %2)
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i32 %3
}
int getSeparator(char *arg) {
  int i = 0;
  char chr;
  while ((chr = arg[i]) != '\0') {
    if (chr == '=')
      return i;
    ++i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<getSeparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114f <getSeparator+0x4f>
movsbl -0x15(%rbp),%eax
cmp    $0x3d,%eax
jne    1141 <getSeparator+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <getSeparator+0x56>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <getSeparator+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSeparator>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <getSeparator+0x23>
cmp    $0x3d,%cl
je     1128 <getSeparator+0x28>
add    $0x1,%rax
jmp    1110 <getSeparator+0x10>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @getSeparator(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %10
i8 61, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %9, %8 ], [ -1, %2 ]
ret i32 %11
}
unsigned long clear(unsigned long *field, unsigned long flag) {
  *field = *field & ~flag;
  return *field;
}


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

x86 assembly (clang, -O2):
<clear>:
mov    %rsi,%rax
not    %rax
and    (%rdi),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define i64 @clear(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64, i64* %4
%8 = xor i64 %7, -1
%9 = and i64 %6, %8
%10 = load i64*, i64** %3
store i64 %9, i64* %10
%11 = load i64*, i64** %3
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @clear(i64* nocapture %0, i64 %1) {
%3 = load i64, i64* %0
%4 = xor i64 %1, -1
%5 = and i64 %3, %4
store i64 %5, i64* %0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ cgstack(int);
int /*<<< orphan*/ gentext();
void genstack(int n) {
  if (n) {
    gentext();
    cgstack(n);
  }
}


x86 assembly (clang, -O0):
<genstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <genstack+0x24>
mov    $0x0,%al
call   1030 <gentext@plt>
mov    -0x4(%rbp),%edi
call   1040 <cgstack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genstack>:
test   %edi,%edi
je     1136 <genstack+0x16>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <gentext@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <cgstack@plt>
ret

LLVM IR (-O0):
define void @genstack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 (...) @gentext()
%7 = load i32, i32* %2
%8 = call i32 @cgstack(i32 %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @genstack(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @gentext()
%5 = tail call i32 @cgstack(i32 %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgetnamuid(int);
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void putusrname(int uid) { fputs(cgetnamuid(uid), stdout); }


x86 assembly (clang, -O0):
<putusrname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <cgetnamuid@plt>
mov    %eax,%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putusrname>:
push   %rax
call   1040 <cgetnamuid@plt>
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @putusrname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cgetnamuid(i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @putusrname(i32 %0) {
%2 = tail call i32 @cgetnamuid(i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int unlzma(unsigned char *, int, unsigned char *, void *);
int decompress(unsigned char *buf, int in_len, unsigned char *output) {
  return unlzma(buf, in_len - 4, output, ((void *)0));
}


x86 assembly (clang, -O0):
<decompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x4,%esi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <unlzma@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decompress>:
add    $0xfffffffc,%esi
xor    %ecx,%ecx
jmp    1030 <unlzma@plt>

LLVM IR (-O0):
define i32 @decompress(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 4
%10 = load i8*, i8** %6
%11 = call i32 @unlzma(i8* %7, i32 %9, i8* %10, i8* null)
ret i32 %11
}

LLVM IR (-O2):
define i32 @decompress(i8* %0, i32 %1, i8* %2) {
%4 = add nsw i32 %1, -4
%5 = tail call i32 @unlzma(i8* %0, i32 %4, i8* %2, i8* null)
ret i32 %5
}
int foo(void) { return 17; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 17
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 17
}
void native_runtime_connect(void *addr, struct connection *c) {
  void (*cb)(struct connection *);
  *(void **)&(cb) = addr;
  cb(c);
}


x86 assembly (clang, -O0):
<native_runtime_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_runtime_connect>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

LLVM IR (-O0):
%struct.connection = type opaque
define void @native_runtime_connect(i8* %0, %struct.connection* %1) {
%3 = alloca i8*
%4 = alloca %struct.connection*
%5 = alloca void (%struct.connection*)*
store i8* %0, i8** %3
store %struct.connection* %1, %struct.connection** %4
%6 = load i8*, i8** %3
%7 = bitcast void (%struct.connection*)** %5 to i8**
store i8* %6, i8** %7
%8 = load void (%struct.connection*)*, void (%struct.connection*)** %5
%9 = load %struct.connection*, %struct.connection** %4
ret void
}

LLVM IR (-O2):
%struct.connection = type opaque
define void @native_runtime_connect(i8* nocapture %0, %struct.connection* %1) {
%3 = bitcast i8* %0 to void (%struct.connection*)*
tail call void %3(%struct.connection* %1)
ret void
}
void g_strchomp() {}


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

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

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

LLVM IR (-O2):
define void @g_strchomp() {
ret void
}
/* Variables and functions */
char *strncpy(char *, char const *, int /*<<< orphan*/);
char *strcpy(char *dest, const char *src) { return strncpy(dest, src, ~0); }


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

x86 assembly (clang, -O2):
<strcpy>:
mov    $0xffffffff,%edx
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = tail call i8* @strncpy(i8* %0, i8* %1, i32 -1)
ret i8* %3
}