xunge/DecIR huggingface dataset:
int setCarry(char *STAT, int bit) {
  if (bit == 1)
    *STAT = *STAT | 2;
  else
    *STAT = *STAT & (255 - 2);
}


x86 assembly (clang, -O0):
<setCarry>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    112c <setCarry+0x2c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
or     $0x2,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    1140 <setCarry+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xfd,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCarry>:
cmp    $0x1,%esi
sete   %al
mov    (%rdi),%cl
and    $0xfd,%cl
add    %al,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define i32 @setCarry(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = or i32 %11, 2
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
store i8 %13, i8* %14
br label %22
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = and i32 %18, 253
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
store i8 %20, i8* %21
br label %22
22: ; preds = %15, %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @setCarry(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = load i8, i8* %0
%5 = and i8 %4, -3
%6 = select i1 %3, i8 2, i8 0
%7 = or i8 %5, %6
store i8 %7, i8* %0
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int, char *, int);
int main(int argc, char **argv) {
  int fd = open(argv[1], O_RDONLY);
  char buf[256];
  read(fd, buf, 255);
  close(fd);
  printf(buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0xff,%edx
call   1050 <read@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
lea    -0x120(%rbp),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    0x8(%rsi),%rdi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,%ebx
mov    %rsp,%r14
mov    %eax,%edi
mov    %r14,%rsi
mov    $0xff,%edx
call   1050 <read@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = load i32, i32* @O_RDONLY
%12 = call i32 @open(i8* %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%15 = call i32 @read(i32 %13, i8* %14, i32 255)
%16 = load i32, i32* %6
%17 = call i32 @close(i32 %16)
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%19 = call i32 @printf(i8* %18)
ret i32 0
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = load i32, i32* @O_RDONLY
%7 = tail call i32 @open(i8* %5, i32 %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = call i32 @read(i32 %7, i8* %8, i32 255)
%10 = tail call i32 @close(i32 %7)
%11 = call i32 @printf(i8* %8)
ret i32 0
}
/* Variables and functions */
char **__crt0_glob_function(char *_arg) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8** @__crt0_glob_function(i8* nocapture readnone %0) {
ret i8** null
}
/* Variables and functions */
int /*<<< orphan*/ testFileInnerProduct();
int main() {
  for (int i = 0; i < 1; i++) {
    testFileInnerProduct();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <testFileInnerProduct@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testFileInnerProduct()
ret i32 0
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ check_file_mmap(struct __test_metadata *);
void wrapper_check_file_mmap(struct __test_metadata *_metadata,
                             struct __fixture_variant_metadata *variant) {
  check_file_mmap(_metadata);
}


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

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

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_check_file_mmap(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @check_file_mmap(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_check_file_mmap(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @check_file_mmap(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int fb_read(void *, unsigned long);
int /*<<< orphan*/ fb_seek_set(unsigned long);
unsigned long fb_tell();
int fb_peek(void *data, unsigned long len) {
  unsigned long pos;
  int ret;
  pos = fb_tell();
  ret = fb_read(data, len);
  fb_seek_set(pos);
  return ret;
}


x86 assembly (clang, -O0):
<fb_peek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <fb_tell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fb_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <fb_seek_set@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_peek>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <fb_tell@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <fb_read@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <fb_seek_set@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fb_peek(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = call i64 (...) @fb_tell()
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @fb_read(i8* %8, i64 %9)
store i32 %10, i32* %6
%11 = load i64, i64* %5
%12 = call i32 @fb_seek_set(i64 %11)
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @fb_peek(i8* %0, i64 %1) {
%3 = tail call i64 (...) @fb_tell()
%4 = tail call i32 @fb_read(i8* %0, i64 %1)
%5 = tail call i32 @fb_seek_set(i64 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void pexit(char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<pexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pexit>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @pexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @pexit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t pack_get_u8(uint8_t *buffer, int byteNr) {
  uint8_t retVal;
  uint8_t *ptr;
  ptr = (uint8_t *)&retVal;
  *(ptr + 0) = *(buffer + byteNr + 0);
  return (retVal);
}


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

x86 assembly (clang, -O2):
<pack_get_u8>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @pack_get_u8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32* %5, i32** %6
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 %12, i32* %14
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @pack_get_u8(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
unsigned long get_next_pow2(unsigned long n) {
  n--;
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  n |= n >> 32;
  n++;
  return n;
}


x86 assembly (clang, -O0):
<get_next_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_pow2>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @get_next_pow2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, -1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = load i64, i64* %2
%8 = or i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = lshr i64 %9, 2
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = lshr i64 %13, 4
%15 = load i64, i64* %2
%16 = or i64 %15, %14
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
%19 = load i64, i64* %2
%20 = or i64 %19, %18
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = lshr i64 %21, 16
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = lshr i64 %25, 32
%27 = load i64, i64* %2
%28 = or i64 %27, %26
store i64 %28, i64* %2
%29 = load i64, i64* %2
%30 = add i64 %29, 1
store i64 %30, i64* %2
%31 = load i64, i64* %2
ret i64 %31
}

LLVM IR (-O2):
define i64 @get_next_pow2(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnbr(int);
void ft_mul(int a, int b) {
  ft_putnbr(a * b);
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
call   1040 <ft_putnbr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_mul>:
push   %rax
imul   %esi,%edi
call   1040 <ft_putnbr@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_mul(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = call i32 @ft_putnbr(i32 %7)
%9 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ft_mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @ft_putnbr(i32 %3)
%5 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *fv_alloc(size_t size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @fv_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
__attribute__((const)) unsigned popcnt(unsigned x) {
  x -= ((x >> 1) & 0x55555555);
  x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
  x = (x + (x >> 4)) & 0x0f0f0f0f;
  x += x >> 8;
  x += x >> 16;
  return x & 0x3f;
}


x86 assembly (clang, -O0):
<popcnt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcnt>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @popcnt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = sub i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 4
%17 = add i32 %14, %16
%18 = and i32 %17, 252645135
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 8
%21 = load i32, i32* %2
%22 = add i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = lshr i32 %23, 16
%25 = load i32, i32* %2
%26 = add i32 %25, %24
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = and i32 %27, 63
ret i32 %28
}

LLVM IR (-O2):
define i32 @popcnt(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = lshr i32 %11, 8
%13 = add nuw nsw i32 %12, %11
%14 = lshr i32 %13, 16
%15 = add nuw nsw i32 %14, %13
%16 = and i32 %15, 63
ret i32 %16
}
void clear_array(int array[], int n_elements) {
  while (n_elements > 0)
    array[--n_elements] = 0;
}


x86 assembly (clang, -O0):
<clear_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1131 <clear_array+0x31>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    110b <clear_array+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_array>:
test   %esi,%esi
jle    1126 <clear_array+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear_array(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *realloc(char *, int);
char *PUT(char *to, int tosize, char c) {
  if ((tosize & 4095) == 0) {
    to = realloc(to, tosize + 4096);
    if (to == NULL)
      abort();
  }
  to[tosize] = c;
  return to;
}


x86 assembly (clang, -O0):
<PUT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfff,%eax
cmp    $0x0,%eax
jne    1172 <PUT+0x52>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1000,%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116d <PUT+0x4d>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1172 <PUT+0x52>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUT>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%ebx
test   $0xfff,%esi
jne    1142 <PUT+0x22>
lea    0x1000(%rbx),%esi
call   1040 <realloc@plt>
mov    %rax,%rdi
test   %rax,%rax
je     1153 <PUT+0x33>
movslq %ebx,%rax
mov    %bpl,(%rdi,%rax,1)
mov    %rdi,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @PUT(i8* %0, i32 %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %5
%8 = and i32 %7, 4095
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 4096
%14 = call i8* @realloc(i8* %11, i32 %13)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %10
br label %20
20: ; preds = %19, %3
%21 = load i8, i8* %6
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 %21, i8* %25
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @PUT(i8* %0, i32 %1, i8 signext %2) {
%4 = and i32 %1, 4095
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = add nsw i32 %1, 4096
%8 = tail call i8* @realloc(i8* %0, i32 %7)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %6, %3
%13 = phi i8* [ %8, %6 ], [ %0, %3 ]
%14 = sext i32 %1 to i64
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 %2, i8* %15
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_screen_hold();
int /*<<< orphan*/ roadmap_screen_refresh();
int /*<<< orphan*/ roadmap_state_refresh();
int /*<<< orphan*/ roadmap_trip_set_focus(char *);
void roadmap_start_show_gps(void) {
  roadmap_screen_hold();
  roadmap_trip_set_focus("GPS");
  roadmap_screen_refresh();
  roadmap_state_refresh();
}


x86 assembly (clang, -O0):
<roadmap_start_show_gps>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <roadmap_screen_hold@plt>
lea    0xeae(%rip),%rdi
call   1050 <roadmap_trip_set_focus@plt>
mov    $0x0,%al
call   1060 <roadmap_screen_refresh@plt>
mov    $0x0,%al
call   1040 <roadmap_state_refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_start_show_gps>:
push   %rax
xor    %eax,%eax
call   1030 <roadmap_screen_hold@plt>
lea    0xeb1(%rip),%rdi
call   1050 <roadmap_trip_set_focus@plt>
xor    %eax,%eax
call   1060 <roadmap_screen_refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <roadmap_state_refresh@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"GPS\00"
define void @roadmap_start_show_gps() {
%1 = call i32 (...) @roadmap_screen_hold()
%2 = call i32 @roadmap_trip_set_focus(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @roadmap_screen_refresh()
%4 = call i32 (...) @roadmap_state_refresh()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"GPS\00"
define void @roadmap_start_show_gps() {
%1 = tail call i32 (...) @roadmap_screen_hold()
%2 = tail call i32 @roadmap_trip_set_focus(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @roadmap_screen_refresh()
%4 = tail call i32 (...) @roadmap_state_refresh()
ret void
}
int iseq(char *str1, char *str2) {
  int i = 0;
  while (*(str1 + i) == *(str2 + i)) {
    if (*(str1 + i) == '\0') {
      return 1;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<iseq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1162 <iseq+0x62>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1154 <iseq+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1169 <iseq+0x69>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <iseq+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iseq>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1124 <iseq+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %cl,%cl
je     1125 <iseq+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <iseq+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @iseq(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
store i32 0, i32* %6
br label %7
7: ; preds = %30, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %13, %19
br i1 %20, label %21, label %33
21: ; preds = %7
%22 = load i8*, i8** %4
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %21
store i32 1, i32* %3
br label %34
30: ; preds = %21
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %7
33: ; preds = %7
store i32 0, i32* %3
br label %34
34: ; preds = %33, %29
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @iseq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %12, label %17
6: ; preds = %12
%7 = getelementptr inbounds i8, i8* %0, i64 %16
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %1, i64 %16
%10 = load i8, i8* %9
%11 = icmp eq i8 %8, %10
br i1 %11, label %12, label %17
12: ; preds = %2, %6
%13 = phi i64 [ %16, %6 ], [ 0, %2 ]
%14 = phi i8 [ %8, %6 ], [ %3, %2 ]
%15 = icmp eq i8 %14, 0
%16 = add nuw i64 %13, 1
br i1 %15, label %17, label %6
17: ; preds = %12, %6, %2
%18 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 1, %12 ]
ret i32 %18
}
int test_imm_E9uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xE9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E9uint64_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, 233
%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_E9uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 15269888
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned char random();
void random_memory(void *buf, size_t len) {
  unsigned char *ptr = buf;
  size_t i;
  for (i = 0; i < len; i++)
    ptr[i] = random();
}


x86 assembly (clang, -O0):
<random_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1163 <random_memory+0x53>
mov    $0x0,%al
call   1030 <random@plt>
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <random_memory+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_memory>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1144 <random_memory+0x34>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_memory+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @random_memory(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
store i64 0, i64* %6
br label %8
8: ; preds = %17, %2
%9 = load i64, i64* %6
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = call zeroext i8 (...) @random()
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 %13, i8* %16
br label %17
17: ; preds = %12
%18 = load i64, i64* %6
%19 = add i64 %18, 1
store i64 %19, i64* %6
br label %8
20: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @random_memory(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = tail call zeroext i8 (...) @random()
%7 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %6, i8* %7
%8 = add nuw i64 %5, 1
%9 = icmp eq i64 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
int ddebug_remove_module(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ddebug_remove_module() {
ret i32 0
}
/* Variables and functions */
unsigned int arc4_getbyte();
unsigned int arc4_getword(void) {
  unsigned int val;
  val = arc4_getbyte() << 24;
  val |= arc4_getbyte() << 16;
  val |= arc4_getbyte() << 8;
  val |= arc4_getbyte();
  return val;
}


x86 assembly (clang, -O0):
<arc4_getword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <arc4_getbyte@plt>
shl    $0x18,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <arc4_getbyte@plt>
shl    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <arc4_getbyte@plt>
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <arc4_getbyte@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc4_getword>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <arc4_getbyte@plt>
mov    %eax,%ebx
shl    $0x18,%ebx
xor    %eax,%eax
call   1030 <arc4_getbyte@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <arc4_getbyte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1030 <arc4_getbyte@plt>
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @arc4_getword() {
%1 = alloca i32
%2 = call i32 (...) @arc4_getbyte()
%3 = shl i32 %2, 24
store i32 %3, i32* %1
%4 = call i32 (...) @arc4_getbyte()
%5 = shl i32 %4, 16
%6 = load i32, i32* %1
%7 = or i32 %6, %5
store i32 %7, i32* %1
%8 = call i32 (...) @arc4_getbyte()
%9 = shl i32 %8, 8
%10 = load i32, i32* %1
%11 = or i32 %10, %9
store i32 %11, i32* %1
%12 = call i32 (...) @arc4_getbyte()
%13 = load i32, i32* %1
%14 = or i32 %13, %12
store i32 %14, i32* %1
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @arc4_getword() {
%1 = tail call i32 (...) @arc4_getbyte()
%2 = shl i32 %1, 24
%3 = tail call i32 (...) @arc4_getbyte()
%4 = shl i32 %3, 16
%5 = or i32 %4, %2
%6 = tail call i32 (...) @arc4_getbyte()
%7 = shl i32 %6, 8
%8 = or i32 %5, %7
%9 = tail call i32 (...) @arc4_getbyte()
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_path_decode(const char *path, const char *prefix, char **external_id) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_path_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_path_decode>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_path_decode(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_path_decode(i8* nocapture readnone %0, i8* nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
unsigned int hdmi_rd_reg(unsigned long addr) {
  unsigned long data;
  (*(volatile unsigned long *)(0xd0040000 + (0x2000)) = addr);
  (*(volatile unsigned long *)(0xd0040000 + (0x2000)) = addr);
  data = (*(volatile unsigned long *)(0xd0040000 + (0x2004)));
  return (data);
}


x86 assembly (clang, -O0):
<hdmi_rd_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xd0042000,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rcx
mov    $0xd0042000,%eax
mov    %rcx,(%rax)
mov    $0xd0042004,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdmi_rd_reg>:
mov    $0xd0042000,%eax
mov    %rdi,(%rax)
mov    %rdi,(%rax)
mov    0x4(%rax),%rax
ret

LLVM IR (-O0):
define i32 @hdmi_rd_reg(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store volatile i64 %4, i64* inttoptr (i64 3489931264 to i64*)
%5 = load i64, i64* %2
store volatile i64 %5, i64* inttoptr (i64 3489931264 to i64*)
%6 = load volatile i64, i64* inttoptr (i64 3489931268 to i64*)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @hdmi_rd_reg(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 3489931264 to i64*)
store volatile i64 %0, i64* inttoptr (i64 3489931264 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 3489931268 to i64*)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int do_311() { return 311; }


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

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

LLVM IR (-O0):
define i32 @do_311() {
ret i32 311
}

LLVM IR (-O2):
define i32 @do_311() {
ret i32 311
}
unsigned __int128 countRoutes(int n) {
  unsigned __int128 nfac = factorial(n);
  unsigned __int128 routes = reducedFactorial(2 * n, n) / nfac;
  return routes;
}


x86 assembly (clang, -O0):
<countRoutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %al,-0x41(%rbp)
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    -0x41(%rbp),%al
movslq %ecx,%rdx
mov    %rdx,%rcx
sar    $0x3f,%rcx
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%edi
add    %edi,%edi
call   1040 <reducedFactorial@plt>
movslq %eax,%rdi
mov    %rdi,%rsi
sar    $0x3f,%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   11a0 <__udivti3>
mov    %rdx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<countRoutes>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <factorial@plt>
movslq %eax,%r14
mov    %r14,%r15
sar    $0x3f,%r15
lea    (%rbx,%rbx,1),%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <reducedFactorial@plt>
movslq %eax,%rdi
mov    %rdi,%rsi
sar    $0x3f,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1160 <__udivti3>
pop    %rbx
pop    %r14
pop    %r15
ret
nop

LLVM IR (-O0):
define { i64, i64 } @countRoutes(i32 %0) {
%2 = alloca i128
%3 = alloca i32
%4 = alloca i128
%5 = alloca i128
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i32, ...) bitcast (i32 (...)* @factorial to i32 (i32, ...)*)(i32 %6)
%8 = sext i32 %7 to i128
store i128 %8, i128* %4
%9 = load i32, i32* %3
%10 = mul nsw i32 2, %9
%11 = load i32, i32* %3
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @reducedFactorial to i32 (i32, i32, ...)*)(i32 %10, i32 %11)
%13 = sext i32 %12 to i128
%14 = load i128, i128* %4
%15 = udiv i128 %13, %14
store i128 %15, i128* %5
%16 = load i128, i128* %5
store i128 %16, i128* %2
%17 = bitcast i128* %2 to { i64, i64 }*
%18 = load { i64, i64 }, { i64, i64 }* %17
ret { i64, i64 } %18
}

LLVM IR (-O2):
define { i64, i64 } @countRoutes(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @factorial to i32 (i32, ...)*)(i32 %0)
%3 = sext i32 %2 to i128
%4 = shl nsw i32 %0, 1
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @reducedFactorial to i32 (i32, i32, ...)*)(i32 %4, i32 %0)
%6 = sext i32 %5 to i128
%7 = udiv i128 %6, %3
%8 = trunc i128 %7 to i64
%9 = lshr i128 %7, 64
%10 = trunc i128 %9 to i64
%11 = insertvalue { i64, i64 } poison, i64 %8, 0
%12 = insertvalue { i64, i64 } %11, i64 %10, 1
ret { i64, i64 } %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct sha3_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cryptonite_sha3_init(struct sha3_ctx *, int /*<<< orphan*/);
void cryptonite_keccak_init(struct sha3_ctx *ctx, uint32_t hashlen) {
  cryptonite_sha3_init(ctx, hashlen);
}


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

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

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

LLVM IR (-O2):
%struct.sha3_ctx = type { i32 }
define void @cryptonite_keccak_init(%struct.sha3_ctx* %0, i32 %1) {
%3 = tail call i32 @cryptonite_sha3_init(%struct.sha3_ctx* %0, i32 %1)
ret void
}
void set_colors() {
  unsigned char *vidmem = (unsigned char *)0xb8000;
  int i;
  for (i = 1; i < 25 * 80 * 2; i += 2)
    vidmem[i] = 0x02;
}


x86 assembly (clang, -O0):
<set_colors>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8000,%eax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xfa0,-0xc(%rbp)
jge    113b <set_colors+0x3b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x2,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <set_colors+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_colors>:
mov    $0xfffffffffffffff1,%rax
mov    $0xb800f,%ecx
nopl   0x0(%rax)
movb   $0x2,0x1(%rcx,%rax,1)
movb   $0x2,0x3(%rcx,%rax,1)
movb   $0x2,0x5(%rcx,%rax,1)
movb   $0x2,0x7(%rcx,%rax,1)
movb   $0x2,0x9(%rcx,%rax,1)
movb   $0x2,0xb(%rcx,%rax,1)
movb   $0x2,0xd(%rcx,%rax,1)
movb   $0x2,0xf(%rcx,%rax,1)
add    $0x10,%rax
cmp    $0xf90,%rax
jb     1110 <set_colors+0x10>
ret

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

LLVM IR (-O2):
define void @set_colors() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 1, %0 ], [ %18, %1 ]
%3 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %2
store i8 2, i8* %3
%4 = add nuw nsw i64 %2, 2
%5 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %4
store i8 2, i8* %5
%6 = add nuw nsw i64 %2, 4
%7 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %6
store i8 2, i8* %7
%8 = add nuw nsw i64 %2, 6
%9 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %8
store i8 2, i8* %9
%10 = add nuw nsw i64 %2, 8
%11 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %10
store i8 2, i8* %11
%12 = add nuw nsw i64 %2, 10
%13 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %12
store i8 2, i8* %13
%14 = add nuw nsw i64 %2, 12
%15 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %14
store i8 2, i8* %15
%16 = add nuw nsw i64 %2, 14
%17 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %16
store i8 2, i8* %17
%18 = add nuw nsw i64 %2, 16
%19 = icmp ult i64 %2, 3984
br i1 %19, label %1, label %20
20: ; preds = %1
ret void
}
int num_len(int num) {
  int len = 1;
  for (; num >= 10; len++) {
    num /= 10;
  }
  return len;
}


x86 assembly (clang, -O0):
<num_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1134 <num_len+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <num_len+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_len>:
mov    $0x1,%eax
cmp    $0xa,%edi
jl     1134 <num_len+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <num_len+0x20>
ret

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

LLVM IR (-O2):
define i32 @num_len(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i32 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
void ExttHoldUserAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttHoldUserAuxTable() {
ret void
}
/* Variables and functions */
__attribute__((noreturn, weak)) void __default_exit(void) {
  while (true) {
  }
}


x86 assembly (clang, -O0):
<__default_exit>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__default_exit+0x9>
jmp    1109 <__default_exit+0x9>

x86 assembly (clang, -O2):
<__default_exit>:
jmp    1100 <__default_exit>

LLVM IR (-O0):
define weak void @__default_exit() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @__default_exit() {
br label %1
1: ; preds = %0, %1
br label %1
}
char plugin_format() { return 'M'; }


x86 assembly (clang, -O0):
<plugin_format>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4d,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_format>:
mov    $0x4d,%al
ret

LLVM IR (-O0):
define signext i8 @plugin_format() {
ret i8 77
}

LLVM IR (-O2):
define signext i8 @plugin_format() {
ret i8 77
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double wctime() {
  struct timespec tv;
  clock_gettime(CLOCK_MONOTONIC, &tv);
  return (tv.tv_sec + 1E-9 * tv.tv_nsec);
}


x86 assembly (clang, -O0):
<wctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctime>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @wctime() {
%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 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double 1.000000e-09, double %8, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timespec = type { double, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @wctime() {
%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 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e-09, double %6)
ret double %10
}
void liba_func() {}


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

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

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

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