#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 CopyString(char const *, long, char *, int);
int /*<<< orphan*/ DymosimMessageSeverity(int, char *);
int sprintf(char *, char *, double const);
void dymosimmessagedoublesSev_(int severity, const char message[],
                               const double d[], const int *nd, int lstr) {
  char textline[200];
  int ic, i;
  int onLine = 0;
  ic = CopyString(message, lstr, textline, 200);
  ic = ic + CopyString("{", 1L, textline + ic, 200 - ic);
  for (i = 0; i < *nd; i++) {
    if (i > 0)
      ic = ic + CopyString(",", 1L, textline + ic, 200 - ic);
    if (onLine >= 5) {
      DymosimMessageSeverity(severity, textline);
      ic = 0;
      ic = ic + CopyString(" ", 1L, textline, 200);
      onLine = 0;
    }
    if (ic + 20 >= 200) {
      break;
    }
    ic = ic + sprintf(&textline[ic], " %G", d[i]);
    ++onLine;
  }
  ic = ic + CopyString(" }", 2L, textline + ic, 200 - ic);
  DymosimMessageSeverity(severity, textline);
}


x86 assembly (clang, -O0):
<dymosimmessagedoublesSev_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movl   $0x0,-0xfc(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x24(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
mov    $0xc8,%ecx
call   1030 <CopyString@plt>
mov    %eax,-0xf4(%rbp)
mov    -0xf4(%rbp),%eax
mov    %eax,-0x100(%rbp)
lea    -0xf0(%rbp),%rdx
movslq -0xf4(%rbp),%rax
add    %rax,%rdx
mov    $0xc8,%ecx
sub    -0xf4(%rbp),%ecx
lea    0xe5a(%rip),%rdi
mov    $0x1,%esi
call   1030 <CopyString@plt>
mov    %eax,%ecx
mov    -0x100(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xf4(%rbp)
movl   $0x0,-0xf8(%rbp)
mov    -0xf8(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jge    1320 <dymosimmessagedoublesSev_+0x1f0>
cmpl   $0x0,-0xf8(%rbp)
jle    1232 <dymosimmessagedoublesSev_+0x102>
mov    -0xf4(%rbp),%eax
mov    %eax,-0x104(%rbp)
lea    -0xf0(%rbp),%rdx
movslq -0xf4(%rbp),%rax
add    %rax,%rdx
mov    $0xc8,%ecx
sub    -0xf4(%rbp),%ecx
lea    0xdea(%rip),%rdi
mov    $0x1,%esi
call   1030 <CopyString@plt>
mov    %eax,%ecx
mov    -0x104(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xf4(%rbp)
cmpl   $0x5,-0xfc(%rbp)
jl     129b <dymosimmessagedoublesSev_+0x16b>
mov    -0x4(%rbp),%edi
lea    -0xf0(%rbp),%rsi
call   1040 <DymosimMessageSeverity@plt>
movl   $0x0,-0xf4(%rbp)
mov    -0xf4(%rbp),%eax
mov    %eax,-0x108(%rbp)
lea    -0xf0(%rbp),%rdx
lea    0xd92(%rip),%rdi
mov    $0x1,%esi
mov    $0xc8,%ecx
call   1030 <CopyString@plt>
mov    %eax,%ecx
mov    -0x108(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xf4(%rbp)
movl   $0x0,-0xfc(%rbp)
mov    -0xf4(%rbp),%eax
add    $0x14,%eax
cmp    $0xc8,%eax
jl     12b4 <dymosimmessagedoublesSev_+0x184>
jmp    1320 <dymosimmessagedoublesSev_+0x1f0>
mov    -0xf4(%rbp),%eax
mov    %eax,-0x10c(%rbp)
movslq -0xf4(%rbp),%rax
lea    -0xf0(%rbp),%rdi
add    %rax,%rdi
mov    -0x18(%rbp),%rax
movslq -0xf8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd1e(%rip),%rsi
call   1050 <sprintf@plt>
mov    %eax,%ecx
mov    -0x10c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xf4(%rbp)
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
mov    -0xf8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf8(%rbp)
jmp    11ca <dymosimmessagedoublesSev_+0x9a>
mov    -0xf4(%rbp),%eax
mov    %eax,-0x110(%rbp)
lea    -0xf0(%rbp),%rdx
movslq -0xf4(%rbp),%rax
add    %rax,%rdx
mov    $0xc8,%ecx
sub    -0xf4(%rbp),%ecx
lea    0xcbb(%rip),%rdi
mov    $0x2,%esi
call   1030 <CopyString@plt>
mov    %eax,%ecx
mov    -0x110(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xf4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xf0(%rbp),%rsi
call   1040 <DymosimMessageSeverity@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dymosimmessagedoublesSev_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rcx,%rbp
mov    %rdx,%r12
mov    %rsi,%rax
mov    %edi,0xc(%rsp)
movslq %r8d,%rsi
lea    0x10(%rsp),%rdx
mov    %rax,%rdi
mov    $0xc8,%ecx
call   1030 <CopyString@plt>
movslq %eax,%rbx
lea    (%rsp,%rbx,1),%rdx
add    $0x10,%rdx
mov    $0xc8,%ecx
sub    %ebx,%ecx
lea    0xe84(%rip),%rdi
mov    $0x1,%esi
call   1030 <CopyString@plt>
mov    %eax,%r13d
add    %ebx,%r13d
cmpl   $0x0,0x0(%rbp)
jle    1242 <dymosimmessagedoublesSev_+0x112>
xor    %r15d,%r15d
xor    %r14d,%r14d
nopl   0x0(%rax)
test   %r15,%r15
je     11ce <dymosimmessagedoublesSev_+0x9e>
movslq %r13d,%rbx
lea    (%rsp,%rbx,1),%rdx
add    $0x10,%rdx
mov    $0xc8,%ecx
sub    %ebx,%ecx
mov    $0x1,%esi
lea    0xe3f(%rip),%rdi
call   1030 <CopyString@plt>
mov    %eax,%r13d
add    %ebx,%r13d
cmp    $0x5,%r14d
jl     1204 <dymosimmessagedoublesSev_+0xd4>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <DymosimMessageSeverity@plt>
mov    $0x1,%esi
lea    0xe13(%rip),%rdi
mov    %rbx,%rdx
mov    $0xc8,%ecx
call   1030 <CopyString@plt>
mov    %eax,%r13d
xor    %r14d,%r14d
cmp    $0xb3,%r13d
jg     1242 <dymosimmessagedoublesSev_+0x112>
movslq %r13d,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x10,%rdi
movsd  (%r12,%r15,8),%xmm0
lea    0xde1(%rip),%rsi
call   1050 <sprintf@plt>
add    %eax,%r13d
add    $0x1,%r14d
add    $0x1,%r15
movslq 0x0(%rbp),%rax
cmp    %rax,%r15
jl     11a0 <dymosimmessagedoublesSev_+0x70>
movslq %r13d,%rax
lea    (%rsp,%rax,1),%rdx
add    $0x10,%rdx
mov    $0xc8,%ecx
sub    %eax,%ecx
lea    0xdaf(%rip),%rdi
mov    $0x2,%esi
call   1030 <CopyString@plt>
lea    0x10(%rsp),%rsi
mov    0xc(%rsp),%edi
call   1040 <DymosimMessageSeverity@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
@.str.1 = [2 x i8] c",\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [4 x i8] c" %G\00"
@.str.4 = [3 x i8] c" }\00"
define void @dymosimmessagedoublesSev_(i32 %0, i8* %1, double* %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca [200 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store double* %2, double** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
store i32 0, i32* %14
%15 = load i8*, i8** %7
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%19 = call i32 @CopyString(i8* %15, i64 %17, i8* %18, i32 200)
store i32 %19, i32* %12
%20 = load i32, i32* %12
%21 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%22 = load i32, i32* %12
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i32, i32* %12
%26 = sub nsw i32 200, %25
%27 = call i32 @CopyString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 1, i8* %24, i32 %26)
%28 = add nsw i32 %20, %27
store i32 %28, i32* %12
store i32 0, i32* %13
br label %29
29: ; preds = %77, %5
%30 = load i32, i32* %13
%31 = load i32*, i32** %9
%32 = load i32, i32* %31
%33 = icmp slt i32 %30, %32
br i1 %33, label %34, label %80
34: ; preds = %29
%35 = load i32, i32* %13
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %47
37: ; preds = %34
%38 = load i32, i32* %12
%39 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%40 = load i32, i32* %12
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i32, i32* %12
%44 = sub nsw i32 200, %43
%45 = call i32 @CopyString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i64 1, i8* %42, i32 %44)
%46 = add nsw i32 %38, %45
store i32 %46, i32* %12
br label %47
47: ; preds = %37, %34
%48 = load i32, i32* %14
%49 = icmp sge i32 %48, 5
br i1 %49, label %50, label %58
50: ; preds = %47
%51 = load i32, i32* %6
%52 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%53 = call i32 @DymosimMessageSeverity(i32 %51, i8* %52)
store i32 0, i32* %12
%54 = load i32, i32* %12
%55 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%56 = call i32 @CopyString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i64 1, i8* %55, i32 200)
%57 = add nsw i32 %54, %56
store i32 %57, i32* %12
store i32 0, i32* %14
br label %58
58: ; preds = %50, %47
%59 = load i32, i32* %12
%60 = add nsw i32 %59, 20
%61 = icmp sge i32 %60, 200
br i1 %61, label %62, label %63
62: ; preds = %58
br label %80
63: ; preds = %58
%64 = load i32, i32* %12
%65 = load i32, i32* %12
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 %66
%68 = load double*, double** %8
%69 = load i32, i32* %13
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %68, i64 %70
%72 = load double, double* %71
%73 = call i32 @sprintf(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %72)
%74 = add nsw i32 %64, %73
store i32 %74, i32* %12
%75 = load i32, i32* %14
%76 = add nsw i32 %75, 1
store i32 %76, i32* %14
br label %77
77: ; preds = %63
%78 = load i32, i32* %13
%79 = add nsw i32 %78, 1
store i32 %79, i32* %13
br label %29
80: ; preds = %62, %29
%81 = load i32, i32* %12
%82 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%83 = load i32, i32* %12
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
%86 = load i32, i32* %12
%87 = sub nsw i32 200, %86
%88 = call i32 @CopyString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 2, i8* %85, i32 %87)
%89 = add nsw i32 %81, %88
store i32 %89, i32* %12
%90 = load i32, i32* %6
%91 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%92 = call i32 @DymosimMessageSeverity(i32 %90, i8* %91)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"{\00"
@.str.1 = [2 x i8] c",\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [4 x i8] c" %G\00"
@.str.4 = [3 x i8] c" }\00"
define void @dymosimmessagedoublesSev_(i32 %0, i8* %1, double* nocapture %2, i32* nocapture %3, i32 %4) {
%6 = alloca [200 x i8]
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%8 = sext i32 %4 to i64
%9 = call i32 @CopyString(i8* %1, i64 %8, i8* %7, i32 200)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 %10
%12 = sub nsw i32 200, %9
%13 = call i32 @CopyString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 1, i8* %11, i32 %12)
%14 = add nsw i32 %13, %9
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %50
17: ; preds = %5, %38
%18 = phi i64 [ %46, %38 ], [ 0, %5 ]
%19 = phi i32 [ %45, %38 ], [ 0, %5 ]
%20 = phi i32 [ %44, %38 ], [ %14, %5 ]
%21 = icmp eq i64 %18, 0
br i1 %21, label %28, label %22
22: ; preds = %17
%23 = sext i32 %20 to i64
%24 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 %23
%25 = sub nsw i32 200, %20
%26 = call i32 @CopyString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i64 1, i8* %24, i32 %25)
%27 = add nsw i32 %26, %20
br label %28
28: ; preds = %22, %17
%29 = phi i32 [ %27, %22 ], [ %20, %17 ]
%30 = icmp sgt i32 %19, 4
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = call i32 @DymosimMessageSeverity(i32 %0, i8* %7)
%33 = call i32 @CopyString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i64 1, i8* %7, i32 200)
br label %34
34: ; preds = %31, %28
%35 = phi i32 [ %33, %31 ], [ %29, %28 ]
%36 = phi i32 [ 0, %31 ], [ %19, %28 ]
%37 = icmp sgt i32 %35, 179
br i1 %37, label %50, label %38
38: ; preds = %34
%39 = sext i32 %35 to i64
%40 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 %39
%41 = getelementptr inbounds double, double* %2, i64 %18
%42 = load double, double* %41
%43 = call i32 @sprintf(i8* %40, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %42)
%44 = add nsw i32 %43, %35
%45 = add nsw i32 %36, 1
%46 = add nuw nsw i64 %18, 1
%47 = load i32, i32* %3
%48 = sext i32 %47 to i64
%49 = icmp slt i64 %46, %48
br i1 %49, label %17, label %50
50: ; preds = %38, %34, %5
%51 = phi i32 [ %14, %5 ], [ %35, %34 ], [ %44, %38 ]
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 %52
%54 = sub nsw i32 200, %51
%55 = call i32 @CopyString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 2, i8* %53, i32 %54)
%56 = call i32 @DymosimMessageSeverity(i32 %0, i8* %7)
ret void
}