#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 */
double log(double);
double pow(double, double);
void nicelog(double llimit, double ulimit, int max, double *val, int *nret) {
  int i, j, k, ij, mul, icy, nexp, nrt;
  double xxl, xxu;
  double lind[5] = {9, 5, 3, 2, 1};
  double seed[9][5] = {1, 1, 1, 1, 1, 2, 2, 2, 3, 0, 3, 4, 5, 0, 0,
                       4, 6, 0, 0, 0, 5, 8, 0, 0, 0, 6, 0, 0, 0, 0,
                       7, 0, 0, 0, 0, 8, 0, 0, 0, 0, 9, 0, 0, 0, 0};
  nrt = 0;
  if (llimit <= 0.0 || ulimit <= 0.0) {
    return;
  }
  xxl = llimit;
  xxu = ulimit;
  if (xxu < xxl) {
    xxl = ulimit;
    xxu = llimit;
  }
  xxl = log(xxl) / 0.99999 / 2.30258;
  if (xxl < 0) {
    xxl = xxl * 0.9999 - 1.0;
  }
  ij = xxl;
  mul = ij;
  xxl = pow(10, (double)ij);
  xxu = log(xxu) / 0.99999 / 2.30258;
  if (xxu > 0) {
    xxu = xxu * 0.9999 + 1.0;
  }
  icy = xxu;
  icy = icy - ij;
  for (k = 0; k < 5; k++) {
    nrt = icy * lind[k] + 1;
    if (nrt <= max) {
      break;
    }
    if (k == 4) {
      k = -1;
      icy--;
    }
  }
  ij = -1;
  for (i = 0; i < icy; i++) {
    for (j = 0; j < lind[k]; j++) {
      ij++;
      val[ij] = seed[j][k] * xxl * pow(10.0, (double)(i));
    }
  }
  val[nrt - 1] = xxl * pow(10.0, (double)icy);
  nexp = mul;
  *nret = nrt;
}


x86 assembly (clang, -O0):
<nicelog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xe93(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe7e(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe69(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe54(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
lea    -0x1f0(%rbp),%rdi
lea    0xe91(%rip),%rsi
mov    $0x168,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jae    11ec <nicelog+0xac>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11f1 <nicelog+0xb1>
jmp    1493 <nicelog+0x353>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    122d <nicelog+0xed>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1050 <log@plt>
movsd  0xdf1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xddd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    1284 <nicelog+0x144>
movsd  -0x50(%rbp),%xmm0
movsd  0xdc9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdc5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
cvttsd2si -0x50(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x3c(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm1
movsd  0xda9(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1050 <log@plt>
movsd  0xd75(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd61(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1304 <nicelog+0x1c4>
movsd  -0x58(%rbp),%xmm0
movsd  0xd49(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd05(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
cvttsd2si -0x58(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
sub    -0x38(%rbp),%eax
mov    %eax,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    138a <nicelog+0x24a>
cvtsi2sdl -0x40(%rbp),%xmm0
movslq -0x34(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcbf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     135d <nicelog+0x21d>
jmp    138a <nicelog+0x24a>
cmpl   $0x4,-0x34(%rbp)
jne    1377 <nicelog+0x237>
movl   $0xffffffff,-0x34(%rbp)
mov    -0x40(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x40(%rbp)
jmp    137c <nicelog+0x23c>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    131c <nicelog+0x1dc>
movl   $0xffffffff,-0x38(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1444 <nicelog+0x304>
movl   $0x0,-0x30(%rbp)
cvtsi2sdl -0x30(%rbp),%xmm1
movslq -0x34(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    1431 <nicelog+0x2f1>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
movslq -0x30(%rbp),%rcx
lea    -0x1f0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x1f8(%rbp)
ff
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  0xc46(%rip),%xmm0
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x1f8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    13ab <nicelog+0x26b>
jmp    1436 <nicelog+0x2f6>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1398 <nicelog+0x258>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x200(%rbp)
ff
cvtsi2sdl -0x40(%rbp),%xmm1
movsd  0xbea(%rip),%xmm0
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x200(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x48(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nicelog>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,0x10(%rsp)
movapd %xmm0,%xmm2
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movapd 0xec5(%rip),%xmm0
movapd %xmm0,0x50(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x60(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
jae    13a8 <nicelog+0x288>
ucomisd %xmm1,%xmm0
jae    13a8 <nicelog+0x288>
mov    %edi,%r12d
mov    %rdx,0x20(%rsp)
movapd %xmm1,%xmm0
minsd  %xmm2,%xmm0
maxsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
call   1030 <log@plt>
divsd  0xe82(%rip),%xmm0
divsd  0xe82(%rip),%xmm0
movsd  0xe82(%rip),%xmm3
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm1
cmpltsd %xmm2,%xmm1
movapd %xmm1,%xmm2
andnpd %xmm0,%xmm2
mulsd  %xmm3,%xmm0
addsd  0xe69(%rip),%xmm0
andpd  %xmm0,%xmm1
orpd   %xmm2,%xmm1
cvttsd2si %xmm1,%ebp
cvttpd2dq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm1
movsd  0xe55(%rip),%xmm0
call   1040 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  (%rsp),%xmm0
call   1030 <log@plt>
divsd  0xe18(%rip),%xmm0
divsd  0xe18(%rip),%xmm0
movsd  0xe18(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe24(%rip),%xmm2
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm3
xorpd  %xmm4,%xmm4
cmpltsd %xmm0,%xmm4
movapd %xmm4,%xmm1
andnpd %xmm0,%xmm1
andpd  %xmm3,%xmm4
orpd   %xmm1,%xmm4
cvttsd2si %xmm4,%ebx
sub    %ebp,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0xdf6(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
cvttsd2si %xmm0,%esi
xor    %eax,%eax
cmp    %r12d,%esi
jle    12a3 <nicelog+0x183>
xor    %edx,%edx
nop
xor    %ecx,%ecx
cmp    $0x4,%edx
lea    0x1(%rdx),%edx
cmove  %eax,%edx
sete   %cl
sub    %ecx,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movslq %edx,%rcx
movsd  0x40(%rsp,%rcx,8),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
cvttsd2si %xmm0,%esi
cmp    %r12d,%esi
jg     1270 <nicelog+0x150>
jmp    12a5 <nicelog+0x185>
xor    %ecx,%ecx
mov    %esi,0xc(%rsp)
test   %ebx,%ebx
jle    1373 <nicelog+0x253>
lea    0xda8(%rip),%rax
lea    (%rax,%rcx,8),%rax
mov    %rax,0x28(%rsp)
mov    $0xffffffff,%ebp
xor    %r14d,%r14d
xorpd  %xmm1,%xmm1
movsd  %xmm3,0x30(%rsp)
jmp    12f5 <nicelog+0x1d5>
cs nopw 0x0(%rax,%rax,1)
nop
addsd  0xd60(%rip),%xmm1
add    $0x1,%r14d
cmp    %ebx,%r14d
je     1373 <nicelog+0x253>
ucomisd 0xd5b(%rip),%xmm3
jbe    12e0 <nicelog+0x1c0>
movslq %ebp,%rax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%r15
mov    $0x1,%r12d
mov    0x28(%rsp),%r13
movsd  %xmm1,0x38(%rsp)
nopl   0x0(%rax)
movsd  0x0(%r13),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xd07(%rip),%xmm0
call   1040 <pow@plt>
movsd  0x38(%rsp),%xmm1
movsd  0x30(%rsp),%xmm3
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%r15,%r12,8)
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
add    $0x1,%ebp
add    $0x1,%r12
add    $0x28,%r13
ucomisd %xmm0,%xmm3
ja     1320 <nicelog+0x200>
jmp    12e0 <nicelog+0x1c0>
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
movsd  0xcbe(%rip),%xmm0
call   1040 <pow@plt>
movsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movslq 0xc(%rsp),%rax
mov    0x10(%rsp),%rcx
movsd  %xmm1,-0x8(%rcx,%rax,8)
mov    0x20(%rsp),%rcx
mov    %eax,(%rcx)
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.nicelog.seed = [9 x [5 x double]] [[5 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00], [5 x double] [double 2.000000e+00, double 2.000000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00], [5 x double] [double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 4.000000e+00, double 6.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 5.000000e+00, double 8.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 6.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 7.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 8.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 9.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00]]
define void @nicelog(double %0, double %1, i32 %2, double* %3, i32* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca double
%20 = alloca double
%21 = alloca [5 x double]
%22 = alloca [9 x [5 x double]]
store double %0, double* %6
store double %1, double* %7
store i32 %2, i32* %8
store double* %3, double** %9
store i32* %4, i32** %10
%23 = bitcast [5 x double]* %21 to i8*
%24 = bitcast i8* %23 to [5 x double]*
%25 = getelementptr inbounds [5 x double], [5 x double]* %24, i32 0, i32 0
store double 9.000000e+00, double* %25
%26 = getelementptr inbounds [5 x double], [5 x double]* %24, i32 0, i32 1
store double 5.000000e+00, double* %26
%27 = getelementptr inbounds [5 x double], [5 x double]* %24, i32 0, i32 2
store double 3.000000e+00, double* %27
%28 = getelementptr inbounds [5 x double], [5 x double]* %24, i32 0, i32 3
store double 2.000000e+00, double* %28
%29 = getelementptr inbounds [5 x double], [5 x double]* %24, i32 0, i32 4
store double 1.000000e+00, double* %29
%30 = bitcast [9 x [5 x double]]* %22 to i8*
store i32 0, i32* %18
%31 = load double, double* %6
%32 = fcmp ole double %31, 0.000000e+00
br i1 %32, label %36, label %33
33: ; preds = %5
%34 = load double, double* %7
%35 = fcmp ole double %34, 0.000000e+00
br i1 %35, label %36, label %37
36: ; preds = %33, %5
br label %159
37: ; preds = %33
%38 = load double, double* %6
store double %38, double* %19
%39 = load double, double* %7
store double %39, double* %20
%40 = load double, double* %20
%41 = load double, double* %19
%42 = fcmp olt double %40, %41
br i1 %42, label %43, label %46
43: ; preds = %37
%44 = load double, double* %7
store double %44, double* %19
%45 = load double, double* %6
store double %45, double* %20
br label %46
46: ; preds = %43, %37
%47 = load double, double* %19
%48 = call double @log(double %47)
%49 = fdiv double %48, 9.999900e-01
%50 = fdiv double %49, 2.302580e+00
store double %50, double* %19
%51 = load double, double* %19
%52 = fcmp olt double %51, 0.000000e+00
br i1 %52, label %53, label %56
53: ; preds = %46
%54 = load double, double* %19
%55 = call double @llvm.fmuladd.f64(double %54, double 9.999000e-01, double -1.000000e+00)
store double %55, double* %19
br label %56
56: ; preds = %53, %46
%57 = load double, double* %19
%58 = fptosi double %57 to i32
store i32 %58, i32* %14
%59 = load i32, i32* %14
store i32 %59, i32* %15
%60 = load i32, i32* %14
%61 = sitofp i32 %60 to double
%62 = call double @pow(double 1.000000e+01, double %61)
store double %62, double* %19
%63 = load double, double* %20
%64 = call double @log(double %63)
%65 = fdiv double %64, 9.999900e-01
%66 = fdiv double %65, 2.302580e+00
store double %66, double* %20
%67 = load double, double* %20
%68 = fcmp ogt double %67, 0.000000e+00
br i1 %68, label %69, label %72
69: ; preds = %56
%70 = load double, double* %20
%71 = call double @llvm.fmuladd.f64(double %70, double 9.999000e-01, double 1.000000e+00)
store double %71, double* %20
br label %72
72: ; preds = %69, %56
%73 = load double, double* %20
%74 = fptosi double %73 to i32
store i32 %74, i32* %16
%75 = load i32, i32* %16
%76 = load i32, i32* %14
%77 = sub nsw i32 %75, %76
store i32 %77, i32* %16
store i32 0, i32* %13
br label %78
78: ; preds = %101, %72
%79 = load i32, i32* %13
%80 = icmp slt i32 %79, 5
br i1 %80, label %81, label %104
81: ; preds = %78
%82 = load i32, i32* %16
%83 = sitofp i32 %82 to double
%84 = load i32, i32* %13
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [5 x double], [5 x double]* %21, i64 0, i64 %85
%87 = load double, double* %86
%88 = call double @llvm.fmuladd.f64(double %83, double %87, double 1.000000e+00)
%89 = fptosi double %88 to i32
store i32 %89, i32* %18
%90 = load i32, i32* %18
%91 = load i32, i32* %8
%92 = icmp sle i32 %90, %91
br i1 %92, label %93, label %94
93: ; preds = %81
br label %104
94: ; preds = %81
%95 = load i32, i32* %13
%96 = icmp eq i32 %95, 4
br i1 %96, label %97, label %100
97: ; preds = %94
store i32 -1, i32* %13
%98 = load i32, i32* %16
%99 = add nsw i32 %98, -1
store i32 %99, i32* %16
br label %100
100: ; preds = %97, %94
br label %101
101: ; preds = %100
%102 = load i32, i32* %13
%103 = add nsw i32 %102, 1
store i32 %103, i32* %13
br label %78
104: ; preds = %93, %78
store i32 -1, i32* %14
store i32 0, i32* %11
br label %105
105: ; preds = %142, %104
%106 = load i32, i32* %11
%107 = load i32, i32* %16
%108 = icmp slt i32 %106, %107
br i1 %108, label %109, label %145
109: ; preds = %105
store i32 0, i32* %12
br label %110
110: ; preds = %138, %109
%111 = load i32, i32* %12
%112 = sitofp i32 %111 to double
%113 = load i32, i32* %13
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [5 x double], [5 x double]* %21, i64 0, i64 %114
%116 = load double, double* %115
%117 = fcmp olt double %112, %116
br i1 %117, label %118, label %141
118: ; preds = %110
%119 = load i32, i32* %14
%120 = add nsw i32 %119, 1
store i32 %120, i32* %14
%121 = load i32, i32* %12
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [9 x [5 x double]], [9 x [5 x double]]* %22, i64 0, i64 %122
%124 = load i32, i32* %13
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [5 x double], [5 x double]* %123, i64 0, i64 %125
%127 = load double, double* %126
%128 = load double, double* %19
%129 = fmul double %127, %128
%130 = load i32, i32* %11
%131 = sitofp i32 %130 to double
%132 = call double @pow(double 1.000000e+01, double %131)
%133 = fmul double %129, %132
%134 = load double*, double** %9
%135 = load i32, i32* %14
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds double, double* %134, i64 %136
store double %133, double* %137
br label %138
138: ; preds = %118
%139 = load i32, i32* %12
%140 = add nsw i32 %139, 1
store i32 %140, i32* %12
br label %110
141: ; preds = %110
br label %142
142: ; preds = %141
%143 = load i32, i32* %11
%144 = add nsw i32 %143, 1
store i32 %144, i32* %11
br label %105
145: ; preds = %105
%146 = load double, double* %19
%147 = load i32, i32* %16
%148 = sitofp i32 %147 to double
%149 = call double @pow(double 1.000000e+01, double %148)
%150 = fmul double %146, %149
%151 = load double*, double** %9
%152 = load i32, i32* %18
%153 = sub nsw i32 %152, 1
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %151, i64 %154
store double %150, double* %155
%156 = load i32, i32* %15
store i32 %156, i32* %17
%157 = load i32, i32* %18
%158 = load i32*, i32** %10
store i32 %157, i32* %158
br label %159
159: ; preds = %145, %36
ret void
}

LLVM IR (-O2):
@__const.nicelog.seed = [9 x [5 x double]] [[5 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00], [5 x double] [double 2.000000e+00, double 2.000000e+00, double 2.000000e+00, double 3.000000e+00, double 0.000000e+00], [5 x double] [double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 4.000000e+00, double 6.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 5.000000e+00, double 8.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 6.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 7.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 8.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00], [5 x double] [double 9.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00]]
define void @nicelog(double %0, double %1, i32 %2, double* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = alloca [5 x double]
%7 = bitcast [5 x double]* %6 to i8*
%8 = bitcast [5 x double]* %6 to <2 x double>*
store <2 x double> <double 9.000000e+00, double 5.000000e+00>, <2 x double>* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 2
%10 = bitcast double* %9 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 2.000000e+00>, <2 x double>* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 4
store double 1.000000e+00, double* %11
%12 = fcmp ole double %0, 0.000000e+00
%13 = fcmp ole double %1, 0.000000e+00
%14 = or i1 %12, %13
br i1 %14, label %98, label %15
15: ; preds = %5
%16 = fcmp olt double %1, %0
%17 = select i1 %16, double %1, double %0
%18 = select i1 %16, double %0, double %1
%19 = tail call double @log(double %17)
%20 = fdiv double %19, 9.999900e-01
%21 = fdiv double %20, 2.302580e+00
%22 = fcmp olt double %21, 0.000000e+00
%23 = tail call double @llvm.fmuladd.f64(double %21, double 9.999000e-01, double -1.000000e+00)
%24 = select i1 %22, double %23, double %21
%25 = fptosi double %24 to i32
%26 = sitofp i32 %25 to double
%27 = tail call double @pow(double 1.000000e+01, double %26)
%28 = tail call double @log(double %18)
%29 = fdiv double %28, 9.999900e-01
%30 = fdiv double %29, 2.302580e+00
%31 = fcmp ogt double %30, 0.000000e+00
%32 = tail call double @llvm.fmuladd.f64(double %30, double 9.999000e-01, double 1.000000e+00)
%33 = select i1 %31, double %32, double %30
%34 = fptosi double %33 to i32
%35 = sub nsw i32 %34, %25
%36 = sitofp i32 %35 to double
%37 = tail call double @llvm.fmuladd.f64(double %36, double 9.000000e+00, double 1.000000e+00)
%38 = fptosi double %37 to i32
%39 = icmp sgt i32 %38, %2
br i1 %39, label %50, label %42
40: ; preds = %50
%41 = sext i32 %57 to i64
br label %42
42: ; preds = %40, %15
%43 = phi double [ 9.000000e+00, %15 ], [ %61, %40 ]
%44 = phi i64 [ 0, %15 ], [ %41, %40 ]
%45 = phi i32 [ %35, %15 ], [ %55, %40 ]
%46 = phi i32 [ %38, %15 ], [ %63, %40 ]
%47 = icmp sgt i32 %45, 0
br i1 %47, label %48, label %91
48: ; preds = %42
%49 = fcmp ogt double %43, 0.000000e+00
br label %65
50: ; preds = %15, %50
%51 = phi i32 [ %55, %50 ], [ %35, %15 ]
%52 = phi i32 [ %57, %50 ], [ 0, %15 ]
%53 = icmp eq i32 %52, 4
%54 = sext i1 %53 to i32
%55 = add nsw i32 %51, %54
%56 = add nsw i32 %52, 1
%57 = select i1 %53, i32 0, i32 %56
%58 = sitofp i32 %55 to double
%59 = sext i32 %57 to i64
%60 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 %59
%61 = load double, double* %60
%62 = tail call double @llvm.fmuladd.f64(double %58, double %61, double 1.000000e+00)
%63 = fptosi double %62 to i32
%64 = icmp sgt i32 %63, %2
br i1 %64, label %50, label %40
65: ; preds = %48, %87
%66 = phi i32 [ 0, %48 ], [ %89, %87 ]
%67 = phi i32 [ -1, %48 ], [ %88, %87 ]
br i1 %49, label %68, label %87
68: ; preds = %65
%69 = sitofp i32 %66 to double
%70 = sext i32 %67 to i64
br label %71
71: ; preds = %68, %71
%72 = phi i64 [ %70, %68 ], [ %74, %71 ]
%73 = phi i64 [ 0, %68 ], [ %81, %71 ]
%74 = add i64 %72, 1
%75 = getelementptr inbounds [9 x [5 x double]], [9 x [5 x double]]* @__const.nicelog.seed, i64 0, i64 %73, i64 %44
%76 = load double, double* %75
%77 = fmul double %27, %76
%78 = tail call double @pow(double 1.000000e+01, double %69)
%79 = fmul double %77, %78
%80 = getelementptr inbounds double, double* %3, i64 %74
store double %79, double* %80
%81 = add nuw i64 %73, 1
%82 = trunc i64 %81 to i32
%83 = sitofp i32 %82 to double
%84 = fcmp ogt double %43, %83
br i1 %84, label %71, label %85
85: ; preds = %71
%86 = trunc i64 %74 to i32
br label %87
87: ; preds = %85, %65
%88 = phi i32 [ %67, %65 ], [ %86, %85 ]
%89 = add nuw nsw i32 %66, 1
%90 = icmp eq i32 %89, %45
br i1 %90, label %91, label %65
91: ; preds = %87, %42
%92 = sitofp i32 %45 to double
%93 = tail call double @pow(double 1.000000e+01, double %92)
%94 = fmul double %27, %93
%95 = add nsw i32 %46, -1
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %3, i64 %96
store double %94, double* %97
store i32 %46, i32* %4
br label %98
98: ; preds = %5, %91
ret void
}