#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 *, ...);
char *stdin_to_str();
char **str_parsing(char *);
int main(void) {
  char *input;
  char **grid;
  int rows;
  int cols;
  rows = 0;
  cols = 0;
  input = stdin_to_str();
  grid = str_parsing(input);
  while (*(grid + rows)) {
    cols = 0;
    while (grid[rows][cols]) {
      printf("%c", grid[rows][cols]);
      cols++;
    }
    printf("\n");
    rows++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1050 <stdin_to_str@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <str_parsing@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11e5 <main+0xb5>
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     11c9 <main+0x99>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    117f <main+0x4f>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1165 <main+0x35>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <stdin_to_str@plt>
mov    %rax,%rdi
call   1040 <str_parsing@plt>
mov    %rax,%r14
mov    (%rax),%rax
test   %rax,%rax
je     11aa <main+0x7a>
xor    %r15d,%r15d
mov    %r14,%r12
jmp    1180 <main+0x50>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    (%r14,%r15,8),%r12
add    $0x8,%r12
mov    0x8(%r14,%r15,8),%rax
add    $0x1,%r15
test   %rax,%rax
je     11aa <main+0x7a>
mov    (%rax),%al
test   %al,%al
je     1160 <main+0x30>
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
mov    (%r12),%rax
movzbl (%rax,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1190 <main+0x60>
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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