#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*/ printf(char *, ...);
void print_solution(const float *const res) {
  for (int m = 0; m < 2; m++) {
    char matrix = 'A' + m;
    printf("%c: matrix(\n", matrix);
    for (int h = 0; h < 5; h++) {
      int pos = m * 5 * 5 + h * 5;
      printf("[ ");
      for (int w = 0; w < 5 - 1; w++) {
        printf("%10.9e, ", res[pos + w]);
      }
      printf("%10.9e ]", res[pos + 5 - 1]);
      if (h < (5 - 1))
        printf(",");
      printf("\n");
    }
    printf(");\n%c: factor(%c);\n\n", matrix, matrix);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1239 <print_solution+0x129>
mov    -0xc(%rbp),%eax
add    $0x41,%eax
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1215 <print_solution+0x105>
imul   $0x5,-0xc(%rbp),%eax
imul   $0x5,%eax,%eax
imul   $0x5,-0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    11ba <print_solution+0xaa>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117e <print_solution+0x6e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x5,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cmpl   $0x4,-0x14(%rbp)
jge    11f9 <print_solution+0xe9>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114f <print_solution+0x3f>
movsbl -0xd(%rbp),%esi
movsbl -0xd(%rbp),%edx
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_solution+0x13>
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_solution>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r13
lea    0xecb(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%r13),%rbx
lea    0xec1(%rip),%r14
lea    0xebd(%rip),%r15
lea    0xebf(%rip),%r12
xor    %ebp,%ebp
jmp    117c <print_solution+0x5c>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
add    $0x14,%rbx
cmp    $0x5,%rbp
je     11fd <print_solution+0xdd>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  -0x10(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0xc(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x8(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x4(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmp    $0x3,%rbp
ja     1160 <print_solution+0x40>
mov    $0x2c,%edi
call   1030 <putchar@plt>
jmp    1160 <print_solution+0x40>
lea    0xe1e(%rip),%rdi
mov    $0x41,%esi
mov    $0x41,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xde4(%rip),%rdi
mov    $0x42,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x74,%r13
lea    0xdda(%rip),%r14
lea    0xdd6(%rip),%r15
lea    0xdd8(%rip),%r12
xor    %ebx,%ebx
jmp    126c <print_solution+0x14c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
add    $0x14,%r13
cmp    $0x5,%rbx
je     12f3 <print_solution+0x1d3>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  -0x10(%r13),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0xc(%r13),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x8(%r13),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x4(%r13),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x0(%r13),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmp    $0x3,%rbx
ja     1250 <print_solution+0x130>
mov    $0x2c,%edi
call   1030 <putchar@plt>
jmp    1250 <print_solution+0x130>
lea    0xd28(%rip),%rdi
mov    $0x42,%esi
mov    $0x42,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%c: matrix(\0A\00"
@.str.1 = [3 x i8] c"[ \00"
@.str.2 = [9 x i8] c"%10.9e, \00"
@.str.3 = [9 x i8] c"%10.9e ]\00"
@.str.4 = [2 x i8] c",\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [21 x i8] c");\0A%c: factor(%c);\0A\0A\00"
define void @print_solution(float* %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %8
8: ; preds = %70, %1
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %73
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 65, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %4
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %16)
store i32 0, i32* %5
br label %18
18: ; preds = %61, %11
%19 = load i32, i32* %5
%20 = icmp slt i32 %19, 5
br i1 %20, label %21, label %64
21: ; preds = %18
%22 = load i32, i32* %3
%23 = mul nsw i32 %22, 5
%24 = mul nsw i32 %23, 5
%25 = load i32, i32* %5
%26 = mul nsw i32 %25, 5
%27 = add nsw i32 %24, %26
store i32 %27, i32* %6
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %7
br label %29
29: ; preds = %42, %21
%30 = load i32, i32* %7
%31 = icmp slt i32 %30, 4
br i1 %31, label %32, label %45
32: ; preds = %29
%33 = load float*, float** %2
%34 = load i32, i32* %6
%35 = load i32, i32* %7
%36 = add nsw i32 %34, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds float, float* %33, i64 %37
%39 = load float, float* %38
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %40)
br label %42
42: ; preds = %32
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %29
45: ; preds = %29
%46 = load float*, float** %2
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 5
%49 = sub nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds float, float* %46, i64 %50
%52 = load float, float* %51
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %53)
%55 = load i32, i32* %5
%56 = icmp slt i32 %55, 4
br i1 %56, label %57, label %59
57: ; preds = %45
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %59
59: ; preds = %57, %45
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %61
61: ; preds = %59
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 1
store i32 %63, i32* %5
br label %18
64: ; preds = %18
%65 = load i8, i8* %4
%66 = sext i8 %65 to i32
%67 = load i8, i8* %4
%68 = sext i8 %67 to i32
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %66, i32 %68)
br label %70
70: ; preds = %64
%71 = load i32, i32* %3
%72 = add nsw i32 %71, 1
store i32 %72, i32* %3
br label %8
73: ; preds = %8
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%c: matrix(\0A\00"
@.str.1 = [3 x i8] c"[ \00"
@.str.2 = [9 x i8] c"%10.9e, \00"
@.str.3 = [9 x i8] c"%10.9e ]\00"
@.str.6 = [21 x i8] c");\0A%c: factor(%c);\0A\0A\00"
define void @print_solution(float* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 65)
br label %45
3: ; preds = %76
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 65, i32 65)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 66)
br label %6
6: ; preds = %38, %3
%7 = phi i64 [ 0, %3 ], [ %40, %38 ]
%8 = mul nuw nsw i64 %7, 5
%9 = add nuw nsw i64 %8, 25
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds float, float* %0, i64 %9
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %13)
%15 = add nuw nsw i64 %8, 26
%16 = getelementptr inbounds float, float* %0, i64 %15
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %18)
%20 = add nuw nsw i64 %8, 27
%21 = getelementptr inbounds float, float* %0, i64 %20
%22 = load float, float* %21
%23 = fpext float %22 to double
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %23)
%25 = add nuw nsw i64 %8, 28
%26 = getelementptr inbounds float, float* %0, i64 %25
%27 = load float, float* %26
%28 = fpext float %27 to double
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %28)
%30 = add nuw nsw i64 %8, 29
%31 = getelementptr inbounds float, float* %0, i64 %30
%32 = load float, float* %31
%33 = fpext float %32 to double
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %33)
%35 = icmp ult i64 %7, 4
br i1 %35, label %36, label %38
36: ; preds = %6
%37 = tail call i32 @putchar(i32 44)
br label %38
38: ; preds = %36, %6
%39 = tail call i32 @putchar(i32 10)
%40 = add nuw nsw i64 %7, 1
%41 = icmp eq i64 %40, 5
br i1 %41, label %42, label %6
42: ; preds = %38
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 66, i32 66)
%44 = tail call i32 @putchar(i32 10)
ret void
45: ; preds = %1, %76
%46 = phi i64 [ 0, %1 ], [ %78, %76 ]
%47 = mul nuw nsw i64 %46, 5
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%49 = getelementptr inbounds float, float* %0, i64 %47
%50 = load float, float* %49
%51 = fpext float %50 to double
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %51)
%53 = add nuw nsw i64 %47, 1
%54 = getelementptr inbounds float, float* %0, i64 %53
%55 = load float, float* %54
%56 = fpext float %55 to double
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %56)
%58 = add nuw nsw i64 %47, 2
%59 = getelementptr inbounds float, float* %0, i64 %58
%60 = load float, float* %59
%61 = fpext float %60 to double
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %61)
%63 = add nuw nsw i64 %47, 3
%64 = getelementptr inbounds float, float* %0, i64 %63
%65 = load float, float* %64
%66 = fpext float %65 to double
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %66)
%68 = add nuw nsw i64 %47, 4
%69 = getelementptr inbounds float, float* %0, i64 %68
%70 = load float, float* %69
%71 = fpext float %70 to double
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %71)
%73 = icmp ult i64 %46, 4
br i1 %73, label %74, label %76
74: ; preds = %45
%75 = tail call i32 @putchar(i32 44)
br label %76
76: ; preds = %74, %45
%77 = tail call i32 @putchar(i32 10)
%78 = add nuw nsw i64 %46, 1
%79 = icmp eq i64 %78, 5
br i1 %79, label %3, label %45
}