xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ U_PMF_SERIAL_get(char const **, int *, int, int, int);
int U_PMF_RECORD_SIZE_get(const char *contents) {
  if (!contents) {
    return (0);
  }
  int Size;
  const char *from = contents + 4;
  U_PMF_SERIAL_get(&from, &Size, 4, 1, 1);
  return (Size);
}


x86 assembly (clang, -O0):
<U_PMF_RECORD_SIZE_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <U_PMF_RECORD_SIZE_get+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1160 <U_PMF_RECORD_SIZE_get+0x50>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <U_PMF_SERIAL_get@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_PMF_RECORD_SIZE_get>:
test   %rdi,%rdi
je     114a <U_PMF_RECORD_SIZE_get+0x3a>
sub    $0x18,%rsp
add    $0x4,%rdi
mov    %rdi,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1030 <U_PMF_SERIAL_get@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @U_PMF_RECORD_SIZE_get(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = bitcast i32* %2 to i8*
%7 = bitcast i8** %3 to i8*
%8 = getelementptr inbounds i8, i8* %0, i64 4
store i8* %8, i8** %3
%9 = call i32 @U_PMF_SERIAL_get(i8** %3, i32* %2, i32 4, i32 1, i32 1)
%10 = load i32, i32* %2
br label %11
11: ; preds = %1, %5
%12 = phi i32 [ %10, %5 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ strcmp(void const *, void const *);
int second_hash_cmp(const void *a, const void *b) {
  return (strcmp(a, b) == 0);
}


x86 assembly (clang, -O0):
<second_hash_cmp>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<second_hash_cmp>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @second_hash_cmp(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @second_hash_cmp(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int putenv_r(char *string) { exit(0); }


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

x86 assembly (clang, -O2):
<putenv_r>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @putenv_r(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @putenv_r(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int nist_ctr_drbg_block_cipher_df_initialize();
int nist_ctr_drbg_instantiate_initialize();
int nist_ctr_initialize() {
  int err;
  err = nist_ctr_drbg_instantiate_initialize();
  if (err)
    return err;
  err = nist_ctr_drbg_block_cipher_df_initialize();
  if (err)
    return err;
  return 0;
}


x86 assembly (clang, -O0):
<nist_ctr_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <nist_ctr_drbg_instantiate_initialize@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1147 <nist_ctr_initialize+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <nist_ctr_initialize+0x4d>
mov    $0x0,%al
call   1040 <nist_ctr_drbg_block_cipher_df_initialize@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1166 <nist_ctr_initialize+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <nist_ctr_initialize+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nist_ctr_initialize>:
push   %rax
xor    %eax,%eax
call   1030 <nist_ctr_drbg_instantiate_initialize@plt>
test   %eax,%eax
je     112e <nist_ctr_initialize+0xe>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <nist_ctr_drbg_block_cipher_df_initialize@plt>

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

LLVM IR (-O2):
define i32 @nist_ctr_initialize() {
%1 = tail call i32 (...) @nist_ctr_drbg_instantiate_initialize()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @nist_ctr_drbg_block_cipher_df_initialize()
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %1, %0 ], [ %4, %3 ]
ret i32 %6
}
void *memcpy(void *a, const void *b, long unsigned int len) {
  if (a == b)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1137 <memcpy+0x27>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
cmp    %rsi,%rdi
je     1116 <memcpy+0x6>
ret
push   %rax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @memcpy(i8* readnone %0, i8* readnone %1, i64 %2) {
%4 = icmp eq i8* %0, %1
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @abort()
unreachable
6: ; preds = %3
ret i8* undef
}
unsigned int inttogray(unsigned int x) {
  unsigned int y, r = 0;
  for (y = 1; y <= 0x80; y <<= 1)
    r |= ((x + y) >> 1) & y;
  return r;
}


x86 assembly (clang, -O0):
<inttogray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
ja     1142 <inttogray+0x42>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
shr    $0x1,%eax
and    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <inttogray+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inttogray>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xeef(%rip),%xmm1
movdqa %xmm0,%xmm2
paddd  %xmm1,%xmm2
movdqa 0xeef(%rip),%xmm3
paddd  %xmm3,%xmm0
psrld  $0x1,%xmm0
psrld  $0x1,%xmm2
pand   %xmm1,%xmm2
pand   %xmm3,%xmm0
por    %xmm2,%xmm0
pshufd $0xee,%xmm0,%xmm1
por    %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
por    %xmm1,%xmm0
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @inttogray(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 1, i32* %3
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %3
%7 = icmp ule i32 %6, 128
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add i32 %9, %10
%12 = lshr i32 %11, 1
%13 = load i32, i32* %3
%14 = and i32 %12, %13
%15 = load i32, i32* %4
%16 = or i32 %15, %14
store i32 %16, i32* %4
br label %17
17: ; preds = %8
%18 = load i32, i32* %3
%19 = shl i32 %18, 1
store i32 %19, i32* %3
br label %5
20: ; preds = %5
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @inttogray(i32 %0) {
%2 = insertelement <8 x i32> poison, i32 %0, i64 0
%3 = shufflevector <8 x i32> %2, <8 x i32> poison, <8 x i32> zeroinitializer
%4 = add <8 x i32> %3, <i32 128, i32 64, i32 32, i32 16, i32 8, i32 4, i32 2, i32 1>
%5 = lshr <8 x i32> %4, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%6 = and <8 x i32> %5, <i32 128, i32 64, i32 32, i32 16, i32 8, i32 4, i32 2, i32 1>
%7 = call i32 @llvm.vector.reduce.or.v8i32(<8 x i32> %6)
ret i32 %7
}
int f_lt_mr1(float *a1, float a2) { return (((*a1) < (a2))); }


x86 assembly (clang, -O0):
<f_lt_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_lt_mr1>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @f_lt_mr1(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 = load float, float* %4
%8 = fcmp olt float %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_lt_mr1(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp olt float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
float Cos(float);
float Sin(float);
float RotatePointX(float x, float y, float centerX, float centerY,
                   float degrees) {
  float dx = x - centerX;
  float dy = y - centerY;
  return (Cos(degrees) * dx) - (Sin(degrees) * dy) + centerX;
}


x86 assembly (clang, -O0):
<RotatePointX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <Cos@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <Sin@plt>
movss  -0x24(%rbp),%xmm2
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
addss  -0xc(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotatePointX>:
sub    $0x18,%rsp
movss  %xmm4,0x4(%rsp)
movss  %xmm2,0x14(%rsp)
subss  %xmm2,%xmm0
movss  %xmm0,0x10(%rsp)
subss  %xmm3,%xmm1
movss  %xmm1,0xc(%rsp)
movaps %xmm4,%xmm0
call   1040 <Cos@plt>
movss  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <Sin@plt>
mulss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mulss  0x10(%rsp),%xmm1
subss  %xmm0,%xmm1
addss  0x14(%rsp),%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @RotatePointX(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%13 = load float, float* %6
%14 = load float, float* %8
%15 = fsub float %13, %14
store float %15, float* %11
%16 = load float, float* %7
%17 = load float, float* %9
%18 = fsub float %16, %17
store float %18, float* %12
%19 = load float, float* %10
%20 = call float @Cos(float %19)
%21 = load float, float* %11
%22 = load float, float* %10
%23 = call float @Sin(float %22)
%24 = load float, float* %12
%25 = fmul float %23, %24
%26 = fneg float %25
%27 = call float @llvm.fmuladd.f32(float %20, float %21, float %26)
%28 = load float, float* %8
%29 = fadd float %27, %28
ret float %29
}

LLVM IR (-O2):
define float @RotatePointX(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %0, %2
%7 = fsub float %1, %3
%8 = tail call float @Cos(float %4)
%9 = tail call float @Sin(float %4)
%10 = fneg float %9
%11 = fmul float %7, %10
%12 = tail call float @llvm.fmuladd.f32(float %8, float %6, float %11)
%13 = fadd float %12, %2
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ ev_default_loop(int /*<<< orphan*/);
int /*<<< orphan*/ ev_loop_fork(int /*<<< orphan*/);
void ev_default_fork(void) { ev_loop_fork(ev_default_loop(0)); }


x86 assembly (clang, -O0):
<ev_default_fork>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <ev_default_loop@plt>
mov    %eax,%edi
call   1030 <ev_loop_fork@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_default_fork>:
push   %rax
xor    %edi,%edi
call   1040 <ev_default_loop@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ev_loop_fork@plt>

LLVM IR (-O0):
define void @ev_default_fork() {
%1 = call i32 @ev_default_loop(i32 0)
%2 = call i32 @ev_loop_fork(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ev_default_fork() {
%1 = tail call i32 @ev_default_loop(i32 0)
%2 = tail call i32 @ev_loop_fork(i32 %1)
ret void
}
void foo(int n, int i) {
  int A[n];
#pragma omp parallel firstprivate(A)
  { A[i] = 1; }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movslq -0x8(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i32, i64 %8
store i64 %8, i64* %6
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 1, i32* %13
%14 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
ret void
}
unsigned int test_09(unsigned int x) { return x - (x != 0); }


x86 assembly (clang, -O0):
<test_09>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_09>:
mov    %edi,%eax
cmp    $0x1,%edi
adc    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @test_09(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = sext i1 %2 to i32
%4 = add i32 %3, %0
ret i32 %4
}
void arg_char3(char x, char y, char z) {}


x86 assembly (clang, -O0):
<arg_char3>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @arg_char3(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
ret void
}

LLVM IR (-O2):
define void @arg_char3(i8 signext %0, i8 signext %1, i8 signext %2) {
ret void
}
void *move_ptr_roundup(void *ptr, unsigned long offset, unsigned long align) {
  return (void *)(((unsigned long)(ptr + offset) + (align - 1)) &
                  (~(align - 1)));
}


x86 assembly (clang, -O0):
<move_ptr_roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_ptr_roundup>:
add    %rsi,%rdi
lea    (%rdx,%rdi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rdx
and    %rdx,%rax
ret

LLVM IR (-O0):
define i8* @move_ptr_roundup(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = getelementptr i8, i8* %7, i64 %8
%10 = ptrtoint i8* %9 to i64
%11 = load i64, i64* %6
%12 = sub i64 %11, 1
%13 = add i64 %10, %12
%14 = load i64, i64* %6
%15 = sub i64 %14, 1
%16 = xor i64 %15, -1
%17 = and i64 %13, %16
%18 = inttoptr i64 %17 to i8*
ret i8* %18
}

LLVM IR (-O2):
define i8* @move_ptr_roundup(i8* %0, i64 %1, i64 %2) {
%4 = getelementptr i8, i8* %0, i64 %1
%5 = ptrtoint i8* %4 to i64
%6 = add i64 %2, -1
%7 = add i64 %6, %5
%8 = sub i64 0, %2
%9 = and i64 %7, %8
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memtrap_install() {
  printf("NOT IMPLEMENTED:"
         "pa_memtrap_install"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_memtrap_install\0A\00"
define i32 @pa_memtrap_install() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_memtrap_install\00"
define i32 @pa_memtrap_install() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
float money_to_float(long x) { return (float)x / 100.0f; }


x86 assembly (clang, -O0):
<money_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<money_to_float>:
cvtsi2ss %rdi,%xmm0
divss  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define float @money_to_float(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = fdiv float %4, 1.000000e+02
ret float %5
}

LLVM IR (-O2):
define float @money_to_float(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = fdiv float %2, 1.000000e+02
ret float %3
}
/* Variables and functions */
int *build123Array(int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ inplaceReverse(int *, int);
int /*<<< orphan*/ outArrInt(int *, int);
void testInplaceReverse() {
  int size = 11;
  int *elems = build123Array(size);
  outArrInt(elems, size);
  inplaceReverse(elems, size);
  outArrInt(elems, size);
  free(elems);
}


x86 assembly (clang, -O0):
<testInplaceReverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xb,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <build123Array@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1060 <outArrInt@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <inplaceReverse@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1060 <outArrInt@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testInplaceReverse>:
push   %rbx
mov    $0xb,%edi
call   1050 <build123Array@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xb,%esi
call   1060 <outArrInt@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <inplaceReverse@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1060 <outArrInt@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @testInplaceReverse() {
%1 = alloca i32
%2 = alloca i32*
store i32 11, i32* %1
%3 = load i32, i32* %1
%4 = call i32* @build123Array(i32 %3)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %1
%7 = call i32 @outArrInt(i32* %5, i32 %6)
%8 = load i32*, i32** %2
%9 = load i32, i32* %1
%10 = call i32 @inplaceReverse(i32* %8, i32 %9)
%11 = load i32*, i32** %2
%12 = load i32, i32* %1
%13 = call i32 @outArrInt(i32* %11, i32 %12)
%14 = load i32*, i32** %2
%15 = call i32 @free(i32* %14)
ret void
}

LLVM IR (-O2):
define void @testInplaceReverse() {
%1 = tail call i32* @build123Array(i32 11)
%2 = tail call i32 @outArrInt(i32* %1, i32 11)
%3 = tail call i32 @inplaceReverse(i32* %1, i32 11)
%4 = tail call i32 @outArrInt(i32* %1, i32 11)
%5 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
double isnormal(double);
double function_isnormal(double x) { return isnormal(x); }


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

x86 assembly (clang, -O2):
<function_isnormal>:
jmp    1030 <isnormal@plt>

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

LLVM IR (-O2):
define double @function_isnormal(double %0) {
%2 = tail call double @isnormal(double %0)
ret double %2
}
/* Variables and functions */
bool nrf51_errata_18(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_18() {
ret i32 0
}
void pthread_create() {}


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

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

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

LLVM IR (-O2):
define void @pthread_create() {
ret void
}
void f(int a[4]) {}


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

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

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

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
ret void
}
void fibonacci_computing(unsigned int *lastTerm, unsigned int *oldTerm) {
  unsigned int tmp_oldTerm = *oldTerm;
  *oldTerm = *lastTerm;
  *lastTerm = tmp_oldTerm + *lastTerm;
  return;
}


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

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

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

LLVM IR (-O2):
define void @fibonacci_computing(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
store i32 %4, i32* %1
%5 = load i32, i32* %0
%6 = add i32 %5, %3
store i32 %6, i32* %0
ret void
}
int __attribute__((weak)) testWeak2() { return 1; }


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

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

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

LLVM IR (-O2):
define weak i32 @testWeak2() {
ret i32 1
}
/* Type definitions */
struct proxy_worker {
  int dummy;
};

/* Variables and functions */
int proxy_worker_connected(struct proxy_worker *);
int proxy_worker_connect_cb(void *worker, void *data) {
  return proxy_worker_connected((struct proxy_worker *)worker);
}


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

x86 assembly (clang, -O2):
<proxy_worker_connect_cb>:
jmp    1030 <proxy_worker_connected@plt>

LLVM IR (-O0):
%struct.proxy_worker = type { i32 }
define i32 @proxy_worker_connect_cb(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 = bitcast i8* %5 to %struct.proxy_worker*
%7 = call i32 @proxy_worker_connected(%struct.proxy_worker* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.proxy_worker = type { i32 }
define i32 @proxy_worker_connect_cb(i8* %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to %struct.proxy_worker*
%4 = tail call i32 @proxy_worker_connected(%struct.proxy_worker* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Drop();
int CmdDrop(void) {
  Drop();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @CmdDrop() {
%1 = call i32 (...) @Drop()
ret i32 0
}

LLVM IR (-O2):
define i32 @CmdDrop() {
%1 = tail call i32 (...) @Drop()
ret i32 0
}
unsigned long long int rdtsc(void) {
  unsigned int low, high;
  __asm__ __volatile__("rdtsc" : "=a"(low), "=d"(high));
  return ((unsigned long long int)high << 32) | low;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x20,%rax
mov    -0x4(%rbp),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
shl    $0x20,%rdx
mov    %eax,%eax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = shl i64 %7, 32
%9 = load i32, i32* %1
%10 = zext i32 %9 to i64
%11 = or i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %3 to i64
%5 = shl nuw i64 %4, 32
%6 = zext i32 %2 to i64
%7 = or i64 %5, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ pRender_PutBorder(int, int);
void Render_PutBorder(int HorizontalCount, int Line) {
  pRender_PutBorder(HorizontalCount, Line);
}


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

x86 assembly (clang, -O2):
<Render_PutBorder>:
jmp    1030 <pRender_PutBorder@plt>

LLVM IR (-O0):
define void @Render_PutBorder(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 = call i32 @pRender_PutBorder(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @Render_PutBorder(i32 %0, i32 %1) {
%3 = tail call i32 @pRender_PutBorder(i32 %0, i32 %1)
ret void
}
double pathcon_nm4_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<pathcon_nm4_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm4_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pathcon_nm4_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @pathcon_nm4_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
unsigned int bit_num_ints(unsigned int);
scalar_t__ calloc(unsigned int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *bit_make(unsigned int num_bits) {
  unsigned int *bits;
  unsigned int num_ints = bit_num_ints(num_bits);
  bits = (unsigned int *)calloc(num_ints, sizeof(unsigned int));
  if (bits == NULL) {
    perror("calloc");
    exit(-1);
  }
  return ((void *)bits);
}


x86 assembly (clang, -O0):
<bit_make>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <bit_num_ints@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1188 <bit_make+0x48>
lea    0xe87(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_make>:
push   %rax
call   1050 <bit_num_ints@plt>
mov    %eax,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1159 <bit_make+0x19>
pop    %rcx
ret
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"calloc\00"
define i8* @bit_make(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @bit_num_ints(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i64 @calloc(i32 %7, i32 4)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %1
%16 = load i32*, i32** %3
%17 = bitcast i32* %16 to i8*
ret i8* %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"calloc\00"
define i8* @bit_make(i32 %0) {
%2 = tail call i32 @bit_num_ints(i32 %0)
%3 = tail call i64 @calloc(i32 %2, i32 4)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
%9 = inttoptr i64 %3 to i8*
ret i8* %9
}
int test_imm_FBint64_lowword_mem(long long *val) {
  return ((*val) & (0xFB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FBint64_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, 251
%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_FBint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 251
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FTSENT;

/* Variables and functions */
int acccmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
int revacccmp(const FTSENT *a, const FTSENT *b) { return (acccmp(b, a)); }


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

x86 assembly (clang, -O2):
<revacccmp>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <acccmp@plt>

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

LLVM IR (-O2):
define i32 @revacccmp(i32* %0, i32* %1) {
%3 = tail call i32 @acccmp(i32* %1, i32* %0)
ret i32 %3
}
unsigned long pci_config_addr(int slot, int func) {
  return 0x7bc00000 + (slot << 11) + (func << 8);
}


x86 assembly (clang, -O0):
<pci_config_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xb,%eax
add    $0x7bc00000,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_config_addr>:
shl    $0xb,%edi
shl    $0x8,%esi
lea    (%rdi,%rsi,1),%eax
add    $0x7bc00000,%eax
cltq
ret

LLVM IR (-O0):
define i64 @pci_config_addr(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 = shl i32 %5, 11
%7 = add nsw i32 2076180480, %6
%8 = load i32, i32* %4
%9 = shl i32 %8, 8
%10 = add nsw i32 %7, %9
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @pci_config_addr(i32 %0, i32 %1) {
%3 = shl i32 %0, 11
%4 = add nsw i32 %3, 2076180480
%5 = shl i32 %1, 8
%6 = add nsw i32 %4, %5
%7 = sext i32 %6 to i64
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void i2c_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<i2c_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @i2c_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ketama_md5_digest(char *, unsigned char *);
unsigned int ketama_hashi(char *inString) {
  unsigned char digest[16];
  ketama_md5_digest(inString, digest);
  return (unsigned int)((digest[3] << 24) | (digest[2] << 16) |
                        (digest[1] << 8) | digest[0]);
}


x86 assembly (clang, -O0):
<ketama_hashi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <ketama_md5_digest@plt>
movzbl -0x1d(%rbp),%eax
shl    $0x18,%eax
movzbl -0x1e(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x1f(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x20(%rbp),%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ketama_hashi>:
sub    $0x18,%rsp
mov    %rsp,%rsi
call   1030 <ketama_md5_digest@plt>
mov    (%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @ketama_hashi(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = call i32 @ketama_md5_digest(i8* %4, i8* %5)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 24
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = or i32 %15, %19
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %20, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @ketama_hashi(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @ketama_md5_digest(i8* %0, i8* %3)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw i32 %7, 24
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %12, %8
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw nsw i32 %16, 8
%18 = or i32 %13, %17
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
ret i32 %21
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ sendto(int, void const *, size_t, int,
                          struct sockaddr const *, int /*<<< orphan*/);
ssize_t send_from_to(int sockfd, const void *buf, size_t len, int flags,
                     const struct sockaddr_in6 *src_addr,
                     const struct sockaddr *dest_addr, socklen_t addrlen) {
  return sendto(sockfd, buf, len, flags, dest_addr, addrlen);
}


x86 assembly (clang, -O0):
<send_from_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9d
call   1030 <sendto@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_from_to>:
mov    %r9,%r8
mov    0x8(%rsp),%r9d
jmp    1030 <sendto@plt>

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @send_from_to(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr_in6* %4, %struct.sockaddr* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca %struct.sockaddr_in6*
%13 = alloca %struct.sockaddr*
%14 = alloca i32
store i32 %0, i32* %8
store i8* %1, i8** %9
store i64 %2, i64* %10
store i32 %3, i32* %11
store %struct.sockaddr_in6* %4, %struct.sockaddr_in6** %12
store %struct.sockaddr* %5, %struct.sockaddr** %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i8*, i8** %9
%17 = load i64, i64* %10
%18 = load i32, i32* %11
%19 = load %struct.sockaddr*, %struct.sockaddr** %13
%20 = load i32, i32* %14
%21 = call i32 @sendto(i32 %15, i8* %16, i64 %17, i32 %18, %struct.sockaddr* %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @send_from_to(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr_in6* nocapture readnone %4, %struct.sockaddr* %5, i32 %6) {
%8 = tail call i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %5, i32 %6)
ret i32 %8
}
int ft_islower(int c) { return (c <= 'z' && c >= 'a'); }


x86 assembly (clang, -O0):
<ft_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1120 <ft_islower+0x20>
cmpl   $0x61,-0x4(%rbp)
setge  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct nli {
  int dummy;
};

/* Variables and functions */
struct nli *add_node_to_list(int /*<<< orphan*/ *);
struct nli *create_nodelist() {
  return add_node_to_list(NULL);
}


x86 assembly (clang, -O0):
<create_nodelist>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <add_node_to_list@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_nodelist>:
xor    %edi,%edi
jmp    1030 <add_node_to_list@plt>

LLVM IR (-O0):
%struct.nli = type { i32 }
define %struct.nli* @create_nodelist() {
%1 = call %struct.nli* @add_node_to_list(i32* null)
ret %struct.nli* %1
}

LLVM IR (-O2):
%struct.nli = type { i32 }
define %struct.nli* @create_nodelist() {
%1 = tail call %struct.nli* @add_node_to_list(i32* null)
ret %struct.nli* %1
}
int pathconN_nm5_n_in(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pathconN_nm5_n_in() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
int bs_conv_copy(const unsigned char *in_buf, int size,
                 unsigned char *out_buf) {
  memcpy(out_buf, in_buf, size);
  return size;
}


x86 assembly (clang, -O0):
<bs_conv_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_conv_copy>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bs_conv_copy(i8* %0, i32 returned %1, i8* %2) {
%4 = tail call i32 @memcpy(i8* %2, i8* %0, i32 %1)
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, int /*<<< orphan*/ *);
scalar_t__ fork();
int main(int argc, char *argv[]) {
  pid_t pid;
  pid = fork();
  if (pid == 0) {
    execl("/usr/local/bin/mplayer", "xxx", argv[1], NULL);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xea5(%rip),%rdi
lea    0xeb5(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <execl@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jne    1149 <main+0x29>
mov    0x8(%rbx),%rdx
lea    0xec5(%rip),%rdi
lea    0xed5(%rip),%rsi
xor    %ecx,%ecx
call   1030 <execl@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"/usr/local/bin/mplayer\00"
@.str.1 = [4 x i8] c"xxx\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 (...) @fork()
store i64 %7, i64* %6
%8 = load i64, i64* %6
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32* null)
br label %15
15: ; preds = %10, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"/usr/local/bin/mplayer\00"
@.str.1 = [4 x i8] c"xxx\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32* null)
br label %9
9: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
char *getenv(char const *);
char *_mesa_getenv(const char *var) { return getenv(var); }


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

x86 assembly (clang, -O2):
<_mesa_getenv>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @_mesa_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
int test_imm_6Fuint8_mem(unsigned char *val) {
  return ((*val) & (-0x6F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Fuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -111
%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_6Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -111
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int foo(int a) { return a + 10; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 10
ret i32 %2
}