#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *unixos[] = {
      "OpenBSD", "FreeBSD",      "Open Solaris", "NetBSD",
      "AIX",     "GNU/Linux Os", "HP/UX",        "Dragonfly BSD",
  };
  char **bsd_os[4] = {&unixos[0], &unixos[1]};
  bsd_os[2] = &unixos[3];
  bsd_os[3] = &unixos[7];
  for (int i = 0; i < sizeof(**bsd_os) / sizeof(**bsd_os[0]); i++)
    printf("%s\n", *bsd_os[i]);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0x2c93(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rcx
lea    -0x50(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    %rcx,%rax
add    $0x8,%rax
lea    -0x50(%rbp),%rdx
add    $0x8,%rdx
mov    %rdx,-0x68(%rbp)
add    $0x8,%rax
add    $0x20,%rcx
mov    %rcx,-0x88(%rbp)
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
mov    -0x88(%rbp),%rcx
movq   $0x0,(%rax)
add    $0x8,%rax
mov    %rax,-0x90(%rbp)
cmp    %rcx,%rax
mov    %rax,-0x80(%rbp)
jne    1179 <main+0x59>
lea    -0x50(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x60(%rbp)
lea    -0x50(%rbp),%rax
add    $0x38,%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x74(%rbp)
movslq -0x74(%rbp),%rax
cmp    $0x8,%rax
jae    11f6 <main+0xd6>
movslq -0x74(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rax
mov    (%rax),%rsi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11c2 <main+0xa2>
mov    0x2ddb(%rip),%rax
mov    (%rax),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf0d(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"OpenBSD\00"
@.str.1 = [8 x i8] c"FreeBSD\00"
@.str.2 = [13 x i8] c"Open Solaris\00"
@.str.3 = [7 x i8] c"NetBSD\00"
@.str.4 = [4 x i8] c"AIX\00"
@.str.5 = [13 x i8] c"GNU/Linux Os\00"
@.str.6 = [6 x i8] c"HP/UX\00"
@.str.7 = [14 x i8] c"Dragonfly BSD\00"
@__const.main.unixos = [8 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i32 0, i32 0)]
@.str.8 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8*]
%3 = alloca [4 x i8**]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [8 x i8*]* %2 to i8*
%6 = getelementptr inbounds [4 x i8**], [4 x i8**]* %3, i64 0, i64 0
%7 = getelementptr inbounds [8 x i8*], [8 x i8*]* %2, i64 0, i64 0
store i8** %7, i8*** %6
%8 = getelementptr inbounds i8**, i8*** %6, i64 1
%9 = getelementptr inbounds [8 x i8*], [8 x i8*]* %2, i64 0, i64 1
store i8** %9, i8*** %8
%10 = getelementptr inbounds i8**, i8*** %8, i64 1
%11 = getelementptr inbounds i8**, i8*** %6, i64 4
br label %12
12: ; preds = %12, %0
%13 = phi i8*** [ %10, %0 ], [ %14, %12 ]
store i8** null, i8*** %13
%14 = getelementptr inbounds i8**, i8*** %13, i64 1
%15 = icmp eq i8*** %14, %11
br i1 %15, label %16, label %12
16: ; preds = %12
%17 = getelementptr inbounds [8 x i8*], [8 x i8*]* %2, i64 0, i64 3
%18 = getelementptr inbounds [4 x i8**], [4 x i8**]* %3, i64 0, i64 2
store i8** %17, i8*** %18
%19 = getelementptr inbounds [8 x i8*], [8 x i8*]* %2, i64 0, i64 7
%20 = getelementptr inbounds [4 x i8**], [4 x i8**]* %3, i64 0, i64 3
store i8** %19, i8*** %20
store i32 0, i32* %4
br label %21
21: ; preds = %32, %16
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = icmp ult i64 %23, 8
br i1 %24, label %25, label %35
25: ; preds = %21
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [4 x i8**], [4 x i8**]* %3, i64 0, i64 %27
%29 = load i8**, i8*** %28
%30 = load i8*, i8** %29
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %25
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %21
35: ; preds = %21
%36 = load i32, i32* @EXIT_SUCCESS
ret i32 %36
}

LLVM IR (-O2):
@.str = [8 x i8] c"OpenBSD\00"
@.str.1 = [8 x i8] c"FreeBSD\00"
@.str.3 = [7 x i8] c"NetBSD\00"
@.str.7 = [14 x i8] c"Dragonfly BSD\00"
@.str.8 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* undef)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* undef)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* undef)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* undef)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}