#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 *);
void main() {
  char *s[] = {"man", "woman", "girl", "boy", "sister"};
  char **q;
  int k;
  for (k = 0; k < 5; k++) {
    q = &s[k];
    printf("%s\n", *q);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeb6(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeb1(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeab(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xea4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x5,-0x3c(%rbp)
jge    11b4 <main+0x94>
movslq -0x3c(%rbp),%rcx
lea    -0x30(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rsi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1176 <main+0x56>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xefe(%rip),%rbx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"man\00"
@.str.1 = [6 x i8] c"woman\00"
@.str.2 = [5 x i8] c"girl\00"
@.str.3 = [4 x i8] c"boy\00"
@.str.4 = [7 x i8] c"sister\00"
@.str.5 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [5 x i8*]
%2 = alloca i8**
%3 = alloca i32
%4 = bitcast [5 x i8*]* %1 to i8*
%5 = bitcast i8* %4 to [5 x i8*]*
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 4
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8** %10
store i32 0, i32* %3
br label %11
11: ; preds = %21, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 %16
store i8** %17, i8*** %2
%18 = load i8**, i8*** %2
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %14
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %11
24: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"man\00"
@.str.1 = [6 x i8] c"woman\00"
@.str.2 = [5 x i8] c"girl\00"
@.str.3 = [4 x i8] c"boy\00"
@.str.4 = [7 x i8] c"sister\00"
@.str.5 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
ret void
}