#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int log(double);
int E1_to_s(double e_val, int n0, int n1, int db_size, void *pu) {
  double mp, np, a_n0, a_n0f, a_n1;
  double zs, log_len, p_val;
  int score;
  if (n1 < 10)
    return 0;
  score = -log(e_val) / log(10.0);
  if (score < 0)
    score = 0;
  return score;
}


x86 assembly (clang, -O0):
<E1_to_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    1140 <E1_to_s+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1182 <E1_to_s+0x72>
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x70(%rbp)
movsd  0xea5(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x70(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jge    117c <E1_to_s+0x6c>
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<E1_to_s>:
xor    %eax,%eax
cmp    $0xa,%esi
jl     113b <E1_to_s+0x2b>
push   %rbx
call   1030 <log@plt>
mov    %eax,%ebx
movsd  0xed9(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xor    %ecx,%ecx
neg    %eax
cmovs  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @E1_to_s(double %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca i32
store double %0, double* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
%21 = load i32, i32* %9
%22 = icmp slt i32 %21, 10
br i1 %22, label %23, label %24
23: ; preds = %5
store i32 0, i32* %6
br label %35
24: ; preds = %5
%25 = load double, double* %7
%26 = call i32 @log(double %25)
%27 = sub nsw i32 0, %26
%28 = call i32 @log(double 1.000000e+01)
%29 = sdiv i32 %27, %28
store i32 %29, i32* %20
%30 = load i32, i32* %20
%31 = icmp slt i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %24
store i32 0, i32* %20
br label %33
33: ; preds = %32, %24
%34 = load i32, i32* %20
store i32 %34, i32* %6
br label %35
35: ; preds = %33, %23
%36 = load i32, i32* %6
ret i32 %36
}

LLVM IR (-O2):
define i32 @E1_to_s(double %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = icmp slt i32 %2, 10
br i1 %6, label %14, label %7
7: ; preds = %5
%8 = tail call i32 @log(double %0)
%9 = tail call i32 @log(double 1.000000e+01)
%10 = sdiv i32 %8, %9
%11 = sub nsw i32 0, %10
%12 = icmp sgt i32 %11, 0
%13 = select i1 %12, i32 %11, i32 0
br label %14
14: ; preds = %5, %7
%15 = phi i32 [ %13, %7 ], [ 0, %5 ]
ret i32 %15
}