#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 printimatl(int *a, int m, int n) {
  int i, j, jmod;
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      printf("%10d ", a[i * n + j]);
      jmod = (j + 1) % 10;
      if ((jmod == 0) && (j < (n - 1))) {
        printf("  ...\n");
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printimatl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d3 <printimatl+0xc3>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b7 <printimatl+0xa7>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    11a4 <printimatl+0x94>
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11a4 <printimatl+0x94>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a9 <printimatl+0x99>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113c <printimatl+0x2c>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <printimatl+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printimatl>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,(%rsp)
test   %esi,%esi
jle    1217 <printimatl+0xe7>
mov    %rdi,%rbx
mov    (%rsp),%rcx
lea    -0x1(%rcx),%eax
cltq
mov    %rax,0x20(%rsp)
movslq %ecx,%rax
mov    %esi,%ecx
mov    %rcx,0x8(%rsp)
mov    %eax,%r14d
shl    $0x2,%rax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
jmp    119f <printimatl+0x6f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%rax
add    $0x1,%rax
add    0x10(%rsp),%rbx
cmp    0x8(%rsp),%rax
je     1217 <printimatl+0xe7>
mov    %rax,0x18(%rsp)
cmpl   $0x0,(%rsp)
jle    1180 <printimatl+0x50>
mov    $0x1,%r12d
xor    %r15d,%r15d
jmp    11c9 <printimatl+0x99>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r12d
cmp    %r15,%r14
je     1180 <printimatl+0x50>
mov    %r15,%rbp
mov    %r12d,%eax
mov    $0xcccccccd,%ecx
imul   %rcx,%rax
shr    $0x23,%rax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,1),%r13d
add    $0xffffffff,%r13d
mov    (%rbx,%r15,4),%esi
lea    0xe0e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15
cmp    %ebp,%r13d
jne    11c0 <printimatl+0x90>
cmp    0x20(%rsp),%rbp
jge    11c0 <printimatl+0x90>
lea    0xdf6(%rip),%rdi
call   1040 <puts@plt>
jmp    11c0 <printimatl+0x90>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%10d \00"
@.str.1 = [7 x i8] c" ...\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @printimatl(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %10
10: ; preds = %48, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %51
14: ; preds = %10
store i32 0, i32* %8
br label %15
15: ; preds = %43, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %6
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %46
19: ; preds = %15
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = mul nsw i32 %21, %22
%24 = load i32, i32* %8
%25 = add nsw i32 %23, %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %20, i64 %26
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
%32 = srem i32 %31, 10
store i32 %32, i32* %9
%33 = load i32, i32* %9
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %42
35: ; preds = %19
%36 = load i32, i32* %8
%37 = load i32, i32* %6
%38 = sub nsw i32 %37, 1
%39 = icmp slt i32 %36, %38
br i1 %39, label %40, label %42
40: ; preds = %35
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %42
42: ; preds = %40, %35, %19
br label %43
43: ; preds = %42
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %15
46: ; preds = %15
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %46
%49 = load i32, i32* %7
%50 = add nsw i32 %49, 1
store i32 %50, i32* %7
br label %10
51: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%10d \00"
@str = [6 x i8] c" ...\00"
define void @printimatl(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %36
5: ; preds = %3
%6 = icmp sgt i32 %2, 0
%7 = add nsw i32 %2, -1
%8 = sext i32 %7 to i64
%9 = sext i32 %2 to i64
%10 = zext i32 %1 to i64
%11 = zext i32 %2 to i64
br label %12
12: ; preds = %5, %32
%13 = phi i64 [ 0, %5 ], [ %34, %32 ]
br i1 %6, label %14, label %32
14: ; preds = %12
%15 = mul nsw i64 %13, %9
br label %16
16: ; preds = %14, %30
%17 = phi i64 [ 0, %14 ], [ %22, %30 ]
%18 = add nsw i64 %17, %15
%19 = getelementptr inbounds i32, i32* %0, i64 %18
%20 = load i32, i32* %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = add nuw nsw i64 %17, 1
%23 = trunc i64 %22 to i32
%24 = urem i32 %23, 10
%25 = icmp eq i32 %24, 0
%26 = icmp slt i64 %17, %8
%27 = select i1 %25, i1 %26, i1 false
br i1 %27, label %28, label %30
28: ; preds = %16
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %30
30: ; preds = %16, %28
%31 = icmp eq i64 %22, %11
br i1 %31, label %32, label %16
32: ; preds = %30, %12
%33 = tail call i32 @putchar(i32 10)
%34 = add nuw nsw i64 %13, 1
%35 = icmp eq i64 %34, %10
br i1 %35, label %36, label %12
36: ; preds = %32, %3
ret void
}