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


x86 assembly (clang, -O0):
<printMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11e1 <printMatrix+0xd1>
movl   $0x1,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    1192 <printMatrix+0x82>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <printMatrix+0x46>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cmp    $0xa,%eax
jge    11ce <printMatrix+0xbe>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d3 <printMatrix+0xc3>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <printMatrix+0x35>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%esi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x4c,%rbx
lea    0xeac(%rip),%r14
lea    0xeae(%rip),%r15
lea    0xea3(%rip),%r12
xor    %ebp,%ebp
jmp    117e <printMatrix+0x5e>
nopl   0x0(%rax)
add    $0x50,%rbx
cmp    $0xa,%rbp
je     129f <printMatrix+0x17f>
mov    %rbp,%r13
mov    -0x48(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x44(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x40(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x3c(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x38(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x34(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x30(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x2c(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x28(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x24(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x20(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x1c(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x18(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x14(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x10(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0xc(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x8(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x4(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
add    $0x1,%rbp
cmp    $0x9,%r13
jae    1170 <printMatrix+0x50>
mov    -0x4c(%rbx),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1170 <printMatrix+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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