xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned short quick_select_ushort(unsigned short *, int, int);
unsigned short quick_select_median_ushort(unsigned short *arr, int nelems) {
  return quick_select_ushort(arr, nelems, (nelems - 1) / 2);
}


x86 assembly (clang, -O0):
<quick_select_median_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <quick_select_ushort@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_select_median_ushort>:
lea    -0x1(%rsi),%eax
shr    $0x1f,%eax
lea    (%rsi,%rax,1),%edx
add    $0xffffffff,%edx
sar    %edx
jmp    1030 <quick_select_ushort@plt>

LLVM IR (-O0):
define zeroext i16 @quick_select_median_ushort(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i16*, i16** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 2
%10 = call zeroext i16 @quick_select_ushort(i16* %5, i32 %6, i32 %9)
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @quick_select_median_ushort(i16* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = tail call zeroext i16 @quick_select_ushort(i16* %0, i32 %1, i32 %4)
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void to_binary(unsigned long n) {
  int r;
  r = n % 2;
  if (n >= 2)
    to_binary(n / 2);
  putchar('0' + r);
}


x86 assembly (clang, -O0):
<to_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    %eax,-0xc(%rbp)
cmpq   $0x2,-0x8(%rbp)
jb     114f <to_binary+0x2f>
mov    -0x8(%rbp),%rdi
shr    $0x1,%rdi
call   1040 <to_binary@plt>
mov    -0xc(%rbp),%edi
add    $0x30,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_binary>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%rdi
jb     1135 <to_binary+0x15>
mov    %rbx,%rdi
shr    %rdi
call   1040 <to_binary@plt>
and    $0x1,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @to_binary(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = urem i64 %4, 2
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i64, i64* %2
%8 = icmp uge i64 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i64, i64* %2
%11 = udiv i64 %10, 2
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = add nsw i32 48, %13
%15 = call i32 @putchar(i32 %14)
ret void
}

LLVM IR (-O2):
define void @to_binary(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i64 %0, 1
tail call void @to_binary(i64 %4)
br label %5
5: ; preds = %3, %1
%6 = trunc i64 %0 to i32
%7 = and i32 %6, 1
%8 = or i32 %7, 48
%9 = tail call i32 @putchar(i32 %8)
ret void
}
/* Variables and functions */
int fn_sq_ch_78_ch_97_ch_109_ch_101_ch_100_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108(
    char const *);
int fn_al_sq_ch_78_ch_97_ch_109_ch_101_ch_100_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_78_ch_97_ch_109_ch_101_ch_100_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_78_ch_97_ch_109_ch_101_ch_100_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_78_ch_97_ch_109_ch_101_ch_100_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_78_ch_97_ch_109_ch_101_ch_100_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_78_ch_97_ch_109_ch_101_ch_100_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108(i8* %0) {
%2 = tail call i32 @fn_sq_ch_78_ch_97_ch_109_ch_101_ch_100_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef unsigned long long uint64_t;
struct timespec {
  unsigned long long tv_sec;
  unsigned long long tv_nsec;
};

/* Variables and functions */
struct timespec __pfcq_ns_to_timespec(uint64_t _ns) {
  struct timespec ret;
  ret.tv_sec = _ns / 1000000000ULL;
  ret.tv_nsec = _ns - ret.tv_sec * 1000000000ULL;
  return ret;
}


x86 assembly (clang, -O0):
<__pfcq_ns_to_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rcx
mul    %rcx
shr    $0xb,%rdx
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   $0x3b9aca00,%rcx,%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfcq_ns_to_timespec>:
mov    %rdi,%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rcx
mul    %rcx
mov    %rdx,%rax
shr    $0xb,%rax
imul   $0xffffffffc4653600,%rax,%rdx
add    %rdi,%rdx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @__pfcq_ns_to_timespec(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = udiv i64 %4, 1000000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %3
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = mul i64 %9, 1000000000
%11 = sub i64 %7, %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %11, i64* %12
%13 = bitcast %struct.timespec* %2 to { i64, i64 }*
%14 = load { i64, i64 }, { i64, i64 }* %13
ret { i64, i64 } %14
}

LLVM IR (-O2):
define { i64, i64 } @__pfcq_ns_to_timespec(i64 %0) {
%2 = udiv i64 %0, 1000000000
%3 = mul i64 %2, -1000000000
%4 = add i64 %3, %0
%5 = insertvalue { i64, i64 } poison, i64 %2, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
void uart0TxFlush(void) { (*((volatile unsigned long *)0xE000C008)) |= 0x04; }


x86 assembly (clang, -O0):
<uart0TxFlush>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000c008,%eax
mov    (%rax),%rcx
or     $0x4,%rcx
mov    $0xe000c008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart0TxFlush>:
mov    $0xe000c008,%eax
orq    $0x4,(%rax)
ret

LLVM IR (-O0):
define void @uart0TxFlush() {
%1 = load volatile i64, i64* inttoptr (i64 3758145544 to i64*)
%2 = or i64 %1, 4
store volatile i64 %2, i64* inttoptr (i64 3758145544 to i64*)
ret void
}

LLVM IR (-O2):
define void @uart0TxFlush() {
%1 = load volatile i64, i64* inttoptr (i64 3758145544 to i64*)
%2 = or i64 %1, 4
store volatile i64 %2, i64* inttoptr (i64 3758145544 to i64*)
ret void
}
int fun366() { return 366; }


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

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

LLVM IR (-O0):
define i32 @fun366() {
ret i32 366
}

LLVM IR (-O2):
define i32 @fun366() {
ret i32 366
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_sendto;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, void const *, size_t, int,
                           struct sockaddr const *, int /*<<< orphan*/);
__attribute__((always_)) ssize_t
_syscall_sendto(int socket, const void *message, size_t length, int flags,
                const struct sockaddr *dest_addr, socklen_t dest_len) {
  return syscall(__NR_sendto, socket, message, length, flags, dest_addr,
                 dest_len);
}


x86 assembly (clang, -O0):
<_syscall_sendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_sendto>:
push   %rax
mov    %r8,%rax
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2eba(%rip),%rdi
mov    (%rdi),%edi
mov    %r9d,(%rsp)
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@__NR_sendto = global i32 0
define i32 @_syscall_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32 %5, i32* %12
%13 = load i32, i32* @__NR_sendto
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = load i32, i32* %10
%18 = load %struct.sockaddr*, %struct.sockaddr** %11
%19 = load i32, i32* %12
%20 = call i32 @syscall(i32 %13, i32 %14, i8* %15, i64 %16, i32 %17, %struct.sockaddr* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@__NR_sendto = global i32 0
define i32 @_syscall_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = load i32, i32* @__NR_sendto
%8 = tail call i32 @syscall(i32 %7, i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
void gcov_strip_leading_dirs(int prefix_length, int gcov_prefix_strip,
                             const char *filename, char *gi_filename_up) {
  strcpy(gi_filename_up, filename);
}


x86 assembly (clang, -O0):
<gcov_strip_leading_dirs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcov_strip_leading_dirs>:
mov    %rcx,%rdi
mov    %rdx,%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @gcov_strip_leading_dirs(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i8*, i8** %7
%11 = call i32 @strcpy(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @gcov_strip_leading_dirs(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @strcpy(i8* %3, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo11(double, int);
void bar11(double y, int x) { foo11(y, x); }


x86 assembly (clang, -O0):
<bar11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <foo11@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar11>:
jmp    1030 <foo11@plt>

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

LLVM IR (-O2):
define void @bar11(double %0, i32 %1) {
%3 = tail call i32 @foo11(double %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
main() { system("pause"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void Py_FatalError(const char *msg) { __coverity_panic__(); }


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

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

LLVM IR (-O0):
define void @Py_FatalError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @__coverity_panic__()
ret void
}

LLVM IR (-O2):
define void @Py_FatalError(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @__coverity_panic__()
ret void
}
int putchar(int c) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
ret i32 0
}
/* Variables and functions */
int open_imb(int /*<<< orphan*/);
int initIPMI(void) {
  int rc;
  rc = open_imb(0);
  if (rc == 1)
    rc = 0;
  else
    rc = -1;
  return (rc);
}


x86 assembly (clang, -O0):
<initIPMI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <open_imb@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1138 <initIPMI+0x28>
movl   $0x0,-0x4(%rbp)
jmp    113f <initIPMI+0x2f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initIPMI>:
push   %rax
xor    %edi,%edi
call   1030 <open_imb@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @initIPMI() {
%1 = alloca i32
%2 = call i32 @open_imb(i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @initIPMI() {
%1 = tail call i32 @open_imb(i32 0)
%2 = icmp ne i32 %1, 1
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int ntohs(int);
int16_t _bt_int16_t(char *buf, int offset) {
  uint16_t curr_val;
  curr_val = (uint8_t)buf[offset] << 8;
  curr_val += (uint8_t)buf[offset + 1];
  curr_val = ntohs(curr_val);
  int16_t return_val = (int16_t)curr_val;
  return return_val;
}


x86 assembly (clang, -O0):
<_bt_int16_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <ntohs@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bt_int16_t>:
movslq %esi,%rax
movsbl (%rdi,%rax,1),%ecx
shl    $0x8,%ecx
movsbl 0x1(%rdi,%rax,1),%edi
add    %ecx,%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
define i32 @_bt_int16_t(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%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
%12 = sext i8 %11 to i32
%13 = shl i32 %12, 8
store i32 %13, i32* %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i32, i32* %5
%22 = add nsw i32 %21, %20
store i32 %22, i32* %5
%23 = load i32, i32* %5
%24 = call i32 @ntohs(i32 %23)
store i32 %24, i32* %5
%25 = load i32, i32* %5
store i32 %25, i32* %6
%26 = load i32, i32* %6
ret i32 %26
}

LLVM IR (-O2):
define i32 @_bt_int16_t(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = add nsw i32 %1, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %7, %12
%14 = tail call i32 @ntohs(i32 %13)
ret i32 %14
}
/* Variables and functions */
unsigned long GetWidth56();
unsigned long getwidth() { return GetWidth56(); }


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

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

LLVM IR (-O0):
define i64 @getwidth() {
%1 = call i64 (...) @GetWidth56()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getwidth() {
%1 = tail call i64 (...) @GetWidth56()
ret i64 %1
}
void XDefaultColormap() {}


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

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

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

LLVM IR (-O2):
define void @XDefaultColormap() {
ret void
}
main() {
  int x[] = {[1 ... 2] = 1};
  return x[0] + x[1] + x[2];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.x = [3 x i32] [i32 0, i32 1, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
double exp(double);
double usoil_func(double ucanopy, double a, double hc, double d0m, double z0m) {
  double usoil;
  usoil = ucanopy * exp(a * (((z0m + d0m) / hc) - 1.0));
  return (usoil);
}


x86 assembly (clang, -O0):
<usoil_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xea9(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usoil_func>:
push   %rax
movsd  %xmm0,(%rsp)
addsd  %xmm4,%xmm3
divsd  %xmm2,%xmm3
addsd  0xeda(%rip),%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @usoil_func(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %6
%13 = load double, double* %7
%14 = load double, double* %10
%15 = load double, double* %9
%16 = fadd double %14, %15
%17 = load double, double* %8
%18 = fdiv double %16, %17
%19 = fsub double %18, 1.000000e+00
%20 = fmul double %13, %19
%21 = call double @exp(double %20)
%22 = fmul double %12, %21
store double %22, double* %11
%23 = load double, double* %11
ret double %23
}

LLVM IR (-O2):
define double @usoil_func(double %0, double %1, double %2, double %3, double %4) {
%6 = fadd double %3, %4
%7 = fdiv double %6, %2
%8 = fadd double %7, -1.000000e+00
%9 = fmul double %8, %1
%10 = tail call double @exp(double %9)
%11 = fmul double %10, %0
ret double %11
}
unsigned int test(unsigned int x) { return x / 0x80000001U / 0x00000002U; }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x80000001,%ecx
xor    %edx,%edx
div    %ecx
shr    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
ret i32 0
}
void mods235(double *p, double *x, int m, int n, void *data) {
  x[0] = 0.1 * (p[0] - 1.0);
  x[1] = p[1] - p[0] * p[0];
}


x86 assembly (clang, -O0):
<mods235>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xee2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mods235>:
movsd  (%rdi),%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
movsd  %xmm0,(%rsi)
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsi)
ret

LLVM IR (-O0):
define void @mods235(double* %0, double* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load double*, double** %6
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = fsub double %13, 1.000000e+00
%15 = fmul double 1.000000e-01, %14
%16 = load double*, double** %7
%17 = getelementptr inbounds double, double* %16, i64 0
store double %15, double* %17
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 1
%20 = load double, double* %19
%21 = load double*, double** %6
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = load double*, double** %6
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = fneg double %23
%28 = call double @llvm.fmuladd.f64(double %27, double %26, double %20)
%29 = load double*, double** %7
%30 = getelementptr inbounds double, double* %29, i64 1
store double %28, double* %30
ret void
}

LLVM IR (-O2):
define void @mods235(double* nocapture %0, double* nocapture writeonly %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = load double, double* %0
%7 = fadd double %6, -1.000000e+00
%8 = fmul double %7, 1.000000e-01
store double %8, double* %1
%9 = getelementptr inbounds double, double* %0, i64 1
%10 = load double, double* %9
%11 = load double, double* %0
%12 = fneg double %11
%13 = tail call double @llvm.fmuladd.f64(double %12, double %11, double %10)
%14 = getelementptr inbounds double, double* %1, i64 1
store double %13, double* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int /*<<< orphan*/);
void show_help(const char *exc) {
  printf("Usage: %s [-d DELIMITER] [-l LINEDELIMITER] [FILE1..FILEn]\n"
         "\n"
         "Usage:\n"
         "   -h, --help              Show this help output.\n"
         "   -d, --delimiter D       Use D as the delimiter (default: \").\n"
         "   -l, --line-delimiter L  Use L as the line delimiter (default: "
         "newline).\n"
         "\n"
         "msplit version %d - Cris van Pelt <cris.vanpelt@gmail.com>\n",
         exc, 0);
}


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

x86 assembly (clang, -O2):
<show_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [317 x i8] c"Usage: %s [-d DELIMITER] [-l LINEDELIMITER] [FILE1..FILEn]\0A\0AUsage:\0A -h, --help Show this help output.\0A -d, --delimiter D Use D as the delimiter (default: \22).\0A -l, --line-delimiter L Use L as the line delimiter (default: newline).\0A\0Amsplit version %d - Cris van Pelt <cris.vanpelt@gmail.com>\0A\00"
define void @show_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([317 x i8], [317 x i8]* @.str, i64 0, i64 0), i8* %3, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [317 x i8] c"Usage: %s [-d DELIMITER] [-l LINEDELIMITER] [FILE1..FILEn]\0A\0AUsage:\0A -h, --help Show this help output.\0A -d, --delimiter D Use D as the delimiter (default: \22).\0A -l, --line-delimiter L Use L as the line delimiter (default: newline).\0A\0Amsplit version %d - Cris van Pelt <cris.vanpelt@gmail.com>\0A\00"
define void @show_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([317 x i8], [317 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ execvp(char *, char **);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int spawn(char *program, char **arg_list) {
  pid_t child_pid;
  child_pid = fork();
  if (child_pid != 0)
    return child_pid;
  else {
    execvp(program, arg_list);
    fprintf(stderr, "An error occurred in execvp\n");
    abort();
  }
}


x86 assembly (clang, -O0):
<spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1170 <spawn+0x30>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <execvp@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<spawn>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     115e <spawn+0x1e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <execvp@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"An error occurred in execvp\0A\00"
define i32 @spawn(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i64
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = call i64 (...) @fork()
store i64 %6, i64* %5
%7 = load i64, i64* %5
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i64, i64* %5
%11 = trunc i64 %10 to i32
ret i32 %11
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8**, i8*** %4
%15 = call i32 @execvp(i8* %13, i8** %14)
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"An error occurred in execvp\0A\00"
define i32 @spawn(i8* %0, i8** %1) {
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = trunc i64 %3 to i32
ret i32 %6
7: ; preds = %2
%8 = tail call i32 @execvp(i8* %0, i8** %1)
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
unsigned long GetASN4(char const *);
unsigned long GetASN6(char const *);
int /*<<< orphan*/ *strchr(char const *, char);
unsigned long int GetASN(const char *ip) {
  if (strchr(ip, ':') == NULL)
    return GetASN4(ip);
  else
    return GetASN6(ip);
}


x86 assembly (clang, -O0):
<GetASN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
cmp    $0x0,%rax
jne    1166 <GetASN+0x36>
mov    -0x10(%rbp),%rdi
call   1040 <GetASN4@plt>
mov    %rax,-0x8(%rbp)
jmp    1173 <GetASN+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <GetASN6@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetASN>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     114c <GetASN+0x1c>
pop    %rbx
jmp    1030 <GetASN6@plt>
pop    %rbx
jmp    1040 <GetASN4@plt>

LLVM IR (-O0):
define i64 @GetASN(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @strchr(i8* %4, i8 signext 58)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @GetASN4(i8* %8)
store i64 %9, i64* %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i64 @GetASN6(i8* %11)
store i64 %12, i64* %2
br label %13
13: ; preds = %10, %7
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
define i64 @GetASN(i8* %0) {
%2 = tail call i32* @strchr(i8* %0, i8 signext 58)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i64 @GetASN4(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i64 @GetASN6(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i64 [ %5, %4 ], [ %7, %6 ]
ret i64 %9
}
/* Variables and functions */
float __ieee754_expf(int);
void benchmark(void) {
  volatile float result = 0;
  result = __ieee754_expf(1);
  result = __ieee754_expf(2);
  result = __ieee754_expf(3);
  result = __ieee754_expf(4);
  result = __ieee754_expf(5);
}


x86 assembly (clang, -O0):
<benchmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <__ieee754_expf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <__ieee754_expf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <__ieee754_expf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <__ieee754_expf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <__ieee754_expf@plt>
movss  %xmm0,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    $0x1,%edi
call   1030 <__ieee754_expf@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
call   1030 <__ieee754_expf@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x3,%edi
call   1030 <__ieee754_expf@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x4,%edi
call   1030 <__ieee754_expf@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x5,%edi
call   1030 <__ieee754_expf@plt>
movss  %xmm0,0x4(%rsp)
pop    %rax
ret

LLVM IR (-O0):
define void @benchmark() {
%1 = alloca float
store volatile float 0.000000e+00, float* %1
%2 = call float @__ieee754_expf(i32 1)
store volatile float %2, float* %1
%3 = call float @__ieee754_expf(i32 2)
store volatile float %3, float* %1
%4 = call float @__ieee754_expf(i32 3)
store volatile float %4, float* %1
%5 = call float @__ieee754_expf(i32 4)
store volatile float %5, float* %1
%6 = call float @__ieee754_expf(i32 5)
store volatile float %6, float* %1
ret void
}

LLVM IR (-O2):
define void @benchmark() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store volatile float 0.000000e+00, float* %1
%3 = tail call float @__ieee754_expf(i32 1)
store volatile float %3, float* %1
%4 = tail call float @__ieee754_expf(i32 2)
store volatile float %4, float* %1
%5 = tail call float @__ieee754_expf(i32 3)
store volatile float %5, float* %1
%6 = tail call float @__ieee754_expf(i32 4)
store volatile float %6, float* %1
%7 = tail call float @__ieee754_expf(i32 5)
store volatile float %7, float* %1
ret void
}
char *nevermind(char harrumph) {
  char buf[1024];
  buf[3] = harrumph;
}


x86 assembly (clang, -O0):
<nevermind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x390,%rsp
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x40d(%rbp)
mov    -0x8(%rbp),%rax
add    $0x390,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @nevermind(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca [1024 x i8]
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 3
store i8 %5, i8* %6
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @nevermind(i8 signext %0) {
ret i8* undef
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t byteSwapper(uint16_t bananas) {
  return ((bananas & 0xFF00) >> 8) | ((bananas & 0x00FF) << 8);
}


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

x86 assembly (clang, -O2):
<byteSwapper>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @byteSwapper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @byteSwapper(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
int swapbits(int n, int i, int j) {
  n ^= (1 << i - 1);
  n ^= (1 << j - 1);
  return n;
}


x86 assembly (clang, -O0):
<swapbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapbits>:
mov    %edi,%eax
add    $0xff,%sil
btc    %esi,%eax
add    $0xff,%dl
btc    %edx,%eax
ret

LLVM IR (-O0):
define i32 @swapbits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, %9
store i32 %11, i32* %4
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = shl i32 1, %13
%15 = load i32, i32* %4
%16 = xor i32 %15, %14
store i32 %16, i32* %4
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @swapbits(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = shl nuw i32 1, %4
%6 = xor i32 %5, %0
%7 = add nsw i32 %2, -1
%8 = shl nuw i32 1, %7
%9 = xor i32 %6, %8
ret i32 %9
}
void ASN1_STRING_type_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_STRING_type_new() {
ret void
}
/* Variables and functions */
int g_append_object(int);
int g_get_object_id(char *);
int g_append_object_byname(char *label) {
  int id;
  if ((id = g_get_object_id(label)) == -1)
    return -1;
  return g_append_object(id);
}


x86 assembly (clang, -O0):
<g_append_object_byname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <g_get_object_id@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    114d <g_append_object_byname+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <g_append_object_byname+0x38>
mov    -0x14(%rbp),%edi
call   1040 <g_append_object@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_append_object_byname>:
push   %rax
call   1030 <g_get_object_id@plt>
cmp    $0xffffffff,%eax
je     1133 <g_append_object_byname+0x13>
mov    %eax,%edi
pop    %rax
jmp    1040 <g_append_object@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @g_append_object_byname(i8* %0) {
%2 = tail call i32 @g_get_object_id(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @g_append_object(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
char *skip_white(char *ptr) {
  while (*ptr == ' ' || *ptr == '\t')
    ptr++;
  return (ptr);
}


x86 assembly (clang, -O0):
<skip_white>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_white+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_white+0x3d>
jmp    114e <skip_white+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_white+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_white>:
mov    %rdi,%rax
jmp    1114 <skip_white+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_white+0x10>
cmp    $0x9,%cl
je     1110 <skip_white+0x10>
ret

LLVM IR (-O0):
define i8* @skip_white(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skip_white(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, int);
int cbm_iec_wait(int f, int line, int state) {
  return ioctl(f, _IO(0xcb, 15), (line << 8) | state);
}


x86 assembly (clang, -O0):
<cbm_iec_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xcb,%edi
mov    $0xf,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
shl    $0x8,%edx
or     -0xc(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_iec_wait>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0xcb,%edi
mov    $0xf,%esi
call   1030 <_IO@plt>
shl    $0x8,%ebp
or     %ebp,%ebx
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbm_iec_wait(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @_IO(i32 203, i32 15)
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = load i32, i32* %6
%12 = or i32 %10, %11
%13 = call i32 @ioctl(i32 %7, i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @cbm_iec_wait(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_IO(i32 203, i32 15)
%5 = shl i32 %1, 8
%6 = or i32 %5, %2
%7 = tail call i32 @ioctl(i32 %0, i32 %4, i32 %6)
ret i32 %7
}
void v2i(vec) long vec[2];
{
  float v[2];
  v[0] = vec[0];
  v[1] = vec[1];
  vcall(v, 2);
}


x86 assembly (clang, -O0):
<v2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq (%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq 0x8(%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2i>:
push   %rax
cvtsi2ssq (%rdi),%xmm0
movss  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ssq 0x8(%rdi),%xmm0
movss  %xmm0,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <vcall@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @v2i(i64* %0) {
%2 = alloca i64*
%3 = alloca [2 x float]
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to float
%8 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load i64*, i64** %2
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to float
%13 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%15 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %14, i32 2)
ret void
}

LLVM IR (-O2):
define void @v2i(i64* nocapture %0) {
%2 = alloca [2 x float]
%3 = bitcast [2 x float]* %2 to i8*
%4 = load i64, i64* %0
%5 = sitofp i64 %4 to float
%6 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
store float %5, float* %6
%7 = getelementptr inbounds i64, i64* %0, i64 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to float
%10 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
store float %9, float* %10
%11 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %6, i32 2)
ret void
}
const char *deviceBeaconGetName() { return "Laser Beacon"; }


x86 assembly (clang, -O0):
<deviceBeaconGetName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deviceBeaconGetName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Laser Beacon\00"
define i8* @deviceBeaconGetName() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"Laser Beacon\00"
define i8* @deviceBeaconGetName() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xd3() {
  Assert_real((isbdigit(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_isbdigit.c",
              1060, ("isbdigit should be 0 for 0xd3"));
}


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

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

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xd3\00"
define void @t_isbdigit_0xd3() {
%1 = call i64 @isbdigit(i32 211)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xd3\00"
define void @t_isbdigit_0xd3() {
%1 = tail call i64 @isbdigit(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 ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int patentclaims() { return 20; }


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

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

LLVM IR (-O0):
define i32 @patentclaims() {
ret i32 20
}

LLVM IR (-O2):
define i32 @patentclaims() {
ret i32 20
}
/* Variables and functions */
char const *json_rpc_strerror(int);
const char *abus_strerror(int errnum) { return json_rpc_strerror(errnum); }


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

x86 assembly (clang, -O2):
<abus_strerror>:
jmp    1030 <json_rpc_strerror@plt>

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

LLVM IR (-O2):
define i8* @abus_strerror(i32 %0) {
%2 = tail call i8* @json_rpc_strerror(i32 %0)
ret i8* %2
}