#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ bookFirstSeatAtWindow(int *, int);
int /*<<< orphan*/ bookSeat(int *, int);
int /*<<< orphan*/ cancelBooking(int *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *, int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ saveDiagram(char *, int *, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ seatIsBooked(int *, int);
int /*<<< orphan*/ showBookedSeats(int *, int);
int /*<<< orphan*/ showDiagram(char *, int *, int);
int /*<<< orphan*/ showEmptySeats(int *, int);
int /*<<< orphan*/ showMenu();
int main() {
  int action;
  int numberOfSeats;
  char busNumber[10];
  FILE *fp;
  fp = fopen("bus.txt", "r");
  if (fp) {
    fscanf(fp, "%s %d", busNumber, &numberOfSeats);
    fclose(fp);
  } else {
    printf("\nFile bus.txt not found\n");
    return 0;
  }
  if (numberOfSeats > 53 || ((numberOfSeats - 5) % 4) != 0) {
    printf("\nInvalid number of seats\n");
    return 0;
  }
  int seats[numberOfSeats];
  int n = 0;
  while (n < numberOfSeats) {
    seats[n] = 0;
    n++;
  }
  do {
    showMenu();
    scanf("%d", &action);
    if (action == 1) {
      showEmptySeats(seats, numberOfSeats);
    }
    if (action == 2) {
      bookSeat(seats, numberOfSeats);
    }
    if (action == 3) {
      bookFirstSeatAtWindow(seats, numberOfSeats);
    }
    if (action == 4) {
      cancelBooking(seats, numberOfSeats);
    }
    if (action == 5) {
      seatIsBooked(seats, numberOfSeats);
    }
    if (action == 6) {
      showBookedSeats(seats, numberOfSeats);
    }
    if (action == 7) {
      showDiagram(busNumber, seats, numberOfSeats);
    }
    if (action == 8) {
      saveDiagram(busNumber, seats, numberOfSeats);
    }
    if (action == 0) {
      return 0;
    }
    if (action < 0 || action > 8) {
      printf("Wrong input. Please try again\n");
    }
  } while (action != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe0a(%rip),%rdi
lea    0xe0b(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1237 <main+0x57>
mov    -0x20(%rbp),%rdi
lea    -0x16(%rbp),%rdx
lea    0xdea(%rip),%rsi
lea    -0xc(%rbp),%rcx
call   1070 <fscanf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
jmp    124f <main+0x6f>
lea    0xdd2(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1414 <main+0x234>
cmpl   $0x35,-0xc(%rbp)
jg     1270 <main+0x90>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1288 <main+0xa8>
lea    0xdb2(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1414 <main+0x234>
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12df <main+0xff>
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12b6 <main+0xd6>
jmp    12e4 <main+0x104>
mov    $0x0,%al
call   10a0 <showMenu@plt>
lea    0xd1b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   10e0 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1311 <main+0x131>
mov    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <showEmptySeats@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1327 <main+0x147>
mov    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <bookSeat@plt>
cmpl   $0x3,-0x8(%rbp)
jne    133d <main+0x15d>
mov    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1090 <bookFirstSeatAtWindow@plt>
cmpl   $0x4,-0x8(%rbp)
jne    1353 <main+0x173>
mov    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10b0 <cancelBooking@plt>
cmpl   $0x5,-0x8(%rbp)
jne    1369 <main+0x189>
mov    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10c0 <seatIsBooked@plt>
cmpl   $0x6,-0x8(%rbp)
jne    137f <main+0x19f>
mov    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <showBookedSeats@plt>
cmpl   $0x7,-0x8(%rbp)
jne    1399 <main+0x1b9>
mov    -0x40(%rbp),%rsi
lea    -0x16(%rbp),%rdi
mov    -0xc(%rbp),%edx
call   10d0 <showDiagram@plt>
cmpl   $0x8,-0x8(%rbp)
jne    13b3 <main+0x1d3>
mov    -0x40(%rbp),%rsi
lea    -0x16(%rbp),%rdi
mov    -0xc(%rbp),%edx
call   1100 <saveDiagram@plt>
cmpl   $0x0,-0x8(%rbp)
jne    13d0 <main+0x1f0>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x38(%rbp)
jmp    140d <main+0x22d>
cmpl   $0x0,-0x8(%rbp)
jl     13e4 <main+0x204>
cmpl   $0x8,-0x8(%rbp)
jle    13f0 <main+0x210>
lea    0xc58(%rip),%rdi
call   1060 <printf@plt>
jmp    13f5 <main+0x215>
cmpl   $0x0,-0x8(%rbp)
jne    12e4 <main+0x104>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xdf8(%rip),%rdi
lea    0xdf9(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     125c <main+0x6c>
mov    %rax,%rbx
lea    0xde7(%rip),%rsi
lea    -0x42(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
mov    %rax,%rdi
call   1080 <fscanf@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    -0x2c(%rbp),%eax
cmp    $0x35,%eax
jg     124b <main+0x5b>
lea    -0x1(%rax),%ecx
test   $0x3,%cl
je     126d <main+0x7d>
lea    0xdf4(%rip),%rdi
call   1040 <puts@plt>
jmp    13eb <main+0x1fb>
lea    0xdad(%rip),%rdi
call   1040 <puts@plt>
jmp    13eb <main+0x1fb>
mov    %rsp,-0x38(%rbp)
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x2c(%rbp),%edx
test   %edx,%edx
jle    129b <main+0xab>
shl    $0x2,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
lea    0xd6b(%rip),%r14
lea    -0x30(%rbp),%r15
lea    -0x42(%rbp),%r12
lea    0xd77(%rip),%r13
jmp    12c8 <main+0xd8>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %ecx,%ecx
je     13e7 <main+0x1f7>
xor    %eax,%eax
call   10b0 <showMenu@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   10f0 <scanf@plt>
mov    -0x30(%rbp),%eax
cmp    $0x1,%eax
je     1320 <main+0x130>
cmp    $0x2,%eax
je     1333 <main+0x143>
cmp    $0x3,%eax
je     1346 <main+0x156>
cmp    $0x4,%eax
je     1359 <main+0x169>
cmp    $0x5,%eax
je     136c <main+0x17c>
cmp    $0x6,%eax
je     1383 <main+0x193>
cmp    $0x7,%eax
je     139a <main+0x1aa>
cmp    $0x8,%eax
je     13b4 <main+0x1c4>
test   %eax,%eax
jne    13c9 <main+0x1d9>
jmp    13e7 <main+0x1f7>
xchg   %ax,%ax
mov    -0x2c(%rbp),%esi
mov    %rbx,%rdi
call   1090 <showEmptySeats@plt>
mov    -0x30(%rbp),%eax
cmp    $0x2,%eax
jne    12e7 <main+0xf7>
mov    -0x2c(%rbp),%esi
mov    %rbx,%rdi
call   1030 <bookSeat@plt>
mov    -0x30(%rbp),%eax
cmp    $0x3,%eax
jne    12ec <main+0xfc>
mov    -0x2c(%rbp),%esi
mov    %rbx,%rdi
call   10a0 <bookFirstSeatAtWindow@plt>
mov    -0x30(%rbp),%eax
cmp    $0x4,%eax
jne    12f1 <main+0x101>
mov    -0x2c(%rbp),%esi
mov    %rbx,%rdi
call   10c0 <cancelBooking@plt>
mov    -0x30(%rbp),%eax
cmp    $0x5,%eax
jne    12f6 <main+0x106>
mov    -0x2c(%rbp),%esi
mov    %rbx,%rdi
call   10d0 <seatIsBooked@plt>
mov    -0x30(%rbp),%eax
cmp    $0x6,%eax
jne    12ff <main+0x10f>
mov    -0x2c(%rbp),%esi
mov    %rbx,%rdi
call   1060 <showBookedSeats@plt>
mov    -0x30(%rbp),%eax
cmp    $0x7,%eax
jne    1308 <main+0x118>
mov    -0x2c(%rbp),%edx
mov    %r12,%rdi
mov    %rbx,%rsi
call   10e0 <showDiagram@plt>
mov    -0x30(%rbp),%eax
cmp    $0x8,%eax
jne    1311 <main+0x121>
mov    -0x2c(%rbp),%edx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1110 <saveDiagram@plt>
mov    -0x30(%rbp),%eax
test   %eax,%eax
je     13e7 <main+0x1f7>
mov    $0x1,%ecx
cmp    $0x9,%eax
jb     12c0 <main+0xd0>
mov    %r13,%rdi
call   1040 <puts@plt>
mov    -0x30(%rbp),%ecx
jmp    12c0 <main+0xd0>
mov    -0x38(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"bus.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"%s %d\00"
@.str.3 = [25 x i8] c"\0AFile bus.txt not found\0A\00"
@.str.4 = [26 x i8] c"\0AInvalid number of seats\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [31 x i8] c"Wrong input. Please try again\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i8]
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %19
13: ; preds = %0
%14 = load i32*, i32** %5
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%16 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %15, i32* %3)
%17 = load i32*, i32** %5
%18 = call i32 @fclose(i32* %17)
br label %21
19: ; preds = %0
%20 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %118
21: ; preds = %13
%22 = load i32, i32* %3
%23 = icmp sgt i32 %22, 53
br i1 %23, label %29, label %24
24: ; preds = %21
%25 = load i32, i32* %3
%26 = sub nsw i32 %25, 5
%27 = srem i32 %26, 4
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %24, %21
%30 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %118
31: ; preds = %24
%32 = load i32, i32* %3
%33 = zext i32 %32 to i64
%34 = call i8* @llvm.stacksave()
store i8* %34, i8** %6
%35 = alloca i32, i64 %33
store i64 %33, i64* %7
store i32 0, i32* %8
br label %36
36: ; preds = %40, %31
%37 = load i32, i32* %8
%38 = load i32, i32* %3
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %46
40: ; preds = %36
%41 = load i32, i32* %8
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %35, i64 %42
store i32 0, i32* %43
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %36
46: ; preds = %36
br label %47
47: ; preds = %112, %46
%48 = call i32 (...) @showMenu()
%49 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%50 = load i32, i32* %2
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %55
52: ; preds = %47
%53 = load i32, i32* %3
%54 = call i32 @showEmptySeats(i32* %35, i32 %53)
br label %55
55: ; preds = %52, %47
%56 = load i32, i32* %2
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i32, i32* %3
%60 = call i32 @bookSeat(i32* %35, i32 %59)
br label %61
61: ; preds = %58, %55
%62 = load i32, i32* %2
%63 = icmp eq i32 %62, 3
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load i32, i32* %3
%66 = call i32 @bookFirstSeatAtWindow(i32* %35, i32 %65)
br label %67
67: ; preds = %64, %61
%68 = load i32, i32* %2
%69 = icmp eq i32 %68, 4
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = load i32, i32* %3
%72 = call i32 @cancelBooking(i32* %35, i32 %71)
br label %73
73: ; preds = %70, %67
%74 = load i32, i32* %2
%75 = icmp eq i32 %74, 5
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = load i32, i32* %3
%78 = call i32 @seatIsBooked(i32* %35, i32 %77)
br label %79
79: ; preds = %76, %73
%80 = load i32, i32* %2
%81 = icmp eq i32 %80, 6
br i1 %81, label %82, label %85
82: ; preds = %79
%83 = load i32, i32* %3
%84 = call i32 @showBookedSeats(i32* %35, i32 %83)
br label %85
85: ; preds = %82, %79
%86 = load i32, i32* %2
%87 = icmp eq i32 %86, 7
br i1 %87, label %88, label %92
88: ; preds = %85
%89 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%90 = load i32, i32* %3
%91 = call i32 @showDiagram(i8* %89, i32* %35, i32 %90)
br label %92
92: ; preds = %88, %85
%93 = load i32, i32* %2
%94 = icmp eq i32 %93, 8
br i1 %94, label %95, label %99
95: ; preds = %92
%96 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%97 = load i32, i32* %3
%98 = call i32 @saveDiagram(i8* %96, i32* %35, i32 %97)
br label %99
99: ; preds = %95, %92
%100 = load i32, i32* %2
%101 = icmp eq i32 %100, 0
br i1 %101, label %102, label %103
102: ; preds = %99
store i32 0, i32* %1
store i32 1, i32* %9
br label %116
103: ; preds = %99
%104 = load i32, i32* %2
%105 = icmp slt i32 %104, 0
br i1 %105, label %109, label %106
106: ; preds = %103
%107 = load i32, i32* %2
%108 = icmp sgt i32 %107, 8
br i1 %108, label %109, label %111
109: ; preds = %106, %103
%110 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %111
111: ; preds = %109, %106
br label %112
112: ; preds = %111
%113 = load i32, i32* %2
%114 = icmp ne i32 %113, 0
br i1 %114, label %47, label %115
115: ; preds = %112
store i32 0, i32* %1
store i32 1, i32* %9
br label %116
116: ; preds = %115, %102
%117 = load i8*, i8** %6
br label %118
118: ; preds = %116, %29, %19
%119 = load i32, i32* %1
ret i32 %119
}

LLVM IR (-O2):
@.str = [8 x i8] c"bus.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"%s %d\00"
@.str.5 = [3 x i8] c"%d\00"
@str = [24 x i8] c"\0AFile bus.txt not found\00"
@str.7 = [30 x i8] c"Wrong input. Please try again\00"
@str.8 = [25 x i8] c"\0AInvalid number of seats\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %14, label %9
9: ; preds = %0
%10 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32* %2)
%11 = call i32 @fclose(i32* %7)
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 53
br i1 %13, label %20, label %16
14: ; preds = %0
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %103
16: ; preds = %9
%17 = add nsw i32 %12, 3
%18 = and i32 %17, 3
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %16, %9
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.8, i64 0, i64 0))
br label %103
22: ; preds = %16
%23 = zext i32 %12 to i64
%24 = call i8* @llvm.stacksave()
%25 = alloca i32, i64 %23
%26 = load i32, i32* %2
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %22
%29 = bitcast i32* %25 to i8*
%30 = zext i32 %26 to i64
%31 = shl nuw nsw i64 %30, 2
br label %32
32: ; preds = %28, %22
br label %33
33: ; preds = %32, %99
%34 = call i32 (...) @showMenu()
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%36 = load i32, i32* %1
%37 = icmp eq i32 %36, 1
br i1 %37, label %38, label %42
38: ; preds = %33
%39 = load i32, i32* %2
%40 = call i32 @showEmptySeats(i32* %25, i32 %39)
%41 = load i32, i32* %1
br label %42
42: ; preds = %38, %33
%43 = phi i32 [ %41, %38 ], [ %36, %33 ]
%44 = icmp eq i32 %43, 2
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = load i32, i32* %2
%47 = call i32 @bookSeat(i32* %25, i32 %46)
%48 = load i32, i32* %1
br label %49
49: ; preds = %45, %42
%50 = phi i32 [ %48, %45 ], [ %43, %42 ]
%51 = icmp eq i32 %50, 3
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = load i32, i32* %2
%54 = call i32 @bookFirstSeatAtWindow(i32* %25, i32 %53)
%55 = load i32, i32* %1
br label %56
56: ; preds = %52, %49
%57 = phi i32 [ %55, %52 ], [ %50, %49 ]
%58 = icmp eq i32 %57, 4
br i1 %58, label %59, label %63
59: ; preds = %56
%60 = load i32, i32* %2
%61 = call i32 @cancelBooking(i32* %25, i32 %60)
%62 = load i32, i32* %1
br label %63
63: ; preds = %59, %56
%64 = phi i32 [ %62, %59 ], [ %57, %56 ]
%65 = icmp eq i32 %64, 5
br i1 %65, label %66, label %70
66: ; preds = %63
%67 = load i32, i32* %2
%68 = call i32 @seatIsBooked(i32* %25, i32 %67)
%69 = load i32, i32* %1
br label %70
70: ; preds = %66, %63
%71 = phi i32 [ %69, %66 ], [ %64, %63 ]
%72 = icmp eq i32 %71, 6
br i1 %72, label %73, label %77
73: ; preds = %70
%74 = load i32, i32* %2
%75 = call i32 @showBookedSeats(i32* %25, i32 %74)
%76 = load i32, i32* %1
br label %77
77: ; preds = %73, %70
%78 = phi i32 [ %76, %73 ], [ %71, %70 ]
%79 = icmp eq i32 %78, 7
br i1 %79, label %80, label %84
80: ; preds = %77
%81 = load i32, i32* %2
%82 = call i32 @showDiagram(i8* %6, i32* %25, i32 %81)
%83 = load i32, i32* %1
br label %84
84: ; preds = %80, %77
%85 = phi i32 [ %83, %80 ], [ %78, %77 ]
%86 = icmp eq i32 %85, 8
br i1 %86, label %87, label %91
87: ; preds = %84
%88 = load i32, i32* %2
%89 = call i32 @saveDiagram(i8* %6, i32* %25, i32 %88)
%90 = load i32, i32* %1
br label %91
91: ; preds = %87, %84
%92 = phi i32 [ %90, %87 ], [ %85, %84 ]
%93 = icmp eq i32 %92, 0
br i1 %93, label %102, label %94
94: ; preds = %91
%95 = icmp ugt i32 %92, 8
br i1 %95, label %96, label %99
96: ; preds = %94
%97 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.7, i64 0, i64 0))
%98 = load i32, i32* %1
br label %99
99: ; preds = %96, %94
%100 = phi i32 [ %98, %96 ], [ 1, %94 ]
%101 = icmp eq i32 %100, 0
br i1 %101, label %102, label %33
102: ; preds = %99, %91
br label %103
103: ; preds = %102, %20, %14
ret i32 0
}