#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*/ printf(char *, char *);
main() {
  int i;
  char cad[5][81];
  char *p[5];
  char **q;
  for (i = 0; i < 5; i++)
    p[i] = cad[i];
  q = p;
  for (i = 0; i < 5; i++)
    gets(q[i]);
  for (i = 0; i < 5; i++)
    printf("%s\n", q[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    116f <main+0x4f>
movslq -0x8(%rbp),%rax
lea    -0x1a0(%rbp),%rcx
imul   $0x51,%rax,%rax
add    %rax,%rcx
movslq -0x8(%rbp),%rax
mov    %rcx,-0x1d0(%rbp,%rax,8)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
lea    -0x1d0(%rbp),%rax
mov    %rax,-0x1d8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11b0 <main+0x90>
mov    -0x1d8(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <gets@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1184 <main+0x64>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11ea <main+0xca>
mov    -0x1d8(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b7 <main+0x97>
mov    -0x4(%rbp),%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
lea    0x51(%rsp),%r13
lea    0xa2(%rsp),%r12
lea    0xf3(%rsp),%r15
lea    0x144(%rsp),%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %r13,%rdi
call   1040 <gets@plt>
mov    %r12,%rdi
call   1040 <gets@plt>
mov    %r15,%rdi
call   1040 <gets@plt>
mov    %r14,%rdi
call   1040 <gets@plt>
lea    0xe80(%rip),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x [81 x i8]]
%2 = getelementptr inbounds [5 x [81 x i8]], [5 x [81 x i8]]* %1, i64 0, i64 0, i64 0
%3 = getelementptr inbounds [5 x [81 x i8]], [5 x [81 x i8]]* %1, i64 0, i64 1, i64 0
%4 = getelementptr inbounds [5 x [81 x i8]], [5 x [81 x i8]]* %1, i64 0, i64 2, i64 0
%5 = getelementptr inbounds [5 x [81 x i8]], [5 x [81 x i8]]* %1, i64 0, i64 3, i64 0
%6 = getelementptr inbounds [5 x [81 x i8]], [5 x [81 x i8]]* %1, i64 0, i64 4, i64 0
%7 = call i32 @gets(i8* %2)
%8 = call i32 @gets(i8* %3)
%9 = call i32 @gets(i8* %4)
%10 = call i32 @gets(i8* %5)
%11 = call i32 @gets(i8* %6)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}