#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*/ DymosimMessage(char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
int /*<<< orphan*/ strcat(char *, char const *);
void DymosimMessageDoubleVector(const char *matrixname, double *d, int n) {
  char text[100];
  char textline[2000];
  int i;
  textline[0] = '\0';
  strcat(textline, matrixname);
  strcat(textline, " = {");
  for (i = 0; i < n; i++) {
    if (i > 0)
      strcat(textline, ", ");
    sprintf(text, "%G", d[i]);
    strcat(textline, text);
  }
  strcat(textline, "}");
  DymosimMessage(textline);
}


x86 assembly (clang, -O0):
<DymosimMessageDoubleVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x860,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movb   $0x0,-0x850(%rbp)
lea    -0x850(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcat@plt>
lea    -0x850(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1040 <strcat@plt>
movl   $0x0,-0x854(%rbp)
mov    -0x854(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ed <DymosimMessageDoubleVector+0xbd>
cmpl   $0x0,-0x854(%rbp)
jle    11a9 <DymosimMessageDoubleVector+0x79>
lea    -0x850(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1040 <strcat@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x854(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe44(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x850(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x854(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x854(%rbp)
jmp    117a <DymosimMessageDoubleVector+0x4a>
lea    -0x850(%rbp),%rdi
lea    0xe10(%rip),%rsi
call   1040 <strcat@plt>
lea    -0x850(%rbp),%rdi
call   1030 <DymosimMessage@plt>
add    $0x860,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DymosimMessageDoubleVector>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x848,%rsp
mov    %edx,%ebp
mov    %rsi,%r12
mov    %rdi,%rsi
movb   $0x0,0x70(%rsp)
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
test   %ebp,%ebp
jle    11e4 <DymosimMessageDoubleVector+0xb4>
movsd  (%r12),%xmm0
lea    0xe8d(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
lea    0x70(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <strcat@plt>
cmp    $0x1,%ebp
je     11e4 <DymosimMessageDoubleVector+0xb4>
mov    %ebp,%r13d
mov    $0x1,%r14d
lea    0x70(%rsp),%rbp
lea    0xe5b(%rip),%r15
mov    %rsp,%rbx
mov    %rbp,%rdi
lea    0xe4b(%rip),%rsi
call   1040 <strcat@plt>
movsd  (%r12,%r14,8),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <sprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <strcat@plt>
add    $0x1,%r14
cmp    %r14,%r13
jne    11b0 <DymosimMessageDoubleVector+0x80>
lea    0xe20(%rip),%rsi
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <DymosimMessage@plt>
add    $0x848,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c" = {\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [3 x i8] c"%G\00"
@.str.3 = [2 x i8] c"}\00"
define void @DymosimMessageDoubleVector(i8* %0, double* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [100 x i8]
%8 = alloca [2000 x i8]
%9 = alloca i32
store i8* %0, i8** %4
store double* %1, double** %5
store i32 %2, i32* %6
%10 = getelementptr inbounds [2000 x i8], [2000 x i8]* %8, i64 0, i64 0
store i8 0, i8* %10
%11 = getelementptr inbounds [2000 x i8], [2000 x i8]* %8, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @strcat(i8* %11, i8* %12)
%14 = getelementptr inbounds [2000 x i8], [2000 x i8]* %8, i64 0, i64 0
%15 = call i32 @strcat(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %9
br label %16
16: ; preds = %37, %3
%17 = load i32, i32* %9
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %40
20: ; preds = %16
%21 = load i32, i32* %9
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = getelementptr inbounds [2000 x i8], [2000 x i8]* %8, i64 0, i64 0
%25 = call i32 @strcat(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %23, %20
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%28 = load double*, double** %5
%29 = load i32, i32* %9
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
%32 = load double, double* %31
%33 = call i32 @sprintf(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double %32)
%34 = getelementptr inbounds [2000 x i8], [2000 x i8]* %8, i64 0, i64 0
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%36 = call i32 @strcat(i8* %34, i8* %35)
br label %37
37: ; preds = %26
%38 = load i32, i32* %9
%39 = add nsw i32 %38, 1
store i32 %39, i32* %9
br label %16
40: ; preds = %16
%41 = getelementptr inbounds [2000 x i8], [2000 x i8]* %8, i64 0, i64 0
%42 = call i32 @strcat(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%43 = getelementptr inbounds [2000 x i8], [2000 x i8]* %8, i64 0, i64 0
%44 = call i32 @DymosimMessage(i8* %43)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" = {\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [3 x i8] c"%G\00"
@.str.3 = [2 x i8] c"}\00"
define void @DymosimMessageDoubleVector(i8* %0, double* nocapture %1, i32 %2) {
%4 = alloca [100 x i8]
%5 = alloca [2000 x i8]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [2000 x i8], [2000 x i8]* %5, i64 0, i64 0
store i8 0, i8* %7
%8 = call i32 @strcat(i8* %7, i8* %0)
%9 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp sgt i32 %2, 0
br i1 %10, label %11, label %26
11: ; preds = %3
%12 = zext i32 %2 to i64
%13 = load double, double* %1
%14 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double %13)
%15 = call i32 @strcat(i8* %7, i8* %6)
%16 = icmp eq i32 %2, 1
br i1 %16, label %26, label %17
17: ; preds = %11, %17
%18 = phi i64 [ %24, %17 ], [ 1, %11 ]
%19 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = getelementptr inbounds double, double* %1, i64 %18
%21 = load double, double* %20
%22 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double %21)
%23 = call i32 @strcat(i8* %7, i8* %6)
%24 = add nuw nsw i64 %18, 1
%25 = icmp eq i64 %24, %12
br i1 %25, label %26, label %17
26: ; preds = %17, %11, %3
%27 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%28 = call i32 @DymosimMessage(i8* %7)
ret void
}