xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/);
void sig_block(int sig) {
  sigset_t ss;
  sigemptyset(&ss);
  sigaddset(&ss, sig);
  sigprocmask(SIG_BLOCK, &ss, 0);
}


x86 assembly (clang, -O0):
<sig_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_block>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define void @sig_block(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @sigaddset(i32* %3, i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* %3, i32 0)
ret void
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define void @sig_block(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = call i32 @sigaddset(i32* %2, i32 %0)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %2, i32 0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_integration_test();
int main() {
  test_integration_test();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_integration_test@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_integration_test()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test_integration_test()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
void vec3_imul(float a[3], float k) { vec3_mul(a, k, a); }


x86 assembly (clang, -O0):
<vec3_imul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%rsi
mov    $0x1,%al
call   1030 <vec3_mul@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_imul>:
cvtss2sd %xmm0,%xmm0
mov    %rdi,%rsi
mov    $0x1,%al
jmp    1030 <vec3_mul@plt>

LLVM IR (-O0):
define void @vec3_imul(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = load float*, float** %3
%9 = call i32 (float*, double, float*, ...) bitcast (i32 (...)* @vec3_mul to i32 (float*, double, float*, ...)*)(float* %5, double %7, float* %8)
ret void
}

LLVM IR (-O2):
define void @vec3_imul(float* %0, float %1) {
%3 = fpext float %1 to double
%4 = tail call i32 (float*, double, float*, ...) bitcast (i32 (...)* @vec3_mul to i32 (float*, double, float*, ...)*)(float* %0, double %3, float* %0)
ret void
}
/* Variables and functions */
void ui_set_null_cursor(void) {}


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

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

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

LLVM IR (-O2):
define void @ui_set_null_cursor() {
ret void
}
double f(double u) { return 0.5 * u * u; }


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

x86 assembly (clang, -O2):
<f>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @f(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = fmul double %2, %0
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ init();
void *x_mmap(void *, size_t, int, int, int, int /*<<< orphan*/);
void *v4l2_mmap(void *addr, size_t length, int prot, int flags, int fd,
                off_t offset) {
  init();
  return x_mmap(addr, length, prot, flags, fd, offset);
}


x86 assembly (clang, -O0):
<v4l2_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <x_mmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l2_mmap>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <init@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <x_mmap@plt>

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

LLVM IR (-O2):
define i8* @v4l2_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 (...) @init()
%8 = tail call i8* @x_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret i8* %8
}
/* Variables and functions */
void *realloc(void *, size_t);
void *erealloc(void *ptr, size_t sz) { return realloc(ptr, sz); }


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

x86 assembly (clang, -O2):
<erealloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @erealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_and();
int /*<<< orphan*/ test_div();
int /*<<< orphan*/ test_lshift();
int /*<<< orphan*/ test_minus();
int /*<<< orphan*/ test_mod();
int /*<<< orphan*/ test_mult();
int /*<<< orphan*/ test_or();
int /*<<< orphan*/ test_plus();
int /*<<< orphan*/ test_rshift();
int /*<<< orphan*/ test_xor();
int main(void) {
  test_mult();
  test_div();
  test_mod();
  test_plus();
  test_minus();
  test_lshift();
  test_rshift();
  test_and();
  test_xor();
  test_or();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <test_mult@plt>
mov    $0x0,%al
call   10b0 <test_div@plt>
mov    $0x0,%al
call   1080 <test_mod@plt>
mov    $0x0,%al
call   1050 <test_plus@plt>
mov    $0x0,%al
call   1070 <test_minus@plt>
mov    $0x0,%al
call   10c0 <test_lshift@plt>
mov    $0x0,%al
call   1040 <test_rshift@plt>
mov    $0x0,%al
call   10a0 <test_and@plt>
mov    $0x0,%al
call   1030 <test_xor@plt>
mov    $0x0,%al
call   1060 <test_or@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <test_mult@plt>
xor    %eax,%eax
call   10b0 <test_div@plt>
xor    %eax,%eax
call   1080 <test_mod@plt>
xor    %eax,%eax
call   1050 <test_plus@plt>
xor    %eax,%eax
call   1070 <test_minus@plt>
xor    %eax,%eax
call   10c0 <test_lshift@plt>
xor    %eax,%eax
call   1040 <test_rshift@plt>
xor    %eax,%eax
call   10a0 <test_and@plt>
xor    %eax,%eax
call   1030 <test_xor@plt>
xor    %eax,%eax
call   1060 <test_or@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_mult()
%3 = call i32 (...) @test_div()
%4 = call i32 (...) @test_mod()
%5 = call i32 (...) @test_plus()
%6 = call i32 (...) @test_minus()
%7 = call i32 (...) @test_lshift()
%8 = call i32 (...) @test_rshift()
%9 = call i32 (...) @test_and()
%10 = call i32 (...) @test_xor()
%11 = call i32 (...) @test_or()
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_mult()
%2 = tail call i32 (...) @test_div()
%3 = tail call i32 (...) @test_mod()
%4 = tail call i32 (...) @test_plus()
%5 = tail call i32 (...) @test_minus()
%6 = tail call i32 (...) @test_lshift()
%7 = tail call i32 (...) @test_rshift()
%8 = tail call i32 (...) @test_and()
%9 = tail call i32 (...) @test_xor()
%10 = tail call i32 (...) @test_or()
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double log2(double);
int max_height(int height) {
  return (int)(1.44 * log2((double)(height + 2)) + 0.672);
}


x86 assembly (clang, -O0):
<max_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm0
call   1030 <log2@plt>
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_height>:
push   %rax
add    $0x2,%edi
cvtsi2sd %edi,%xmm0
call   1030 <log2@plt>
mulsd  0xedb(%rip),%xmm0
addsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @max_height(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = sitofp i32 %4 to double
%6 = call double @log2(double %5)
%7 = call double @llvm.fmuladd.f64(double 1.440000e+00, double %6, double 6.720000e-01)
%8 = fptosi double %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @max_height(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sitofp i32 %2 to double
%4 = tail call double @log2(double %3)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.440000e+00, double 6.720000e-01)
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Variables and functions */
void *memchr(const void *ptr, int value, size_t num) {
  const unsigned char *vptr = (const unsigned char *)ptr;
  while (num) {
    if (*vptr == (unsigned char)value)
      return ((void *)vptr);
    vptr++;
    num--;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1161 <memchr+0x61>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1144 <memchr+0x44>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <memchr+0x69>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
je     111f <memchr+0x1f>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1121 <memchr+0x21>
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

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

/* Variables and functions */
unsigned int UCHAR_MAX;
int /*<<< orphan*/ time(int /*<<< orphan*/);
unsigned time_seed() {
  time_t now = time(0);
  unsigned char *p = (unsigned char *)&now;
  unsigned seed = 0;
  size_t i;
  for (i = 0; i < sizeof now; i++) {
    seed = seed * (UCHAR_MAX + 2U) + p[i];
  }
  return seed;
}


x86 assembly (clang, -O0):
<time_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x4,-0x20(%rbp)
jae    1178 <time_seed+0x68>
mov    -0x14(%rbp),%eax
mov    0x2ea2(%rip),%rcx
mov    (%rcx),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1139 <time_seed+0x29>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_seed>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ecx
movzbl %al,%edx
movzbl %ah,%esi
shr    $0x10,%eax
shr    $0x18,%ecx
mov    0x2ec3(%rip),%rdi
mov    (%rdi),%edi
add    $0x2,%edi
imul   %edi,%edx
add    %edx,%esi
imul   %edi,%esi
movzbl %al,%eax
add    %esi,%eax
imul   %edi,%eax
add    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@UCHAR_MAX = global i32 0
define i32 @time_seed() {
%1 = tail call i32 @time(i32 0)
%2 = lshr i32 %1, 8
%3 = lshr i32 %1, 16
%4 = lshr i32 %1, 24
%5 = load i32, i32* @UCHAR_MAX
%6 = add i32 %5, 2
%7 = and i32 %1, 255
%8 = mul i32 %6, %7
%9 = and i32 %2, 255
%10 = add i32 %8, %9
%11 = mul i32 %6, %10
%12 = and i32 %3, 255
%13 = add i32 %11, %12
%14 = mul i32 %6, %13
%15 = add i32 %14, %4
ret i32 %15
}
/* Variables and functions */
char *strchr(char const *, char);
int strlen(char const *);
int opt_len(const char *str) {
  char *postfix;
  postfix = strchr(str, ':');
  if (!postfix)
    return strlen(str);
  return (int)(postfix - str);
}


x86 assembly (clang, -O0):
<opt_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <opt_len+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <opt_len+0x48>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_len>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3a,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1137 <opt_len+0x17>
sub    %ebx,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @opt_len(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 58)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %2
br label %19
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
store i32 %18, i32* %2
br label %19
19: ; preds = %12, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @opt_len(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
br label %11
6: ; preds = %1
%7 = ptrtoint i8* %2 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ %10, %6 ], [ %5, %4 ]
ret i32 %12
}
/* Type definitions */
struct discriminant_t {
  int dummy;
};

/* Variables and functions */
void *calloc(int, size_t);
size_t key_size(struct discriminant_t *);
void *key_alloc(struct discriminant_t *d, size_t *size) {
  return calloc(1, *size = key_size(d));
}


x86 assembly (clang, -O0):
<key_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <key_size@plt>
mov    %rax,%rsi
mov    -0x10(%rbp),%rax
mov    %rsi,(%rax)
mov    $0x1,%edi
call   1040 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_alloc>:
push   %rbx
mov    %rsi,%rbx
call   1030 <key_size@plt>
mov    %rax,(%rbx)
mov    $0x1,%edi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <calloc@plt>

LLVM IR (-O0):
%struct.discriminant_t = type { i32 }
define i8* @key_alloc(%struct.discriminant_t* %0, i64* %1) {
%3 = alloca %struct.discriminant_t*
%4 = alloca i64*
store %struct.discriminant_t* %0, %struct.discriminant_t** %3
store i64* %1, i64** %4
%5 = load %struct.discriminant_t*, %struct.discriminant_t** %3
%6 = call i64 @key_size(%struct.discriminant_t* %5)
%7 = load i64*, i64** %4
store i64 %6, i64* %7
%8 = call i8* @calloc(i32 1, i64 %6)
ret i8* %8
}

LLVM IR (-O2):
%struct.discriminant_t = type { i32 }
define i8* @key_alloc(%struct.discriminant_t* %0, i64* nocapture writeonly %1) {
%3 = tail call i64 @key_size(%struct.discriminant_t* %0)
store i64 %3, i64* %1
%4 = tail call i8* @calloc(i32 1, i64 %3)
ret i8* %4
}
/* Variables and functions */
int floor(double);
double mod360_positive(double vin) { return vin - 360 * floor(vin / 360); }


x86 assembly (clang, -O0):
<mod360_positive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  -0x10(%rbp),%xmm0
imul   $0x168,%eax,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod360_positive>:
push   %rax
movsd  %xmm0,(%rsp)
divsd  0xee2(%rip),%xmm0
call   1030 <floor@plt>
imul   $0x168,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mod360_positive(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 3.600000e+02
%6 = call i32 @floor(double %5)
%7 = mul nsw i32 360, %6
%8 = sitofp i32 %7 to double
%9 = fsub double %3, %8
ret double %9
}

LLVM IR (-O2):
define double @mod360_positive(double %0) {
%2 = fdiv double %0, 3.600000e+02
%3 = tail call i32 @floor(double %2)
%4 = mul nsw i32 %3, 360
%5 = sitofp i32 %4 to double
%6 = fsub double %0, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int read_header();
int main() {
  if (read_header() != 156) {
    printf("Error %d\n", (int)1);
    exit(1);
  };
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <read_header@plt>
cmp    $0x9c,%eax
je     116e <main+0x3e>
lea    0xea8(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <read_header@plt>
cmp    $0x9c,%eax
jne    1162 <main+0x22>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xe97(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @read_header()
%3 = icmp ne i32 %2, 156
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error %d\0A\00"
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 (...) @read_header()
%2 = icmp eq i32 %1, 156
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
int main() {
  int arg1 = 0x70000000;
  int arg2 = 7;
  int mulLo = 0;
  int mulHi = 0;
  __asm__("imull %%ebx;" : "=a"(mulLo), "=d"(mulHi) : "a"(arg1), "b"(arg2));
  return (mulLo == 0x10000000) && (mulHi == 0x3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movl   $0x70000000,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ebx
imul   %ebx
mov    %eax,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x10000000,-0x18(%rbp)
mov    %al,-0x1d(%rbp)
jne    1152 <main+0x52>
cmpl   $0x3,-0x1c(%rbp)
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x70000000,%eax
mov    $0x7,%ebx
imul   %ebx
xor    $0x10000000,%eax
xor    $0x3,%edx
xor    %ecx,%ecx
or     %eax,%edx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1879048192, i32* %2
store i32 7, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call { i32, i32 } asm "imull %ebx;", "={ax},={dx},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %7)
%9 = extractvalue { i32, i32 } %8, 0
%10 = extractvalue { i32, i32 } %8, 1
store i32 %9, i32* %4
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 268435456
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 3
br label %16
16: ; preds = %13, %0
%17 = phi i1 [ false, %0 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i32, i32 } asm "imull %ebx;", "={ax},={dx},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 1879048192, i32 7)
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = icmp eq i32 %2, 268435456
%5 = icmp eq i32 %3, 3
%6 = select i1 %4, i1 %5, i1 false
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void swapstr(char *a, char *b) {
  char c[50];
  strcpy(c, a);
  strcpy(a, b);
  strcpy(b, c);
}


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

x86 assembly (clang, -O2):
<swapstr>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swapstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [50 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @swapstr(i8* %0, i8* %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @strcpy(i8* %0, i8* %1)
%7 = call i32 @strcpy(i8* %1, i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ remove(char *);
FILE *sfd_preproc(FILE *in, char *name) {
  FILE *out;
  remove(name);
  out = fopen(name, "w");
  fclose(in);
  return out;
}


x86 assembly (clang, -O0):
<sfd_preproc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <remove@plt>
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfd_preproc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <remove@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define i32* @sfd_preproc(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32*
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @remove(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %5
%10 = load i32*, i32** %3
%11 = call i32 @fclose(i32* %10)
%12 = load i32*, i32** %5
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define noalias i32* @sfd_preproc(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @remove(i8* %1)
%4 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fclose(i32* %0)
ret i32* %4
}
int f_gt_rr1(float a1, float a2) { return (((a1) > (a2))); }


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

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

LLVM IR (-O0):
define i32 @f_gt_rr1(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f_gt_rr1(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void g_node_new() {}


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

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

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

LLVM IR (-O2):
define void @g_node_new() {
ret void
}
/* Variables and functions */
int atoi(char *);
int parseLine(char *line) {
  while (*line < '0' || *line > '9') {
    line++;
  }
  return atoi(line);
}


x86 assembly (clang, -O0):
<parseLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     1141 <parseLine+0x31>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1151 <parseLine+0x41>
jmp    1162 <parseLine+0x52>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <parseLine+0xc>
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseLine>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
add    $0xc6,%al
cmp    $0xf6,%al
jb     1120 <parseLine+0x10>
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @parseLine(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -58
%6 = icmp ult i8 %5, -10
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = tail call i32 @atoi(i8* %3)
ret i32 %9
}
int test_imm_D5int16_reg(short val) {
  return ((val) & (0xD5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D5int16_reg>:
test   $0xd5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D5int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 213
%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_D5int16_reg(i16 signext %0) {
%2 = and i16 %0, 213
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ ends_in(char const *, char *);
int smells_like_module(const char *name) {
  return ends_in(name, ".ko") || ends_in(name, ".ko.gz");
}


x86 assembly (clang, -O0):
<smells_like_module>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <ends_in@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1158 <smells_like_module+0x48>
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <ends_in@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smells_like_module>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <ends_in@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112f <smells_like_module+0x1f>
pop    %rbx
ret
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
call   1030 <ends_in@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c".ko\00"
@.str.1 = [7 x i8] c".ko.gz\00"
define i32 @smells_like_module(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @ends_in(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @ends_in(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c".ko\00"
@.str.1 = [7 x i8] c".ko.gz\00"
define i32 @smells_like_module(i8* %0) {
%2 = tail call i64 @ends_in(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ends_in(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int __getpriority(int, int);
int getpriority(int which, int who) {
  int rv = __getpriority(which, who);
  return (rv < 0) ? rv : 20 - rv;
}


x86 assembly (clang, -O0):
<getpriority>:
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 <__getpriority@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1141 <getpriority+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114c <getpriority+0x3c>
mov    $0x14,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpriority>:
push   %rax
call   1030 <__getpriority@plt>
mov    $0x14,%ecx
sub    %eax,%ecx
test   %eax,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getpriority(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* %4
%8 = call i32 @__getpriority(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %5
br label %16
13: ; preds = %2
%14 = load i32, i32* %5
%15 = sub nsw i32 20, %14
br label %16
16: ; preds = %13, %11
%17 = phi i32 [ %12, %11 ], [ %15, %13 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @getpriority(i32 %0, i32 %1) {
%3 = tail call i32 @__getpriority(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
%5 = sub nsw i32 20, %3
%6 = select i1 %4, i32 %3, i32 %5
ret i32 %6
}
int ft_tabstrlen(char **tab) {
  int size;
  size = 0;
  while (tab[size])
    ++size;
  return (size);
}


x86 assembly (clang, -O0):
<ft_tabstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <ft_tabstrlen+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_tabstrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_tabstrlen(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void permitUnusedInt(int i) {}


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

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

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

LLVM IR (-O2):
define void @permitUnusedInt(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int32_t get_int32_le(uint8_t *buf) {
  int32_t res;
  res = buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  return res;
}


x86 assembly (clang, -O0):
<get_int32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int32_le>:
mov    0xc(%rdi),%ecx
shl    $0x18,%ecx
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
or     %ecx,%edx
shl    $0x8,%eax
or     %edx,%eax
or     (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_int32_le(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = load i32, i32* %0
%14 = or i32 %12, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ LDIR(int, int, int, int);
void op_ED_0xb0(void) {
  LDIR(12, 17, 4, 7);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0xb0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
mov    $0x11,%esi
mov    $0x4,%edx
mov    $0x7,%ecx
call   1030 <LDIR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0xb0>:
mov    $0xc,%edi
mov    $0x11,%esi
mov    $0x4,%edx
mov    $0x7,%ecx
jmp    1030 <LDIR@plt>

LLVM IR (-O0):
define void @op_ED_0xb0() {
%1 = call i32 @LDIR(i32 12, i32 17, i32 4, i32 7)
ret void
}

LLVM IR (-O2):
define void @op_ED_0xb0() {
%1 = tail call i32 @LDIR(i32 12, i32 17, i32 4, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ halt();
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
void __attribute__((cdecl)) irq_ssf(unsigned cs, unsigned ip) {
  printf("irq_"
         "ssf"
         "!%x:%x",
         cs, ip);
  halt();
}


x86 assembly (clang, -O0):
<irq_ssf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <halt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_ssf>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <halt@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"irq_ssf!%x:%x\00"
define void @irq_ssf(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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 (...) @halt()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"irq_ssf!%x:%x\00"
define void @irq_ssf(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 (...) @halt()
ret void
}
int do_395() { return 395; }


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

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

LLVM IR (-O0):
define i32 @do_395() {
ret i32 395
}

LLVM IR (-O2):
define i32 @do_395() {
ret i32 395
}
int test_imm_9Aint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x9A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Aint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 154
%7 = icmp ne i64 %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_9Aint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 661424963584
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void glGetShaderInfoLog(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetShaderInfoLog() {
ret void
}
/* Type definitions */
typedef int __u8;
typedef int __u16;

/* Variables and functions */
__u8 lo8(__u16 n) { return (n & 0xFF); }


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

x86 assembly (clang, -O2):
<lo8>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @lo8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}

LLVM IR (-O2):
define i32 @lo8(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
unsigned int mksym_u32() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mksym_u32() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_WR_MODE;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ pabort(char *);
void set_spi_mode(int fd, uint8_t mode) {
  int ret = ioctl(fd, SPI_IOC_WR_MODE, &mode);
  if (ret < 0) {
    pabort("Cannot set mode");
  }
}


x86 assembly (clang, -O0):
<set_spi_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    115c <set_spi_mode+0x3c>
lea    0xea9(%rip),%rdi
call   1040 <pabort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_spi_mode>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
test   %eax,%eax
js     113e <set_spi_mode+0x1e>
pop    %rax
ret
lea    0xebb(%rip),%rdi
call   1040 <pabort@plt>
pop    %rax
ret

LLVM IR (-O0):
@SPI_IOC_WR_MODE = global i32 0
@.str = [16 x i8] c"Cannot set mode\00"
define void @set_spi_mode(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* @SPI_IOC_WR_MODE
%8 = call i32 @ioctl(i32 %6, i32 %7, i32* %4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @pabort(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@SPI_IOC_WR_MODE = global i32 0
@.str = [16 x i8] c"Cannot set mode\00"
define void @set_spi_mode(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SPI_IOC_WR_MODE
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @pabort(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret void
}
int hisi_charger_type_notifier_register(struct notifier_block *nb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @hisi_charger_type_notifier_register(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}