#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 rxn_coor(double *, double *, int);
double tanh(double);
double mlnL(double *a, double **zA, double **zB, int m) {
  int i, j;
  double lnl, rk;
  lnl = ((double)(zA[0][0] + zB[0][0])) * log(0.5);
  for (i = 1; i <= zA[0][0]; i = i + 1) {
    rk = rxn_coor(a, zA[i], m);
    lnl = lnl + log(1.0 - tanh(rk));
  }
  for (i = 1; i <= zB[0][0]; i = i + 1) {
    rk = rxn_coor(a, zB[i], m);
    lnl = lnl + log(1.0 + tanh(rk));
  }
  return (-lnl);
}


x86 assembly (clang, -O0):
<mlnL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe96(%rip),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x20(%rbp)
cvtsi2sdl -0x20(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1205 <mlnL+0xd5>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <rxn_coor@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1030 <tanh@plt>
movaps %xmm0,%xmm1
movsd  0xe2b(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1187 <mlnL+0x57>
movl   $0x1,-0x20(%rbp)
cvtsi2sdl -0x20(%rbp),%xmm1
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     128a <mlnL+0x15a>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <rxn_coor@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1030 <tanh@plt>
movaps %xmm0,%xmm1
movsd  0xda6(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    120c <mlnL+0xdc>
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlnL>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r14d
mov    %rdx,%r12
mov    %rdi,%r15
mov    (%rsi),%rax
movsd  (%rax),%xmm2
mov    (%rdx),%rax
ucomisd 0xeb1(%rip),%xmm2
movsd  (%rax),%xmm0
addsd  %xmm0,%xmm2
mulsd  0xe99(%rip),%xmm2
jb     11d9 <mlnL+0xa9>
mov    %rsi,%rbp
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movapd %xmm2,(%rsp)
mov    0x0(%rbp,%rbx,8),%rsi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <rxn_coor@plt>
call   1030 <tanh@plt>
movsd  0xe66(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1050 <log@plt>
movapd (%rsp),%xmm2
addsd  %xmm0,%xmm2
add    $0x1,%rbx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mov    0x0(%rbp),%rax
movsd  (%rax),%xmm1
ucomisd %xmm0,%xmm1
jae    1180 <mlnL+0x50>
mov    (%r12),%rax
movsd  (%rax),%xmm0
ucomisd 0xe27(%rip),%xmm0
jb     1238 <mlnL+0x108>
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
movapd %xmm2,(%rsp)
mov    (%r12,%rbp,8),%rsi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <rxn_coor@plt>
call   1030 <tanh@plt>
addsd  0xdf7(%rip),%xmm0
call   1050 <log@plt>
movapd (%rsp),%xmm2
addsd  %xmm0,%xmm2
add    $0x1,%rbp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mov    (%r12),%rax
movsd  (%rax),%xmm1
ucomisd %xmm0,%xmm1
jae    11f0 <mlnL+0xc0>
xorpd  0xdd0(%rip),%xmm2
movapd %xmm2,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @mlnL(double* %0, double** %1, double** %2, i32 %3) {
%5 = alloca double*
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store double* %0, double** %5
store double** %1, double*** %6
store double** %2, double*** %7
store i32 %3, i32* %8
%13 = load double**, double*** %6
%14 = getelementptr inbounds double*, double** %13, i64 0
%15 = load double*, double** %14
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = load double**, double*** %7
%19 = getelementptr inbounds double*, double** %18, i64 0
%20 = load double*, double** %19
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = fadd double %17, %22
%24 = call double @log(double 5.000000e-01)
%25 = fmul double %23, %24
store double %25, double* %11
store i32 1, i32* %9
br label %26
26: ; preds = %50, %4
%27 = load i32, i32* %9
%28 = sitofp i32 %27 to double
%29 = load double**, double*** %6
%30 = getelementptr inbounds double*, double** %29, i64 0
%31 = load double*, double** %30
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = fcmp ole double %28, %33
br i1 %34, label %35, label %53
35: ; preds = %26
%36 = load double*, double** %5
%37 = load double**, double*** %6
%38 = load i32, i32* %9
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double*, double** %37, i64 %39
%41 = load double*, double** %40
%42 = load i32, i32* %8
%43 = call double @rxn_coor(double* %36, double* %41, i32 %42)
store double %43, double* %12
%44 = load double, double* %11
%45 = load double, double* %12
%46 = call double @tanh(double %45)
%47 = fsub double 1.000000e+00, %46
%48 = call double @log(double %47)
%49 = fadd double %44, %48
store double %49, double* %11
br label %50
50: ; preds = %35
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
store i32 %52, i32* %9
br label %26
53: ; preds = %26
store i32 1, i32* %9
br label %54
54: ; preds = %78, %53
%55 = load i32, i32* %9
%56 = sitofp i32 %55 to double
%57 = load double**, double*** %7
%58 = getelementptr inbounds double*, double** %57, i64 0
%59 = load double*, double** %58
%60 = getelementptr inbounds double, double* %59, i64 0
%61 = load double, double* %60
%62 = fcmp ole double %56, %61
br i1 %62, label %63, label %81
63: ; preds = %54
%64 = load double*, double** %5
%65 = load double**, double*** %7
%66 = load i32, i32* %9
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double*, double** %65, i64 %67
%69 = load double*, double** %68
%70 = load i32, i32* %8
%71 = call double @rxn_coor(double* %64, double* %69, i32 %70)
store double %71, double* %12
%72 = load double, double* %11
%73 = load double, double* %12
%74 = call double @tanh(double %73)
%75 = fadd double 1.000000e+00, %74
%76 = call double @log(double %75)
%77 = fadd double %72, %76
store double %77, double* %11
br label %78
78: ; preds = %63
%79 = load i32, i32* %9
%80 = add nsw i32 %79, 1
store i32 %80, i32* %9
br label %54
81: ; preds = %54
%82 = load double, double* %11
%83 = fneg double %82
ret double %83
}

LLVM IR (-O2):
define double @mlnL(double* %0, double** nocapture %1, double** nocapture %2, i32 %3) {
%5 = load double*, double** %1
%6 = load double, double* %5
%7 = load double*, double** %2
%8 = load double, double* %7
%9 = fadd double %6, %8
%10 = fmul double %9, 0xBFE62E42FEFA39EF
%11 = fcmp ult double %6, 1.000000e+00
br i1 %11, label %15, label %19
12: ; preds = %19
%13 = load double*, double** %2
%14 = load double, double* %13
br label %15
15: ; preds = %12, %4
%16 = phi double [ %8, %4 ], [ %14, %12 ]
%17 = phi double [ %10, %4 ], [ %28, %12 ]
%18 = fcmp ult double %16, 1.000000e+00
br i1 %18, label %51, label %35
19: ; preds = %4, %19
%20 = phi i64 [ %29, %19 ], [ 1, %4 ]
%21 = phi double [ %28, %19 ], [ %10, %4 ]
%22 = getelementptr inbounds double*, double** %1, i64 %20
%23 = load double*, double** %22
%24 = tail call double @rxn_coor(double* %0, double* %23, i32 %3)
%25 = tail call double @tanh(double %24)
%26 = fsub double 1.000000e+00, %25
%27 = tail call double @log(double %26)
%28 = fadd double %21, %27
%29 = add nuw i64 %20, 1
%30 = trunc i64 %29 to i32
%31 = sitofp i32 %30 to double
%32 = load double*, double** %1
%33 = load double, double* %32
%34 = fcmp ult double %33, %31
br i1 %34, label %12, label %19
35: ; preds = %15, %35
%36 = phi i64 [ %45, %35 ], [ 1, %15 ]
%37 = phi double [ %44, %35 ], [ %17, %15 ]
%38 = getelementptr inbounds double*, double** %2, i64 %36
%39 = load double*, double** %38
%40 = tail call double @rxn_coor(double* %0, double* %39, i32 %3)
%41 = tail call double @tanh(double %40)
%42 = fadd double %41, 1.000000e+00
%43 = tail call double @log(double %42)
%44 = fadd double %37, %43
%45 = add nuw i64 %36, 1
%46 = trunc i64 %45 to i32
%47 = sitofp i32 %46 to double
%48 = load double*, double** %2
%49 = load double, double* %48
%50 = fcmp ult double %49, %47
br i1 %50, label %51, label %35
51: ; preds = %35, %15
%52 = phi double [ %17, %15 ], [ %44, %35 ]
%53 = fneg double %52
ret double %53
}