#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(char str[50][50]) {
  int i, j, check;
  int length = 50;
  for (i = 0; i < length; i++) {
    check = 0;
    for (j = 0; j < length; j++) {
      printf("%c", str[i][j]);
      if (!check && str[i][j] != '\0')
        check++;
    }
    if (check)
      printf("\n");
  }
}


x86 assembly (clang, -O0):
<printMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x32,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11e6 <printMatrix+0xd6>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11bb <printMatrix+0xab>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    11a8 <printMatrix+0x98>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11a8 <printMatrix+0x98>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ad <printMatrix+0x9d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <printMatrix+0x34>
cmpl   $0x0,-0x14(%rbp)
je     11d3 <printMatrix+0xc3>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <printMatrix+0xc8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <printMatrix+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r14
xor    %r15d,%r15d
jmp    1138 <printMatrix+0x28>
test   %al,%al
je     112e <printMatrix+0x1e>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
cmp    $0x32,%r15
je     1181 <printMatrix+0x71>
xor    %ebx,%ebx
xor    %r12d,%r12d
jmp    115a <printMatrix+0x4a>
nop
add    %rbx,%rbp
movzbl 0x0(%rbp),%eax
xor    %r12d,%r12d
test   %al,%al
setne  %r12b
add    $0x1,%rbx
cmp    $0x32,%rbx
je     1120 <printMatrix+0x10>
imul   $0x32,%r15,%rbp
add    %r14,%rbp
movsbl (%rbx,%rbp,1),%edi
call   1030 <putchar@plt>
test   %r12d,%r12d
je     1140 <printMatrix+0x30>
add    $0x1,%rbx
mov    $0x1,%r12d
cmp    $0x32,%rbx
jne    115a <printMatrix+0x4a>
jmp    1124 <printMatrix+0x14>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @printMatrix([50 x i8]* nocapture %0) {
br label %2
2: ; preds = %1, %27
%3 = phi i64 [ 0, %1 ], [ %28, %27 ]
br label %4
4: ; preds = %18, %2
%5 = phi i64 [ 0, %2 ], [ %19, %18 ]
%6 = phi i32 [ 0, %2 ], [ %20, %18 ]
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %0, i64 %3, i64 %5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = tail call i32 @putchar(i32 %9)
%11 = icmp eq i32 %6, 0
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i8, i8* %7
%14 = icmp ne i8 %13, 0
%15 = zext i1 %14 to i32
%16 = add nuw nsw i64 %5, 1
%17 = icmp eq i64 %16, 50
br i1 %17, label %24, label %18
18: ; preds = %12, %21
%19 = phi i64 [ %16, %12 ], [ %22, %21 ]
%20 = phi i32 [ %15, %12 ], [ 1, %21 ]
br label %4
21: ; preds = %4
%22 = add nuw nsw i64 %5, 1
%23 = icmp eq i64 %22, 50
br i1 %23, label %25, label %18
24: ; preds = %12
br i1 %14, label %25, label %27
25: ; preds = %21, %24
%26 = tail call i32 @putchar(i32 10)
br label %27
27: ; preds = %24, %25
%28 = add nuw nsw i64 %3, 1
%29 = icmp eq i64 %28, 50
br i1 %29, label %30, label %2
30: ; preds = %27
ret void
}