xunge/DecIR huggingface dataset:
/* Variables and functions */
int b64_pton_stop(char const *, unsigned char *, size_t, char *);
int b64_pton(char const *src, unsigned char *target, size_t targsize) {
  return (b64_pton_stop(src, target, targsize, ""));
}


x86 assembly (clang, -O0):
<b64_pton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec9(%rip),%rcx
call   1030 <b64_pton_stop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64_pton>:
lea    0xee9(%rip),%rcx
jmp    1030 <b64_pton_stop@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @b64_pton(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @b64_pton_stop(i8* %7, i8* %8, i64 %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %10
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @b64_pton(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @b64_pton_stop(i8* %0, i8* %1, i64 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void ERREXIT() { abort(); }


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

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

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

LLVM IR (-O2):
define void @ERREXIT() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_systemcall(char *para, char *data, int len) {
  int i = 0;
  unsigned char *value;
  data[len] = '\0';
  printf("cmd_cfgread \n");
  printf("%s", data);
}


x86 assembly (clang, -O0):
<print_systemcall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_systemcall>:
push   %rbx
mov    %rsi,%rbx
movslq %edx,%rax
movb   $0x0,(%rsi,%rax,1)
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [13 x i8] c"cmd_cfgread \00"
define void @print_systemcall(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 0, i8* %5
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int MFRC522_ReadRegister(int);
int /*<<< orphan*/ MFRC522_SetBitMask(int, int);
void MFRC522_AntennaOn(void) {
  uint8_t temp;
  temp = MFRC522_ReadRegister(0x14);
  if (!(temp & 0x03)) {
    MFRC522_SetBitMask(0x14, 0x03);
  }
}


x86 assembly (clang, -O0):
<MFRC522_AntennaOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1030 <MFRC522_ReadRegister@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1153 <MFRC522_AntennaOn+0x33>
mov    $0x14,%edi
mov    $0x3,%esi
call   1040 <MFRC522_SetBitMask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MFRC522_AntennaOn>:
push   %rax
mov    $0x14,%edi
call   1030 <MFRC522_ReadRegister@plt>
test   $0x3,%al
je     1131 <MFRC522_AntennaOn+0x11>
pop    %rax
ret
mov    $0x14,%edi
mov    $0x3,%esi
pop    %rax
jmp    1040 <MFRC522_SetBitMask@plt>

LLVM IR (-O0):
define void @MFRC522_AntennaOn() {
%1 = alloca i32
%2 = call i32 @MFRC522_ReadRegister(i32 20)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 3
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @MFRC522_SetBitMask(i32 20, i32 3)
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
define void @MFRC522_AntennaOn() {
%1 = tail call i32 @MFRC522_ReadRegister(i32 20)
%2 = and i32 %1, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @MFRC522_SetBitMask(i32 20, i32 3)
br label %6
6: ; preds = %4, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ __get_unaligned_be32(int /*<<< orphan*/ const *);
__u32 get_unaligned_be32(const void *p) {
  return __get_unaligned_be32((const __u8 *)p);
}


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

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

LLVM IR (-O0):
define i32 @get_unaligned_be32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @__get_unaligned_be32(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_unaligned_be32(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__get_unaligned_be32(i32* %2)
ret i32 %3
}
long good_rand(x)
register long x;
{
  register long hi, lo;
  hi = x / 127773;
  lo = x % 127773;
  x = 16807 * lo - 2836 * hi;
  if (x <= 0)
    x += 0x7fffffff;
  return (x);
}


x86 assembly (clang, -O0):
<good_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1f31d,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1f31d,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x18(%rbp)
imul   $0x41a7,-0x18(%rbp),%rax
imul   $0xb14,-0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jg     115c <good_rand+0x5c>
mov    -0x8(%rbp),%rax
add    $0x7fffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<good_rand>:
movabs $0x41a705af1fe3fb79,%rcx
05 a7 41
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xf,%rdx
add    %rax,%rdx
imul   $0x1f31d,%rdx,%rax
sub    %rax,%rdi
imul   $0x41a7,%rdi,%rax
imul   $0xfffffffffffff4ec,%rdx,%rcx
lea    (%rcx,%rax,1),%rdx
test   %rdx,%rdx
lea    0x7fffffff(%rcx,%rax,1),%rax
7f
cmovg  %rdx,%rax
ret

LLVM IR (-O0):
define i64 @good_rand(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = sdiv i64 %5, 127773
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = srem i64 %7, 127773
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = mul nsw i64 16807, %9
%11 = load i64, i64* %3
%12 = mul nsw i64 2836, %11
%13 = sub nsw i64 %10, %12
store i64 %13, i64* %2
%14 = load i64, i64* %2
%15 = icmp sle i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %1
%17 = load i64, i64* %2
%18 = add nsw i64 %17, 2147483647
store i64 %18, i64* %2
br label %19
19: ; preds = %16, %1
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @good_rand(i64 %0) {
%2 = sdiv i64 %0, 127773
%3 = srem i64 %0, 127773
%4 = mul nsw i64 %3, 16807
%5 = mul nsw i64 %2, -2836
%6 = add nsw i64 %5, %4
%7 = icmp slt i64 %6, 1
%8 = add nsw i64 %6, 2147483647
%9 = select i1 %7, i64 %8, i64 %6
ret i64 %9
}
void gdk_drawable_get_size() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drawable_get_size() {
ret void
}
blsvdp_dma() {}


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

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

LLVM IR (-O0):
define i32 @blsvdp_dma() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @blsvdp_dma() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
scalar_t__ __SIGRTMIN;
int /*<<< orphan*/ __sigdelset(int /*<<< orphan*/ *, scalar_t__);
void __clear_internal_signals(sigset_t *set) {
  __sigdelset(set, __SIGRTMIN);
  __sigdelset(set, __SIGRTMIN);
  __sigdelset(set, (__SIGRTMIN + 1));
}


x86 assembly (clang, -O0):
<__clear_internal_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%rsi
call   1030 <__sigdelset@plt>
mov    -0x8(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%rsi
call   1030 <__sigdelset@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e9b(%rip),%rax
mov    (%rax),%rsi
add    $0x1,%rsi
call   1030 <__sigdelset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__clear_internal_signals>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
mov    (%r14),%rsi
call   1030 <__sigdelset@plt>
mov    (%r14),%rsi
mov    %rbx,%rdi
call   1030 <__sigdelset@plt>
mov    (%r14),%rsi
add    $0x1,%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__sigdelset@plt>

LLVM IR (-O0):
@__SIGRTMIN = global i64 0
define void @__clear_internal_signals(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i64, i64* @__SIGRTMIN
%5 = call i32 @__sigdelset(i32* %3, i64 %4)
%6 = load i32*, i32** %2
%7 = load i64, i64* @__SIGRTMIN
%8 = call i32 @__sigdelset(i32* %6, i64 %7)
%9 = load i32*, i32** %2
%10 = load i64, i64* @__SIGRTMIN
%11 = add nsw i64 %10, 1
%12 = call i32 @__sigdelset(i32* %9, i64 %11)
ret void
}

LLVM IR (-O2):
@__SIGRTMIN = global i64 0
define void @__clear_internal_signals(i32* %0) {
%2 = load i64, i64* @__SIGRTMIN
%3 = tail call i32 @__sigdelset(i32* %0, i64 %2)
%4 = load i64, i64* @__SIGRTMIN
%5 = tail call i32 @__sigdelset(i32* %0, i64 %4)
%6 = load i64, i64* @__SIGRTMIN
%7 = add nsw i64 %6, 1
%8 = tail call i32 @__sigdelset(i32* %0, i64 %7)
ret void
}
void HibernateDataGet(unsigned long *pulData, unsigned long ulCount) {
  unsigned int uIdx;
  ;
  ;
  for (uIdx = 0; uIdx < ulCount; uIdx++) {
    pulData[uIdx] = (*((volatile unsigned long *)(0x400FC030 + (uIdx * 4))));
  }
}


x86 assembly (clang, -O0):
<HibernateDataGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jae    1149 <HibernateDataGet+0x49>
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
add    $0x400fc030,%eax
mov    %eax,%eax
mov    (%rax),%rdx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <HibernateDataGet+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateDataGet>:
test   %rsi,%rsi
je     1126 <HibernateDataGet+0x26>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
lea    0x400fc030(,%rax,4),%ecx
mov    (%rcx),%rcx
mov    %rcx,(%rdi,%rax,8)
add    $0x1,%eax
cmp    %rsi,%rax
jb     1110 <HibernateDataGet+0x10>
ret

LLVM IR (-O0):
define void @HibernateDataGet(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i32
store i64* %0, i64** %3
store i64 %1, i64* %4
store i32 0, i32* %5
br label %6
6: ; preds = %22, %2
%7 = load i32, i32* %5
%8 = zext i32 %7 to i64
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %6
%12 = load i32, i32* %5
%13 = mul i32 %12, 4
%14 = add i32 1074774064, %13
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
%18 = load i64*, i64** %3
%19 = load i32, i32* %5
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i64, i64* %18, i64 %20
store i64 %17, i64* %21
br label %22
22: ; preds = %11
%23 = load i32, i32* %5
%24 = add i32 %23, 1
store i32 %24, i32* %5
br label %6
25: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @HibernateDataGet(i64* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %13, %4 ], [ 0, %2 ]
%6 = shl nuw nsw i64 %5, 2
%7 = add nuw nsw i64 %6, 1074774064
%8 = and i64 %7, 4294967292
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = getelementptr inbounds i64, i64* %0, i64 %5
store i64 %10, i64* %11
%12 = add nuw nsw i64 %5, 1
%13 = and i64 %12, 4294967295
%14 = icmp ult i64 %13, %1
br i1 %14, label %4, label %15
15: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kchdir(char *);
int /*<<< orphan*/ kputs(char *);
int cmdChangeWorkingDirectory(int argc, char **argv) {
  if (argc <= 1) {
    kputs("Error: Expected argument to command 'cd'\n");
  } else {
    kchdir(argv[1]);
  }
  return 1;
}


x86 assembly (clang, -O0):
<cmdChangeWorkingDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     114a <cmdChangeWorkingDirectory+0x2a>
lea    0xec0(%rip),%rdi
call   1040 <kputs@plt>
jmp    1157 <cmdChangeWorkingDirectory+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <kchdir@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdChangeWorkingDirectory>:
push   %rax
cmp    $0x1,%edi
jg     1134 <cmdChangeWorkingDirectory+0x14>
lea    0xed3(%rip),%rdi
call   1040 <kputs@plt>
jmp    113d <cmdChangeWorkingDirectory+0x1d>
mov    0x8(%rsi),%rdi
call   1030 <kchdir@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Error: Expected argument to command 'cd'\0A\00"
define i32 @cmdChangeWorkingDirectory(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @kputs(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %14
9: ; preds = %2
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @kchdir(i8* %12)
br label %14
14: ; preds = %9, %7
ret i32 1
}

LLVM IR (-O2):
@.str = [42 x i8] c"Error: Expected argument to command 'cd'\0A\00"
define i32 @cmdChangeWorkingDirectory(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @kputs(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @kchdir(i8* %8)
br label %10
10: ; preds = %6, %4
ret i32 1
}
int condition_r(char c) { return c == 'r'; }


x86 assembly (clang, -O0):
<condition_r>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x72,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_r>:
xor    %eax,%eax
cmp    $0x72,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @condition_r(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 114
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @condition_r(i8 signext %0) {
%2 = icmp eq i8 %0, 114
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int strcmp(void const *, void const *);
int compare_char(const void *lm1, const void *lm2) {
  return (strcmp(lm1, lm2));
}


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

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

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

LLVM IR (-O2):
define i32 @compare_char(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
g() {
  typedef int func_decl;
  func_decl a = 3;
  return a;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g() {
ret i32 3
}
int get_ds(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_ds() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putch(char const);
void puth2(unsigned int i) {
  const char c[] = "0123456789abcdef";
  for (int pos = 4; pos != -4; pos -= 4) {
    putch(c[(i >> (unsigned int)(pos)) & 0xFU]);
  }
}


x86 assembly (clang, -O0):
<puth2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x10(%rbp)
movl   $0x4,-0x24(%rbp)
cmpl   $0xfffffffc,-0x24(%rbp)
je     1170 <puth2+0x60>
mov    -0x4(%rbp),%eax
mov    -0x24(%rbp),%ecx
shr    %cl,%eax
and    $0xf,%eax
mov    %eax,%eax
movsbl -0x20(%rbp,%rax,1),%edi
call   1030 <putch@plt>
mov    -0x24(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x24(%rbp)
jmp    1141 <puth2+0x31>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puth2>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0xedb(%rip),%r14
movsbl (%rax,%r14,1),%edi
call   1030 <putch@plt>
and    $0xf,%ebx
movsbl (%rbx,%r14,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putch@plt>

LLVM IR (-O0):
@__const.puth2.c = [17 x i8] c"0123456789abcdef\00"
define void @puth2(i32 %0) {
%2 = alloca i32
%3 = alloca [17 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast [17 x i8]* %3 to i8*
store i32 4, i32* %4
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, -4
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = lshr i32 %10, %11
%13 = and i32 %12, 15
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @putch(i8 signext %16)
br label %18
18: ; preds = %9
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 4
store i32 %20, i32* %4
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@__const.puth2.c = [17 x i8] c"0123456789abcdef\00"
define void @puth2(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @__const.puth2.c, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @putch(i8 signext %6)
%8 = and i32 %0, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @__const.puth2.c, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @putch(i8 signext %11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_mrrc2(int, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
uint64_t mrrc2() { return __builtin_arm_mrrc2(15, 0, 0); }


x86 assembly (clang, -O0):
<mrrc2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <__builtin_arm_mrrc2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrrc2>:
mov    $0xf,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__builtin_arm_mrrc2@plt>

LLVM IR (-O0):
define i32 @mrrc2() {
%1 = call i32 @__builtin_arm_mrrc2(i32 15, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mrrc2() {
%1 = tail call i32 @__builtin_arm_mrrc2(i32 15, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int ways_aux(size_t, int);
unsigned ways(int n) {
  size_t first_qty;
  if (n >= 25) {
    first_qty = 0;
  } else if (n >= 10) {
    first_qty = 1;
  } else if (n >= 5) {
    first_qty = 2;
  } else {
    first_qty = 3;
  }
  return ways_aux(first_qty, n);
}


x86 assembly (clang, -O0):
<ways>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x19,-0x4(%rbp)
jl     1132 <ways+0x22>
movq   $0x0,-0x10(%rbp)
jmp    1172 <ways+0x62>
cmpl   $0xa,-0x4(%rbp)
jl     1149 <ways+0x39>
movq   $0x1,-0x10(%rbp)
jmp    116d <ways+0x5d>
cmpl   $0x5,-0x4(%rbp)
jl     1160 <ways+0x50>
movq   $0x2,-0x10(%rbp)
jmp    1168 <ways+0x58>
movq   $0x3,-0x10(%rbp)
jmp    116d <ways+0x5d>
jmp    1172 <ways+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <ways_aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ways>:
mov    %edi,%esi
cmp    $0x18,%edi
jle    111e <ways+0xe>
xor    %edi,%edi
jmp    1030 <ways_aux@plt>
mov    $0x1,%edi
cmp    $0x9,%esi
jg     1135 <ways+0x25>
xor    %edi,%edi
cmp    $0x5,%esi
setge  %dil
xor    $0x3,%rdi
jmp    1030 <ways_aux@plt>

LLVM IR (-O0):
define i32 @ways(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 25
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %3
br label %18
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 1, i64* %3
br label %17
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 5
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 2, i64* %3
br label %16
15: ; preds = %11
store i64 3, i64* %3
br label %16
16: ; preds = %15, %14
br label %17
17: ; preds = %16, %10
br label %18
18: ; preds = %17, %6
%19 = load i64, i64* %3
%20 = load i32, i32* %2
%21 = call i32 @ways_aux(i64 %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @ways(i32 %0) {
%2 = icmp sgt i32 %0, 24
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 9
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, 4
%7 = select i1 %6, i64 2, i64 3
br label %8
8: ; preds = %5, %3, %1
%9 = phi i64 [ 0, %1 ], [ 1, %3 ], [ %7, %5 ]
%10 = tail call i32 @ways_aux(i64 %9, i32 %0)
ret i32 %10
}
void EVP_CIPHER_type(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void *shmat(int, void const *, int);
void *Shmat(int shmid, const void *shmaddr, int shmflg) {
  void *p = shmat(shmid, shmaddr, shmflg);
  if (p == (void *)-1) {
    perror("shmat error");
    exit(0);
  }
  return p;
}


x86 assembly (clang, -O0):
<Shmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <shmat@plt>
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x20(%rbp)
jne    1179 <Shmat+0x49>
lea    0xe93(%rip),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Shmat>:
push   %rax
call   1040 <shmat@plt>
cmp    $0xffffffffffffffff,%rax
je     113e <Shmat+0xe>
pop    %rcx
ret
lea    0xebb(%rip),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"shmat error\00"
define i8* @Shmat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i8* @shmat(i32 %8, i8* %9, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp eq i8* %12, inttoptr (i64 -1 to i8*)
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %3
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
@.str = [12 x i8] c"shmat error\00"
define i8* @Shmat(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @shmat(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i8* %4, inttoptr (i64 -1 to i8*)
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ test_fail_memory_common(
    char *, int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/ *,
    int /*<<< orphan*/ *, int /*<<< orphan*/ *, char const *,
    unsigned char const *, size_t, unsigned char const *, size_t);
void test_output_memory(const char *name, const unsigned char *m, size_t l) {
  test_fail_memory_common("memory", NULL, 0, NULL, NULL, NULL, name, m, l, m,
                          l);
}


x86 assembly (clang, -O0):
<test_output_memory>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x18(%rbp),%r14
mov    -0x20(%rbp),%rbx
mov    -0x28(%rbp),%r11
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
lea    0xebe(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%r9d
xor    %edx,%edx
mov    %r9,%rsi
mov    %r9,%rcx
mov    %r9,%r8
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <test_fail_memory_common@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_output_memory>:
push   %rax
mov    %rdx,%rax
mov    %rsi,%r10
mov    %rdi,%r11
sub    $0x8,%rsp
lea    0xedb(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
push   %r10
push   %rax
push   %r10
push   %r11
call   1030 <test_fail_memory_common@plt>
add    $0x30,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"memory\00"
define void @test_output_memory(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i32 @test_fail_memory_common(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* null, i32 0, i32* null, i32* null, i32* null, i8* %7, i8* %8, i64 %9, i8* %10, i64 %11)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"memory\00"
define void @test_output_memory(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @test_fail_memory_common(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* null, i32 0, i32* null, i32* null, i32* null, i8* %0, i8* %1, i64 %2, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("No realtime signals\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"No realtime signals\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"No realtime signals\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void die(char *s, char *a) {
  fprintf(stderr, "error: ");
  fprintf(stderr, s, a);
  fprintf(stderr, "\n");
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eae(%rip),%r15
mov    (%r15),%edi
lea    0xec4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xeab(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"error: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @die(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* %8, i8* %9)
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"error: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @die(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* %0, i8* %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
}
void _swap(double *a, double *b) {
  double tmp = 0;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


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

x86 assembly (clang, -O2):
<_swap>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @_swap(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
%6 = load double*, double** %3
%7 = load double, double* %6
store double %7, double* %5
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = load double*, double** %3
store double %9, double* %10
%11 = load double, double* %5
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @_swap(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
store double %4, double* %0
store double %3, double* %1
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, struct in_addr *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *inet_ntoa(struct in_addr in) {
  static char ret[18];
  strcpy(ret, "[inet_ntoa error]");
  (void)inet_ntop(AF_INET, &in, ret, sizeof ret);
  return (ret);
}


x86 assembly (clang, -O0):
<inet_ntoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0x2f0e(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1040 <strcpy@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
lea    0x2eee(%rip),%rdx
mov    $0x12,%ecx
call   1030 <inet_ntop@plt>
lea    0x2edd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_ntoa>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x8(%rsp)
lea    0x2f10(%rip),%rbx
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
mov    %rbx,%rdx
mov    $0x12,%ecx
call   1030 <inet_ntop@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@inet_ntoa.ret = internal global [18 x i8] zeroinitializer
@.str = [18 x i8] c"[inet_ntoa error]\00"
@AF_INET = global i32 0
define i8* @inet_ntoa(i32 %0) {
%2 = alloca %struct.in_addr
%3 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = call i32 @strcpy(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @inet_ntoa.ret, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @AF_INET
%6 = call i32 @inet_ntop(i32 %5, %struct.in_addr* %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @inet_ntoa.ret, i64 0, i64 0), i32 18)
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @inet_ntoa.ret, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@inet_ntoa.ret = internal global [18 x i8] zeroinitializer
@.str = [18 x i8] c"[inet_ntoa error]\00"
@AF_INET = global i32 0
define i8* @inet_ntoa(i32 %0) {
%2 = alloca %struct.in_addr
%3 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
store i32 %0, i32* %3
%4 = tail call i32 @strcpy(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @inet_ntoa.ret, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @AF_INET
%6 = call i32 @inet_ntop(i32 %5, %struct.in_addr* %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @inet_ntoa.ret, i64 0, i64 0), i32 18)
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @inet_ntoa.ret, i64 0, i64 0)
}
/* Variables and functions */
double asym(double);
double log(int /*<<< orphan*/);
double neg(double);
int /*<<< orphan*/ pos(double);
int signgam;
double gamma(double arg) {
  signgam = 1;
  if (arg <= 0)
    return neg(arg);
  if (arg > 8)
    return asym(arg);
  return log(pos(arg));
}


x86 assembly (clang, -O0):
<gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    0x2e94(%rip),%rax
movl   $0x1,(%rax)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     117c <gamma+0x3c>
movsd  -0x10(%rbp),%xmm0
call   1030 <neg@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11bd <gamma+0x7d>
movsd  -0x10(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a7 <gamma+0x67>
movsd  -0x10(%rbp),%xmm0
call   1040 <asym@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11bd <gamma+0x7d>
movsd  -0x10(%rbp),%xmm0
call   1060 <pos@plt>
mov    %eax,%edi
call   1050 <log@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma>:
push   %rax
mov    0x2ea0(%rip),%rax
movl   $0x1,(%rax)
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1168 <gamma+0x28>
ucomisd 0xea0(%rip),%xmm0
jbe    116e <gamma+0x2e>
pop    %rax
jmp    1040 <asym@plt>
pop    %rax
jmp    1030 <neg@plt>
call   1060 <pos@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <log@plt>

LLVM IR (-O0):
@signgam = global i32 0
define double @gamma(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
store i32 1, i32* @signgam
%4 = load double, double* %3
%5 = fcmp ole double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @neg(double %7)
store double %8, double* %2
br label %19
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp ogt double %10, 8.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %3
%14 = call double @asym(double %13)
store double %14, double* %2
br label %19
15: ; preds = %9
%16 = load double, double* %3
%17 = call i32 @pos(double %16)
%18 = call double @log(i32 %17)
store double %18, double* %2
br label %19
19: ; preds = %15, %12, %6
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
@signgam = global i32 0
define double @gamma(double %0) {
store i32 1, i32* @signgam
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @neg(double %0)
br label %12
5: ; preds = %1
%6 = fcmp ogt double %0, 8.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call double @asym(double %0)
br label %12
9: ; preds = %5
%10 = tail call i32 @pos(double %0)
%11 = tail call double @log(i32 %10)
br label %12
12: ; preds = %9, %7, %3
%13 = phi double [ %4, %3 ], [ %8, %7 ], [ %11, %9 ]
ret double %13
}
int dot(int *input1, int *input2) {
  return ((input1[0] * input2[0]) + (input1[1] * input2[1]) +
          (input1[2] * input2[2])) /
         62;
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x4(%rdx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x8(%rdx),%ecx
add    %ecx,%eax
mov    $0x3e,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
mov    (%rsi),%eax
mov    0x4(%rsi),%ecx
imul   (%rdi),%eax
imul   0x4(%rdi),%ecx
add    %eax,%ecx
mov    0x8(%rsi),%eax
imul   0x8(%rdi),%eax
add    %ecx,%eax
cltq
imul   $0xffffffff84210843,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dot(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %7, %10
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = mul nsw i32 %14, %17
%19 = add nsw i32 %11, %18
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 2
%25 = load i32, i32* %24
%26 = mul nsw i32 %22, %25
%27 = add nsw i32 %19, %26
%28 = sdiv i32 %27, 62
ret i32 %28
}

LLVM IR (-O2):
define i32 @dot(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %3
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, %7
%11 = add nsw i32 %10, %5
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 2
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, %13
%17 = add nsw i32 %11, %16
%18 = sdiv i32 %17, 62
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgstorlw(int n) { ngen("%s\t[bp%+d],ax", "mov", n); }


x86 assembly (clang, -O0):
<cgstorlw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstorlw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%s\09[bp%+d],ax\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgstorlw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s\09[bp%+d],ax\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgstorlw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void swap(int *arr, int x, int y) {
  int tmp = arr[x];
  arr[x] = arr[y];
  arr[y] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void kmain(void *multiboot_pointer) {}


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

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

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

LLVM IR (-O2):
define void @kmain(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qprintf(char *);
int q_CreateResLockEntry() {
  qprintf("*** CreateResLockEntry()\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<q_CreateResLockEntry>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <qprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"*** CreateResLockEntry()\0A\00"
define i32 @q_CreateResLockEntry() {
%1 = call i32 @qprintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [26 x i8] c"*** CreateResLockEntry()\0A\00"
define i32 @q_CreateResLockEntry() {
%1 = tail call i32 @qprintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: cksum [-o 1 | 2 | 3] [file ...]\n");
  (void)fprintf(stderr, "       sum [file ...]\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    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"usage: cksum [-o 1 | 2 | 3] [file ...]\0A\00"
@.str.1 = [23 x i8] c" sum [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"usage: cksum [-o 1 | 2 | 3] [file ...]\0A\00"
@.str.1 = [23 x i8] c" sum [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int __int64_t_encoded_array_size(const int64_t *p, int elements) {
  return sizeof(int64_t) * elements;
}


x86 assembly (clang, -O0):
<__int64_t_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int64_t_encoded_array_size>:
lea    0x0(,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @__int64_t_encoded_array_size(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__int64_t_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl i32 %1, 2
ret i32 %3
}