#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 /*<<< orphan*/ free(double *);
double ln_argmin_asymptotic(double const *, double const *, int const);
int ln_grid_optimal(double const *, double const *, int const, double *,
                    int const, char const *, double const);
double log10(double);
double *malloc(int const);
double pow(int, double);
scalar_t__ strcmp(char const *, char *);
double ln_grid_search(const double *data, const double *weight, const int n,
                      const double xmin, const double xmax, double offset,
                      const char *scale, const int k, const char *risk_function,
                      const double threshold) {
  if (offset < 0) {
    offset = ln_argmin_asymptotic(data, weight, n);
    if (strcmp(scale, "log") == 0) {
      offset = log10(offset);
    }
  }
  double *bandwidths = malloc(k * sizeof(double));
  double delta = (xmax - xmin) / (k - 1);
  for (int i = 0; i < k; i++) {
    bandwidths[i] = i * delta + xmin + offset;
  }
  if (strcmp(scale, "log") == 0) {
    for (int i = 0; i < k; i++) {
      bandwidths[i] = pow(10, bandwidths[i]);
    }
  }
  int idx =
      ln_grid_optimal(data, weight, n, bandwidths, k, risk_function, threshold);
  double result = bandwidths[idx];
  free(bandwidths);
  return result;
}


x86 assembly (clang, -O0):
<ln_grid_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8d,-0x3c(%rbp)
mov    %r9,-0x48(%rbp)
movsd  %xmm3,-0x50(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    11f7 <ln_grid_search+0x87>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <ln_argmin_asymptotic@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11f2 <ln_grid_search+0x82>
movsd  -0x30(%rbp),%xmm0
call   1090 <log10@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    11f7 <ln_grid_search+0x87>
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mov    -0x3c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1271 <ln_grid_search+0x101>
cvtsi2sdl -0x64(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    122e <ln_grid_search+0xbe>
mov    -0x38(%rbp),%rdi
lea    0xd84(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12d5 <ln_grid_search+0x165>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    12d0 <ln_grid_search+0x160>
mov    -0x58(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0xa,%edi
call   1080 <pow@plt>
mov    -0x58(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1292 <ln_grid_search+0x122>
jmp    12d5 <ln_grid_search+0x165>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x58(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    -0x48(%rbp),%r9
movsd  -0x50(%rbp),%xmm0
call   1050 <ln_grid_optimal@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x78(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_grid_search>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
movsd  %xmm3,0x38(%rsp)
mov    %r9,0x30(%rsp)
mov    %r8d,%r12d
mov    %rcx,%r15
movapd %xmm1,0x50(%rsp)
movapd %xmm0,0x40(%rsp)
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
xorpd  %xmm0,%xmm0
movapd %xmm2,(%rsp)
ucomisd %xmm2,%xmm0
jbe    11e9 <ln_grid_search+0x79>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <ln_argmin_asymptotic@plt>
movapd %xmm0,(%rsp)
lea    0xe83(%rip),%rsi
mov    %r15,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11e9 <ln_grid_search+0x79>
movapd (%rsp),%xmm0
call   1090 <log10@plt>
movapd %xmm0,(%rsp)
lea    0x0(,%r12,8),%edi
call   1070 <malloc@plt>
mov    %rax,%r13
test   %r12d,%r12d
mov    %r14d,0x1c(%rsp)
mov    %rbx,0x28(%rsp)
mov    %rbp,0x20(%rsp)
jle    1248 <ln_grid_search+0xd8>
mov    %r15,%rdi
lea    -0x1(%r12),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd 0x50(%rsp),%xmm7
movapd 0x40(%rsp),%xmm12
subsd  %xmm12,%xmm7
divsd  %xmm0,%xmm7
mov    %r12d,%r15d
cmp    $0x4,%r12d
jae    125c <ln_grid_search+0xec>
xor    %eax,%eax
movapd (%rsp),%xmm13
jmp    13b0 <ln_grid_search+0x240>
lea    0xe01(%rip),%rsi
mov    %r15,%rdi
call   1060 <strcmp@plt>
jmp    14ad <ln_grid_search+0x33d>
mov    %r15d,%eax
and    $0xfffffffc,%eax
movapd %xmm7,%xmm1
unpcklpd %xmm7,%xmm1
movapd %xmm12,%xmm2
unpcklpd %xmm12,%xmm2
movapd (%rsp),%xmm13
movapd %xmm13,%xmm0
unpcklpd %xmm13,%xmm0
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     14fb <ln_grid_search+0x38b>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
movdqa 0xd55(%rip),%xmm6
xor    %ecx,%ecx
movdqa 0xd5a(%rip),%xmm8
movdqa 0xd61(%rip),%xmm9
movdqa 0xd68(%rip),%xmm10
movdqa 0xd6f(%rip),%xmm11
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movdqa %xmm6,%xmm3
cvtdq2pd %xmm6,%xmm5
paddd  %xmm8,%xmm3
cvtdq2pd %xmm3,%xmm3
mulpd  %xmm1,%xmm5
addpd  %xmm2,%xmm5
mulpd  %xmm1,%xmm3
addpd  %xmm2,%xmm3
addpd  %xmm0,%xmm5
addpd  %xmm0,%xmm3
movupd %xmm5,0x0(%r13,%rcx,8)
movdqa %xmm6,%xmm5
paddd  %xmm9,%xmm5
movdqa %xmm6,%xmm4
paddd  %xmm10,%xmm4
cvtdq2pd %xmm5,%xmm5
cvtdq2pd %xmm4,%xmm4
movupd %xmm3,0x10(%r13,%rcx,8)
mulpd  %xmm1,%xmm5
addpd  %xmm2,%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
addpd  %xmm0,%xmm5
addpd  %xmm0,%xmm4
movupd %xmm5,0x20(%r13,%rcx,8)
movupd %xmm4,0x30(%r13,%rcx,8)
add    $0x8,%rcx
paddd  %xmm11,%xmm6
add    $0xfffffffffffffffe,%rsi
jne    12e0 <ln_grid_search+0x170>
test   $0x1,%dl
je     13a5 <ln_grid_search+0x235>
cvtdq2pd %xmm6,%xmm3
paddd  0xc95(%rip),%xmm6
cvtdq2pd %xmm6,%xmm4
mulpd  %xmm1,%xmm3
addpd  %xmm2,%xmm3
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
addpd  %xmm0,%xmm3
addpd  %xmm0,%xmm4
movupd %xmm3,0x0(%r13,%rcx,8)
movupd %xmm4,0x10(%r13,%rcx,8)
cmp    %r15,%rax
je     13d5 <ln_grid_search+0x265>
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm7,%xmm0
addsd  %xmm12,%xmm0
addsd  %xmm13,%xmm0
movsd  %xmm0,0x0(%r13,%rax,8)
add    $0x1,%rax
cmp    %rax,%r15
jne    13b0 <ln_grid_search+0x240>
lea    0xc74(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    14ad <ln_grid_search+0x33d>
test   %r12d,%r12d
jle    14ad <ln_grid_search+0x33d>
lea    -0x1(%r15),%rax
mov    %r15d,%r14d
and    $0x3,%r14d
cmp    $0x3,%rax
jae    1408 <ln_grid_search+0x298>
xor    %ebx,%ebx
jmp    1479 <ln_grid_search+0x309>
and    $0xfffffffc,%r15d
xor    %ebx,%ebx
xchg   %ax,%ax
movsd  0x0(%r13,%rbx,8),%xmm0
mov    $0xa,%edi
call   1080 <pow@plt>
movsd  %xmm0,0x0(%r13,%rbx,8)
movsd  0x8(%r13,%rbx,8),%xmm0
mov    $0xa,%edi
call   1080 <pow@plt>
movsd  %xmm0,0x8(%r13,%rbx,8)
movsd  0x10(%r13,%rbx,8),%xmm0
mov    $0xa,%edi
call   1080 <pow@plt>
movsd  %xmm0,0x10(%r13,%rbx,8)
movsd  0x18(%r13,%rbx,8),%xmm0
mov    $0xa,%edi
call   1080 <pow@plt>
movsd  %xmm0,0x18(%r13,%rbx,8)
add    $0x4,%rbx
cmp    %rbx,%r15
jne    1410 <ln_grid_search+0x2a0>
test   %r14,%r14
je     14ad <ln_grid_search+0x33d>
lea    0x0(,%rbx,8),%rbx
add    %r13,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rbp,8),%xmm0
mov    $0xa,%edi
call   1080 <pow@plt>
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1490 <ln_grid_search+0x320>
mov    0x20(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x1c(%rsp),%edx
mov    %r13,%rcx
mov    %r12d,%r8d
mov    0x30(%rsp),%r9
movsd  0x38(%rsp),%xmm0
call   1050 <ln_grid_optimal@plt>
cltq
movsd  0x0(%r13,%rax,8),%xmm0
movsd  %xmm0,(%rsp)
mov    %r13,%rdi
call   1030 <free@plt>
movsd  (%rsp),%xmm0
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movdqa 0xafd(%rip),%xmm6
xor    %ecx,%ecx
test   $0x1,%dl
jne    136f <ln_grid_search+0x1ff>
jmp    13a5 <ln_grid_search+0x235>

LLVM IR (-O0):
@.str = [4 x i8] c"log\00"
define double @ln_grid_search(double* %0, double* %1, i32 %2, double %3, double %4, double %5, i8* %6, i32 %7, i8* %8, double %9) {
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i8*
%20 = alloca double
%21 = alloca double*
%22 = alloca double
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca double
store double* %0, double** %11
store double* %1, double** %12
store i32 %2, i32* %13
store double %3, double* %14
store double %4, double* %15
store double %5, double* %16
store i8* %6, i8** %17
store i32 %7, i32* %18
store i8* %8, i8** %19
store double %9, double* %20
%27 = load double, double* %16
%28 = fcmp olt double %27, 0.000000e+00
br i1 %28, label %29, label %41
29: ; preds = %10
%30 = load double*, double** %11
%31 = load double*, double** %12
%32 = load i32, i32* %13
%33 = call double @ln_argmin_asymptotic(double* %30, double* %31, i32 %32)
store double %33, double* %16
%34 = load i8*, i8** %17
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %29
%38 = load double, double* %16
%39 = call double @log10(double %38)
store double %39, double* %16
br label %40
40: ; preds = %37, %29
br label %41
41: ; preds = %40, %10
%42 = load i32, i32* %18
%43 = sext i32 %42 to i64
%44 = mul i64 %43, 8
%45 = trunc i64 %44 to i32
%46 = call double* @malloc(i32 %45)
store double* %46, double** %21
%47 = load double, double* %15
%48 = load double, double* %14
%49 = fsub double %47, %48
%50 = load i32, i32* %18
%51 = sub nsw i32 %50, 1
%52 = sitofp i32 %51 to double
%53 = fdiv double %49, %52
store double %53, double* %22
store i32 0, i32* %23
br label %54
54: ; preds = %70, %41
%55 = load i32, i32* %23
%56 = load i32, i32* %18
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %73
58: ; preds = %54
%59 = load i32, i32* %23
%60 = sitofp i32 %59 to double
%61 = load double, double* %22
%62 = load double, double* %14
%63 = call double @llvm.fmuladd.f64(double %60, double %61, double %62)
%64 = load double, double* %16
%65 = fadd double %63, %64
%66 = load double*, double** %21
%67 = load i32, i32* %23
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
store double %65, double* %69
br label %70
70: ; preds = %58
%71 = load i32, i32* %23
%72 = add nsw i32 %71, 1
store i32 %72, i32* %23
br label %54
73: ; preds = %54
%74 = load i8*, i8** %17
%75 = call i64 @strcmp(i8* %74, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %97
77: ; preds = %73
store i32 0, i32* %24
br label %78
78: ; preds = %93, %77
%79 = load i32, i32* %24
%80 = load i32, i32* %18
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %96
82: ; preds = %78
%83 = load double*, double** %21
%84 = load i32, i32* %24
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %83, i64 %85
%87 = load double, double* %86
%88 = call double @pow(i32 10, double %87)
%89 = load double*, double** %21
%90 = load i32, i32* %24
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %89, i64 %91
store double %88, double* %92
br label %93
93: ; preds = %82
%94 = load i32, i32* %24
%95 = add nsw i32 %94, 1
store i32 %95, i32* %24
br label %78
96: ; preds = %78
br label %97
97: ; preds = %96, %73
%98 = load double*, double** %11
%99 = load double*, double** %12
%100 = load i32, i32* %13
%101 = load double*, double** %21
%102 = load i32, i32* %18
%103 = load i8*, i8** %19
%104 = load double, double* %20
%105 = call i32 @ln_grid_optimal(double* %98, double* %99, i32 %100, double* %101, i32 %102, i8* %103, double %104)
store i32 %105, i32* %25
%106 = load double*, double** %21
%107 = load i32, i32* %25
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %106, i64 %108
%110 = load double, double* %109
store double %110, double* %26
%111 = load double*, double** %21
%112 = call i32 @free(double* %111)
%113 = load double, double* %26
ret double %113
}

LLVM IR (-O2):
@.str = [4 x i8] c"log\00"
define double @ln_grid_search(double* %0, double* %1, i32 %2, double %3, double %4, double %5, i8* %6, i32 %7, i8* %8, double %9) {
%11 = fcmp olt double %5, 0.000000e+00
br i1 %11, label %12, label %18
12: ; preds = %10
%13 = tail call double @ln_argmin_asymptotic(double* %0, double* %1, i32 %2)
%14 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = tail call double @log10(double %13)
br label %18
18: ; preds = %12, %16, %10
%19 = phi double [ %17, %16 ], [ %13, %12 ], [ %5, %10 ]
%20 = shl i32 %7, 3
%21 = tail call double* @malloc(i32 %20)
%22 = fsub double %4, %3
%23 = add nsw i32 %7, -1
%24 = sitofp i32 %23 to double
%25 = fdiv double %22, %24
%26 = icmp sgt i32 %7, 0
br i1 %26, label %29, label %27
27: ; preds = %18
%28 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %157
29: ; preds = %18
%30 = zext i32 %7 to i64
%31 = icmp ult i32 %7, 4
br i1 %31, label %103, label %32
32: ; preds = %29
%33 = and i64 %30, 4294967292
%34 = insertelement <2 x double> poison, double %25, i64 0
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> zeroinitializer
%36 = insertelement <2 x double> poison, double %3, i64 0
%37 = shufflevector <2 x double> %36, <2 x double> poison, <2 x i32> zeroinitializer
%38 = insertelement <2 x double> poison, double %25, i64 0
%39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> zeroinitializer
%40 = insertelement <2 x double> poison, double %3, i64 0
%41 = shufflevector <2 x double> %40, <2 x double> poison, <2 x i32> zeroinitializer
%42 = insertelement <2 x double> poison, double %19, i64 0
%43 = shufflevector <2 x double> %42, <2 x double> poison, <2 x i32> zeroinitializer
%44 = insertelement <2 x double> poison, double %19, i64 0
%45 = shufflevector <2 x double> %44, <2 x double> poison, <2 x i32> zeroinitializer
%46 = add nsw i64 %33, -4
%47 = lshr exact i64 %46, 2
%48 = add nuw nsw i64 %47, 1
%49 = and i64 %48, 1
%50 = icmp eq i64 %46, 0
br i1 %50, label %85, label %51
51: ; preds = %32
%52 = and i64 %48, 9223372036854775806
br label %53
53: ; preds = %53, %51
%54 = phi i64 [ 0, %51 ], [ %81, %53 ]
%55 = phi <2 x i32> [ <i32 0, i32 1>, %51 ], [ %82, %53 ]
%56 = phi i64 [ 0, %51 ], [ %83, %53 ]
%57 = add <2 x i32> %55, <i32 2, i32 2>
%58 = sitofp <2 x i32> %55 to <2 x double>
%59 = sitofp <2 x i32> %57 to <2 x double>
%60 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %58, <2 x double> %35, <2 x double> %37)
%61 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %59, <2 x double> %39, <2 x double> %41)
%62 = fadd <2 x double> %43, %60
%63 = fadd <2 x double> %45, %61
%64 = getelementptr inbounds double, double* %21, i64 %54
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> %62, <2 x double>* %65
%66 = getelementptr inbounds double, double* %64, i64 2
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> %63, <2 x double>* %67
%68 = or i64 %54, 4
%69 = add <2 x i32> %55, <i32 4, i32 4>
%70 = add <2 x i32> %55, <i32 6, i32 6>
%71 = sitofp <2 x i32> %69 to <2 x double>
%72 = sitofp <2 x i32> %70 to <2 x double>
%73 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %71, <2 x double> %35, <2 x double> %37)
%74 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %72, <2 x double> %39, <2 x double> %41)
%75 = fadd <2 x double> %43, %73
%76 = fadd <2 x double> %45, %74
%77 = getelementptr inbounds double, double* %21, i64 %68
%78 = bitcast double* %77 to <2 x double>*
store <2 x double> %75, <2 x double>* %78
%79 = getelementptr inbounds double, double* %77, i64 2
%80 = bitcast double* %79 to <2 x double>*
store <2 x double> %76, <2 x double>* %80
%81 = add nuw i64 %54, 8
%82 = add <2 x i32> %55, <i32 8, i32 8>
%83 = add i64 %56, 2
%84 = icmp eq i64 %83, %52
br i1 %84, label %85, label %53
85: ; preds = %53, %32
%86 = phi i64 [ 0, %32 ], [ %81, %53 ]
%87 = phi <2 x i32> [ <i32 0, i32 1>, %32 ], [ %82, %53 ]
%88 = icmp eq i64 %49, 0
br i1 %88, label %101, label %89
89: ; preds = %85
%90 = add <2 x i32> %87, <i32 2, i32 2>
%91 = sitofp <2 x i32> %87 to <2 x double>
%92 = sitofp <2 x i32> %90 to <2 x double>
%93 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %91, <2 x double> %35, <2 x double> %37)
%94 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %92, <2 x double> %39, <2 x double> %41)
%95 = fadd <2 x double> %43, %93
%96 = fadd <2 x double> %45, %94
%97 = getelementptr inbounds double, double* %21, i64 %86
%98 = bitcast double* %97 to <2 x double>*
store <2 x double> %95, <2 x double>* %98
%99 = getelementptr inbounds double, double* %97, i64 2
%100 = bitcast double* %99 to <2 x double>*
store <2 x double> %96, <2 x double>* %100
br label %101
101: ; preds = %85, %89
%102 = icmp eq i64 %33, %30
br i1 %102, label %105, label %103
103: ; preds = %29, %101
%104 = phi i64 [ 0, %29 ], [ %33, %101 ]
br label %115
105: ; preds = %115, %101
%106 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
%108 = and i1 %107, %26
br i1 %108, label %109, label %157
109: ; preds = %105
%110 = add nsw i64 %30, -1
%111 = and i64 %30, 3
%112 = icmp ult i64 %110, 3
br i1 %112, label %145, label %113
113: ; preds = %109
%114 = and i64 %30, 4294967292
br label %124
115: ; preds = %103, %115
%116 = phi i64 [ %122, %115 ], [ %104, %103 ]
%117 = trunc i64 %116 to i32
%118 = sitofp i32 %117 to double
%119 = tail call double @llvm.fmuladd.f64(double %118, double %25, double %3)
%120 = fadd double %19, %119
%121 = getelementptr inbounds double, double* %21, i64 %116
store double %120, double* %121
%122 = add nuw nsw i64 %116, 1
%123 = icmp eq i64 %122, %30
br i1 %123, label %105, label %115
124: ; preds = %124, %113
%125 = phi i64 [ 0, %113 ], [ %142, %124 ]
%126 = phi i64 [ 0, %113 ], [ %143, %124 ]
%127 = getelementptr inbounds double, double* %21, i64 %125
%128 = load double, double* %127
%129 = tail call double @pow(i32 10, double %128)
store double %129, double* %127
%130 = or i64 %125, 1
%131 = getelementptr inbounds double, double* %21, i64 %130
%132 = load double, double* %131
%133 = tail call double @pow(i32 10, double %132)
store double %133, double* %131
%134 = or i64 %125, 2
%135 = getelementptr inbounds double, double* %21, i64 %134
%136 = load double, double* %135
%137 = tail call double @pow(i32 10, double %136)
store double %137, double* %135
%138 = or i64 %125, 3
%139 = getelementptr inbounds double, double* %21, i64 %138
%140 = load double, double* %139
%141 = tail call double @pow(i32 10, double %140)
store double %141, double* %139
%142 = add nuw nsw i64 %125, 4
%143 = add i64 %126, 4
%144 = icmp eq i64 %143, %114
br i1 %144, label %145, label %124
145: ; preds = %124, %109
%146 = phi i64 [ 0, %109 ], [ %142, %124 ]
%147 = icmp eq i64 %111, 0
br i1 %147, label %157, label %148
148: ; preds = %145, %148
%149 = phi i64 [ %154, %148 ], [ %146, %145 ]
%150 = phi i64 [ %155, %148 ], [ 0, %145 ]
%151 = getelementptr inbounds double, double* %21, i64 %149
%152 = load double, double* %151
%153 = tail call double @pow(i32 10, double %152)
store double %153, double* %151
%154 = add nuw nsw i64 %149, 1
%155 = add i64 %150, 1
%156 = icmp eq i64 %155, %111
br i1 %156, label %157, label %148
157: ; preds = %145, %148, %27, %105
%158 = tail call i32 @ln_grid_optimal(double* %0, double* %1, i32 %2, double* %21, i32 %7, i8* %8, double %9)
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds double, double* %21, i64 %159
%161 = load double, double* %160
%162 = tail call i32 @free(double* %21)
ret double %161
}