#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 *, ...);
int /*<<< orphan*/ putchar(char);
void showPlan(int layout[], int maxSeats, char plate[]) {
  int i, c;
  printf("\n%s\n", plate);
  for (i = 0; i < (maxSeats - 5); i += 4) {
    for (c = 0; c <= 3; c++) {
      putchar(layout[i + c] ? '*' : '_');
      if (c == 1) {
        putchar(' ');
      }
    }
    printf("\n");
  }
  for (i = maxSeats - 5; i < maxSeats; i++) {
    putchar(layout[i] ? '*' : '_');
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<showPlan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x5,%ecx
cmp    %ecx,%eax
jge    11d9 <showPlan+0xb9>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jg     11bd <showPlan+0x9d>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    $0x5f,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpl   $0x1,-0x20(%rbp)
jne    11aa <showPlan+0x8a>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11af <showPlan+0x8f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1164 <showPlan+0x44>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <showPlan+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    121f <showPlan+0xff>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    $0x5f,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e2 <showPlan+0xc2>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showPlan>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xecb(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x5(%r14),%r15d
cmp    $0x6,%r14d
jl     11c8 <showPlan+0xa8>
xor    %ebp,%ebp
mov    $0x5f,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,(%rbx,%rbp,4)
mov    $0x2a,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rbx,%rbp,4)
mov    $0x2a,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x8(%rbx,%rbp,4)
mov    $0x2a,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0xc(%rbx,%rbp,4)
mov    $0x2a,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x4,%rbp
cmp    %ebp,%r15d
jg     1160 <showPlan+0x40>
movslq %r15d,%rbp
movslq %r14d,%r12
cmpl   $0x0,(%rbx,%rbp,4)
mov    $0x5f,%r15d
mov    $0x2a,%r14d
mov    $0x2a,%edi
cmove  %r15d,%edi
call   1030 <putchar@plt>
lea    0x1(%rbp),%rax
cmp    %r12,%rax
jge    123f <showPlan+0x11f>
cmpl   $0x0,0x4(%rbx,%rbp,4)
mov    $0x2a,%edi
cmove  %r15d,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x8(%rbx,%rbp,4)
mov    $0x2a,%edi
cmove  %r15d,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0xc(%rbx,%rbp,4)
mov    $0x2a,%edi
cmove  %r15d,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x10(%rbx,%rbp,4)
cmove  %r15d,%r14d
mov    %r14d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @showPlan(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9)
store i32 0, i32* %7
br label %11
11: ; preds = %43, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 5
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %46
16: ; preds = %11
store i32 0, i32* %8
br label %17
17: ; preds = %38, %16
%18 = load i32, i32* %8
%19 = icmp sle i32 %18, 3
br i1 %19, label %20, label %41
20: ; preds = %17
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = add nsw i32 %22, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %21, i64 %25
%27 = load i32, i32* %26
%28 = icmp ne i32 %27, 0
%29 = zext i1 %28 to i64
%30 = select i1 %28, i32 42, i32 95
%31 = trunc i32 %30 to i8
%32 = call i32 @putchar(i8 signext %31)
%33 = load i32, i32* %8
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %37
35: ; preds = %20
%36 = call i32 @putchar(i8 signext 32)
br label %37
37: ; preds = %35, %20
br label %38
38: ; preds = %37
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 1
store i32 %40, i32* %8
br label %17
41: ; preds = %17
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %43
43: ; preds = %41
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 4
store i32 %45, i32* %7
br label %11
46: ; preds = %11
%47 = load i32, i32* %5
%48 = sub nsw i32 %47, 5
store i32 %48, i32* %7
br label %49
49: ; preds = %64, %46
%50 = load i32, i32* %7
%51 = load i32, i32* %5
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %67
53: ; preds = %49
%54 = load i32*, i32** %4
%55 = load i32, i32* %7
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %54, i64 %56
%58 = load i32, i32* %57
%59 = icmp ne i32 %58, 0
%60 = zext i1 %59 to i64
%61 = select i1 %59, i32 42, i32 95
%62 = trunc i32 %61 to i8
%63 = call i32 @putchar(i8 signext %62)
br label %64
64: ; preds = %53
%65 = load i32, i32* %7
%66 = add nsw i32 %65, 1
store i32 %66, i32* %7
br label %49
67: ; preds = %49
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
define void @showPlan(i32* nocapture %0, i32 %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = add i32 %1, -5
%6 = icmp sgt i32 %1, 5
br i1 %6, label %17, label %7
7: ; preds = %17, %3
%8 = sext i32 %5 to i64
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %8
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i8 95, i8 42
%14 = tail call i32 @putchar(i8 signext %13)
%15 = add nsw i64 %8, 1
%16 = icmp slt i64 %15, %9
br i1 %16, label %47, label %71
17: ; preds = %3, %17
%18 = phi i64 [ %44, %17 ], [ 0, %3 ]
%19 = getelementptr inbounds i32, i32* %0, i64 %18
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 0
%22 = select i1 %21, i8 95, i8 42
%23 = tail call i32 @putchar(i8 signext %22)
%24 = or i64 %18, 1
%25 = getelementptr inbounds i32, i32* %0, i64 %24
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i8 95, i8 42
%29 = tail call i32 @putchar(i8 signext %28)
%30 = tail call i32 @putchar(i8 signext 32)
%31 = or i64 %18, 2
%32 = getelementptr inbounds i32, i32* %0, i64 %31
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, 0
%35 = select i1 %34, i8 95, i8 42
%36 = tail call i32 @putchar(i8 signext %35)
%37 = or i64 %18, 3
%38 = getelementptr inbounds i32, i32* %0, i64 %37
%39 = load i32, i32* %38
%40 = icmp eq i32 %39, 0
%41 = select i1 %40, i8 95, i8 42
%42 = tail call i32 @putchar(i8 signext %41)
%43 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
%44 = add nuw i64 %18, 4
%45 = trunc i64 %44 to i32
%46 = icmp sgt i32 %5, %45
br i1 %46, label %17, label %7
47: ; preds = %7
%48 = getelementptr inbounds i32, i32* %0, i64 %15
%49 = load i32, i32* %48
%50 = icmp eq i32 %49, 0
%51 = select i1 %50, i8 95, i8 42
%52 = tail call i32 @putchar(i8 signext %51)
%53 = add nsw i64 %8, 2
%54 = getelementptr inbounds i32, i32* %0, i64 %53
%55 = load i32, i32* %54
%56 = icmp eq i32 %55, 0
%57 = select i1 %56, i8 95, i8 42
%58 = tail call i32 @putchar(i8 signext %57)
%59 = add nsw i64 %8, 3
%60 = getelementptr inbounds i32, i32* %0, i64 %59
%61 = load i32, i32* %60
%62 = icmp eq i32 %61, 0
%63 = select i1 %62, i8 95, i8 42
%64 = tail call i32 @putchar(i8 signext %63)
%65 = add nsw i64 %8, 4
%66 = getelementptr inbounds i32, i32* %0, i64 %65
%67 = load i32, i32* %66
%68 = icmp eq i32 %67, 0
%69 = select i1 %68, i8 95, i8 42
%70 = tail call i32 @putchar(i8 signext %69)
br label %71
71: ; preds = %47, %7
%72 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
}