xunge/DecIR huggingface dataset:
/* Type definitions */
struct udev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ udev_builtin_list(struct udev *);
void help(struct udev *udev) {
  fprintf(stderr, "\n");
  fprintf(stderr, "Usage: udevadm builtin [--help] <command> <syspath>\n");
  udev_builtin_list(udev);
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xef7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <udev_builtin_list@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eb1(%rip),%r15
mov    (%r15),%edi
lea    0xefa(%rip),%r14
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <udev_builtin_list@plt>
mov    (%r15),%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.udev = type { i32 }
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [53 x i8] c"Usage: udevadm builtin [--help] <command> <syspath>\0A\00"
define void @help(%struct.udev* %0) {
%2 = alloca %struct.udev*
store %struct.udev* %0, %struct.udev** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%7 = load %struct.udev*, %struct.udev** %2
%8 = call i32 @udev_builtin_list(%struct.udev* %7)
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.udev = type { i32 }
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [53 x i8] c"Usage: udevadm builtin [--help] <command> <syspath>\0A\00"
define void @help(%struct.udev* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @udev_builtin_list(%struct.udev* %0)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int h(int b) {
  int c = 0x12345678;
  return __builtin_bswap32(c);
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x12345678,-0x8(%rbp)
mov    -0x8(%rbp),%eax
bswap  %eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @h(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 305419896, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @llvm.bswap.i32(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @h(i32 %0) {
ret i32 2018915346
}
/* Variables and functions */
int /*<<< orphan*/ signal(int, void (*)(int));
void sigAlarm(int sig) { signal(sig, sigAlarm); }


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

x86 assembly (clang, -O2):
<sigAlarm>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <signal@plt>

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

LLVM IR (-O2):
define void @sigAlarm(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @sigAlarm)
ret void
}
/* Variables and functions */
int write(int, unsigned char *, int);
int SendByte(int comport_number, unsigned char byte) {
  int n;
  n = write(comport_number, &byte, 1);
  if (n < 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<SendByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114b <SendByte+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <SendByte+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendByte>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
shr    $0x1f,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @SendByte(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cbrt(int);
int round(int /*<<< orphan*/);
int is_perfect_cube(int n) {
  int root = round(cbrt(n));
  return n == root * root * root;
}


x86 assembly (clang, -O0):
<is_perfect_cube>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <cbrt@plt>
mov    %eax,%edi
call   1040 <round@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_perfect_cube>:
push   %rbx
mov    %edi,%ebx
call   1030 <cbrt@plt>
mov    %eax,%edi
call   1040 <round@plt>
mov    %eax,%ecx
imul   %eax,%ecx
imul   %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_perfect_cube(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @cbrt(i32 %4)
%6 = call i32 @round(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %3
%12 = mul nsw i32 %10, %11
%13 = icmp eq i32 %7, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_perfect_cube(i32 %0) {
%2 = tail call i32 @cbrt(i32 %0)
%3 = tail call i32 @round(i32 %2)
%4 = mul nsw i32 %3, %3
%5 = mul nsw i32 %4, %3
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
int predec_arg_idx(int *p, int i) {
  int j = i - 1;
  __builtin_prefetch(&p[--i], 0, 0);
  return i == j;
}


x86 assembly (clang, -O0):
<predec_arg_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
prefetchnta (%rax)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<predec_arg_idx>:
movslq %esi,%rax
prefetchnta -0x4(%rdi,%rax,4)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @predec_arg_idx(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = bitcast i32* %12 to i8*
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = icmp eq i32 %14, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @predec_arg_idx(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = bitcast i32* %5 to i8*
tail call void @llvm.prefetch.p0i8(i8* %6, i32 0, i32 0, i32 1)
ret i32 1
}
void vlib_stats_register_mem_heap(void *notused) {}


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

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

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

LLVM IR (-O2):
define void @vlib_stats_register_mem_heap(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  int A[2048];
  int B[2048];
  int i;
  int tmp;
  for (i = 0; i < 2048; i++) {
    tmp = A[i];
    B[i] = tmp;
  }
  __VERIFIER_assert(A[2048 / 2] != B[2048 / 2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4020,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4014(%rbp)
cmpl   $0x800,-0x4014(%rbp)
jge    1178 <main+0x68>
movslq -0x4014(%rbp),%rax
mov    -0x2010(%rbp,%rax,4),%eax
mov    %eax,-0x4018(%rbp)
mov    -0x4018(%rbp),%ecx
movslq -0x4014(%rbp),%rax
mov    %ecx,-0x4010(%rbp,%rax,4)
mov    -0x4014(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4014(%rbp)
jmp    112c <main+0x1c>
mov    -0x1010(%rbp),%eax
cmp    -0x3010(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x4020,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2048 x i32]
%3 = alloca [2048 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2048
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [2048 x i32], [2048 x i32]* %2, i64 0, i64 %11
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 %16
store i32 %14, i32* %17
br label %18
18: ; preds = %9
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %6
21: ; preds = %6
%22 = getelementptr inbounds [2048 x i32], [2048 x i32]* %2, i64 0, i64 1024
%23 = load i32, i32* %22
%24 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 1024
%25 = load i32, i32* %24
%26 = icmp ne i32 %23, %25
%27 = zext i1 %26 to i32
%28 = call i32 @__VERIFIER_assert(i32 %27)
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ x_msg(int, char *);
int translate_mtu_discover_type_name(const char *name) {
  x_msg((1 << 4), "--mtu-disc is not supported on this OS");
  return -1;
}


x86 assembly (clang, -O0):
<translate_mtu_discover_type_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x10,%edi
lea    0xed8(%rip),%rsi
call   1030 <x_msg@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate_mtu_discover_type_name>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x10,%edi
call   1030 <x_msg@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"--mtu-disc is not supported on this OS\00"
define i32 @translate_mtu_discover_type_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @x_msg(i32 16, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [39 x i8] c"--mtu-disc is not supported on this OS\00"
define i32 @translate_mtu_discover_type_name(i8* nocapture readnone %0) {
%2 = tail call i32 @x_msg(i32 16, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
struct cryptonight_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cryptonight_ctx *);
void cryptonight_free_ctx(struct cryptonight_ctx *ctx) { free(ctx); }


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

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

LLVM IR (-O0):
%struct.cryptonight_ctx = type { i32 }
define void @cryptonight_free_ctx(%struct.cryptonight_ctx* %0) {
%2 = alloca %struct.cryptonight_ctx*
store %struct.cryptonight_ctx* %0, %struct.cryptonight_ctx** %2
%3 = load %struct.cryptonight_ctx*, %struct.cryptonight_ctx** %2
%4 = call i32 @free(%struct.cryptonight_ctx* %3)
ret void
}

LLVM IR (-O2):
%struct.cryptonight_ctx = type { i32 }
define void @cryptonight_free_ctx(%struct.cryptonight_ctx* nocapture %0) {
%2 = tail call i32 @free(%struct.cryptonight_ctx* %0)
ret void
}
int mn_words_required(int size) { return ((size + 1) * 3) / 4; }


x86 assembly (clang, -O0):
<mn_words_required>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
imul   $0x3,%eax,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<mn_words_required>:
lea    (%rdi,%rdi,2),%ecx
add    $0x3,%ecx
lea    (%rdi,%rdi,2),%eax
add    $0x6,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @mn_words_required(i32 %0) {
%2 = mul i32 %0, 3
%3 = add i32 %2, 3
%4 = sdiv i32 %3, 4
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void display(int a[], int n) {
  int i;
  printf("\n");
  for (i = 1; i <= n; i++) {
    printf("%d\t", a[i]);
  }
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1167 <display+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <display+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %esi,%r12d
mov    %rdi,%r14
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r12d,%r12d
jle    1167 <display+0x47>
add    $0x1,%r12d
mov    $0x1,%ebx
lea    0xeb3(%rip),%r15
nopl   (%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1150 <display+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [4 x i8] c"%d\09\00"
define void @display(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %5
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %7
21: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\09\00"
define void @display(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = icmp slt i32 %1, 1
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = add nuw i32 %1, 1
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ 1, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
long double os_time() {
  struct timespec tp;
  clock_gettime(CLOCK_MONOTONIC, &tp);
  return (long double)((long double)tp.tv_sec + (long double)tp.tv_nsec / 1e9);
}


x86 assembly (clang, -O0):
<os_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
fildll -0x18(%rbp)
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
flds   0xeba(%rip)
fdivrp %st,%st(1)
faddp  %st,%st(1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_time>:
sub    $0x28,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x18(%rsp),%rsi
call   1030 <clock_gettime@plt>
mov    0x18(%rsp),%rax
mov    0x20(%rsp),%rcx
mov    %rcx,0x8(%rsp)
fildll 0x8(%rsp)
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
fdivs  0xeb7(%rip)
faddp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define x86_fp80 @os_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to x86_fp80
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to x86_fp80
%10 = fdiv x86_fp80 %9, 0xK401CEE6B280000000000
%11 = fadd x86_fp80 %6, %10
ret x86_fp80 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define x86_fp80 @os_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to x86_fp80
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to x86_fp80
%11 = fdiv x86_fp80 %10, 0xK401CEE6B280000000000
%12 = fadd x86_fp80 %11, %7
ret x86_fp80 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srli_epi64(int /*<<< orphan*/, int);
__m128i test_mm_srli_epi64(__m128i A) { return _mm_srli_epi64(A, 1); }


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

x86 assembly (clang, -O2):
<test_mm_srli_epi64>:
mov    $0x1,%esi
jmp    1030 <_mm_srli_epi64@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srli_epi64(i32 %0) {
%2 = tail call i32 @_mm_srli_epi64(i32 %0, i32 1)
ret i32 %2
}
int array_insert() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @array_insert() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void ill_handler(int sig) {
  printf("Illegal instruction hit.  Try again\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<ill_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Illegal instruction hit. Try again\0A\00"
define void @ill_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [36 x i8] c"Illegal instruction hit. Try again\00"
define void @ill_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
char *uid_name(uid_t uid) {
  struct passwd *pw = getpwuid(uid);
  return pw ? pw->pw_name : NULL;
}


x86 assembly (clang, -O0):
<uid_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1142 <uid_name+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    114d <uid_name+0x3d>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    114d <uid_name+0x3d>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uid_name>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1120 <uid_name+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @uid_name(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.passwd*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.passwd* @getpwuid(i32 %4)
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = icmp ne %struct.passwd* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load %struct.passwd*, %struct.passwd** %3
%10 = getelementptr inbounds %struct.passwd, %struct.passwd* %9, i32 0, i32 0
%11 = load i8*, i8** %10
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %8
%14 = phi i8* [ %11, %8 ], [ null, %12 ]
ret i8* %14
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @uid_name(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
char getchar();
get_a_char() {
  char ch;
  ch = getchar();
  if (ch != '\n')
    while (getchar() != '\n')
      ;
  return (ch);
}


x86 assembly (clang, -O0):
<get_a_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1151 <get_a_char+0x41>
jmp    1134 <get_a_char+0x24>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     114c <get_a_char+0x3c>
jmp    1134 <get_a_char+0x24>
jmp    1151 <get_a_char+0x41>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_a_char>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
cmp    $0xa,%al
je     112b <get_a_char+0x1b>
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <get_a_char+0x10>
movsbl %bl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_a_char() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3, %0
%7 = sext i8 %1 to i32
ret i32 %7
}
unsigned char rightrot(unsigned char x, unsigned char n) {
  enum size { BYTE = (sizeof(unsigned char) * 8) };
  return ((x << (BYTE - n)) | (x >> n));
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%edx
mov    $0x8,%ecx
sub    %edx,%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
movzbl -0x2(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @rightrot(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = sub nsw i32 8, %8
%10 = shl i32 %6, %9
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = ashr i32 %12, %14
%16 = or i32 %10, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @rightrot(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %1)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void sigterm(int signo) {
  syslog(LOG_INFO, "got SIGTERM; exiting");
  exit(0);
}


x86 assembly (clang, -O0):
<sigterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <syslog@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [21 x i8] c"got SIGTERM; exiting\00"
define void @sigterm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_INFO
%4 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [21 x i8] c"got SIGTERM; exiting\00"
define void @sigterm(i32 %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
void Delay(int n) {
  volatile int i;
  for (i = 0; i < n; i++) {
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <Delay+0x2d>
jmp    111f <Delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Delay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jge    111f <Delay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <Delay+0x10>
ret

LLVM IR (-O0):
define void @Delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load volatile i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load volatile i32, i32* %3
%11 = add nsw i32 %10, 1
store volatile i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp slt i32 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
char convert_pattern(char data, int shift) { return (data - '0') << shift; }


x86 assembly (clang, -O0):
<convert_pattern>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_pattern>:
mov    %esi,%ecx
movzbl %dil,%eax
add    $0xd0,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define signext i8 @convert_pattern(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 48
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @convert_pattern(i8 signext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = add nuw nsw i32 %3, 208
%5 = shl i32 %4, %1
%6 = trunc i32 %5 to i8
ret i8 %6
}
void i2d_ASN1_NULL(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_ASN1_NULL() {
ret void
}
void gdk_window_set_modal_hint() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_set_modal_hint() {
ret void
}
/* Type definitions */
struct gpio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gpio_mode(struct gpio *, int, int);
void gpio_i2c2(void) {
  gpio_mode((struct gpio *)0x40010C00, 10, 3 | 8);
  gpio_mode((struct gpio *)0x40010C00, 11, 3 | 8);
}


x86 assembly (clang, -O0):
<gpio_i2c2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40010c00,%edi
mov    $0xa,%esi
mov    $0xb,%edx
call   1030 <gpio_mode@plt>
mov    $0x40010c00,%edi
mov    $0xb,%edx
mov    %edx,%esi
call   1030 <gpio_mode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_i2c2>:
push   %rax
mov    $0x40010c00,%edi
mov    $0xa,%esi
mov    $0xb,%edx
call   1030 <gpio_mode@plt>
mov    $0x40010c00,%edi
mov    $0xb,%esi
mov    $0xb,%edx
pop    %rax
jmp    1030 <gpio_mode@plt>

LLVM IR (-O0):
%struct.gpio = type { i32 }
define void @gpio_i2c2() {
%1 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073810432 to %struct.gpio*), i32 10, i32 11)
%2 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073810432 to %struct.gpio*), i32 11, i32 11)
ret void
}

LLVM IR (-O2):
%struct.gpio = type { i32 }
define void @gpio_i2c2() {
%1 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073810432 to %struct.gpio*), i32 10, i32 11)
%2 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073810432 to %struct.gpio*), i32 11, i32 11)
ret void
}
int almacena_numero(int num, int primitiva[]) {}


x86 assembly (clang, -O0):
<almacena_numero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @almacena_numero(i32 %0, i32* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ perror(char const *);
int perror2(const char *s) {
  int save = errno;
  perror(s);
  return save;
}


x86 assembly (clang, -O0):
<perror2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror2>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ebx
call   1030 <perror@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @perror2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @perror(i8* %5)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @perror2(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @perror(i8* %0)
ret i32 %2
}
void LPCIRQSet(unsigned long ulBase, unsigned long ulIRQ) {
  unsigned long ulTemp;
  ;
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000008)));
  ulTemp |= (ulIRQ & 0xFFFF0000);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) = ulTemp;
}


x86 assembly (clang, -O0):
<LPCIRQSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
movabs $0xffff0000,%rax
and    -0x10(%rbp),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCIRQSet>:
and    $0xffff0000,%esi
or     %rsi,0x8(%rdi)
ret

LLVM IR (-O0):
define void @LPCIRQSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 8
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %4
%11 = and i64 %10, 4294901760
%12 = load i64, i64* %5
%13 = or i64 %12, %11
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = load i64, i64* %3
%16 = add i64 %15, 8
%17 = inttoptr i64 %16 to i64*
store volatile i64 %14, i64* %17
ret void
}

LLVM IR (-O2):
define void @LPCIRQSet(i64 %0, i64 %1) {
%3 = add i64 %0, 8
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %1, 4294901760
%7 = or i64 %5, %6
store volatile i64 %7, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free_double_vec(double *vec) { free(vec); }


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

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

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

LLVM IR (-O2):
define void @free_double_vec(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_GENERALSTRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_GENERALSTRING_it;
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void ASN1_GENERALSTRING_free(ASN1_GENERALSTRING *a) {
  ASN1_item_free((ASN1_VALUE *)a, &ASN1_GENERALSTRING_it);
}


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

x86 assembly (clang, -O2):
<ASN1_GENERALSTRING_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@ASN1_GENERALSTRING_it = global i32 0
define void @ASN1_GENERALSTRING_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @ASN1_GENERALSTRING_it)
ret void
}

LLVM IR (-O2):
@ASN1_GENERALSTRING_it = global i32 0
define void @ASN1_GENERALSTRING_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @ASN1_GENERALSTRING_it)
ret void
}
int compare(const void *a, const void *b) {
  if (*((int *)a) > *((int *)b))
    return 1;
  if (*((int *)a) == *((int *)b))
    return 0;
  if (*((int *)a) < *((int *)b))
    return -1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <compare+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <compare+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <compare+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1161 <compare+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1161 <compare+0x61>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
bool game_ended(char winner, int nrounds) {
  if (winner == ' ' && nrounds < 9) {
    return false;
  } else {
    return true;
  }
}


x86 assembly (clang, -O0):
<game_ended>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1130 <game_ended+0x30>
cmpl   $0x9,-0xc(%rbp)
jge    1130 <game_ended+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1137 <game_ended+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_ended>:
cmp    $0x20,%dil
setne  %al
cmp    $0x9,%esi
setge  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @game_ended(i8 signext %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 32
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 9
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* %3
br label %14
13: ; preds = %9, %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @game_ended(i8 signext %0, i32 %1) {
%3 = icmp ne i8 %0, 32
%4 = icmp sgt i32 %1, 8
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int stb_is_pow2(unsigned int n) { return (n & (n - 1)) == 0; }


x86 assembly (clang, -O0):
<stb_is_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_is_pow2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @stb_is_pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @stb_is_pow2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RB_POWER_OFF;
int /*<<< orphan*/ reboot(int /*<<< orphan*/);
int main(void) { reboot(RB_POWER_OFF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <reboot@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@RB_POWER_OFF = global i32 0
define i32 @main() {
%1 = load i32, i32* @RB_POWER_OFF
%2 = call i32 @reboot(i32 %1)
ret i32 0
}

LLVM IR (-O2):
@RB_POWER_OFF = global i32 0
define i32 @main() {
%1 = load i32, i32* @RB_POWER_OFF
%2 = tail call i32 @reboot(i32 %1)
ret i32 0
}
void foo241(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo241(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall_getgid();
gid_t getgid(void) { return (__syscall_getgid()); }


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

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

LLVM IR (-O0):
define i32 @getgid() {
%1 = call i32 (...) @__syscall_getgid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getgid() {
%1 = tail call i32 (...) @__syscall_getgid()
ret i32 %1
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int ENOSYS;
int errno;
int fstatat(const int dirfd, const char *const pathname, struct stat *const buf,
            const int flags) {
  return errno = ENOSYS, -1;
}


x86 assembly (clang, -O0):
<fstatat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2ecf(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstatat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstatat(i32 %0, i8* %1, %struct.stat* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.stat*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.stat* %2, %struct.stat** %7
store i32 %3, i32* %8
%9 = load i32, i32* @ENOSYS
store i32 %9, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstatat(i32 %0, i8* nocapture readnone %1, %struct.stat* nocapture readnone %2, i32 %3) {
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ arm_cpu_env_flags(int *);
int arm_cpu_env_mask();
int arm_cpu_caps(void) {
  int flags;
  int mask;
  if (!arm_cpu_env_flags(&flags)) {
    return flags;
  }
  mask = arm_cpu_env_mask();
  return flags & mask;
}


x86 assembly (clang, -O0):
<arm_cpu_caps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <arm_cpu_env_flags@plt>
cmp    $0x0,%eax
jne    1145 <arm_cpu_caps+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <arm_cpu_caps+0x38>
mov    $0x0,%al
call   1030 <arm_cpu_env_mask@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_cpu_caps>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <arm_cpu_env_flags@plt>
test   %eax,%eax
je     113c <arm_cpu_caps+0x1c>
xor    %eax,%eax
call   1030 <arm_cpu_env_mask@plt>
and    0x4(%rsp),%eax
pop    %rcx
ret
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @arm_cpu_caps() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @arm_cpu_env_flags(i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* %1
br label %11
7: ; preds = %0
%8 = call i32 (...) @arm_cpu_env_mask()
%9 = load i32, i32* %1
%10 = and i32 %9, %8
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ %10, %7 ], [ %6, %5 ]
ret i32 %12
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
float vec2_distance(float *, float *);
__attribute__((always_)) float psvec2_distance(struct vec2 *a, struct vec2 *b) {
  return vec2_distance((float *)a, (float *)b);
}


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

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

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define float @psvec2_distance(%struct.vec2* %0, %struct.vec2* %1) {
%3 = alloca %struct.vec2*
%4 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %3
store %struct.vec2* %1, %struct.vec2** %4
%5 = load %struct.vec2*, %struct.vec2** %3
%6 = bitcast %struct.vec2* %5 to float*
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = call float @vec2_distance(float* %6, float* %8)
ret float %9
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define float @psvec2_distance(%struct.vec2* %0, %struct.vec2* %1) {
%3 = bitcast %struct.vec2* %0 to float*
%4 = bitcast %struct.vec2* %1 to float*
%5 = tail call float @vec2_distance(float* %3, float* %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ cycinf_init();
int Cyc_BansheeIf_banshee_init(void) {
  cycinf_init();
  return 1;
}


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

x86 assembly (clang, -O2):
<Cyc_BansheeIf_banshee_init>:
push   %rax
xor    %eax,%eax
call   1030 <cycinf_init@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Cyc_BansheeIf_banshee_init() {
%1 = call i32 (...) @cycinf_init()
ret i32 1
}

LLVM IR (-O2):
define i32 @Cyc_BansheeIf_banshee_init() {
%1 = tail call i32 (...) @cycinf_init()
ret i32 1
}