#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 *, ...);
int NUM_print_matrix(double *matrix, int neq) {
  int i = 0;
  int j = 0;
  for (i = 0; i < neq; i++) {
    for (j = 0; j <= neq; j++)
      printf("% .5e ", matrix[i + neq * j]);
    printf("\n");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<NUM_print_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a3 <NUM_print_matrix+0x93>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1187 <NUM_print_matrix+0x77>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe8e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <NUM_print_matrix+0x37>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <NUM_print_matrix+0x24>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NUM_print_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
jle    11a1 <NUM_print_matrix+0x81>
mov    %rdi,%r12
mov    %rsi,%rax
mov    %eax,%ecx
add    $0x1,%eax
mov    %rax,0x10(%rsp)
mov    %rcx,0x8(%rsp)
lea    0x0(,%rcx,8),%rbx
xor    %ebp,%ebp
lea    0xea8(%rip),%r13
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%r14
mov    %r12,%r15
nopl   0x0(%rax,%rax,1)
movsd  (%r15),%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    %rbx,%r15
add    $0xffffffffffffffff,%r14
jne    1170 <NUM_print_matrix+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
add    $0x8,%r12
cmp    0x8(%rsp),%rbp
jne    1160 <NUM_print_matrix+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"% .5e \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @NUM_print_matrix(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %32, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %35
11: ; preds = %7
store i32 0, i32* %6
br label %12
12: ; preds = %27, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %30
16: ; preds = %12
%17 = load double*, double** %3
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = mul nsw i32 %19, %20
%22 = add nsw i32 %18, %21
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %17, i64 %23
%25 = load double, double* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %25)
br label %27
27: ; preds = %16
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %12
30: ; preds = %12
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %32
32: ; preds = %30
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %7
35: ; preds = %7
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

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