xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t cichlid_rotate_right_32(uint32_t x, int n) {
  return (x >> n) | (x << (32 - n));
}


x86 assembly (clang, -O0):
<cichlid_rotate_right_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cichlid_rotate_right_32>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @cichlid_rotate_right_32(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @cichlid_rotate_right_32(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int hnumchars();
int hnumchars_() { return (hnumchars()); }


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

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

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

LLVM IR (-O2):
define i32 @hnumchars_() {
%1 = tail call i32 (...) @hnumchars()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_int(int signo) { printf("Interrupted!!!\n"); }


x86 assembly (clang, -O0):
<sig_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_int>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Interrupted!!!\0A\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"Interrupted!!!\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned long long llReverse3(unsigned long long x) {
  return ((x << 40) & 0x00FF000000000000ull) |
         ((x << 24) & 0x0000FF0000000000ull) |
         ((x >> 8) & 0x00000000FF000000ull) |
         ((x >> 24) & 0x0000000000FF0000ull) |
         ((x << 56) & 0xFF00000000000000ull) |
         ((x << 8) & 0x000000FF00000000ull) |
         ((x >> 40) & 0x000000000000FF00ull) |
         ((x >> 56) & 0x00000000000000FFull);
}


x86 assembly (clang, -O0):
<llReverse3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x28,%rax
movabs $0xff000000000000,%rcx
and    %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x18,%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x18,%rcx
and    $0xff0000,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x38,%rcx
movabs $0xff00000000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x8,%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x28,%rcx
and    $0xff00,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x38,%rcx
and    $0xff,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llReverse3>:
mov    %rdi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @llReverse3(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 40
%5 = and i64 %4, 71776119061217280
%6 = load i64, i64* %2
%7 = shl i64 %6, 24
%8 = and i64 %7, 280375465082880
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = lshr i64 %10, 8
%12 = and i64 %11, 4278190080
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = lshr i64 %14, 24
%16 = and i64 %15, 16711680
%17 = or i64 %13, %16
%18 = load i64, i64* %2
%19 = shl i64 %18, 56
%20 = and i64 %19, -72057594037927936
%21 = or i64 %17, %20
%22 = load i64, i64* %2
%23 = shl i64 %22, 8
%24 = and i64 %23, 1095216660480
%25 = or i64 %21, %24
%26 = load i64, i64* %2
%27 = lshr i64 %26, 40
%28 = and i64 %27, 65280
%29 = or i64 %25, %28
%30 = load i64, i64* %2
%31 = lshr i64 %30, 56
%32 = and i64 %31, 255
%33 = or i64 %29, %32
ret i64 %33
}

LLVM IR (-O2):
define i64 @llReverse3(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int, int);
main() {
  char *a = "main(){char*a=%c%s%c;int b='%c';printf(a,b,a,b,b);}";
  int b = '"';
  printf(a, b, a, b, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x22,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x22,%esi
mov    %rdi,%rdx
mov    $0x22,%ecx
mov    $0x22,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"main(){char*a=%c%s%c;int b='%c';printf(a,b,a,b,b);}\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8** %1
store i32 34, i32* %2
%3 = load i8*, i8** %1
%4 = load i32, i32* %2
%5 = load i8*, i8** %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* %3, i32 %4, i8* %5, i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"main(){char*a=%c%s%c;int b='%c';printf(a,b,a,b,b);}\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 34, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 34, i32 34)
ret i32 0
}
void subroutine2named_subroutine() {}


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

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

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

LLVM IR (-O2):
define void @subroutine2named_subroutine() {
ret void
}
int strLength(const char str[]) {
  int count = 0;
  while (str[count] != '\0')
    count++;
  return count;
}


x86 assembly (clang, -O0):
<strLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strLength+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @strLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ ez_align_to(size_t, size_t);
void *ez_align_ptr_to(void *ptr, size_t a) {
  return (void *)(uintptr_t)ez_align_to((size_t)((uintptr_t)ptr), a);
}


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

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

LLVM IR (-O0):
define i8* @ez_align_ptr_to(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i64, i64* %4
%8 = call i64 @ez_align_to(i64 %6, i64 %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @ez_align_ptr_to(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i64 @ez_align_to(i64 %3, i64 %1)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
void fd286(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
a:;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
p03B:
  goto p03B;
  goto a;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd286>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd286+0x7>

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

LLVM IR (-O0):
define void @fd286(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; No predecessors!
%42 = load i32, i32* %2
%43 = zext i32 %42 to i64
br label %44
44: ; preds = %44, %41
br label %44
45: ; preds = %45
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd286(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void mov_preg64pimm32_reg16(int reg64, unsigned int imm32, int reg16) {
  put8(0x66);
  put8(0x89);
  put8(0x80 | reg64 | (reg16 << 3));
  put32(imm32);
}


x86 assembly (clang, -O0):
<mov_preg64pimm32_reg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x89,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
or     $0x80,%edi
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_preg64pimm32_reg16>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x89,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0x80,%ebx
mov    %ebx,%edi
call   1030 <put8@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_preg64pimm32_reg16(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @put8(i32 102)
%8 = call i32 @put8(i32 137)
%9 = load i32, i32* %4
%10 = or i32 128, %9
%11 = load i32, i32* %6
%12 = shl i32 %11, 3
%13 = or i32 %10, %12
%14 = call i32 @put8(i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @put32(i32 %15)
ret void
}

LLVM IR (-O2):
define void @mov_preg64pimm32_reg16(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put8(i32 102)
%5 = tail call i32 @put8(i32 137)
%6 = shl i32 %2, 3
%7 = or i32 %6, %0
%8 = or i32 %7, 128
%9 = tail call i32 @put8(i32 %8)
%10 = tail call i32 @put32(i32 %1)
ret void
}
one2(a) { nop(); }


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

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

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

LLVM IR (-O2):
define i32 @one2(i32 %0) {
%2 = tail call i32 (...) @nop()
ret i32 undef
}
int posix_kqueue_init(struct kqueue *kq __attribute__((unused))) { return (0); }


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

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

LLVM IR (-O0):
%struct.kqueue = type opaque
define i32 @posix_kqueue_init(%struct.kqueue* %0) {
%2 = alloca %struct.kqueue*
store %struct.kqueue* %0, %struct.kqueue** %2
ret i32 0
}

LLVM IR (-O2):
%struct.kqueue = type opaque
define i32 @posix_kqueue_init(%struct.kqueue* nocapture readnone %0) {
ret i32 0
}
void av_codec_set_seek_preroll() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_set_seek_preroll() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __sys_exit();
volatile void _exit(int exit_code) {
fake_volatile:
  __sys_exit();
  goto fake_volatile;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__sys_exit@plt>
jmp    111b <_exit+0xb>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__sys_exit@plt>
jmp    1120 <_exit+0x10>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = call i32 (...) @__sys_exit()
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @__sys_exit()
br label %2
}
/* Variables and functions */
void *malloc(size_t);
void *numa_alloc_onnode(size_t size, int node) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @numa_alloc_onnode(i64 %0, i32 %1) {
%3 = tail call i8* @malloc(i64 %0)
ret i8* %3
}
void m68k_init(void) {}


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

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

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

LLVM IR (-O2):
define void @m68k_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void fmt_convert_s24_to_s24(void *dest_v, void *src_v, int n) {
  memcpy(dest_v, src_v, n * sizeof(int32_t));
}


x86 assembly (clang, -O0):
<fmt_convert_s24_to_s24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_convert_s24_to_s24>:
shl    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @fmt_convert_s24_to_s24(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(i8* %7, i8* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @fmt_convert_s24_to_s24(i8* %0, i8* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret void
}
void foo435(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo435(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cputs(char const *);
int /*<<< orphan*/ putchar(char);
int puts(const char *s) {
  cputs(s);
  putchar('\r');
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cputs@plt>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1040 <cputs@plt>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cputs(i8* %3)
%5 = call i32 @putchar(i8 signext 13)
%6 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @cputs(i8* %0)
%3 = tail call i32 @putchar(i8 signext 13)
%4 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
int init_OpticsMaterials() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @init_OpticsMaterials() {
ret i32 0
}
void cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
           unsigned int *edx) {
  __asm volatile("cpuid\n\t"
                 : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
                 : "a"(*eax));
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cpuid
mov    %eax,%r9d
mov    -0x38(%rbp),%rax
mov    %ecx,%esi
mov    -0x30(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
push   %rbx
mov    %rcx,%r8
mov    %rdx,%r9
mov    (%rdi),%eax
cpuid
mov    %eax,(%rdi)
mov    %ebx,(%rsi)
mov    %ecx,(%r9)
mov    %edx,(%r8)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpuid(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = call { i32, i32, i32, i32 } asm sideeffect "cpuid\0A\09", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %14)
%16 = extractvalue { i32, i32, i32, i32 } %15, 0
%17 = extractvalue { i32, i32, i32, i32 } %15, 1
%18 = extractvalue { i32, i32, i32, i32 } %15, 2
%19 = extractvalue { i32, i32, i32, i32 } %15, 3
store i32 %16, i32* %9
store i32 %17, i32* %10
store i32 %18, i32* %11
store i32 %19, i32* %12
ret void
}

LLVM IR (-O2):
define void @cpuid(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid\0A\09", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %0
store i32 %8, i32* %1
store i32 %9, i32* %2
store i32 %10, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_array(int **, int);
int /*<<< orphan*/ print_array(int *, int);
int main() {
  int *arr = NULL, size = 16;
  create_array(&arr, size);
  print_array(arr, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x10,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    -0x10(%rbp),%rdi
call   1040 <create_array@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
mov    $0x10,%esi
call   1040 <create_array@plt>
mov    (%rsp),%rdi
mov    $0x10,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
store i32* null, i32** %1
%3 = call i32 @create_array(i32** %1, i32 16)
%4 = load i32*, i32** %1
%5 = call i32 @print_array(i32* %4, i32 16)
ret i32 0
}
void foo476() {}


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

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

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

LLVM IR (-O2):
define void @foo476() {
ret void
}
/* Variables and functions */
int read_mosaic_ncontacts(char const *);
int read_mosaic_ncontacts_(const char *mosaic_file) {
  return read_mosaic_ncontacts(mosaic_file);
}


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

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

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

LLVM IR (-O2):
define i32 @read_mosaic_ncontacts_(i8* %0) {
%2 = tail call i32 @read_mosaic_ncontacts(i8* %0)
ret i32 %2
}
void close_log(void) {}


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

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

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

LLVM IR (-O2):
define void @close_log() {
ret void
}
int yodel_initialize(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @yodel_initialize() {
ret i32 0
}
int _getpid(int n) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @_getpid(i32 %0) {
ret i32 1
}
int testUndefineSymbol() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @testUndefineSymbol() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ raise(int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void _lslp_term(int sig) {
  static int dieNow;
  if (dieNow)
    raise(sig);
  dieNow = 1;
  signal(sig, SIG_DFL);
  raise(sig);
}


x86 assembly (clang, -O0):
<_lslp_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,0x2f02(%rip)
je     1140 <_lslp_term+0x20>
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
movl   $0x1,0x2eea(%rip)
mov    -0x4(%rbp),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lslp_term>:
push   %rbx
mov    %edi,%ebx
cmpb   $0x1,0x2f0a(%rip)
jne    1133 <_lslp_term+0x13>
mov    %ebx,%edi
call   1030 <raise@plt>
movb   $0x1,0x2efa(%rip)
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <signal@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <raise@plt>

LLVM IR (-O0):
@_lslp_term.dieNow = internal global i32 0
@SIG_DFL = global i32 0
define void @_lslp_term(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @_lslp_term.dieNow
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @raise(i32 %6)
br label %8
8: ; preds = %5, %1
store i32 1, i32* @_lslp_term.dieNow
%9 = load i32, i32* %2
%10 = load i32, i32* @SIG_DFL
%11 = call i32 @signal(i32 %9, i32 %10)
%12 = load i32, i32* %2
%13 = call i32 @raise(i32 %12)
ret void
}

LLVM IR (-O2):
@_lslp_term.dieNow = internal unnamed_addr global i1 false
@SIG_DFL = global i32 0
define void @_lslp_term(i32 %0) {
%2 = load i1, i1* @_lslp_term.dieNow
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @raise(i32 %0)
br label %5
5: ; preds = %3, %1
store i1 true, i1* @_lslp_term.dieNow
%6 = load i32, i32* @SIG_DFL
%7 = tail call i32 @signal(i32 %0, i32 %6)
%8 = tail call i32 @raise(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eroare(char *);
void do_subrutina(void) {
  eroare(" din pacate nu am avut timp sa implementez subrutinele");
}


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

x86 assembly (clang, -O2):
<do_subrutina>:
lea    0xee9(%rip),%rdi
jmp    1030 <eroare@plt>

LLVM IR (-O0):
@.str = [55 x i8] c" din pacate nu am avut timp sa implementez subrutinele\00"
define void @do_subrutina() {
%1 = call i32 @eroare(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c" din pacate nu am avut timp sa implementez subrutinele\00"
define void @do_subrutina() {
%1 = tail call i32 @eroare(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, char *);
void my_setbuf(struct aFILE *fp, char *buf) { setbuf(_get_actual_fp(fp), buf); }


x86 assembly (clang, -O0):
<my_setbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_get_actual_fp@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <setbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_setbuf>:
push   %rbx
mov    %rsi,%rbx
call   1040 <_get_actual_fp@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <setbuf@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define void @my_setbuf(%struct.aFILE* %0, i8* %1) {
%3 = alloca %struct.aFILE*
%4 = alloca i8*
store %struct.aFILE* %0, %struct.aFILE** %3
store i8* %1, i8** %4
%5 = load %struct.aFILE*, %struct.aFILE** %3
%6 = call i32 @_get_actual_fp(%struct.aFILE* %5)
%7 = load i8*, i8** %4
%8 = call i32 @setbuf(i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define void @my_setbuf(%struct.aFILE* %0, i8* %1) {
%3 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%4 = tail call i32 @setbuf(i32 %3, i8* %1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h264nal_init(int *);
int /*<<< orphan*/ h264nal_set_ref(int *, int);
int /*<<< orphan*/ h264nal_set_type(int *, int);
void h264sps_init(uint8_t *p_h264sps) {
  h264nal_init(p_h264sps);
  h264nal_set_ref(p_h264sps, 1);
  h264nal_set_type(p_h264sps, 7);
  p_h264sps[5] = 0x0;
}


x86 assembly (clang, -O0):
<h264sps_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <h264nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <h264nal_set_ref@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
call   1040 <h264nal_set_type@plt>
mov    -0x8(%rbp),%rax
movl   $0x0,0x14(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264sps_init>:
push   %rbx
mov    %rdi,%rbx
call   1050 <h264nal_init@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <h264nal_set_ref@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <h264nal_set_type@plt>
movl   $0x0,0x14(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @h264sps_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h264nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h264nal_set_ref(i32* %5, i32 1)
%7 = load i32*, i32** %2
%8 = call i32 @h264nal_set_type(i32* %7, i32 7)
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 5
store i32 0, i32* %10
ret void
}

LLVM IR (-O2):
define void @h264sps_init(i32* %0) {
%2 = tail call i32 @h264nal_init(i32* %0)
%3 = tail call i32 @h264nal_set_ref(i32* %0, i32 1)
%4 = tail call i32 @h264nal_set_type(i32* %0, i32 7)
%5 = getelementptr inbounds i32, i32* %0, i64 5
store i32 0, i32* %5
ret void
}
int __attribute__((weak)) wdt_start(void) { return 0; }


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

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

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

LLVM IR (-O2):
define weak i32 @wdt_start() {
ret i32 0
}
struct ShmDescriptor *getp_shm_descriptor(void *p) {
  return (struct ShmDescriptor *)p;
}


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

x86 assembly (clang, -O2):
<getp_shm_descriptor>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.ShmDescriptor = type opaque
define %struct.ShmDescriptor* @getp_shm_descriptor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.ShmDescriptor*
ret %struct.ShmDescriptor* %4
}

LLVM IR (-O2):
%struct.ShmDescriptor = type opaque
define %struct.ShmDescriptor* @getp_shm_descriptor(i8* readnone %0) {
%2 = bitcast i8* %0 to %struct.ShmDescriptor*
ret %struct.ShmDescriptor* %2
}
__attribute__((always_)) void func2(int x) {
  x++;
  return;
}


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

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

LLVM IR (-O0):
define void @func2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}

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

/* Variables and functions */
uint16_t LCDIDDStatusRead(uint32_t ui32Base, uint32_t ui32CS) {
  uint32_t ui32Reg;
  ;
  ;
  ui32Reg = ui32CS ? 0x00000020 : 0x00000014;
  return ((uint16_t)(*((volatile unsigned long *)(ui32Base + ui32Reg))));
}


x86 assembly (clang, -O0):
<LCDIDDStatusRead>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x14,%eax
mov    $0x20,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIDDStatusRead>:
test   %esi,%esi
mov    $0x14,%eax
mov    $0x20,%ecx
cmove  %eax,%ecx
movslq %edi,%rax
mov    (%rcx,%rax,1),%rax
ret

LLVM IR (-O0):
define i32 @LCDIDDStatusRead(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 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 32, i32 20
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = add nsw i32 %10, %11
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @LCDIDDStatusRead(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 20, i32 32
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
double days_in_year(double y) {
  long yd = (long)y;
  if (yd % 4 != 0)
    return 365;
  if (yd % 100 != 0)
    return 366;
  if (yd % 400 != 0)
    return 365;
  return 366;
}


x86 assembly (clang, -O0):
<days_in_year>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     113d <days_in_year+0x3d>
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119e <days_in_year+0x9e>
mov    -0x18(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1167 <days_in_year+0x67>
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119e <days_in_year+0x9e>
mov    -0x18(%rbp),%rax
mov    $0x190,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1191 <days_in_year+0x91>
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119e <days_in_year+0x9e>
movsd  0xe67(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<days_in_year>:
cvttsd2si %xmm0,%rax
test   $0x3,%al
je     1112 <days_in_year+0x12>
movsd  0xeef(%rip),%xmm0
ret
movabs $0x8f5c28f5c28f5c29,%rcx
28 5c 8f
imul   %rcx,%rax
movabs $0x51eb851eb851eb8,%rcx
b8 1e 05
add    %rax,%rcx
ror    $0x2,%rcx
movabs $0x28f5c28f5c28f5c,%rdx
5c 8f 02
cmp    %rdx,%rcx
jbe    1149 <days_in_year+0x49>
movsd  0xec0(%rip),%xmm0
ret
movabs $0x51eb851eb851eb0,%rcx
b8 1e 05
add    %rcx,%rax
ror    $0x4,%rax
movabs $0xa3d70a3d70a3d7,%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setb   %dl
lea    0xe9d(%rip),%rax
movsd  (%rax,%rdx,8),%xmm0
ret

LLVM IR (-O0):
define double @days_in_year(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
%5 = load double, double* %3
%6 = fptosi double %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = srem i64 %7, 4
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store double 3.650000e+02, double* %2
br label %22
11: ; preds = %1
%12 = load i64, i64* %4
%13 = srem i64 %12, 100
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store double 3.660000e+02, double* %2
br label %22
16: ; preds = %11
%17 = load i64, i64* %4
%18 = srem i64 %17, 400
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
store double 3.650000e+02, double* %2
br label %22
21: ; preds = %16
store double 3.660000e+02, double* %2
br label %22
22: ; preds = %21, %20, %15, %10
%23 = load double, double* %2
ret double %23
}

LLVM IR (-O2):
define double @days_in_year(double %0) {
%2 = fptosi double %0 to i64
%3 = and i64 %2, 3
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = srem i64 %2, 100
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = srem i64 %2, 400
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, double 3.660000e+02, double 3.650000e+02
br label %12
12: ; preds = %8, %5, %1
%13 = phi double [ 3.650000e+02, %1 ], [ 3.660000e+02, %5 ], [ %11, %8 ]
ret double %13
}
int f(int x) { return x + 1; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
unsigned int ret_1() { return 1; }


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

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

LLVM IR (-O0):
define i32 @ret_1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ret_1() {
ret i32 1
}
int test_timer_perf(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_timer_perf() {
ret i32 0
}
/* Type definitions */
struct iommu_group {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int iommu_group_set_name(struct iommu_group *group, const char *name) {
  return -ENODEV;
}


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

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

LLVM IR (-O0):
%struct.iommu_group = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_group_set_name(%struct.iommu_group* %0, i8* %1) {
%3 = alloca %struct.iommu_group*
%4 = alloca i8*
store %struct.iommu_group* %0, %struct.iommu_group** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.iommu_group = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_group_set_name(%struct.iommu_group* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
unsigned int b64d_size(unsigned int in_size) { return ((3 * in_size) / 4); }


x86 assembly (clang, -O0):
<b64d_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
shr    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64d_size>:
lea    (%rdi,%rdi,2),%eax
shr    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @b64d_size(i32 %0) {
%2 = mul i32 %0, 3
%3 = lshr i32 %2, 2
ret i32 %3
}
void *foo() { return 0; }


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

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

LLVM IR (-O0):
define i8* @foo() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @foo() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stampa() {
  printf("Hello world!!!\n");
  return;
}


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

x86 assembly (clang, -O2):
<stampa>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [15 x i8] c"Hello world!!!\00"
define void @stampa() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_south();
int /*<<< orphan*/ do_west();
void do_south_west_corner(void) {
  do_south();
  do_west();
}


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

x86 assembly (clang, -O2):
<do_south_west_corner>:
push   %rax
xor    %eax,%eax
call   1040 <do_south@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <do_west@plt>

LLVM IR (-O0):
define void @do_south_west_corner() {
%1 = call i32 (...) @do_south()
%2 = call i32 (...) @do_west()
ret void
}

LLVM IR (-O2):
define void @do_south_west_corner() {
%1 = tail call i32 (...) @do_south()
%2 = tail call i32 (...) @do_west()
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int isIn(uint64_t sum, uint32_t *p) {
  for (; *p; p++) {
    if (sum == *p)
      return 1;
    if (sum < *p)
      return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isIn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     116a <isIn+0x6a>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jne    1137 <isIn+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1171 <isIn+0x71>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jge    1154 <isIn+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1171 <isIn+0x71>
jmp    1159 <isIn+0x59>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <isIn+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isIn>:
mov    (%rsi),%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1123 <isIn+0x23>
add    $0x8,%rsi
xchg   %ax,%ax
cmp    %rdi,%rcx
je     1124 <isIn+0x24>
jg     1123 <isIn+0x23>
mov    (%rsi),%rcx
add    $0x8,%rsi
test   %rcx,%rcx
jne    1110 <isIn+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isIn(i64 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
br label %6
6: ; preds = %23, %2
%7 = load i64*, i64** %5
%8 = load i64, i64* %7
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %6
%11 = load i64, i64* %4
%12 = load i64*, i64** %5
%13 = load i64, i64* %12
%14 = icmp eq i64 %11, %13
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %3
br label %27
16: ; preds = %10
%17 = load i64, i64* %4
%18 = load i64*, i64** %5
%19 = load i64, i64* %18
%20 = icmp slt i64 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 0, i32* %3
br label %27
22: ; preds = %16
br label %23
23: ; preds = %22
%24 = load i64*, i64** %5
%25 = getelementptr inbounds i64, i64* %24, i32 1
store i64* %25, i64** %5
br label %6
26: ; preds = %6
store i32 0, i32* %3
br label %27
27: ; preds = %26, %21, %15
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @isIn(i64 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %15, label %8
5: ; preds = %12
%6 = load i64, i64* %14
%7 = icmp eq i64 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %2, %5
%9 = phi i64 [ %6, %5 ], [ %3, %2 ]
%10 = phi i64* [ %14, %5 ], [ %1, %2 ]
%11 = icmp eq i64 %9, %0
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = icmp sgt i64 %9, %0
%14 = getelementptr inbounds i64, i64* %10, i64 1
br i1 %13, label %15, label %5
15: ; preds = %8, %12, %5, %2
%16 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 0, %12 ], [ 1, %8 ]
ret i32 %16
}
void empty() { return; }


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

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

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

LLVM IR (-O2):
define void @empty() {
ret void
}
int _max(int a, int b) {
  if (a >= b)
    return (a);
  return (b);
}


x86 assembly (clang, -O0):
<_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <_max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <_max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @_max(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* %4
%7 = load i32, i32* %5
%8 = icmp sge i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @_max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void do_dtemap(int argc, char *argv[], int start) {
  (void)argc;
  (void)argv;
  (void)start;
}


x86 assembly (clang, -O0):
<do_dtemap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_dtemap(i32 %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @do_dtemap(i32 %0, i8** nocapture %1, i32 %2) {
ret void
}