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

/* Variables and functions */
uint64_t RotateByAtLeast1(uint64_t val, int shift) {
  return (val >> shift) | (val << (64 - shift));
}


x86 assembly (clang, -O0):
<RotateByAtLeast1>:
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    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @RotateByAtLeast1(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 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @RotateByAtLeast1(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void CRYPTO_add_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_add_lock() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ nxweb_continue_as_daemon(char const *, char const *);
scalar_t__ nxweb_relauncher(void (*)(), char const *);
int /*<<< orphan*/ sleep(int);
int nxweb_run_daemon(const char *work_dir, const char *log_file,
                     const char *pid_file, void (*main_func)()) {
  nxweb_continue_as_daemon(work_dir, log_file);
  while (nxweb_relauncher(main_func, pid_file))
    sleep(2);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<nxweb_run_daemon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <nxweb_continue_as_daemon@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <nxweb_relauncher@plt>
cmp    $0x0,%rax
je     117b <nxweb_run_daemon+0x4b>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1155 <nxweb_run_daemon+0x25>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nxweb_run_daemon>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
call   1030 <nxweb_continue_as_daemon@plt>
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <nxweb_relauncher@plt>
test   %rax,%rax
je     115c <nxweb_run_daemon+0x2c>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1140 <nxweb_run_daemon+0x10>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @nxweb_run_daemon(i8* %0, i8* %1, i8* %2, void (...)* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca void (...)*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store void (...)* %3, void (...)** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @nxweb_continue_as_daemon(i8* %9, i8* %10)
br label %12
12: ; preds = %17, %4
%13 = load void (...)*, void (...)** %8
%14 = load i8*, i8** %7
%15 = call i64 @nxweb_relauncher(void (...)* %13, i8* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = call i32 @sleep(i32 2)
br label %12
19: ; preds = %12
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @nxweb_run_daemon(i8* %0, i8* %1, i8* %2, void (...)* %3) {
%5 = tail call i32 @nxweb_continue_as_daemon(i8* %0, i8* %1)
%6 = tail call i64 @nxweb_relauncher(void (...)* %3, i8* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %4, %8
%9 = tail call i32 @sleep(i32 2)
%10 = tail call i64 @nxweb_relauncher(void (...)* %3, i8* %2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %8
12: ; preds = %8, %4
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ loff_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, int /*<<< orphan*/ *, int,
                           int /*<<< orphan*/ *, size_t, unsigned int);
loff_t copy_file_range(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out,
                       size_t len, unsigned int flags) {
  return syscall(326, fd_in, off_in, fd_out, off_out, len, flags);
}


x86 assembly (clang, -O0):
<copy_file_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
mov    $0x146,%edi
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_file_range>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    %r9d,(%rsp)
mov    $0x146,%edi
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @copy_file_range(i32 %0, i32* %1, i32 %2, i32* %3, i64 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i64
%12 = alloca i32
store i32 %0, i32* %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i64 %4, i64* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32*, i32** %8
%15 = load i32, i32* %9
%16 = load i32*, i32** %10
%17 = load i64, i64* %11
%18 = load i32, i32* %12
%19 = call i32 @syscall(i32 326, i32 %13, i32* %14, i32 %15, i32* %16, i64 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @copy_file_range(i32 %0, i32* %1, i32 %2, i32* %3, i64 %4, i32 %5) {
%7 = tail call i32 @syscall(i32 326, i32 %0, i32* %1, i32 %2, i32* %3, i64 %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
int GetPindex();
int floor(int);
int Ycoord(int zI) {
  int y;
  if (zI >= GetPindex())
    zI++;
  if (19 % 2 == 1)
    y = floor(zI / 19) - floor(19 / 2);
  else
    y = floor(zI / 19) - (19 / 2 - 1);
  return y;
}


x86 assembly (clang, -O0):
<Ycoord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <GetPindex@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jl     114e <Ycoord+0x2e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x13,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <floor@plt>
mov    %eax,-0x10(%rbp)
mov    $0x9,%edi
call   1040 <floor@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ycoord>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <GetPindex@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setle  %cl
add    %ebx,%ecx
movslq %ecx,%rax
imul   $0x6bca1af3,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x23,%rdi
add    %eax,%edi
call   1040 <floor@plt>
mov    %eax,%ebx
mov    $0x9,%edi
call   1040 <floor@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Ycoord(i32 %0) {
%2 = tail call i32 (...) @GetPindex()
%3 = icmp sle i32 %2, %0
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %0
%6 = sdiv i32 %5, 19
%7 = tail call i32 @floor(i32 %6)
%8 = tail call i32 @floor(i32 9)
%9 = sub nsw i32 %7, %8
ret i32 %9
}
int omp_get_dynamic(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omp_get_dynamic() {
ret i32 0
}
void FPUStackingDisable(void) {
  (*((volatile unsigned long *)(0xE000EF34))) &= ~(0x80000000 | 0x40000000);
}


x86 assembly (clang, -O0):
<FPUStackingDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ef34,%eax
mov    (%rax),%rcx
and    $0x3fffffff,%rcx
mov    $0xe000ef34,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPUStackingDisable>:
mov    $0xe000ef34,%eax
andq   $0x3fffffff,(%rax)
ret

LLVM IR (-O0):
define void @FPUStackingDisable() {
%1 = load volatile i64, i64* inttoptr (i64 3758157620 to i64*)
%2 = and i64 %1, 1073741823
store volatile i64 %2, i64* inttoptr (i64 3758157620 to i64*)
ret void
}

LLVM IR (-O2):
define void @FPUStackingDisable() {
%1 = load volatile i64, i64* inttoptr (i64 3758157620 to i64*)
%2 = and i64 %1, 1073741823
store volatile i64 %2, i64* inttoptr (i64 3758157620 to i64*)
ret void
}
void darken_output(void *data, unsigned *out_width, unsigned *out_height,
                   unsigned width, unsigned height) {
  *out_width = width;
  *out_height = height;
}


x86 assembly (clang, -O0):
<darken_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<darken_output>:
mov    %ecx,(%rsi)
mov    %r8d,(%rdx)
ret

LLVM IR (-O0):
define void @darken_output(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32, i32* %10
%14 = load i32*, i32** %8
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @darken_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
store i32 %3, i32* %1
store i32 %4, i32* %2
ret void
}
void dynmem_pass_1_ptr_(int *iarg, float *arg_ptr, float ***mr_ptrs_ptr) {
  int iarg_c = *iarg - 1;
  float **mr_ptrs;
  mr_ptrs = *mr_ptrs_ptr;
  mr_ptrs[iarg_c] = arg_ptr;
}


x86 assembly (clang, -O0):
<dynmem_pass_1_ptr_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynmem_pass_1_ptr_>:
movslq (%rdi),%rax
mov    (%rdx),%rcx
mov    %rsi,-0x8(%rcx,%rax,8)
ret

LLVM IR (-O0):
define void @dynmem_pass_1_ptr_(i32* %0, float* %1, float*** %2) {
%4 = alloca i32*
%5 = alloca float*
%6 = alloca float***
%7 = alloca i32
%8 = alloca float**
store i32* %0, i32** %4
store float* %1, float** %5
store float*** %2, float**** %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %7
%12 = load float***, float**** %6
%13 = load float**, float*** %12
store float** %13, float*** %8
%14 = load float*, float** %5
%15 = load float**, float*** %8
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float*, float** %15, i64 %17
store float* %14, float** %18
ret void
}

LLVM IR (-O2):
define void @dynmem_pass_1_ptr_(i32* nocapture %0, float* %1, float*** nocapture %2) {
%4 = load i32, i32* %0
%5 = add nsw i32 %4, -1
%6 = load float**, float*** %2
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds float*, float** %6, i64 %7
store float* %1, float** %8
ret void
}
void g_node_get_root() {}


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

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

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

LLVM IR (-O2):
define void @g_node_get_root() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _nl_auto_free_fcn(void *v) {
  if (*((void **)v))
    free(*((void **)v));
}


x86 assembly (clang, -O0):
<_nl_auto_free_fcn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <_nl_auto_free_fcn+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nl_auto_free_fcn>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <_nl_auto_free_fcn+0xd>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @_nl_auto_free_fcn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @_nl_auto_free_fcn(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %1
ret void
}
void ft_swap(int *a, int *b) {
  int temp;
  temp = *a;
  *a = *b;
  *b = temp;
}


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

x86 assembly (clang, -O2):
<ft_swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @ft_swap(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** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @ft_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
int test_imm_ECint64_lowword_mem(long long *val) {
  return ((*val) & (0xEC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ECint64_lowword_mem>:
testb  $0xec,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ECint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 236
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dump_info(unsigned int *, int, char *);
void data_abort_handler(unsigned int *context) {
  dump_info(context, 8, "Data Abort");
}


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

x86 assembly (clang, -O2):
<data_abort_handler>:
lea    0xee9(%rip),%rdx
mov    $0x8,%esi
jmp    1030 <dump_info@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Data Abort\00"
define void @data_abort_handler(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @dump_info(i32* %3, i32 8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Data Abort\00"
define void @data_abort_handler(i32* %0) {
%2 = tail call i32 @dump_info(i32* %0, i32 8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ QuaternionInverse(float *, float *);
int /*<<< orphan*/ QuaternionMult(float *, float *, float *);
double acosf(float);
float QuaternionAngle(float pfQIn1[4], float pfQIn2[4]) {
  float pfQInv[4];
  float pfQProd[4];
  QuaternionInverse(pfQInv, pfQIn1);
  QuaternionMult(pfQProd, pfQIn2, pfQInv);
  return (acosf(pfQProd[0]) * 2.0);
}


x86 assembly (clang, -O0):
<QuaternionAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <QuaternionInverse@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <QuaternionMult@plt>
movss  -0x30(%rbp),%xmm0
call   1030 <acosf@plt>
movsd  0xe90(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuaternionAngle>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1040 <QuaternionInverse@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <QuaternionMult@plt>
movss  (%rsp),%xmm0
call   1030 <acosf@plt>
addsd  %xmm0,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float @QuaternionAngle(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [4 x float]
%6 = alloca [4 x float]
store float* %0, float** %3
store float* %1, float** %4
%7 = getelementptr inbounds [4 x float], [4 x float]* %5, i64 0, i64 0
%8 = load float*, float** %3
%9 = call i32 @QuaternionInverse(float* %7, float* %8)
%10 = getelementptr inbounds [4 x float], [4 x float]* %6, i64 0, i64 0
%11 = load float*, float** %4
%12 = getelementptr inbounds [4 x float], [4 x float]* %5, i64 0, i64 0
%13 = call i32 @QuaternionMult(float* %10, float* %11, float* %12)
%14 = getelementptr inbounds [4 x float], [4 x float]* %6, i64 0, i64 0
%15 = load float, float* %14
%16 = call double @acosf(float %15)
%17 = fmul double %16, 2.000000e+00
%18 = fptrunc double %17 to float
ret float %18
}

LLVM IR (-O2):
define float @QuaternionAngle(float* %0, float* %1) {
%3 = alloca [4 x float]
%4 = alloca [4 x float]
%5 = bitcast [4 x float]* %3 to i8*
%6 = bitcast [4 x float]* %4 to i8*
%7 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%8 = call i32 @QuaternionInverse(float* %7, float* %0)
%9 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 0
%10 = call i32 @QuaternionMult(float* %9, float* %1, float* %7)
%11 = load float, float* %9
%12 = call double @acosf(float %11)
%13 = fmul double %12, 2.000000e+00
%14 = fptrunc double %13 to float
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void sayname(char *name) { printf("My name is %s!\n", name); }


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

x86 assembly (clang, -O2):
<sayname>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"My name is %s!\0A\00"
define void @sayname(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("当前进程ID：%d\n", getpid());
  printf("当前进程的父进程ID：%d\n", getppid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\E5\BD\93\E5\89\8D\E8\BF\9B\E7\A8\8BID\EF\BC\9A%d\0A\00"
@.str.1 = [33 x i8] c"\E5\BD\93\E5\89\8D\E8\BF\9B\E7\A8\8B\E7\9A\84\E7\88\B6\E8\BF\9B\E7\A8\8BID\EF\BC\9A%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @getppid()
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\E5\BD\93\E5\89\8D\E8\BF\9B\E7\A8\8BID\EF\BC\9A%d\0A\00"
@.str.1 = [33 x i8] c"\E5\BD\93\E5\89\8D\E8\BF\9B\E7\A8\8B\E7\9A\84\E7\88\B6\E8\BF\9B\E7\A8\8BID\EF\BC\9A%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
__attribute__((no)) void bar(int *x) { asm volatile("" : "=m"(x)::); }


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

x86 assembly (clang, -O2):
<bar>:
mov    %rdi,-0x8(%rsp)
ret

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

LLVM IR (-O2):
define void @bar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret void
}
int test_imm_AFuint16_mem(unsigned short *val) {
  return ((*val) & (0xAF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AFuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xaf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_AFuint16_mem>:
testb  $0xaf,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_AFuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 175
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double mat_Dabs(const double a) {
  if (a < 0.0)
    return -a;
  else
    return a;
}


x86 assembly (clang, -O0):
<mat_Dabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <mat_Dabs+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <mat_Dabs+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_Dabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mat_Dabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @mat_Dabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int write(int, void const *, size_t);
int sock_write(int fd, const void *buf, size_t size) {
  int ret;
  ret = write(fd, buf, size);
  if (ret == -1) {
    ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<sock_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1147 <sock_write+0x37>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_write>:
push   %rax
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @sock_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
%6 = select i1 %5, i32 0, i32 %4
ret i32 %6
}
RX0RX1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (p0[x0]) = (p1[x1]); }


x86 assembly (clang, -O0):
<RX0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0RX1>:
movslq %ecx,%rax
mov    (%r9,%rax,1),%al
movslq %edx,%rcx
mov    %al,(%r8,%rcx,1)
ret

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

LLVM IR (-O2):
define i32 @RX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4, i8* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i8, i8* %4, i64 %10
store i8 %9, i8* %11
ret i32 undef
}
/* Variables and functions */
scalar_t__ strchr(char const *, char const);
char *strpbrk(const char *s1, const char *s2) {
  for (; *s1; s1++) {
    if (strchr(s2, *s1) != 0)
      return ((char *)s1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<strpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <strpbrk+0x5a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1154 <strpbrk+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <strpbrk+0x62>
jmp    1159 <strpbrk+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <strpbrk+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpbrk>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113c <strpbrk+0x2c>
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    113e <strpbrk+0x2e>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strpbrk+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strpbrk(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = tail call i64 @strchr(i8* %1, i8 signext %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
int test_imm_96uint16_reg(unsigned short val) {
  return ((val) & (-0x96 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_96uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff6a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_96uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -150
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void or_die(int b, const char *msg) {
  if (b == 0) {
    fputs(msg, stderr);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1155 <or_die+0x35>
mov    -0x10(%rbp),%rdi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_die>:
test   %edi,%edi
je     1125 <or_die+0x5>
ret
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %rsi,%rdi
mov    %eax,%esi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @or_die(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* %8, i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @or_die(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* %1, i32 %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solve_dobldobl_Laurent_system(int *root_count, int silent, int nbtasks) {
  int fail;
  int b[2];
  double *c;
  b[0] = silent;
  b[1] = nbtasks;
  fail = _ada_use_c2phc(701, root_count, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solve_dobldobl_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x2bd,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_dobldobl_Laurent_system>:
push   %rax
mov    %rdi,%rax
mov    %esi,(%rsp)
mov    %edx,0x4(%rsp)
mov    %rsp,%rdx
mov    $0x2bd,%edi
mov    %rax,%rsi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solve_dobldobl_Laurent_system(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [2 x i32]
%9 = alloca double*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
store i32 %12, i32* %13
%14 = load i32*, i32** %4
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%16 = load double*, double** %9
%17 = call i32 @_ada_use_c2phc(i32 701, i32* %14, i32* %15, double* %16)
store i32 %17, i32* %7
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @solve_dobldobl_Laurent_system(i32* %0, i32 %1, i32 %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %1, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %2, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 701, i32* %0, i32* %6, double* undef)
ret i32 %8
}
/* Variables and functions */
double log10(double);
float silk_log2(double x) { return (float)(3.32192809488736 * log10(x)); }


x86 assembly (clang, -O0):
<silk_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<silk_log2>:
push   %rax
call   1030 <log10@plt>
mulsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @silk_log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log10(double %3)
%5 = fmul double 0x400A934F0979A36C, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @silk_log2(double %0) {
%2 = tail call double @log10(double %0)
%3 = fmul double %2, 0x400A934F0979A36C
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int getansensor(int, int);
int /*<<< orphan*/ setmotor(int, int);
int setvoltage(int, int /*<<< orphan*/);
void main() {
  int v;
  setmotor(3, 50);
  while (getansensor(2, 3) < 10)
    ;
  v = setvoltage(4, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x32,%esi
call   1040 <setmotor@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <getansensor@plt>
cmp    $0xa,%eax
jge    1164 <main+0x34>
jmp    1147 <main+0x17>
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <setvoltage@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x32,%esi
call   1040 <setmotor@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <getansensor@plt>
cmp    $0xa,%eax
jl     1140 <main+0x10>
mov    $0x4,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <setvoltage@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 @setmotor(i32 3, i32 50)
br label %3
3: ; preds = %6, %0
%4 = call i32 @getansensor(i32 2, i32 3)
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = call i32 @setvoltage(i32 4, i32 0)
store i32 %8, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @setmotor(i32 3, i32 50)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @getansensor(i32 2, i32 3)
%4 = icmp slt i32 %3, 10
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @setvoltage(i32 4, i32 0)
ret void
}
/* Type definitions */
struct S_ELEMENT {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destructors_ops_solver_DG(struct S_ELEMENT *const);
int /*<<< orphan*/ destructors_ops_solver_HDG(struct S_ELEMENT *const);
void destructors_ops_solver(struct S_ELEMENT *const ELEMENT) {
  destructors_ops_solver_DG(ELEMENT);
  destructors_ops_solver_HDG(ELEMENT);
}


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

x86 assembly (clang, -O2):
<destructors_ops_solver>:
push   %rbx
mov    %rdi,%rbx
call   1040 <destructors_ops_solver_DG@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <destructors_ops_solver_HDG@plt>

LLVM IR (-O0):
%struct.S_ELEMENT = type { i32 }
define void @destructors_ops_solver(%struct.S_ELEMENT* %0) {
%2 = alloca %struct.S_ELEMENT*
store %struct.S_ELEMENT* %0, %struct.S_ELEMENT** %2
%3 = load %struct.S_ELEMENT*, %struct.S_ELEMENT** %2
%4 = call i32 @destructors_ops_solver_DG(%struct.S_ELEMENT* %3)
%5 = load %struct.S_ELEMENT*, %struct.S_ELEMENT** %2
%6 = call i32 @destructors_ops_solver_HDG(%struct.S_ELEMENT* %5)
ret void
}

LLVM IR (-O2):
%struct.S_ELEMENT = type { i32 }
define void @destructors_ops_solver(%struct.S_ELEMENT* %0) {
%2 = tail call i32 @destructors_ops_solver_DG(%struct.S_ELEMENT* %0)
%3 = tail call i32 @destructors_ops_solver_HDG(%struct.S_ELEMENT* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  char *usagestring;
  usagestring =
      "Usage: rhnsd [OPTION...] \nSpacewalk Services Daemon \n \n  -f, "
      "--foreground           Run in foreground \n  -i, --interval=MINS        "
      "Connect to Spacewalk every MINS minutes \n  -v, --verbose              "
      "Log all actions to syslog \n  -h, --help                 Give this help "
      "list \n  -u, --usage                Give this help list \n  -V, "
      "--version              Print program version \n \nMandatory or optional "
      "arguments to long options are also mandatory or optional \nfor any "
      "corresponding short options.\n";
  fprintf(stderr, usagestring);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [501 x i8] c"Usage: rhnsd [OPTION...] \0ASpacewalk Services Daemon \0A \0A -f, --foreground Run in foreground \0A -i, --interval=MINS Connect to Spacewalk every MINS minutes \0A -v, --verbose Log all actions to syslog \0A -h, --help Give this help list \0A -u, --usage Give this help list \0A -V, --version Print program version \0A \0AMandatory or optional arguments to long options are also mandatory or optional \0Afor any corresponding short options.\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = alloca i8*
store i8* getelementptr inbounds ([501 x i8], [501 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %1
%4 = call i32 @fprintf(i32 %2, i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [501 x i8] c"Usage: rhnsd [OPTION...] \0ASpacewalk Services Daemon \0A \0A -f, --foreground Run in foreground \0A -i, --interval=MINS Connect to Spacewalk every MINS minutes \0A -v, --verbose Log all actions to syslog \0A -h, --help Give this help list \0A -u, --usage Give this help list \0A -V, --version Print program version \0A \0AMandatory or optional arguments to long options are also mandatory or optional \0Afor any corresponding short options.\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([501 x i8], [501 x i8]* @.str, i64 0, i64 0))
ret void
}
void delay(int cnt) {
  cnt <<= 18;
  while (cnt--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x12,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1129 <delay+0x29>
jmp    1110 <delay+0x10>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
int test_imm_78uint32_mem(unsigned int *val) {
  return ((*val) & (0x78 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_78uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x78,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_78uint32_mem>:
testb  $0x78,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_78uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 120
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _dbg(char *, int /*<<< orphan*/);
int /*<<< orphan*/ board_flash_get_datafs_size();
int board_flash_write_datafs(char *, int /*<<< orphan*/);
int flash_write_datafs(char *buf) {
  if (0)
    _dbg("RW_PARTITION_SIZE: %x\n", board_flash_get_datafs_size());
  return board_flash_write_datafs(buf, board_flash_get_datafs_size());
}


x86 assembly (clang, -O0):
<flash_write_datafs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <board_flash_get_datafs_size@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <board_flash_write_datafs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_write_datafs>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <board_flash_get_datafs_size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <board_flash_write_datafs@plt>

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

LLVM IR (-O2):
define i32 @flash_write_datafs(i8* %0) {
%2 = tail call i32 (...) @board_flash_get_datafs_size()
%3 = tail call i32 @board_flash_write_datafs(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int rand();
int randomRange(int min, int max) { return (rand() % (max - min + 1)) + min; }


x86 assembly (clang, -O0):
<randomRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomRange>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randomRange(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randomRange(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Hello world");
  puts("This is a little longer...\n...and multiline.");
  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)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
@.str.1 = [45 x i8] c"This is a little longer...\0A...and multiline.\00"
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 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
@.str.1 = [45 x i8] c"This is a little longer...\0A...and multiline.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}