xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
scalar_t__ lastlog_path();
int open(char *, int /*<<< orphan*/);
int get_lastlog_fd(void) {
  static int ll_fd = -1;
  if (ll_fd == -1) {
    ll_fd = open((char *)lastlog_path(), O_RDONLY);
  }
  return (ll_fd);
}


x86 assembly (clang, -O0):
<get_lastlog_fd>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0xffffffff,0x2f05(%rip)
jne    114f <get_lastlog_fd+0x2f>
mov    $0x0,%al
call   1030 <lastlog_path@plt>
mov    %rax,%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,0x2ee1(%rip)
mov    0x2edb(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lastlog_fd>:
push   %rax
mov    0x2f09(%rip),%eax
cmp    $0xffffffff,%eax
je     112e <get_lastlog_fd+0xe>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <lastlog_path@plt>
mov    0x2eac(%rip),%rcx
mov    (%rcx),%esi
mov    %rax,%rdi
call   1040 <open@plt>
mov    %eax,0x2ee4(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@get_lastlog_fd.ll_fd = internal global i32 -1
@O_RDONLY = global i32 0
define i32 @get_lastlog_fd() {
%1 = load i32, i32* @get_lastlog_fd.ll_fd
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = call i64 (...) @lastlog_path()
%5 = inttoptr i64 %4 to i8*
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* @get_lastlog_fd.ll_fd
br label %8
8: ; preds = %3, %0
%9 = load i32, i32* @get_lastlog_fd.ll_fd
ret i32 %9
}

LLVM IR (-O2):
@get_lastlog_fd.ll_fd = internal unnamed_addr global i32 -1
@O_RDONLY = global i32 0
define i32 @get_lastlog_fd() {
%1 = load i32, i32* @get_lastlog_fd.ll_fd
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i64 (...) @lastlog_path()
%5 = inttoptr i64 %4 to i8*
%6 = load i32, i32* @O_RDONLY
%7 = tail call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* @get_lastlog_fd.ll_fd
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ %7, %3 ], [ %1, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_OV7725(unsigned short uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_OV7725>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_OV7725>:
movzbl %dil,%edi
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_OV7725(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = trunc i16 %5 to i8
%7 = load i16, i16* %4
%8 = trunc i16 %7 to i8
%9 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %6, i8 zeroext %8)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_OV7725(i16 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %0 to i8
%4 = trunc i16 %1 to i8
%5 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %3, i8 zeroext %4)
ret void
}
float average(float a, float b) { return (a + b) / 2; }


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  0xee0(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
addss  %xmm1,%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @average(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
%8 = fdiv float %7, 2.000000e+00
ret float %8
}

LLVM IR (-O2):
define float @average(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fmul float %3, 5.000000e-01
ret float %4
}
void g_hook_destroy() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_destroy() {
ret void
}
/* Variables and functions */
void *volatile_memset(void *, int /*<<< orphan*/, size_t);
void *memzero(void *s, size_t n) { return volatile_memset(s, 0, n); }


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

x86 assembly (clang, -O2):
<memzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <volatile_memset@plt>

LLVM IR (-O0):
define i8* @memzero(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 = load i64, i64* %4
%7 = call i8* @volatile_memset(i8* %5, i32 0, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @memzero(i8* %0, i64 %1) {
%3 = tail call i8* @volatile_memset(i8* %0, i32 0, i64 %1)
ret i8* %3
}
void GPMCPrefetchEngineEnable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) |=
      ((0x1u) << (0x00000007u));
}


x86 assembly (clang, -O0):
<GPMCPrefetchEngineEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCPrefetchEngineEnable>:
add    $0x1e0,%edi
orl    $0x80,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCPrefetchEngineEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 480
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 128
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @GPMCPrefetchEngineEnable(i32 %0) {
%2 = add i32 %0, 480
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 128
store volatile i32 %6, i32* %4
ret void
}
void fn12C8() { return; }


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

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

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

LLVM IR (-O2):
define void @fn12C8() {
ret void
}
/* Variables and functions */
int random();
int /*<<< orphan*/ srandomdev();
void getseed(char *seed, int seedsize) {
  int i;
  srandomdev();
  for (i = 0; i < seedsize; i++) {
    seed[i] = random() & 0xff;
  }
}


x86 assembly (clang, -O0):
<getseed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <srandomdev@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <getseed+0x50>
mov    $0x0,%al
call   1030 <random@plt>
and    $0xff,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <getseed+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getseed>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <srandomdev@plt>
test   %ebp,%ebp
jle    1154 <getseed+0x34>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <getseed+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @getseed(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (...) @srandomdev()
store i32 0, i32* %5
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = call i32 (...) @random()
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 %14, i8* %18
br label %19
19: ; preds = %11
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @getseed(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 (...) @srandomdev()
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = tail call i32 (...) @random()
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %10, i8* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t n) {
  const void *ends = (const char *)s + n;
  for (; s < ends; s++)
    if (*(const unsigned char *)s == (unsigned char)c)
      return (void *)s;
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1161 <memchr+0x61>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    114b <memchr+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <memchr+0x69>
jmp    1150 <memchr+0x50>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111b <memchr+0x1b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
jle    111e <memchr+0x1e>
mov    %rdi,%rax
add    %rdi,%rdx
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1120 <memchr+0x20>
add    $0x1,%rax
cmp    %rdx,%rax
jb     1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %2
%5 = icmp sgt i64 %2, 0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = trunc i32 %1 to i8
br label %8
8: ; preds = %6, %12
%9 = phi i8* [ %0, %6 ], [ %13, %12 ]
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %7
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = icmp ult i8* %13, %4
br i1 %14, label %8, label %15
15: ; preds = %8, %12, %3
%16 = phi i8* [ null, %3 ], [ null, %12 ], [ %9, %8 ]
ret i8* %16
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ build_prefixes(char **, struct node *, char *,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
void get_prefix_strings(char **prefix, struct node *prefix_tree) {
  char buf[4096];
  build_prefixes(prefix, prefix_tree, buf, 0, 0);
}


x86 assembly (clang, -O0):
<get_prefix_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x1010(%rbp),%rdx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <build_prefixes@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_prefix_strings>:
sub    $0x1008,%rsp
mov    %rsp,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <build_prefixes@plt>
add    $0x1008,%rsp
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @get_prefix_strings(i8** %0, %struct.node* %1) {
%3 = alloca i8**
%4 = alloca %struct.node*
%5 = alloca [4096 x i8]
store i8** %0, i8*** %3
store %struct.node* %1, %struct.node** %4
%6 = load i8**, i8*** %3
%7 = load %struct.node*, %struct.node** %4
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%9 = call i32 @build_prefixes(i8** %6, %struct.node* %7, i8* %8, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @get_prefix_strings(i8** %0, %struct.node* %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = call i32 @build_prefixes(i8** %0, %struct.node* %1, i8* %4, i32 0, i32 0)
ret void
}
int rt_thread_numphysprocessors(void) {
  int a = 1;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @rt_thread_numphysprocessors() {
ret i32 1
}
int secure_storage_emmc_write(char *buf, unsigned int len) { return -1; }


x86 assembly (clang, -O0):
<secure_storage_emmc_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @secure_storage_emmc_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @secure_storage_emmc_write(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
int ntsel_dosel(int mode) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ntsel_dosel(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t __synctory_byteswap_64(uint64_t value) {
  return ((value >> 56) | ((value >> 40) & (uint64_t)0xff00) |
          ((value >> 24) & (uint64_t)0xff0000) |
          ((value >> 8) & (uint64_t)0xff000000) |
          ((value << 8) & (uint64_t)0xff00000000) |
          ((value << 24) & (uint64_t)0xff0000000000) |
          ((value << 40) & (uint64_t)0xff000000000000) | (value << 56));
}


x86 assembly (clang, -O0):
<__synctory_byteswap_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0x0,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
and    $0x0,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
and    $0x0,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__synctory_byteswap_64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 56
%5 = load i32, i32* %2
%6 = ashr i32 %5, 40
%7 = and i32 %6, 65280
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 24
%11 = and i32 %10, 16711680
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = ashr i32 %13, 8
%15 = and i32 %14, -16777216
%16 = or i32 %12, %15
%17 = load i32, i32* %2
%18 = shl i32 %17, 8
%19 = and i32 %18, 0
%20 = or i32 %16, %19
%21 = load i32, i32* %2
%22 = shl i32 %21, 24
%23 = and i32 %22, 0
%24 = or i32 %20, %23
%25 = load i32, i32* %2
%26 = shl i32 %25, 40
%27 = and i32 %26, 0
%28 = or i32 %24, %27
%29 = load i32, i32* %2
%30 = shl i32 %29, 56
%31 = or i32 %28, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @__synctory_byteswap_64(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(unsigned int);
main() {
  signed char c = -1;
  unsigned u = (unsigned short)c;
  f(u);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xff,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
movzwl %ax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffff,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i8 -1, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i16
%6 = zext i16 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @f(i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 65535)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void glmXor3v(bool out[3], const bool x[3], const bool y[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = x[i] != y[i];
}


x86 assembly (clang, -O0):
<glmXor3v>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3,-0x20(%rbp)
jae    115d <glmXor3v+0x5d>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <glmXor3v+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmXor3v>:
mov    (%rsi),%eax
xor    %ecx,%ecx
cmp    (%rdx),%eax
setne  %cl
mov    %ecx,(%rdi)
mov    0x4(%rsi),%eax
xor    %ecx,%ecx
cmp    0x4(%rdx),%eax
setne  %cl
mov    %ecx,0x4(%rdi)
mov    0x8(%rsi),%eax
xor    %ecx,%ecx
cmp    0x8(%rdx),%eax
setne  %cl
mov    %ecx,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @glmXor3v(i32* nocapture writeonly %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
%7 = zext i1 %6 to i32
store i32 %7, i32* %0
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %2, i64 1
%11 = load i32, i32* %10
%12 = icmp ne i32 %9, %11
%13 = zext i1 %12 to i32
%14 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds i32, i32* %1, i64 2
%16 = load i32, i32* %15
%17 = getelementptr inbounds i32, i32* %2, i64 2
%18 = load i32, i32* %17
%19 = icmp ne i32 %16, %18
%20 = zext i1 %19 to i32
%21 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %20, i32* %21
ret void
}
int block_cli_if_desc_update_post_fault_lock_component_release() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @block_cli_if_desc_update_post_fault_lock_component_release() {
ret i32 1
}
int Q_islower(int c) {
  if ((c >= 'a') && (c <= 'z')) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<Q_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <Q_islower+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <Q_islower+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <Q_islower+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Q_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned int inventory_size();
unsigned int xiag_module_inventory_size(void *handle) {
  (void)handle;
  return inventory_size();
}


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

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

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

LLVM IR (-O2):
define i32 @xiag_module_inventory_size(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @inventory_size()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ jstp_tx_char(char);
void jstp_tx_obj_begin() { jstp_tx_char('{'); }


x86 assembly (clang, -O0):
<jstp_tx_obj_begin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7b,%edi
call   1030 <jstp_tx_char@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jstp_tx_obj_begin>:
mov    $0x7b,%edi
jmp    1030 <jstp_tx_char@plt>

LLVM IR (-O0):
define void @jstp_tx_obj_begin() {
%1 = call i32 @jstp_tx_char(i8 signext 123)
ret void
}

LLVM IR (-O2):
define void @jstp_tx_obj_begin() {
%1 = tail call i32 @jstp_tx_char(i8 signext 123)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void set_laptop_mode(void) {
  FILE *file;
  file = fopen("/proc/sys/vm/laptop_mode", "w");
  if (!file)
    return;
  fprintf(file, "5\n");
  fclose(file);
}


x86 assembly (clang, -O0):
<set_laptop_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115f <set_laptop_mode+0x2f>
jmp    1178 <set_laptop_mode+0x48>
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_laptop_mode>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     116e <set_laptop_mode+0x3e>
mov    %rax,%rbx
lea    0xec8(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"/proc/sys/vm/laptop_mode\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"5\0A\00"
define void @set_laptop_mode() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
br label %11
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %1
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/proc/sys/vm/laptop_mode\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"5\0A\00"
define void @set_laptop_mode() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %0, %3
ret void
}
void foo010(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo010(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *stringTreeRealloc_(int /*<<< orphan*/ *, size_t);
void *__attribute__((malloc)) stringTreeMalloc_(size_t size) {
  assert(size > 0);
  return stringTreeRealloc_(NULL, size);
}


x86 assembly (clang, -O0):
<stringTreeMalloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <stringTreeRealloc_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringTreeMalloc_>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <stringTreeRealloc_@plt>

LLVM IR (-O0):
define noalias i8* @stringTreeMalloc_(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ugt i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i64, i64* %2
%8 = call i8* @stringTreeRealloc_(i32* null, i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @stringTreeMalloc_(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @stringTreeRealloc_(i32* null, i64 %0)
ret i8* %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ unknown_function();
uint32_t unknown_nat() {
  uint32_t x = unknown_function();
  if (x >= 0) {
    return x;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<unknown_nat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unknown_function@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     113b <unknown_nat+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1143 <unknown_nat+0x33>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown_nat>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <unknown_function@plt>
test   %rax,%rax
cmovs  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @unknown_nat() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @unknown_function()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp sge i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i64, i64* %2
store i64 %7, i64* %1
br label %9
8: ; preds = %0
store i64 0, i64* %1
br label %9
9: ; preds = %8, %6
%10 = load i64, i64* %1
ret i64 %10
}

LLVM IR (-O2):
define i64 @unknown_nat() {
%1 = tail call i64 (...) @unknown_function()
%2 = icmp sgt i64 %1, 0
%3 = select i1 %2, i64 %1, i64 0
ret i64 %3
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t fBlaMka(uint64_t x, uint64_t y) {
  uint32_t lessX = (uint32_t)x;
  uint32_t lessY = (uint32_t)y;
  uint64_t lessZ = (uint64_t)lessX;
  lessZ = lessZ * lessY;
  lessZ = lessZ << 1;
  uint64_t z = lessZ + x + y;
  return z;
}


x86 assembly (clang, -O0):
<fBlaMka>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fBlaMka>:
mov    %edi,%eax
imul   %esi,%eax
add    %edi,%esi
lea    (%rsi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @fBlaMka(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
store i32 %9, i32* %5
%10 = load i32, i32* %4
store i32 %10, i32* %6
%11 = load i32, i32* %5
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = shl i32 %15, 1
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %4
%21 = add nsw i32 %19, %20
store i32 %21, i32* %8
%22 = load i32, i32* %8
ret i32 %22
}

LLVM IR (-O2):
define i32 @fBlaMka(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = mul i32 %3, %1
%5 = add i32 %1, %0
%6 = add i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int drv_X11_list(void) {
  printf("any X11 server");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"any X11 server\00"
define i32 @drv_X11_list() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"any X11 server\00"
define i32 @drv_X11_list() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct _icmAlloc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void icmAllocStd_free(struct _icmAlloc *pp, void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<icmAllocStd_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct._icmAlloc = type { i32 }
define void @icmAllocStd_free(%struct._icmAlloc* %0, i8* %1) {
%3 = alloca %struct._icmAlloc*
%4 = alloca i8*
store %struct._icmAlloc* %0, %struct._icmAlloc** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
%struct._icmAlloc = type { i32 }
define void @icmAllocStd_free(%struct._icmAlloc* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void move2_(x, y) float *x, *y;
{ move(*x, *y, 0.0); }


x86 assembly (clang, -O0):
<move2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
call   1030 <move@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move2_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <move@plt>

LLVM IR (-O0):
define void @move2_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = call i32 (double, double, double, ...) bitcast (i32 (...)* @move to i32 (double, double, double, ...)*)(double %7, double %10, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @move2_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = fpext float %3 to double
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @move to i32 (double, double, double, ...)*)(double %4, double %6, double 0.000000e+00)
ret void
}
/* Variables and functions */
double cos(int);
double derivativeFunc(double x, double v2, double Psi) {
  return (1 + v2 * cos(2 * (x - Psi)) * 2);
}


x86 assembly (clang, -O0):
<derivativeFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  0xec5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
movsd  0xe98(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derivativeFunc>:
push   %rax
movsd  %xmm1,(%rsp)
subsd  %xmm2,%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
addsd  %xmm0,%xmm0
addsd  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @derivativeFunc(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %4
%9 = load double, double* %6
%10 = fsub double %8, %9
%11 = fmul double 2.000000e+00, %10
%12 = fptosi double %11 to i32
%13 = call double @cos(i32 %12)
%14 = fmul double %7, %13
%15 = call double @llvm.fmuladd.f64(double %14, double 2.000000e+00, double 1.000000e+00)
ret double %15
}

LLVM IR (-O2):
define double @derivativeFunc(double %0, double %1, double %2) {
%4 = fsub double %0, %2
%5 = fmul double %4, 2.000000e+00
%6 = fptosi double %5 to i32
%7 = tail call double @cos(i32 %6)
%8 = fmul double %7, %1
%9 = tail call double @llvm.fmuladd.f64(double %8, double 2.000000e+00, double 1.000000e+00)
ret double %9
}
void chomp(char *i) {
  while (*i != '\0' && *i != '\n') {
    i++;
  }
  *i = '\0';
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <chomp+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <chomp+0x3d>
jmp    114e <chomp+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <chomp+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <chomp+0x11>
cmp    $0xa,%al
je     1111 <chomp+0x11>
add    $0x1,%rdi
jmp    1100 <chomp>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @chomp(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int case_ignore_strcmp(char const *, char const *);
int avltree_case_ignore_strcmpr(const char *s1, const char *s2) {
  return -(case_ignore_strcmp(s1, s2));
}


x86 assembly (clang, -O0):
<avltree_case_ignore_strcmpr>:
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 <case_ignore_strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avltree_case_ignore_strcmpr>:
push   %rax
call   1030 <case_ignore_strcmp@plt>
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @avltree_case_ignore_strcmpr(i8* %0, i8* %1) {
%3 = tail call i32 @case_ignore_strcmp(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ runParsing();
int main(int agv, const char *ags[]) {
  runParsing();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @runParsing()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ALmodulatorState_Delete(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @ALmodulatorState_Delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello Yocto\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello Yocto\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void my_match_callback(char *path, int out_i, char *value, void *userdata) {
  printf("%s:\n", path);
  printf("(%d): %s\n", out_i, value);
}


x86 assembly (clang, -O0):
<my_match_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_match_callback>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%rsi
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s:\0A\00"
@.str.1 = [10 x i8] c"(%d): %s\0A\00"
define void @my_match_callback(i8* %0, i32 %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ divisible(unsigned long);
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long i = 20;
  while (!divisible(i)) {
    i += 20;
  }
  printf("%lu\n", i);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x14,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <divisible@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1155 <main+0x35>
jmp    1166 <main+0x46>
mov    -0x10(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
mov    -0x10(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x14,%rbx
mov    %rbx,%rdi
call   1040 <divisible@plt>
test   %eax,%eax
je     1130 <main+0x10>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 20, i64* %2
br label %3
3: ; preds = %8, %0
%4 = load i64, i64* %2
%5 = call i32 @divisible(i64 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i64, i64* %2
%10 = add i64 %9, 20
store i64 %10, i64* %2
br label %3
11: ; preds = %3
%12 = load i64, i64* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 20, %0 ], [ %5, %1 ]
%3 = tail call i32 @divisible(i64 %2)
%4 = icmp eq i32 %3, 0
%5 = add i64 %2, 20
br i1 %4, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
int ftw_stub(const char *fpath, const struct stat *sb, int typeflag) {
  return 0;
}


x86 assembly (clang, -O0):
<ftw_stub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @ftw_stub(i8* %0, %struct.stat* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.stat*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.stat* %1, %struct.stat** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @ftw_stub(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1, i32 %2) {
ret i32 0
}
int main(void) {
  volatile int x1 = 1;
  volatile int x2 = 1;
  int x3 = 2;
  int t = 1;
  t = 3 <= (x2 | 1 | x3 | x1 - 1U);
  if (t == 1) {
  } else {
    __builtin_abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
or     $0x1,%ecx
or     -0x10(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
or     %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    116d <main+0x5d>
jmp    1172 <main+0x62>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x1,-0x4(%rsp)
movl   $0x1,-0x8(%rsp)
mov    -0x8(%rsp),%eax
mov    -0x4(%rsp),%eax
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store volatile i32 1, i32* %2
store volatile i32 1, i32* %3
store i32 2, i32* %4
store i32 1, i32* %5
%6 = load volatile i32, i32* %3
%7 = or i32 %6, 1
%8 = load i32, i32* %4
%9 = or i32 %7, %8
%10 = load volatile i32, i32* %2
%11 = sub i32 %10, 1
%12 = or i32 %9, %11
%13 = icmp ule i32 3, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %0
br label %19
18: ; preds = %0
unreachable
19: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store volatile i32 1, i32* %2
%5 = load volatile i32, i32* %2
%6 = load volatile i32, i32* %1
ret i32 0
}