#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_matrix(int n, double **a_s, double *b_s) {
  int i;
  for (i = 0; i < n; i++) {
    int j;
    printf("| ");
    for (j = 0; j < n; j++) {
      printf("%5.2f ", a_s[i][j]);
    }
    printf("| %s ", (i == (n / 2) ? "=" : " "));
    printf(" | %5.2f |\n", b_s[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11e3 <print_matrix+0xd3>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1188 <print_matrix+0x78>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe90(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    114b <print_matrix+0x3b>
mov    -0x1c(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
lea    0xe69(%rip),%rsi
lea    0xe6a(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe44(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <print_matrix+0x1a>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,(%rsp)
test   %edi,%edi
jle    11d5 <print_matrix+0xb5>
mov    %rsi,%rbx
mov    %edi,%r15d
mov    %edi,%ebp
shr    %r15d
lea    0xeba(%rip),%r13
xor    %r12d,%r12d
nopl   0x0(%rax)
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%r12,8),%rax
movsd  (%rax,%r14,8),%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    1170 <print_matrix+0x50>
cmp    %r15,%r12
lea    0xe71(%rip),%rsi
lea    0xe72(%rip),%rax
cmove  %rax,%rsi
lea    0xe61(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%rax
movsd  (%rax,%r12,8),%xmm0
lea    0xe51(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r12
cmp    %rbp,%r12
jne    1150 <print_matrix+0x30>
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 = [3 x i8] c"| \00"
@.str.1 = [7 x i8] c"%5.2f \00"
@.str.2 = [6 x i8] c"| %s \00"
@.str.3 = [2 x i8] c"=\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [12 x i8] c" | %5.2f |\0A\00"
@.str.6 = [2 x i8] c"\0A\00"
define void @print_matrix(i32 %0, double** %1, double* %2) {
%4 = alloca i32
%5 = alloca double**
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store double** %1, double*** %5
store double* %2, double** %6
store i32 0, i32* %7
br label %9
9: ; preds = %47, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %50
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %15
15: ; preds = %30, %13
%16 = load i32, i32* %8
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %33
19: ; preds = %15
%20 = load double**, double*** %5
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double*, double** %20, i64 %22
%24 = load double*, double** %23
%25 = load i32, i32* %8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %28)
br label %30
30: ; preds = %19
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 1
store i32 %32, i32* %8
br label %15
33: ; preds = %15
%34 = load i32, i32* %7
%35 = load i32, i32* %4
%36 = sdiv i32 %35, 2
%37 = icmp eq i32 %34, %36
%38 = zext i1 %37 to i64
%39 = select i1 %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %39)
%41 = load double*, double** %6
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
%45 = load double, double* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), double %45)
br label %47
47: ; preds = %33
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
br label %9
50: ; preds = %9
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"| \00"
@.str.1 = [7 x i8] c"%5.2f \00"
@.str.2 = [6 x i8] c"| %s \00"
@.str.3 = [2 x i8] c"=\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [12 x i8] c" | %5.2f |\0A\00"
define void @print_matrix(i32 %0, double** nocapture %1, double* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %30
5: ; preds = %3
%6 = lshr i32 %0, 1
%7 = zext i32 %6 to i64
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %21, %5
%10 = phi i64 [ 0, %5 ], [ %28, %21 ]
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds double*, double** %1, i64 %10
br label %13
13: ; preds = %9, %13
%14 = phi i64 [ 0, %9 ], [ %19, %13 ]
%15 = load double*, double** %12
%16 = getelementptr inbounds double, double* %15, i64 %14
%17 = load double, double* %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %17)
%19 = add nuw nsw i64 %14, 1
%20 = icmp eq i64 %19, %8
br i1 %20, label %21, label %13
21: ; preds = %13
%22 = icmp eq i64 %10, %7
%23 = select i1 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds double, double* %2, i64 %10
%26 = load double, double* %25
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), double %26)
%28 = add nuw nsw i64 %10, 1
%29 = icmp eq i64 %28, %8
br i1 %29, label %30, label %9
30: ; preds = %21, %3
%31 = tail call i32 @putchar(i32 10)
ret void
}