xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ print_bars(int *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void print_bar_line(int *bars) {
  print_bars(bars, 0);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_bar_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <print_bars@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bar_line>:
push   %rax
xor    %esi,%esi
call   1040 <print_bars@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_bar_line(i32* %0) {
%2 = tail call i32 @print_bars(i32* %0, i32 0)
%3 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(char);
void comment(void) { outbyte(';'); }


x86 assembly (clang, -O0):
<comment>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
call   1030 <outbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment>:
mov    $0x3b,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define void @comment() {
%1 = call i32 @outbyte(i8 signext 59)
ret void
}

LLVM IR (-O2):
define void @comment() {
%1 = tail call i32 @outbyte(i8 signext 59)
ret void
}
int isHexadecimal(int c) {
  switch (c) {
  case '0' ... '9':
  case 'A' ... 'F':
  case 'a' ... 'f':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isHexadecimal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffd0,%eax
sub    $0xa,%eax
jb     1146 <isHexadecimal+0x46>
jmp    111e <isHexadecimal+0x1e>
mov    -0xc(%rbp),%eax
add    $0xffffffbf,%eax
sub    $0x6,%eax
jb     114b <isHexadecimal+0x4b>
jmp    1132 <isHexadecimal+0x32>
mov    -0xc(%rbp),%eax
add    $0xffffff9f,%eax
sub    $0x6,%eax
jb     1150 <isHexadecimal+0x50>
jmp    115c <isHexadecimal+0x5c>
jmp    114b <isHexadecimal+0x4b>
jmp    1150 <isHexadecimal+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1163 <isHexadecimal+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isHexadecimal>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0x36,%edi
ja     1117 <isHexadecimal+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @isHexadecimal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 97, label %7
i32 98, label %7
i32 99, label %7
i32 100, label %7
i32 101, label %7
i32 102, label %7
i32 65, label %6
i32 66, label %6
i32 67, label %6
i32 68, label %6
i32 69, label %6
i32 70, label %6
i32 48, label %5
i32 49, label %5
i32 50, label %5
i32 51, label %5
i32 52, label %5
i32 53, label %5
i32 54, label %5
i32 55, label %5
i32 56, label %5
i32 57, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %6
6: ; preds = %1, %1, %1, %1, %1, %1, %5
br label %7
7: ; preds = %1, %1, %1, %1, %1, %1, %6
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@switch.table.isHexadecimal = [55 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @isHexadecimal(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 55
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [55 x i32], [55 x i32]* @switch.table.isHexadecimal, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
void panic_notify(unsigned long UNUSED_reason __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @panic_notify(i64 %0) {
ret void
}
/* Type definitions */
struct stat {
  long st_size;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ stat(char *, struct stat *);
long getBytes(char *path) {
  struct stat buff;
  if (stat(path, &buff) < 0) {
    printf("\nError al usar stat sobre el fichero\n");
    return -1;
  } else {
    return buff.st_size;
  }
}


x86 assembly (clang, -O0):
<getBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    115c <getBytes+0x3c>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1164 <getBytes+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBytes>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1134 <getBytes+0x14>
mov    (%rsp),%rax
pop    %rcx
ret
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
@.str = [38 x i8] c"\0AError al usar stat sobre el fichero\0A\00"
define i64 @getBytes(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i64 -1, i64* %2
br label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i64, i64* %11
store i64 %12, i64* %2
br label %13
13: ; preds = %10, %8
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@str = [37 x i8] c"\0AError al usar stat sobre el fichero\00"
define i64 @getBytes(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i64, i64* %9
br label %11
11: ; preds = %8, %6
%12 = phi i64 [ -1, %6 ], [ %10, %8 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ TidyUp();
void _M2_RTExceptions_finish(__attribute__((unused)) int argc,
                             __attribute__((unused)) char *argv[]) {
  TidyUp();
}


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

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

LLVM IR (-O0):
define void @_M2_RTExceptions_finish(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @TidyUp()
ret void
}

LLVM IR (-O2):
define void @_M2_RTExceptions_finish(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TidyUp()
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int UINT64_C(int);
uint32_t attr_oid_to_vid(uint64_t oid) {
  return (~(UINT64_C(1) << 61) & oid) >> 32;
}


x86 assembly (clang, -O0):
<attr_oid_to_vid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    $0x3d,%ecx
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attr_oid_to_vid>:
mov    $0x1,%edi
jmp    1030 <UINT64_C@plt>

LLVM IR (-O0):
define i32 @attr_oid_to_vid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @UINT64_C(i32 1)
%4 = shl i32 %3, 61
%5 = xor i32 %4, -1
%6 = load i32, i32* %2
%7 = and i32 %5, %6
%8 = ashr i32 %7, 32
ret i32 %8
}

LLVM IR (-O2):
define i32 @attr_oid_to_vid(i32 %0) {
%2 = tail call i32 @UINT64_C(i32 1)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("\nUsage: %s <get | set>\n"
         "  get - display the MAC address of the first Wi-Fi STA that connects "
         "to\n"
         "        the router after it came out from the factory to 'stdout'.\n"
         "  set xx:xx:xx:xx:xx:xx - record specified MAC address to POT "
         "partition,\n"
         "        if thers is a MAC address existed yet, just display\n"
         "        it without any write action.\n",
         name);
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [333 x i8] c"\0AUsage: %s <get | set>\0A get - display the MAC address of the first Wi-Fi STA that connects to\0A the router after it came out from the factory to 'stdout'.\0A set xx:xx:xx:xx:xx:xx - record specified MAC address to POT partition,\0A if thers is a MAC address existed yet, just display\0A it without any write action.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [333 x i8] c"\0AUsage: %s <get | set>\0A get - display the MAC address of the first Wi-Fi STA that connects to\0A the router after it came out from the factory to 'stdout'.\0A set xx:xx:xx:xx:xx:xx - record specified MAC address to POT partition,\0A if thers is a MAC address existed yet, just display\0A it without any write action.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long syscall(int, long, long, long, long, long, long);
long syscall6(int nr, long a, long b, long c, long d, long e, long f) {
  return syscall(nr, a, b, c, d, e, f);
}


x86 assembly (clang, -O0):
<syscall6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall6>:
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i64 @syscall6(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = tail call i64 @syscall(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6)
ret i64 %8
}
int atomic_add(int *i) { return __sync_fetch_and_add(i, 1); }


x86 assembly (clang, -O0):
<atomic_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
lock xadd %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_add>:
mov    $0x1,%eax
lock xadd %eax,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @atomic_add(i32* nocapture %0) {
%2 = atomicrmw add i32* %0, i32 1 seq_cst
ret i32 %2
}
void avio_put_str16le() {}


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

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

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

LLVM IR (-O2):
define void @avio_put_str16le() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int *);
int /*<<< orphan*/ assert(int);
int *malloc(int);
int main() {
  int *foobar = malloc(12);
  __ESBMC_assume(foobar);
  foobar[0] = 0;
  foobar[2] = 1;
  assert(foobar[0] == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__ESBMC_assume@plt>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <__ESBMC_assume@plt>
movl   $0x0,(%rbx)
movl   $0x1,0x8(%rbx)
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 12)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @__ESBMC_assume(i32* %4)
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 0, i32* %7
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32 1, i32* %9
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 12)
%2 = tail call i32 @__ESBMC_assume(i32* %1)
store i32 0, i32* %1
%3 = getelementptr inbounds i32, i32* %1, i64 2
store i32 1, i32* %3
%4 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "checktpl [-p root path] <template file to check>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"checktpl [-p root path] <template file to check>\0A\00"
define void @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))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"checktpl [-p root path] <template file to check>\0A\00"
define void @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))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *sol_util_memdup(const void *data, size_t len) {
  void *ptr;
  ptr = malloc(len);
  if (ptr)
    memcpy(ptr, data, len);
  return ptr;
}


x86 assembly (clang, -O0):
<sol_util_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <sol_util_memdup+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sol_util_memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <sol_util_memdup+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @sol_util_memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
__attribute__((no, noclone)) int bar(unsigned char b) {
  if (0x0 <= b && b <= 0x8)
    goto lab;
  if (b == 0x0b)
    goto lab;
  if (0x0e <= b && b <= 0x1a)
    goto lab;
  if (0x3c <= b && b <= 0x3f)
    goto lab;
  return 0;
lab:
  return 1;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     112a <bar+0x2a>
movzbl -0x5(%rbp),%eax
cmp    $0x8,%eax
jg     112a <bar+0x2a>
jmp    118e <bar+0x8e>
movzbl -0x5(%rbp),%eax
cmp    $0xb,%eax
jne    113c <bar+0x3c>
jmp    118e <bar+0x8e>
movzbl -0x5(%rbp),%ecx
mov    $0xe,%eax
cmp    %ecx,%eax
jg     115f <bar+0x5f>
movzbl -0x5(%rbp),%eax
cmp    $0x1a,%eax
jg     115f <bar+0x5f>
jmp    118e <bar+0x8e>
movzbl -0x5(%rbp),%ecx
mov    $0x3c,%eax
cmp    %ecx,%eax
jg     1182 <bar+0x82>
movzbl -0x5(%rbp),%eax
cmp    $0x3f,%eax
jg     1182 <bar+0x82>
jmp    118e <bar+0x8e>
movl   $0x0,-0x4(%rbp)
jmp    1195 <bar+0x95>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0x9,%dil
setb   %al
cmp    $0xb,%dil
sete   %cl
or     %al,%cl
lea    -0xe(%rdi),%eax
cmp    $0xd,%al
setb   %al
or     %cl,%al
and    $0xfc,%dil
cmp    $0x3c,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @bar(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sle i32 0, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 8
br i1 %10, label %11, label %12
11: ; preds = %7
br label %36
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %14, 11
br i1 %15, label %16, label %17
16: ; preds = %12
br label %36
17: ; preds = %12
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = icmp sle i32 14, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = icmp sle i32 %23, 26
br i1 %24, label %25, label %26
25: ; preds = %21
br label %36
26: ; preds = %21, %17
%27 = load i8, i8* %3
%28 = zext i8 %27 to i32
%29 = icmp sle i32 60, %28
br i1 %29, label %30, label %35
30: ; preds = %26
%31 = load i8, i8* %3
%32 = zext i8 %31 to i32
%33 = icmp sle i32 %32, 63
br i1 %33, label %34, label %35
34: ; preds = %30
br label %36
35: ; preds = %30, %26
store i32 0, i32* %2
br label %37
36: ; preds = %34, %25, %16, %11
store i32 1, i32* %2
br label %37
37: ; preds = %36, %35
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @bar(i8 zeroext %0) {
%2 = icmp ult i8 %0, 9
%3 = icmp eq i8 %0, 11
%4 = or i1 %2, %3
%5 = add i8 %0, -14
%6 = icmp ult i8 %5, 13
%7 = or i1 %4, %6
%8 = and i8 %0, -4
%9 = icmp eq i8 %8, 60
%10 = or i1 %9, %7
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ addGlitter(int);
int /*<<< orphan*/ rainbowCol();
void rainbowWithGlitterCol() {
  rainbowCol();
  addGlitter(80);
}


x86 assembly (clang, -O0):
<rainbowWithGlitterCol>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rainbowCol@plt>
mov    $0x50,%edi
call   1040 <addGlitter@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rainbowWithGlitterCol>:
push   %rax
xor    %eax,%eax
call   1030 <rainbowCol@plt>
mov    $0x50,%edi
pop    %rax
jmp    1040 <addGlitter@plt>

LLVM IR (-O0):
define void @rainbowWithGlitterCol() {
%1 = call i32 (...) @rainbowCol()
%2 = call i32 @addGlitter(i32 80)
ret void
}

LLVM IR (-O2):
define void @rainbowWithGlitterCol() {
%1 = tail call i32 (...) @rainbowCol()
%2 = tail call i32 @addGlitter(i32 80)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("O hai, world!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [15 x i8] c"O hai, world!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"O hai, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ getpid();
void *thread_pid(void *arg) { return (void *)(long)getpid(); }


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

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

LLVM IR (-O0):
define i8* @thread_pid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @getpid()
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @thread_pid(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @getpid()
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void menu() {
  printf("\n--------------------------\n"
         "1.Display books            \n"
         "2.Insert a book            \n"
         "3.Update a book Status      \n"
         "4.Delete a book            \n"
         "5.Search for a book        \n"
         "6.Exit                    \n"
         "--------------------------\n");
  printf("----> Please Enter Your Choice: ");
}


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

x86 assembly (clang, -O2):
<menu>:
push   %rax
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [224 x i8] c"\0A--------------------------\0A1.Display books \0A2.Insert a book \0A3.Update a book Status \0A4.Delete a book \0A5.Search for a book \0A6.Exit \0A--------------------------\0A\00"
@.str.1 = [33 x i8] c"----> Please Enter Your Choice: \00"
define void @menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"----> Please Enter Your Choice: \00"
@str = [223 x i8] c"\0A--------------------------\0A1.Display books \0A2.Insert a book \0A3.Update a book Status \0A4.Delete a book \0A5.Search for a book \0A6.Exit \0A--------------------------\00"
define void @menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([223 x i8], [223 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xd3() {
  Assert_real((isgraph(211) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1060, ("isgraph should be 0 for 0xd3"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xd3>:
push   %rax
mov    $0xd3,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x424,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd3\00"
define void @t_isgraph_0xd3() {
%1 = call i64 @isgraph(i32 211)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd3\00"
define void @t_isgraph_0xd3() {
%1 = tail call i64 @isgraph(i32 211)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ push_f(float *, float);
void shift_left_f(float *f) { push_f(f, 0.0f); }


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

x86 assembly (clang, -O2):
<shift_left_f>:
xorps  %xmm0,%xmm0
jmp    1030 <push_f@plt>

LLVM IR (-O0):
define void @shift_left_f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @push_f(float* %3, float 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @shift_left_f(float* %0) {
%2 = tail call i32 @push_f(float* %0, float 0.000000e+00)
ret void
}
/* Variables and functions */
unsigned long __ia64_get_io_port_base();
void *__ia64_mk_io_addr(unsigned long port) {
  const unsigned long io_base = __ia64_get_io_port_base();
  unsigned long addr;
  addr = io_base | ((port >> 2) << 12) | (port & 0xfff);
  return (void *)addr;
}


x86 assembly (clang, -O0):
<__ia64_mk_io_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__ia64_get_io_port_base@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
shl    $0xc,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xfff,%rcx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ia64_mk_io_addr>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__ia64_get_io_port_base@plt>
mov    %rbx,%rcx
and    $0xfffffffffffffffc,%rcx
shl    $0xa,%rcx
and    $0xfff,%ebx
or     %rcx,%rbx
or     %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @__ia64_mk_io_addr(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = call i64 (...) @__ia64_get_io_port_base()
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %2
%8 = lshr i64 %7, 2
%9 = shl i64 %8, 12
%10 = or i64 %6, %9
%11 = load i64, i64* %2
%12 = and i64 %11, 4095
%13 = or i64 %10, %12
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @__ia64_mk_io_addr(i64 %0) {
%2 = tail call i64 (...) @__ia64_get_io_port_base()
%3 = shl i64 %0, 10
%4 = and i64 %3, -4096
%5 = and i64 %0, 4095
%6 = or i64 %4, %5
%7 = or i64 %6, %2
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_scan(struct wpa_ctrl *ctrl, int argc, const char *argv[]) {
  return wpa_ctrl_command(ctrl, "SCAN");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [5 x i8] c"SCAN\00"
define i32 @wpa_cli_cmd_scan(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [5 x i8] c"SCAN\00"
define i32 @wpa_cli_cmd_scan(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
void *alloc4(int volatile);
void *alloc3(volatile int one) { return alloc4(one); }


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

x86 assembly (clang, -O2):
<alloc3>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%edi
jmp    1030 <alloc4@plt>

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

LLVM IR (-O2):
define i8* @alloc3(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = tail call i8* @alloc4(i32 %3)
ret i8* %4
}
void RTTcpSgWrite(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpSgWrite() {
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ sscanf(char *, char const *, long *);
int MatchFormat(char *buf, const char *format) {
  long result;
  return (sscanf(buf, format, &result) != EOF);
}


x86 assembly (clang, -O0):
<MatchFormat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <sscanf@plt>
mov    0x2eb0(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatchFormat>:
push   %rax
mov    %rsp,%rdx
call   1030 <sscanf@plt>
mov    0x2ec8(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @MatchFormat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i64 @sscanf(i8* %6, i8* %7, i64* %5)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @MatchFormat(i8* %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i64 @sscanf(i8* %0, i8* %1, i64* %3)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void ullong_to_double(double *dest, unsigned long long *src) {
  *dest = (double)*src;
}


x86 assembly (clang, -O0):
<ullong_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   (%rax),%xmm0
movaps 0xee5(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xee9(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ullong_to_double>:
movsd  (%rsi),%xmm0
unpcklps 0xef5(%rip),%xmm0
subpd  0xefd(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
ret

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

LLVM IR (-O2):
define void @ullong_to_double(double* nocapture writeonly %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = uitofp i64 %3 to double
store double %4, double* %0
ret void
}
int ti_floor_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_floor_start(double* nocapture readnone %0) {
ret i32 0
}
const char *def_gettext_hook(const char *msgid) { return msgid; }


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

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

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

LLVM IR (-O2):
define i8* @def_gettext_hook(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void resize(int w, int h) {
  if (w < h)
    glViewport(0, 0, w, w);
  else
    glViewport(0, 0, h, h);
}


x86 assembly (clang, -O0):
<resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113e <resize+0x2e>
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <glViewport@plt>
jmp    114d <resize+0x3d>
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <glViewport@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize>:
cmp    %esi,%edi
jge    1121 <resize+0x11>
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
mov    %edx,%ecx
jmp    1030 <glViewport@plt>
mov    %esi,%ecx
xor    %edi,%edi
xor    %esi,%esi
mov    %ecx,%edx
jmp    1030 <glViewport@plt>

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

LLVM IR (-O2):
define void @resize(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @glViewport(i32 0, i32 0, i32 %1, i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
void fun(int x) { x = 30; }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1e,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fun(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ stderr;
void display_version(void) { fprintf(stderr, "sas version: %.2f\n", 0.8); }


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

x86 assembly (clang, -O2):
<display_version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee8(%rip),%rsi
movsd  0xed8(%rip),%xmm0
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"sas version: %.2f\0A\00"
define void @display_version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 8.000000e-01)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"sas version: %.2f\0A\00"
define void @display_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 8.000000e-01)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_degree_of_multprec_polynomial(int k, int *d) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(449, &k, d, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<syscon_degree_of_multprec_polynomial>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1c1,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @syscon_degree_of_multprec_polynomial(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 449, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ h();
int g2(void) { h(); }


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <h@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g2() {
%1 = alloca i32
%2 = call i32 (...) @h()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @g2() {
%1 = tail call i32 (...) @h()
ret i32 undef
}
void pci_release_of_node(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_release_of_node(%struct.pci_dev* nocapture %0) {
ret void
}
void cpu_init_page_emu(void) {}


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

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

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

LLVM IR (-O2):
define void @cpu_init_page_emu() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_ol(char *);
int /*<<< orphan*/ ol(char *);
inc() {
  debug_ol("; inc");
  ol("addd	#1");
}


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <debug_ol@plt>
lea    0xecb(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <debug_ol@plt>
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"; inc\00"
@.str.1 = [8 x i8] c"addd\09\00"
define i32 @inc() {
%1 = alloca i32
%2 = call i32 @debug_ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"; inc\00"
@.str.1 = [8 x i8] c"addd\09\00"
define i32 @inc() {
%1 = tail call i32 @debug_ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int fgetc(int /*<<< orphan*/);
int my_fgetc(struct aFILE *fp) { return fgetc(_get_actual_fp(fp)); }


x86 assembly (clang, -O0):
<my_fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
call   1040 <fgetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fgetc>:
push   %rax
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <fgetc@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_fgetc(%struct.aFILE* %0) {
%2 = alloca %struct.aFILE*
store %struct.aFILE* %0, %struct.aFILE** %2
%3 = load %struct.aFILE*, %struct.aFILE** %2
%4 = call i32 @_get_actual_fp(%struct.aFILE* %3)
%5 = call i32 @fgetc(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_fgetc(%struct.aFILE* %0) {
%2 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%3 = tail call i32 @fgetc(i32 %2)
ret i32 %3
}
/* Variables and functions */
unsigned swizzle(unsigned in, unsigned limit) {
  unsigned out = 0;
  while (limit) {
    out = (out << 1) | (in & 1);
    in >>= 1;
    limit >>= 1;
  }
  return out;
}


x86 assembly (clang, -O0):
<swizzle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1143 <swizzle+0x43>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <swizzle+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swizzle>:
xor    %eax,%eax
test   %esi,%esi
je     1123 <swizzle+0x23>
mov    %esi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
lea    (%rdx,%rax,2),%eax
shr    %edi
shr    %ecx
cmp    $0x1,%esi
mov    %ecx,%esi
ja     1110 <swizzle+0x10>
ret

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

LLVM IR (-O2):
define i32 @swizzle(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi i32 [ %11, %4 ], [ %0, %2 ]
%8 = shl i32 %5, 1
%9 = and i32 %7, 1
%10 = or i32 %8, %9
%11 = lshr i32 %7, 1
%12 = lshr i32 %6, 1
%13 = icmp ult i32 %6, 2
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_splice() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_splice"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_memblockq_splice\0A\00"
define i32 @pa_memblockq_splice() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_memblockq_splice\00"
define i32 @pa_memblockq_splice() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printBuffer();
void onAlarm(int signum) {
  printBuffer();
  alarm(30);
}


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

x86 assembly (clang, -O2):
<onAlarm>:
push   %rax
xor    %eax,%eax
call   1040 <printBuffer@plt>
mov    $0x1e,%edi
pop    %rax
jmp    1030 <alarm@plt>

LLVM IR (-O0):
define void @onAlarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @printBuffer()
%4 = call i32 @alarm(i32 30)
ret void
}

LLVM IR (-O2):
define void @onAlarm(i32 %0) {
%2 = tail call i32 (...) @printBuffer()
%3 = tail call i32 @alarm(i32 30)
ret void
}
int main(void) {
  float x = 5;
  float *p = (float *)&x;
  *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca float*
store float 5.000000e+00, float* %1
store float* %1, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}