#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*/ textline;
typedef int j;
typedef size_t i;

/* Variables and functions */
int /*<<< orphan*/ DymosimMessage(char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
int /*<<< orphan*/ strcat(char *, char const *);
int strlen(char *);
void DymosimMessageDoubleMatrix(const char *matrixname, double *d, int m, int n,
                                int MaxRow) {
  char text[100];
  char textline[300];
  int i, j;
  textline[0] = '\0';
  strcat(textline, matrixname);
  strcat(textline, " = ");
  strcat(textline, "{");
  DymosimMessage(textline);
  textline[0] = '\0';
  DymosimMessage("");
  for (i = 1; i <= m; i++) {
    strcat(textline, "{");
    for (j = 1; j <= n; j++) {
      if (j > 1)
        strcat(textline, ", ");
      if (strlen(textline) > sizeof(textline) - 100) {
        DymosimMessage(textline);
        textline[0] = '\0';
      }
      sprintf(text, "%G", d[(i)-1 + ((j)-1) * (MaxRow)]);
      strcat(textline, text);
    }
    strcat(textline, "}");
    if (i < m)
      strcat(textline, ", ");
    DymosimMessage(textline);
    textline[0] = '\0';
  }
  DymosimMessage("");
  DymosimMessage("};");
}


x86 assembly (clang, -O0):
<DymosimMessageDoubleMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movb   $0x0,-0x1b0(%rbp)
lea    -0x1b0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x1b0(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x1b0(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x1b0(%rbp),%rdi
call   1040 <DymosimMessage@plt>
movb   $0x0,-0x1b0(%rbp)
lea    0xe54(%rip),%rdi
call   1040 <DymosimMessage@plt>
movl   $0x1,-0x1b4(%rbp)
mov    -0x1b4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     12ff <DymosimMessageDoubleMatrix+0x1bf>
lea    -0x1b0(%rbp),%rdi
lea    0xe24(%rip),%rsi
call   1050 <strcat@plt>
movl   $0x1,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     12a3 <DymosimMessageDoubleMatrix+0x163>
cmpl   $0x1,-0x1b8(%rbp)
jle    121e <DymosimMessageDoubleMatrix+0xde>
lea    -0x1b0(%rbp),%rdi
lea    0xded(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x1b0(%rbp),%rdi
call   1030 <strlen@plt>
cltq
cmp    $0xc8,%rax
jbe    124b <DymosimMessageDoubleMatrix+0x10b>
lea    -0x1b0(%rbp),%rdi
call   1040 <DymosimMessage@plt>
movb   $0x0,-0x1b0(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x1b4(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x1b8(%rbp),%edx
sub    $0x1,%edx
imul   -0x1c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd8f(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x1b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b8(%rbp)
jmp    11ef <DymosimMessageDoubleMatrix+0xaf>
lea    -0x1b0(%rbp),%rdi
lea    0xd5b(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x1b4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12d8 <DymosimMessageDoubleMatrix+0x198>
lea    -0x1b0(%rbp),%rdi
lea    0xd33(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x1b0(%rbp),%rdi
call   1040 <DymosimMessage@plt>
movb   $0x0,-0x1b0(%rbp)
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    11c3 <DymosimMessageDoubleMatrix+0x83>
lea    0xd02(%rip),%rdi
call   1040 <DymosimMessage@plt>
lea    0xcfc(%rip),%rdi
call   1040 <DymosimMessage@plt>
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DymosimMessageDoubleMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1d8,%rsp
mov    %r8d,%r14d
mov    %rcx,0x10(%rsp)
mov    %edx,%ebx
mov    %rsi,0x8(%rsp)
mov    %rdi,%rsi
movb   $0x0,0x40(%rsp)
lea    0x40(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <strcat@plt>
lea    0xe84(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strcat@plt>
lea    0xe79(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strcat@plt>
mov    %rbp,%rdi
call   1040 <DymosimMessage@plt>
movb   $0x0,0x40(%rsp)
lea    0xe61(%rip),%rdi
call   1040 <DymosimMessage@plt>
test   %ebx,%ebx
jle    1326 <DymosimMessageDoubleMatrix+0x1e6>
mov    %rbx,%rcx
movslq %r14d,%r14
mov    0x10(%rsp),%rax
lea    0x1(%rax),%edx
mov    %ecx,%eax
mov    %rax,0x30(%rsp)
add    $0x1,%ecx
mov    %rcx,0x38(%rsp)
mov    0x8(%rsp),%rax
lea    (%rax,%r14,8),%rax
mov    %rax,0x18(%rsp)
shl    $0x3,%r14
mov    %rdx,0x28(%rsp)
lea    -0x2(%rdx),%rax
mov    %rax,0x20(%rsp)
mov    $0x1,%r12d
lea    0x40(%rsp),%rbx
lea    0x170(%rsp),%r15
jmp    1232 <DymosimMessageDoubleMatrix+0xf2>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <DymosimMessage@plt>
movb   $0x0,0x40(%rsp)
add    $0x1,%r12
addq   $0x8,0x18(%rsp)
cmp    0x38(%rsp),%r12
je     1326 <DymosimMessageDoubleMatrix+0x1e6>
mov    %rbx,%rdi
lea    0xdc8(%rip),%rsi
call   1050 <strcat@plt>
cmpl   $0x0,0x10(%rsp)
jle    1291 <DymosimMessageDoubleMatrix+0x151>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0xc9,%eax
jb     1264 <DymosimMessageDoubleMatrix+0x124>
mov    %rbx,%rdi
call   1040 <DymosimMessage@plt>
movb   $0x0,0x40(%rsp)
mov    0x8(%rsp),%rax
movsd  -0x8(%rax,%r12,8),%xmm0
mov    %r15,%rdi
lea    0xd8f(%rip),%rsi
call   1060 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
cmpl   $0x2,0x28(%rsp)
jne    12c0 <DymosimMessageDoubleMatrix+0x180>
mov    %rbx,%rdi
lea    0xd71(%rip),%rsi
call   1050 <strcat@plt>
cmp    0x30(%rsp),%r12
jae    1210 <DymosimMessageDoubleMatrix+0xd0>
mov    %rbx,%rdi
lea    0xd51(%rip),%rsi
call   1050 <strcat@plt>
jmp    1210 <DymosimMessageDoubleMatrix+0xd0>
nop
mov    0x20(%rsp),%rbp
mov    0x18(%rsp),%r13
jmp    12f9 <DymosimMessageDoubleMatrix+0x1b9>
nopl   0x0(%rax)
movsd  0x0(%r13),%xmm0
mov    %r15,%rdi
lea    0xd29(%rip),%rsi
call   1060 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
add    %r14,%r13
add    $0xffffffffffffffff,%rbp
je     1291 <DymosimMessageDoubleMatrix+0x151>
mov    %rbx,%rdi
lea    0xd03(%rip),%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0xc9,%eax
jb     12d0 <DymosimMessageDoubleMatrix+0x190>
mov    %rbx,%rdi
call   1040 <DymosimMessage@plt>
movb   $0x0,0x40(%rsp)
jmp    12d0 <DymosimMessageDoubleMatrix+0x190>
lea    0xcdb(%rip),%rdi
call   1040 <DymosimMessage@plt>
lea    0xcd5(%rip),%rdi
call   1040 <DymosimMessage@plt>
add    $0x1d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" = \00"
@.str.1 = [2 x i8] c"{\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [3 x i8] c", \00"
@.str.4 = [3 x i8] c"%G\00"
@.str.5 = [2 x i8] c"}\00"
@.str.6 = [3 x i8] c"};\00"
define void @DymosimMessageDoubleMatrix(i8* %0, double* nocapture %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca [100 x i8]
%7 = alloca [300 x i8]
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%9 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 0
store i8 0, i8* %9
%10 = call i32 @strcat(i8* %9, i8* %0)
%11 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @DymosimMessage(i8* %9)
store i8 0, i8* %9
%14 = call i32 @DymosimMessage(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp slt i32 %2, 1
br i1 %15, label %65, label %16
16: ; preds = %5
%17 = icmp slt i32 %3, 1
%18 = sext i32 %4 to i64
%19 = add i32 %3, 1
%20 = zext i32 %2 to i64
%21 = add nuw i32 %2, 1
%22 = zext i32 %21 to i64
%23 = zext i32 %19 to i64
%24 = icmp eq i32 %19, 2
br label %25
25: ; preds = %16, %61
%26 = phi i64 [ 1, %16 ], [ %63, %61 ]
%27 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br i1 %17, label %56, label %28
28: ; preds = %25
%29 = add nsw i64 %26, -1
%30 = call i32 @strlen(i8* %9)
%31 = icmp ugt i32 %30, 200
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @DymosimMessage(i8* %9)
store i8 0, i8* %9
br label %34
34: ; preds = %32, %28
%35 = getelementptr inbounds double, double* %1, i64 %29
%36 = load double, double* %35
%37 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), double %36)
%38 = call i32 @strcat(i8* %9, i8* %8)
br i1 %24, label %56, label %39
39: ; preds = %34, %46
%40 = phi i64 [ %54, %46 ], [ 2, %34 ]
%41 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%42 = call i32 @strlen(i8* %9)
%43 = icmp ugt i32 %42, 200
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = call i32 @DymosimMessage(i8* %9)
store i8 0, i8* %9
br label %46
46: ; preds = %44, %39
%47 = add nsw i64 %40, -1
%48 = mul nsw i64 %47, %18
%49 = add nsw i64 %29, %48
%50 = getelementptr inbounds double, double* %1, i64 %49
%51 = load double, double* %50
%52 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), double %51)
%53 = call i32 @strcat(i8* %9, i8* %8)
%54 = add nuw nsw i64 %40, 1
%55 = icmp eq i64 %54, %23
br i1 %55, label %56, label %39
56: ; preds = %46, %34, %25
%57 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%58 = icmp ult i64 %26, %20
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %61
61: ; preds = %59, %56
%62 = call i32 @DymosimMessage(i8* %9)
store i8 0, i8* %9
%63 = add nuw nsw i64 %26, 1
%64 = icmp eq i64 %63, %22
br i1 %64, label %65, label %25
65: ; preds = %61, %5
%66 = call i32 @DymosimMessage(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%67 = call i32 @DymosimMessage(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
ret void
}