xunge/DecIR huggingface dataset:
unary(a) {
  p(!a);
  p(~a);
  p(+a);
  p(-a);
}


x86 assembly (clang, -O0):
<unary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <p@plt>
mov    -0x8(%rbp),%edi
xor    $0xffffffff,%edi
mov    $0x0,%al
call   1030 <p@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <p@plt>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <p@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unary>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
sete   %dil
xor    %eax,%eax
call   1030 <p@plt>
mov    %ebx,%edi
not    %edi
xor    %eax,%eax
call   1030 <p@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <p@plt>
neg    %ebx
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <p@plt>

LLVM IR (-O0):
define i32 @unary(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 (i32, ...) bitcast (i32 (...)* @p to i32 (i32, ...)*)(i32 %7)
%9 = load i32, i32* %3
%10 = xor i32 %9, -1
%11 = call i32 (i32, ...) bitcast (i32 (...)* @p to i32 (i32, ...)*)(i32 %10)
%12 = load i32, i32* %3
%13 = call i32 (i32, ...) bitcast (i32 (...)* @p to i32 (i32, ...)*)(i32 %12)
%14 = load i32, i32* %3
%15 = sub nsw i32 0, %14
%16 = call i32 (i32, ...) bitcast (i32 (...)* @p to i32 (i32, ...)*)(i32 %15)
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @unary(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @p to i32 (i32, ...)*)(i32 %3)
%5 = xor i32 %0, -1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @p to i32 (i32, ...)*)(i32 %5)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @p to i32 (i32, ...)*)(i32 %0)
%8 = sub nsw i32 0, %0
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @p to i32 (i32, ...)*)(i32 %8)
ret i32 undef
}
long __syscall5(long n, long a1, long a2, long a3, long a4, long a5) {
  unsigned long __ret;
  __asm__ __volatile__("push %6 ; call __vsyscall ; add $4,%%esp"
                       : "=a"(__ret)
                       : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4), "g"(a5)
                       : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%r8
mov    %r8,-0x40(%rbp)
push   -0x40(%rbp)
call   1030 <__vsyscall@plt>
add    $0x4,%esp
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall5>:
mov    %rcx,%r10
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rax
mov    %r9,-0x8(%rsp)
mov    %r10,%rdi
mov    %r8,%rsi
push   -0x8(%rsp)
call   1030 <__vsyscall@plt>
add    $0x4,%esp
ret

LLVM IR (-O0):
define i64 @__syscall5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%14 = load i64, i64* %7
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = load i64, i64* %10
%18 = load i64, i64* %11
%19 = load i64, i64* %12
%20 = call i64 asm sideeffect "push $6 ; call __vsyscall ; add $$4,%esp", "={ax},{ax},{dx},{cx},{di},{si},imr,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %14, i64 %15, i64 %16, i64 %17, i64 %18, i64 %19)
store i64 %20, i64* %13
%21 = load i64, i64* %13
ret i64 %21
}

LLVM IR (-O2):
define i64 @__syscall5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = tail call i64 asm sideeffect "push $6 ; call __vsyscall ; add $$4,%esp", "={ax},{ax},{dx},{cx},{di},{si},imr,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5)
ret i64 %7
}
double den(void) { return 9.1e-220 / 1e100; }


x86 assembly (clang, -O0):
<den>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<den>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @den() {
ret double 9.100200e-320
}

LLVM IR (-O2):
define double @den() {
ret double 9.100200e-320
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void check_scan(int nv, int flag, char *file, FILE *fstream) {
  if (flag != nv) {
    fprintf(stderr, "ERROR: reading %s\n", file);
    fclose(fstream);
    fflush(stderr);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_scan>:
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    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     119c <check_scan+0x5c>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_scan>:
cmp    %edi,%esi
jne    1145 <check_scan+0x5>
ret
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    0x2e8d(%rip),%r14
mov    (%r14),%edi
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    (%r14),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"ERROR: reading %s\0A\00"
define void @check_scan(i32 %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %7
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32*, i32** %8
%17 = call i32 @fclose(i32* %16)
%18 = load i32, i32* @stderr
%19 = call i32 @fflush(i32 %18)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"ERROR: reading %s\0A\00"
define void @check_scan(i32 %0, i32 %1, i8* %2, i32* nocapture %3) {
%5 = icmp eq i32 %1, %0
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = tail call i32 @fclose(i32* %3)
%10 = load i32, i32* @stderr
%11 = tail call i32 @fflush(i32 %10)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %4
ret void
}
/* Type definitions */
struct list_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_insert_after(struct list_node *, struct list_node *);
void list_add_head(struct list_node *head, struct list_node *new) {
  list_insert_after(head, new);
}


x86 assembly (clang, -O0):
<list_add_head>:
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 <list_insert_after@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.list_node = type { i32 }
define void @list_add_head(%struct.list_node* %0, %struct.list_node* %1) {
%3 = alloca %struct.list_node*
%4 = alloca %struct.list_node*
store %struct.list_node* %0, %struct.list_node** %3
store %struct.list_node* %1, %struct.list_node** %4
%5 = load %struct.list_node*, %struct.list_node** %3
%6 = load %struct.list_node*, %struct.list_node** %4
%7 = call i32 @list_insert_after(%struct.list_node* %5, %struct.list_node* %6)
ret void
}

LLVM IR (-O2):
%struct.list_node = type { i32 }
define void @list_add_head(%struct.list_node* %0, %struct.list_node* %1) {
%3 = tail call i32 @list_insert_after(%struct.list_node* %0, %struct.list_node* %1)
ret void
}
/* Variables and functions */
scalar_t__ snprintf(char *, unsigned long, char *, char const *, char const *);
unsigned long Cat2Str(const char *str1, const char *str2, char *dst,
                      unsigned long dstBufLen) {
  return (0 < snprintf(dst, dstBufLen, "%s%s", str1, str2));
}


x86 assembly (clang, -O0):
<Cat2Str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xec1(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cat2Str>:
push   %rax
mov    %rdx,%rax
mov    %rsi,%r8
mov    %rdi,%r9
lea    0xedf(%rip),%rdx
mov    %rax,%rdi
mov    %rcx,%rsi
mov    %r9,%rcx
call   1030 <snprintf@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i64 @Cat2Str(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i64 @snprintf(i8* %2, i64 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i64
ret i64 %7
}
/* Type definitions */
struct NumArray {
  int dummy;
};

/* Variables and functions */
int prefixSum(struct NumArray *, int);
int sumRange(struct NumArray *numArray, int i, int j) {
  i++, j++;
  int v = prefixSum(numArray, j) - prefixSum(numArray, i - 1);
  return v;
}


x86 assembly (clang, -O0):
<sumRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <prefixSum@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <prefixSum@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumRange>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x1(%rdx),%esi
call   1030 <prefixSum@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <prefixSum@plt>
sub    %eax,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.NumArray = type { i32 }
define i32 @sumRange(%struct.NumArray* %0, i32 %1, i32 %2) {
%4 = alloca %struct.NumArray*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.NumArray* %0, %struct.NumArray** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
store i32 %11, i32* %6
%12 = load %struct.NumArray*, %struct.NumArray** %4
%13 = load i32, i32* %6
%14 = call i32 @prefixSum(%struct.NumArray* %12, i32 %13)
%15 = load %struct.NumArray*, %struct.NumArray** %4
%16 = load i32, i32* %5
%17 = sub nsw i32 %16, 1
%18 = call i32 @prefixSum(%struct.NumArray* %15, i32 %17)
%19 = sub nsw i32 %14, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
%struct.NumArray = type { i32 }
define i32 @sumRange(%struct.NumArray* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i32 @prefixSum(%struct.NumArray* %0, i32 %4)
%6 = tail call i32 @prefixSum(%struct.NumArray* %0, i32 %1)
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ bzero(unsigned int *, int);
void prep_list(unsigned int **list, unsigned int *N) {
  bzero(*list, sizeof(unsigned int) * (*N + 1));
  (*list)[0] = 1;
  (*list)[1] = 1;
}


x86 assembly (clang, -O0):
<prep_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <bzero@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x1,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prep_list>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    (%rsi),%eax
lea    0x4(,%rax,4),%esi
call   1030 <bzero@plt>
mov    (%rbx),%rax
movabs $0x100000001,%rcx
mov    %rcx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @prep_list(i32** %0, i32* %1) {
%3 = alloca i32**
%4 = alloca i32*
store i32** %0, i32*** %3
store i32* %1, i32** %4
%5 = load i32**, i32*** %3
%6 = load i32*, i32** %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 4, %10
%12 = trunc i64 %11 to i32
%13 = call i32 @bzero(i32* %6, i32 %12)
%14 = load i32**, i32*** %3
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 1, i32* %16
%17 = load i32**, i32*** %3
%18 = load i32*, i32** %17
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 1, i32* %19
ret void
}

LLVM IR (-O2):
define void @prep_list(i32** nocapture %0, i32* nocapture %1) {
%3 = load i32*, i32** %0
%4 = load i32, i32* %1
%5 = shl i32 %4, 2
%6 = add i32 %5, 4
%7 = tail call i32 @bzero(i32* %3, i32 %6)
%8 = load i32*, i32** %0
store i32 1, i32* %8
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 1, i32* %9
ret void
}
void clipboard_init() {}


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

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

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

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

/* Variables and functions */
int strcmp(char const *, char const *);
int8_t opdi_string_cmp(const char *s1, const char *s2) {
  int result = strcmp(s1, s2);
  if (result < 0)
    return -1;
  if (result > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opdi_string_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1146 <opdi_string_cmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <opdi_string_cmp+0x53>
cmpl   $0x0,-0x1c(%rbp)
jle    115c <opdi_string_cmp+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <opdi_string_cmp+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opdi_string_cmp>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @opdi_string_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp sgt i32 %3, -1
%7 = select i1 %6, i32 %5, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: ./rederiver <EQ> <FG> <SW> or ./redriver read.\n");
  printf("   EQ: 0-15\n");
  printf("   FG: 0-3\n");
  printf("   SW: 0-1\n");
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"Usage: ./rederiver <EQ> <FG> <SW> or ./redriver read.\0A\00"
@.str.1 = [13 x i8] c" EQ: 0-15\0A\00"
@.str.2 = [12 x i8] c" FG: 0-3\0A\00"
@.str.3 = [12 x i8] c" SW: 0-1\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [54 x i8] c"Usage: ./rederiver <EQ> <FG> <SW> or ./redriver read.\00"
@str.4 = [12 x i8] c" EQ: 0-15\00"
@str.5 = [11 x i8] c" FG: 0-3\00"
@str.6 = [11 x i8] c" SW: 0-1\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.6, i64 0, i64 0))
ret void
}
zeroindex(ip) long *ip;
{
  int i;
  for (i = 0; i < 100; i++)
    ip[i] = 0;
}


x86 assembly (clang, -O0):
<zeroindex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1137 <zeroindex+0x37>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <zeroindex+0xf>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroindex>:
push   %rax
mov    $0x320,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @zeroindex(i64* %0) {
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 0, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i64*, i64** %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %9, i64 %11
store i64 0, i64* %12
br label %13
13: ; preds = %8
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @zeroindex(i64* nocapture writeonly %0) {
%2 = bitcast i64* %0 to i8*
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ die(int, char *, char const *);
void usage(const char *argv0) {
  die(2, "Usage: %s [-f fd] sock prog ...\n", argv0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xed4(%rip),%rsi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: %s [-f fd] sock prog ...\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @die(i32 2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: %s [-f fd] sock prog ...\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @die(i32 2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BaroAirspeedHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void BaroAirspeedRequestUpdate() { UAVObjRequestUpdate(BaroAirspeedHandle()); }


x86 assembly (clang, -O0):
<BaroAirspeedRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <BaroAirspeedHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BaroAirspeedRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <BaroAirspeedHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @BaroAirspeedRequestUpdate() {
%1 = call i32 (...) @BaroAirspeedHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @BaroAirspeedRequestUpdate() {
%1 = tail call i32 (...) @BaroAirspeedHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((no)) int bar() {
  printf("Hello world.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
define i32 @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void g() {
  printf("%s: %x %x %x\n", __FUNCTION__, __builtin_return_address(0),
         __builtin_return_address(1), __builtin_return_address(2));
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    0x8(%rbp),%rdx
mov    %rbp,%rax
mov    (%rax),%rax
mov    0x8(%rax),%rcx
mov    %rbp,%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    0x8(%rax),%r8
lea    0xeca(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    0x8(%rbp),%rdx
mov    0x0(%rbp),%rax
mov    (%rax),%rsi
mov    0x8(%rax),%rcx
mov    0x8(%rsi),%r8
lea    0xed2(%rip),%rdi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %x %x %x\0A\00"
@__FUNCTION__.g = [2 x i8] c"g\00"
define void @g() {
%1 = call i8* @llvm.returnaddress(i32 0)
%2 = call i8* @llvm.returnaddress(i32 1)
%3 = call i8* @llvm.returnaddress(i32 2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @__FUNCTION__.g, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %x %x %x\0A\00"
@__FUNCTION__.g = [2 x i8] c"g\00"
define void @g() {
%1 = tail call i8* @llvm.returnaddress(i32 0)
%2 = tail call i8* @llvm.returnaddress(i32 1)
%3 = tail call i8* @llvm.returnaddress(i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @__FUNCTION__.g, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
extern void get_surface_fault(double time, struct sensordata *sensorData_ptr,
                              struct nav *navData_ptr,
                              struct control *controlData_ptr) {}


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

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

LLVM IR (-O0):
%struct.sensordata = type opaque
%struct.nav = type opaque
%struct.control = type opaque
define void @get_surface_fault(double %0, %struct.sensordata* %1, %struct.nav* %2, %struct.control* %3) {
%5 = alloca double
%6 = alloca %struct.sensordata*
%7 = alloca %struct.nav*
%8 = alloca %struct.control*
store double %0, double* %5
store %struct.sensordata* %1, %struct.sensordata** %6
store %struct.nav* %2, %struct.nav** %7
store %struct.control* %3, %struct.control** %8
ret void
}

LLVM IR (-O2):
%struct.sensordata = type opaque
%struct.nav = type opaque
%struct.control = type opaque
define void @get_surface_fault(double %0, %struct.sensordata* nocapture %1, %struct.nav* nocapture %2, %struct.control* nocapture %3) {
ret void
}
int test_imm_05uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x05 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_05uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x5,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_05uint64_midword_reg>:
test   $0x50000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_05uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 5
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_05uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 327680
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int _rdrand64_step(unsigned long long *);
void *run(void *param) {
  unsigned long long user = 0;
  for (unsigned long long k = 0; k < 1000000000; k++) {
    unsigned long long result;
    int carry;
    do {
      carry = _rdrand64_step(&result);
    } while (carry == 0);
    user += result;
  }
  return (void *)user;
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3b9aca00,-0x18(%rbp)
3b
jae    1172 <run+0x62>
jmp    113f <run+0x2f>
lea    -0x20(%rbp),%rdi
call   1030 <_rdrand64_step@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     113f <run+0x2f>
mov    -0x20(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <run+0x1c>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %r14d,%r14d
lea    0x8(%rsp),%rbx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <_rdrand64_step@plt>
test   %eax,%eax
je     1130 <run+0x20>
add    0x8(%rsp),%r14
add    $0x1,%r15
cmp    $0x3b9aca00,%r15
jne    1130 <run+0x20>
mov    %r14,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @run(i8* nocapture readnone %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
br label %6
4: ; preds = %12
%5 = inttoptr i64 %14 to i8*
ret i8* %5
6: ; preds = %1, %12
%7 = phi i64 [ 0, %1 ], [ %14, %12 ]
%8 = phi i64 [ 0, %1 ], [ %15, %12 ]
br label %9
9: ; preds = %9, %6
%10 = call i32 @_rdrand64_step(i64* %2)
%11 = icmp eq i32 %10, 0
br i1 %11, label %9, label %12
12: ; preds = %9
%13 = load i64, i64* %2
%14 = add i64 %13, %7
%15 = add nuw nsw i64 %8, 1
%16 = icmp eq i64 %15, 1000000000
br i1 %16, label %4, label %6
}
int c_isupper(int c) {
  switch (c) {
  case 'a' + ('A' - 'a'):
  case 'b' + ('A' - 'a'):
  case 'c' + ('A' - 'a'):
  case 'd' + ('A' - 'a'):
  case 'e' + ('A' - 'a'):
  case 'f' + ('A' - 'a'):
  case 'g' + ('A' - 'a'):
  case 'h' + ('A' - 'a'):
  case 'i' + ('A' - 'a'):
  case 'j' + ('A' - 'a'):
  case 'k' + ('A' - 'a'):
  case 'l' + ('A' - 'a'):
  case 'm' + ('A' - 'a'):
  case 'n' + ('A' - 'a'):
  case 'o' + ('A' - 'a'):
  case 'p' + ('A' - 'a'):
  case 'q' + ('A' - 'a'):
  case 'r' + ('A' - 'a'):
  case 's' + ('A' - 'a'):
  case 't' + ('A' - 'a'):
  case 'u' + ('A' - 'a'):
  case 'v' + ('A' - 'a'):
  case 'w' + ('A' - 'a'):
  case 'x' + ('A' - 'a'):
  case 'y' + ('A' - 'a'):
  case 'z' + ('A' - 'a'):
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<c_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffbf,%eax
sub    $0x19,%eax
ja     1127 <c_isupper+0x27>
jmp    111b <c_isupper+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <c_isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @c_isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 65, label %5
i32 66, label %5
i32 67, label %5
i32 68, label %5
i32 69, label %5
i32 70, label %5
i32 71, label %5
i32 72, label %5
i32 73, label %5
i32 74, label %5
i32 75, label %5
i32 76, label %5
i32 77, label %5
i32 78, label %5
i32 79, label %5
i32 80, label %5
i32 81, label %5
i32 82, label %5
i32 83, label %5
i32 84, label %5
i32 85, label %5
i32 86, label %5
i32 87, label %5
i32 88, label %5
i32 89, label %5
i32 90, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @c_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int test(int j) {
  int i;
  i = j * 4;
  return i + 1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
lea    0x1(,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int, unsigned long *, unsigned long);
int shim_set_mempolicy(int mode, unsigned long *nodemask,
                       unsigned long maxnode) {
  return (int)shim_enosys(0, mode, nodemask, maxnode);
}


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

x86 assembly (clang, -O2):
<shim_set_mempolicy>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_set_mempolicy(i32 %0, i64* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64*
%6 = alloca i64
store i32 %0, i32* %4
store i64* %1, i64** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i64*, i64** %5
%9 = load i64, i64* %6
%10 = call i64 @shim_enosys(i32 0, i32 %7, i64* %8, i64 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @shim_set_mempolicy(i32 %0, i64* %1, i64 %2) {
%4 = tail call i64 @shim_enosys(i32 0, i32 %0, i64* %1, i64 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, int, int, int, int, int, int, int);
int main() {
  foo(0, 1, 2, 3, 4, 5, 6, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
movl   $0x6,(%rsp)
movl   $0x7,0x8(%rsp)
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
push   $0x7
push   $0x6
call   1030 <foo@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_, const)) uint32_t ByteToBE32(uint8_t a, uint8_t b,
                                                    uint8_t c, uint8_t d) {
  return ((uint32_t)a << 0) | ((uint32_t)b << 8) | ((uint32_t)c << 16) |
         ((uint32_t)d << 24);
}


x86 assembly (clang, -O0):
<ByteToBE32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x0,%eax
mov    -0x10(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ByteToBE32>:
mov    %rcx,%rax
shl    $0x8,%esi
or     %edi,%esi
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @ByteToBE32(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 0
%12 = load i64, i64* %6
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
%16 = load i64, i64* %7
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 16
%19 = or i32 %15, %18
%20 = load i64, i64* %8
%21 = trunc i64 %20 to i32
%22 = shl i32 %21, 24
%23 = or i32 %19, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @ByteToBE32(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = trunc i64 %0 to i32
%6 = trunc i64 %1 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %5
%9 = trunc i64 %2 to i32
%10 = shl i32 %9, 16
%11 = or i32 %8, %10
%12 = trunc i64 %3 to i32
%13 = shl i32 %12, 24
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ bs_erase_to_eol();
int bs_builtin_clearline(void) {
  bs_erase_to_eol();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @bs_builtin_clearline() {
%1 = call i32 (...) @bs_erase_to_eol()
ret i32 0
}

LLVM IR (-O2):
define i32 @bs_builtin_clearline() {
%1 = tail call i32 (...) @bs_erase_to_eol()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBDMAChannelEnable(uint32_t ui32Base, uint32_t ui32Channel) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000204 + (0x10 * ui32Channel)))) |=
      0x00000001;
}


x86 assembly (clang, -O0):
<USBDMAChannelEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x204,%eax
mov    -0x8(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDMAChannelEnable>:
movslq %edi,%rax
movslq %esi,%rcx
shl    $0x4,%rcx
orl    $0x1,0x204(%rax,%rcx,1)
01
ret

LLVM IR (-O0):
define void @USBDMAChannelEnable(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 = add nsw i32 %5, 516
%7 = load i32, i32* %4
%8 = mul nsw i32 16, %7
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = or i32 %12, 1
store volatile i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @USBDMAChannelEnable(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 516
%4 = shl nsw i32 %1, 4
%5 = add nsw i32 %3, %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, 1
store volatile i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "usage:  %s [-a] [stream|dgram] socket-name\n", progname);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: %s [-a] [stream|dgram] socket-name\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: %s [-a] [stream|dgram] socket-name\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ on;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char const *, int);
int noly_socket_set_reuseaddr(int sk) {
  int on = 1;
  return setsockopt(sk, SOL_SOCKET, SO_REUSEADDR, (const char *)&on,
                    sizeof(on));
}


x86 assembly (clang, -O0):
<noly_socket_set_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noly_socket_set_reuseaddr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @noly_socket_set_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
ret i32 %8
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @noly_socket_set_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ get_uint32(int /*<<< orphan*/ *, int);
uint32_t format_address_physical_sector(uint8_t *data) {
  return get_uint32(data, 4);
}


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

x86 assembly (clang, -O2):
<format_address_physical_sector>:
mov    $0x4,%esi
jmp    1030 <get_uint32@plt>

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

LLVM IR (-O2):
define i32 @format_address_physical_sector(i32* %0) {
%2 = tail call i32 @get_uint32(i32* %0, i32 4)
ret i32 %2
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_DAEMON;
int LOG_PID;
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
void thin_openlog(char *logname) {
  openlog(logname, LOG_CONS | LOG_PID, LOG_DAEMON);
}


x86 assembly (clang, -O0):
<thin_openlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thin_openlog>:
mov    0x2eb9(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @thin_openlog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @LOG_CONS
%5 = load i32, i32* @LOG_PID
%6 = or i32 %4, %5
%7 = load i32, i32* @LOG_DAEMON
%8 = call i32 @openlog(i8* %3, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @thin_openlog(i8* %0) {
%2 = load i32, i32* @LOG_CONS
%3 = load i32, i32* @LOG_PID
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_DAEMON
%6 = tail call i32 @openlog(i8* %0, i32 %4, i32 %5)
ret void
}
int main(int argc, char **argv) {
  double x = 0x1p-1;
  assert(x == 0.5);
  printf("x is %lf\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe94(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <assert@plt>
lea    0xed4(%rip),%rdi
movsd  0xec4(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"x is %lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 5.000000e-01, double* %6
%7 = load double, double* %6
%8 = fcmp oeq double %7, 5.000000e-01
%9 = zext i1 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %9)
%11 = load double, double* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"x is %lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double 5.000000e-01)
ret i32 0
}
void i2d_OCSP_RESPBYTES(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_OCSP_RESPBYTES() {
ret void
}
/* Variables and functions */
void strcpy(char *__dest, const char *__src) {
  do {
    *__dest = *__src;
    __dest++;
  } while (*__src++);
  return;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110c <strcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
cmpb   $0x0,(%rsi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define void @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = load i8, i8* %5
store i8 %6, i8* %4
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}