#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*/ fittinglogt(int, double *, double *, double, double *);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, double, double, ...);
main() {
  int n = 9;
  double x[9] = {0.95, 0.93, 0.91, 0.69, 0.73, 0.66, 0.77, 0.83};
  double y[9] = {670.0, 310.0, 274.0, 197.0, 150.0, 71.3, 23.4, 10.6, 5.8};
  double t = 10.0, a[7];
  fittinglogt(n, x, y, t, a);
  printf("\na=%e b=%e  ", a[1], a[0]);
  printf("\nq=%e s=%e  ", a[2], a[3]);
  printf("\numax=%e umin=%e u=%e ", a[4], a[5], a[6]);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x9,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
movsd  0xe79(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x4(%rbp),%edi
lea    -0x50(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
movsd  -0xa8(%rbp),%xmm0
ff
lea    -0xe0(%rbp),%rcx
call   1030 <fittinglogt@plt>
movsd  -0xd8(%rbp),%xmm0
ff
movsd  -0xe0(%rbp),%xmm1
ff
lea    0xee0(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0xc8(%rbp),%xmm1
ff
lea    0xecf(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm2
ff
lea    0xeb6(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getch@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xd8,%rsp
mov    0xf12(%rip),%rax
mov    %rax,0xd0(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe96(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
mov    0xf17(%rip),%rax
mov    %rax,0x80(%rsp)
movaps 0xef8(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xec0(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xea4(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x90(%rsp),%rsi
lea    0x40(%rsp),%rdx
movsd  0xe2a(%rip),%xmm0
mov    %rsp,%rcx
mov    $0x9,%edi
call   1030 <fittinglogt@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
lea    0xeb3(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
lea    0xea6(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
lea    0xe93(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
add    $0xd8,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [9 x double] [double 0x3FEE666666666666, double 9.300000e-01, double 9.100000e-01, double 6.900000e-01, double 7.300000e-01, double 6.600000e-01, double 7.700000e-01, double 8.300000e-01, double 0.000000e+00]
@__const.main.y = [9 x double] [double 6.700000e+02, double 3.100000e+02, double 2.740000e+02, double 1.970000e+02, double 1.500000e+02, double 7.130000e+01, double 2.340000e+01, double 1.060000e+01, double 5.800000e+00]
@.str = [13 x i8] c"\0Aa=%e b=%e \00"
@.str.1 = [13 x i8] c"\0Aq=%e s=%e \00"
@.str.2 = [23 x i8] c"\0Aumax=%e umin=%e u=%e \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x double]
%3 = alloca [9 x double]
%4 = alloca double
%5 = alloca [7 x double]
store i32 9, i32* %1
%6 = bitcast [9 x double]* %2 to i8*
%7 = bitcast [9 x double]* %3 to i8*
store double 1.000000e+01, double* %4
%8 = load i32, i32* %1
%9 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 0
%10 = getelementptr inbounds [9 x double], [9 x double]* %3, i64 0, i64 0
%11 = load double, double* %4
%12 = getelementptr inbounds [7 x double], [7 x double]* %5, i64 0, i64 0
%13 = call i32 @fittinglogt(i32 %8, double* %9, double* %10, double %11, double* %12)
%14 = getelementptr inbounds [7 x double], [7 x double]* %5, i64 0, i64 1
%15 = load double, double* %14
%16 = getelementptr inbounds [7 x double], [7 x double]* %5, i64 0, i64 0
%17 = load double, double* %16
%18 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %15, double %17)
%19 = getelementptr inbounds [7 x double], [7 x double]* %5, i64 0, i64 2
%20 = load double, double* %19
%21 = getelementptr inbounds [7 x double], [7 x double]* %5, i64 0, i64 3
%22 = load double, double* %21
%23 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %20, double %22)
%24 = getelementptr inbounds [7 x double], [7 x double]* %5, i64 0, i64 4
%25 = load double, double* %24
%26 = getelementptr inbounds [7 x double], [7 x double]* %5, i64 0, i64 5
%27 = load double, double* %26
%28 = getelementptr inbounds [7 x double], [7 x double]* %5, i64 0, i64 6
%29 = load double, double* %28
%30 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %25, double %27, double %29)
%31 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [9 x double] [double 0x3FEE666666666666, double 9.300000e-01, double 9.100000e-01, double 6.900000e-01, double 7.300000e-01, double 6.600000e-01, double 7.700000e-01, double 8.300000e-01, double 0.000000e+00]
@__const.main.y = [9 x double] [double 6.700000e+02, double 3.100000e+02, double 2.740000e+02, double 1.970000e+02, double 1.500000e+02, double 7.130000e+01, double 2.340000e+01, double 1.060000e+01, double 5.800000e+00]
@.str = [13 x i8] c"\0Aa=%e b=%e \00"
@.str.1 = [13 x i8] c"\0Aq=%e s=%e \00"
@.str.2 = [23 x i8] c"\0Aumax=%e umin=%e u=%e \00"
define i32 @main() {
%1 = alloca [9 x double]
%2 = alloca [9 x double]
%3 = alloca [7 x double]
%4 = bitcast [9 x double]* %1 to i8*
%5 = bitcast [9 x double]* %2 to i8*
%6 = bitcast [7 x double]* %3 to i8*
%7 = getelementptr inbounds [9 x double], [9 x double]* %1, i64 0, i64 0
%8 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 0
%9 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 0
%10 = call i32 @fittinglogt(i32 9, double* %7, double* %8, double 1.000000e+01, double* %9)
%11 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 1
%12 = load double, double* %11
%13 = load double, double* %9
%14 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %12, double %13)
%15 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 2
%16 = load double, double* %15
%17 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 3
%18 = load double, double* %17
%19 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %16, double %18)
%20 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 4
%21 = load double, double* %20
%22 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 5
%23 = load double, double* %22
%24 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 6
%25 = load double, double* %24
%26 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %21, double %23, double %25)
%27 = call i32 (...) @getch()
ret i32 0
}