#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*/ printvec(int, double *, int);
void printmatSQ(int size, int n, double *X, int modulo) {
  int i, ll;
  ll = 0;
  for (i = 1; i <= n; i++) {
    printvec(n, &X[ll], modulo);
    ll += size;
  }
}


x86 assembly (clang, -O0):
<printmatSQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1170 <printmatSQ+0x60>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
call   1030 <printvec@plt>
mov    -0x4(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1133 <printmatSQ+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmatSQ>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    1146 <printmatSQ+0x36>
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %esi,%r15d
movslq %edi,%r12
shl    $0x3,%r12
mov    %esi,%ebp
xchg   %ax,%ax
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <printvec@plt>
add    %r12,%rbx
add    $0xffffffff,%ebp
jne    1130 <printmatSQ+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @printmatSQ(i32 %0, i32 %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store i32 %3, i32* %8
store i32 0, i32* %10
store i32 1, i32* %9
br label %11
11: ; preds = %26, %4
%12 = load i32, i32* %9
%13 = load i32, i32* %6
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %29
15: ; preds = %11
%16 = load i32, i32* %6
%17 = load double*, double** %7
%18 = load i32, i32* %10
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %17, i64 %19
%21 = load i32, i32* %8
%22 = call i32 @printvec(i32 %16, double* %20, i32 %21)
%23 = load i32, i32* %5
%24 = load i32, i32* %10
%25 = add nsw i32 %24, %23
store i32 %25, i32* %10
br label %26
26: ; preds = %15
%27 = load i32, i32* %9
%28 = add nsw i32 %27, 1
store i32 %28, i32* %9
br label %11
29: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @printmatSQ(i32 %0, i32 %1, double* %2, i32 %3) {
%5 = icmp slt i32 %1, 1
br i1 %5, label %16, label %6
6: ; preds = %4
%7 = sext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = phi i32 [ 1, %6 ], [ %14, %8 ]
%11 = getelementptr inbounds double, double* %2, i64 %9
%12 = tail call i32 @printvec(i32 %1, double* %11, i32 %3)
%13 = add nsw i64 %9, %7
%14 = add nuw i32 %10, 1
%15 = icmp eq i32 %10, %1
br i1 %15, label %16, label %8
16: ; preds = %8, %4
ret void
}