#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*/ gets(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char arr[4][10];
  int i;
  for (i = 0; i < 4; i++)
    gets(arr[i]);
  for (i = 0; i < 4; i++)
    puts(arr[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    1162 <main+0x42>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
call   1040 <gets@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    1195 <main+0x75>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
call   1030 <puts@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1169 <main+0x49>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <gets@plt>
lea    0xa(%rsp),%r14
mov    %r14,%rdi
call   1040 <gets@plt>
lea    0x14(%rsp),%r12
mov    %r12,%rdi
call   1040 <gets@plt>
lea    0x1e(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x [10 x i8]]
%2 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 1, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 2, i64 0
%7 = call i32 @gets(i8* %6)
%8 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 3, i64 0
%9 = call i32 @gets(i8* %8)
%10 = call i32 @puts(i8* %2)
%11 = call i32 @puts(i8* %4)
%12 = call i32 @puts(i8* %6)
%13 = call i32 @puts(i8* %8)
ret i32 0
}