#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 is_airplane_full(int **);
int /*<<< orphan*/ print_airplane(int **);
int /*<<< orphan*/ printf(char *, int);
int seat_group_of_two(int **);
int seat_person(int **);
int main() {
  int seats[16][6];
  for (int i = 0; i < 16; i++) {
    for (int j = 0; j < 6; j++) {
      if (i != 12) {
        seats[i][j] = 0;
      } else {
        seats[i][j] = -666;
      }
    }
  }
  printf("seated 1? %d\n", seat_person(seats));
  printf("seated 1? %d\n", seat_person(seats));
  printf("seated 2? %d\n", seat_group_of_two(seats));
  printf("seated 2? %d\n", seat_group_of_two(seats));
  print_airplane(seats);
  printf("is plane full? %d\n", is_airplane_full(seats));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x194(%rbp)
cmpl   $0x10,-0x194(%rbp)
jge    121a <main+0xca>
movl   $0x0,-0x198(%rbp)
cmpl   $0x6,-0x198(%rbp)
jge    1201 <main+0xb1>
cmpl   $0xc,-0x194(%rbp)
je     11c5 <main+0x75>
movslq -0x194(%rbp),%rcx
lea    -0x190(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x198(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    11e8 <main+0x98>
movslq -0x194(%rbp),%rcx
lea    -0x190(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x198(%rbp),%rcx
movl   $0xfffffd66,(%rax,%rcx,4)
jmp    11ed <main+0x9d>
mov    -0x198(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x198(%rbp)
jmp    1183 <main+0x33>
jmp    1206 <main+0xb6>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    116c <main+0x1c>
lea    -0x190(%rbp),%rdi
call   1050 <seat_person@plt>
mov    %eax,%esi
lea    0xdd1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x190(%rbp),%rdi
call   1050 <seat_person@plt>
mov    %eax,%esi
lea    0xdb7(%rip),%rdi
call   1040 <printf@plt>
lea    -0x190(%rbp),%rdi
call   1070 <seat_group_of_two@plt>
mov    %eax,%esi
lea    0xdab(%rip),%rdi
call   1040 <printf@plt>
lea    -0x190(%rbp),%rdi
call   1070 <seat_group_of_two@plt>
mov    %eax,%esi
lea    0xd91(%rip),%rdi
call   1040 <printf@plt>
lea    -0x190(%rbp),%rdi
call   1030 <print_airplane@plt>
lea    -0x190(%rbp),%rdi
call   1060 <is_airplane_full@plt>
mov    %eax,%esi
lea    0xd79(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x188,%rsp
xor    %eax,%eax
movaps 0xe9d(%rip),%xmm0
movabs $0xfffffd66fffffd66,%rcx
fd ff ff
xorps  %xmm1,%xmm1
jmp    11aa <main+0x5a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movaps %xmm0,0x120(%rsp)
mov    %rcx,0x130(%rsp)
movups %xmm1,0x18(%rsp,%rax,1)
movq   $0x0,0x28(%rsp,%rax,1)
add    $0x30,%rax
cmp    $0x180,%rax
je     11c1 <main+0x71>
cmp    $0x120,%rax
je     1180 <main+0x30>
movaps %xmm1,(%rsp,%rax,1)
movq   $0x0,0x10(%rsp,%rax,1)
jmp    1190 <main+0x40>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <seat_person@plt>
lea    0xe3d(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <seat_person@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1070 <seat_group_of_two@plt>
lea    0xe20(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1070 <seat_group_of_two@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <print_airplane@plt>
mov    %rbx,%rdi
call   1060 <is_airplane_full@plt>
lea    0xdfb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x188,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"seated 1? %d\0A\00"
@.str.1 = [14 x i8] c"seated 2? %d\0A\00"
@.str.2 = [19 x i8] c"is plane full? %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x [6 x i32]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %34, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %37
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %30, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 6
br i1 %11, label %12, label %33
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 12
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %2, i64 0, i64 %17
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %18, i64 0, i64 %20
store i32 0, i32* %21
br label %29
22: ; preds = %12
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %2, i64 0, i64 %24
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [6 x i32], [6 x i32]* %25, i64 0, i64 %27
store i32 -666, i32* %28
br label %29
29: ; preds = %22, %15
br label %30
30: ; preds = %29
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %9
33: ; preds = %9
br label %34
34: ; preds = %33
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %5
37: ; preds = %5
%38 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %2, i64 0, i64 0
%39 = bitcast [6 x i32]* %38 to i32**
%40 = call i32 @seat_person(i32** %39)
%41 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %2, i64 0, i64 0
%43 = bitcast [6 x i32]* %42 to i32**
%44 = call i32 @seat_person(i32** %43)
%45 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %44)
%46 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %2, i64 0, i64 0
%47 = bitcast [6 x i32]* %46 to i32**
%48 = call i32 @seat_group_of_two(i32** %47)
%49 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %48)
%50 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %2, i64 0, i64 0
%51 = bitcast [6 x i32]* %50 to i32**
%52 = call i32 @seat_group_of_two(i32** %51)
%53 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %52)
%54 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %2, i64 0, i64 0
%55 = bitcast [6 x i32]* %54 to i32**
%56 = call i32 @print_airplane(i32** %55)
%57 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %2, i64 0, i64 0
%58 = bitcast [6 x i32]* %57 to i32**
%59 = call i32 @is_airplane_full(i32** %58)
%60 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %59)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"seated 1? %d\0A\00"
@.str.1 = [14 x i8] c"seated 2? %d\0A\00"
@.str.2 = [19 x i8] c"is plane full? %d\0A\00"
define i32 @main() {
%1 = alloca [16 x [6 x i32]]
%2 = bitcast [16 x [6 x i32]]* %1 to i8*
%3 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %1, i64 0, i64 12, i64 0
%4 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %1, i64 0, i64 12, i64 4
%5 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %1, i64 0, i64 12, i64 5
%6 = bitcast i32* %3 to <4 x i32>*
br label %7
7: ; preds = %27, %0
%8 = phi i64 [ 0, %0 ], [ %31, %27 ]
%9 = icmp eq i64 %8, 12
br i1 %9, label %26, label %23
10: ; preds = %27
%11 = bitcast [16 x [6 x i32]]* %1 to i32**
%12 = call i32 @seat_person(i32** %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @seat_person(i32** %11)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 @seat_group_of_two(i32** %11)
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = call i32 @seat_group_of_two(i32** %11)
%19 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = call i32 @print_airplane(i32** %11)
%21 = call i32 @is_airplane_full(i32** %11)
%22 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %21)
ret i32 0
23: ; preds = %7
%24 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %1, i64 0, i64 %8, i64 0
%25 = bitcast i32* %24 to i8*
br label %27
26: ; preds = %7
store <4 x i32> <i32 -666, i32 -666, i32 -666, i32 -666>, <4 x i32>* %6
store i32 -666, i32* %4
store i32 -666, i32* %5
br label %27
27: ; preds = %23, %26
%28 = or i64 %8, 1
%29 = getelementptr inbounds [16 x [6 x i32]], [16 x [6 x i32]]* %1, i64 0, i64 %28, i64 0
%30 = bitcast i32* %29 to i8*
%31 = add nuw nsw i64 %8, 2
%32 = icmp eq i64 %31, 16
br i1 %32, label %10, label %7
}