#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*/ fittingln(int, double *, double *, double *);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, double, double, ...);
main() {
  int n = 9;
  double x[9] = {0.6, 2.1, 4.0, 5.2, 8.4, 10.0, 32.4, 57.0, 87.6};
  double y[9] = {0.5, 2.9, 4.8, 6.6, 8.8, 14.9, 38.0, 55.0, 69.0};
  double a[7];
  fittingln(n, x, y, 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    0xea3(%rip),%rsi
mov    $0x48,%edx
call   1040 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    0xedb(%rip),%rsi
mov    $0x48,%edx
call   1040 <memcpy@plt>
mov    -0x4(%rbp),%edi
lea    -0x50(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    -0xe0(%rbp),%rcx
call   1060 <fittingln@plt>
movsd  -0xd8(%rbp),%xmm0
ff
movsd  -0xe0(%rbp),%xmm1
ff
lea    0xee8(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0xc8(%rbp),%xmm1
ff
lea    0xed7(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm2
ff
lea    0xebe(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xd8,%rsp
mov    0xf02(%rip),%rax
mov    %rax,0xd0(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
mov    0xf07(%rip),%rax
mov    %rax,0x80(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x90(%rsp),%rsi
lea    0x40(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x9,%edi
call   1050 <fittingln@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
lea    0xeab(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
lea    0xe9e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
lea    0xe8b(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
xor    %eax,%eax
add    $0xd8,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [9 x double] [double 6.000000e-01, double 2.100000e+00, double 4.000000e+00, double 5.200000e+00, double 8.400000e+00, double 1.000000e+01, double 3.240000e+01, double 5.700000e+01, double 8.760000e+01]
@__const.main.y = [9 x double] [double 5.000000e-01, double 2.900000e+00, double 4.800000e+00, double 6.600000e+00, double 8.800000e+00, double 1.490000e+01, double 3.800000e+01, double 5.500000e+01, double 6.900000e+01]
@.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 [7 x double]
store i32 9, i32* %1
%5 = bitcast [9 x double]* %2 to i8*
%6 = bitcast [9 x double]* %3 to i8*
%7 = load i32, i32* %1
%8 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 0
%9 = getelementptr inbounds [9 x double], [9 x double]* %3, i64 0, i64 0
%10 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 0
%11 = call i32 @fittingln(i32 %7, double* %8, double* %9, double* %10)
%12 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 1
%13 = load double, double* %12
%14 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 0
%15 = load double, double* %14
%16 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %13, double %15)
%17 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 2
%18 = load double, double* %17
%19 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 3
%20 = load double, double* %19
%21 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %18, double %20)
%22 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 4
%23 = load double, double* %22
%24 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 5
%25 = load double, double* %24
%26 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 6
%27 = load double, double* %26
%28 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %23, double %25, double %27)
%29 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [9 x double] [double 6.000000e-01, double 2.100000e+00, double 4.000000e+00, double 5.200000e+00, double 8.400000e+00, double 1.000000e+01, double 3.240000e+01, double 5.700000e+01, double 8.760000e+01]
@__const.main.y = [9 x double] [double 5.000000e-01, double 2.900000e+00, double 4.800000e+00, double 6.600000e+00, double 8.800000e+00, double 1.490000e+01, double 3.800000e+01, double 5.500000e+01, double 6.900000e+01]
@.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 @fittingln(i32 9, double* %7, double* %8, 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
}