#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double, double,
                           double, double, double, double, double, double,
                           double);
int /*<<< orphan*/ sprintf(char *, char *, char const *, ...);
void outputObservs(const char *obsname, int N, int M, double nu, double *XX,
                   double *YY, double *AAXX, double *AAYY, double *AAXY,
                   double *AAYX, double *DAXX, double *DAYY, double *DAXY,
                   double *DAYX) {
  FILE *fp;
  char f0[256], f1[256];
  sprintf(f0, "%s-%1d-%6.4f", obsname, M, nu);
  sprintf(f1, "%s-1.dat", f0);
  fp = fopen(f1, "w");
  for (int i = 0; i < N; ++i)
    fprintf(fp,
            "%14.6e\t%14.6e\t%14.6e\t%14.6e\t%14.6e\t%14.6e\t%14.6e\t%14.6e\t%"
            "14.6e\t%14.6e\n",
            XX[i], YY[i], AAXX[i], AAYY[i], AAXY[i], AAYX[i], DAXX[i], DAYY[i],
            DAXY[i], DAYX[i]);
  fclose(fp);
}


x86 assembly (clang, -O0):
<outputObservs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
lea    0xe64(%rip),%rsi
mov    $0x1,%al
call   1060 <sprintf@plt>
lea    -0x240(%rbp),%rdi
lea    -0x140(%rbp),%rdx
lea    0xe55(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x240(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x244(%rbp)
mov    -0x244(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12c2 <outputObservs+0x182>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x244(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x244(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x244(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x10(%rbp),%rax
movslq -0x244(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    0x18(%rbp),%rax
movslq -0x244(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
mov    0x20(%rbp),%rax
movslq -0x244(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm5
mov    0x28(%rbp),%rax
movslq -0x244(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm6
mov    0x30(%rbp),%rax
movslq -0x244(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm7
mov    0x38(%rbp),%rax
movslq -0x244(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm9
mov    0x40(%rbp),%rax
movslq -0x244(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm8
lea    0xd7c(%rip),%rsi
movsd  %xmm9,(%rsp)
movsd  %xmm8,0x8(%rsp)
call   1040 <fprintf@plt>
mov    -0x244(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x244(%rbp)
jmp    11e0 <outputObservs+0xa0>
mov    -0x38(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outputObservs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %edx,%ecx
mov    %esi,%ebp
mov    %rdi,%rdx
lea    0xe98(%rip),%rsi
lea    0x110(%rsp),%r13
mov    %r13,%rdi
mov    $0x1,%al
call   1060 <sprintf@plt>
lea    0xe8c(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
lea    0xe7c(%rip),%rsi
mov    %rbx,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    1258 <outputObservs+0x118>
mov    %ebp,%r13d
shl    $0x3,%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
movsd  (%r12,%rbp,1),%xmm0
movsd  (%r15,%rbp,1),%xmm1
movsd  (%r14,%rbp,1),%xmm2
mov    0x250(%rsp),%rax
movsd  (%rax,%rbp,1),%xmm3
mov    0x258(%rsp),%rax
movsd  (%rax,%rbp,1),%xmm4
mov    0x260(%rsp),%rax
movsd  (%rax,%rbp,1),%xmm5
mov    0x268(%rsp),%rax
movsd  (%rax,%rbp,1),%xmm6
mov    0x270(%rsp),%rax
movsd  (%rax,%rbp,1),%xmm7
mov    0x278(%rsp),%rax
movsd  (%rax,%rbp,1),%xmm8
mov    0x280(%rsp),%rax
movsd  (%rax,%rbp,1),%xmm9
movsd  %xmm9,0x8(%rsp)
movsd  %xmm8,(%rsp)
mov    %rbx,%rdi
lea    0xdd2(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x8,%rbp
cmp    %rbp,%r13
jne    11c0 <outputObservs+0x80>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s-%1d-%6.4f\00"
@.str.1 = [9 x i8] c"%s-1.dat\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [71 x i8] c"%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\0A\00"
define void @outputObservs(i8* %0, i32 %1, i32 %2, double %3, double* %4, double* %5, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13) {
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
%23 = alloca double*
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca i32*
%30 = alloca [256 x i8]
%31 = alloca [256 x i8]
%32 = alloca i32
store i8* %0, i8** %15
store i32 %1, i32* %16
store i32 %2, i32* %17
store double %3, double* %18
store double* %4, double** %19
store double* %5, double** %20
store double* %6, double** %21
store double* %7, double** %22
store double* %8, double** %23
store double* %9, double** %24
store double* %10, double** %25
store double* %11, double** %26
store double* %12, double** %27
store double* %13, double** %28
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %30, i64 0, i64 0
%34 = load i8*, i8** %15
%35 = load i32, i32* %17
%36 = load double, double* %18
%37 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %33, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %34, i32 %35, double %36)
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %31, i64 0, i64 0
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %30, i64 0, i64 0
%40 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %38, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %39)
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %31, i64 0, i64 0
%42 = call i32* @fopen(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %42, i32** %29
store i32 0, i32* %32
br label %43
43: ; preds = %100, %14
%44 = load i32, i32* %32
%45 = load i32, i32* %16
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %103
47: ; preds = %43
%48 = load i32*, i32** %29
%49 = load double*, double** %19
%50 = load i32, i32* %32
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
%53 = load double, double* %52
%54 = load double*, double** %20
%55 = load i32, i32* %32
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
%58 = load double, double* %57
%59 = load double*, double** %21
%60 = load i32, i32* %32
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
%63 = load double, double* %62
%64 = load double*, double** %22
%65 = load i32, i32* %32
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
%68 = load double, double* %67
%69 = load double*, double** %23
%70 = load i32, i32* %32
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
%73 = load double, double* %72
%74 = load double*, double** %24
%75 = load i32, i32* %32
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %74, i64 %76
%78 = load double, double* %77
%79 = load double*, double** %25
%80 = load i32, i32* %32
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %79, i64 %81
%83 = load double, double* %82
%84 = load double*, double** %26
%85 = load i32, i32* %32
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %84, i64 %86
%88 = load double, double* %87
%89 = load double*, double** %27
%90 = load i32, i32* %32
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %89, i64 %91
%93 = load double, double* %92
%94 = load double*, double** %28
%95 = load i32, i32* %32
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
%98 = load double, double* %97
%99 = call i32 @fprintf(i32* %48, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0), double %53, double %58, double %63, double %68, double %73, double %78, double %83, double %88, double %93, double %98)
br label %100
100: ; preds = %47
%101 = load i32, i32* %32
%102 = add nsw i32 %101, 1
store i32 %102, i32* %32
br label %43
103: ; preds = %43
%104 = load i32*, i32** %29
%105 = call i32 @fclose(i32* %104)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s-%1d-%6.4f\00"
@.str.1 = [9 x i8] c"%s-1.dat\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [71 x i8] c"%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\09%14.6e\0A\00"
define void @outputObservs(i8* %0, i32 %1, i32 %2, double %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, double* nocapture %7, double* nocapture %8, double* nocapture %9, double* nocapture %10, double* nocapture %11, double* nocapture %12, double* nocapture %13) {
%15 = alloca [256 x i8]
%16 = alloca [256 x i8]
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %16, i64 0, i64 0
%19 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %17, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, double %3)
%20 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %18, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%21 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp sgt i32 %1, 0
br i1 %22, label %23, label %25
23: ; preds = %14
%24 = zext i32 %1 to i64
br label %27
25: ; preds = %27, %14
%26 = call i32 @fclose(i32* %21)
ret void
27: ; preds = %23, %27
%28 = phi i64 [ 0, %23 ], [ %50, %27 ]
%29 = getelementptr inbounds double, double* %4, i64 %28
%30 = load double, double* %29
%31 = getelementptr inbounds double, double* %5, i64 %28
%32 = load double, double* %31
%33 = getelementptr inbounds double, double* %6, i64 %28
%34 = load double, double* %33
%35 = getelementptr inbounds double, double* %7, i64 %28
%36 = load double, double* %35
%37 = getelementptr inbounds double, double* %8, i64 %28
%38 = load double, double* %37
%39 = getelementptr inbounds double, double* %9, i64 %28
%40 = load double, double* %39
%41 = getelementptr inbounds double, double* %10, i64 %28
%42 = load double, double* %41
%43 = getelementptr inbounds double, double* %11, i64 %28
%44 = load double, double* %43
%45 = getelementptr inbounds double, double* %12, i64 %28
%46 = load double, double* %45
%47 = getelementptr inbounds double, double* %13, i64 %28
%48 = load double, double* %47
%49 = call i32 @fprintf(i32* %21, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0), double %30, double %32, double %34, double %36, double %38, double %40, double %42, double %44, double %46, double %48)
%50 = add nuw nsw i64 %28, 1
%51 = icmp eq i64 %50, %24
br i1 %51, label %25, label %27
}