#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*/ scanf(char *, int *);
void checkReservedSpecific(int layout[], int maxSeats) {
  int seat;
  printf("\nDoste arithmo thesis: ");
  scanf("%d", &seat);
  if (seat <= maxSeats) {
    if (layout[seat - 1]) {
      printf("H thesi einai kratimeni\n");
    } else {
      printf("H thesi DEN einai kratimeni apo allon\n");
    }
  } else {
    printf("Prepei na dosete enan egkyro arithmo thesis (Max = %d)\n",
           maxSeats);
  }
}


x86 assembly (clang, -O0):
<checkReservedSpecific>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1196 <checkReservedSpecific+0x76>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1183 <checkReservedSpecific+0x63>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1191 <checkReservedSpecific+0x71>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <checkReservedSpecific+0x87>
mov    -0xc(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkReservedSpecific>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
cmp    %ebx,%eax
jle    1173 <checkReservedSpecific+0x43>
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1190 <checkReservedSpecific+0x60>
cmpl   $0x0,-0x4(%r14,%rax,4)
je     1184 <checkReservedSpecific+0x54>
lea    0xef7(%rip),%rdi
jmp    118b <checkReservedSpecific+0x5b>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0ADoste arithmo thesis: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"H thesi einai kratimeni\0A\00"
@.str.3 = [39 x i8] c"H thesi DEN einai kratimeni apo allon\0A\00"
@.str.4 = [56 x i8] c"Prepei na dosete enan egkyro arithmo thesis (Max = %d)\0A\00"
define void @checkReservedSpecific(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %23
21: ; preds = %11
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
br label %27
24: ; preds = %2
%25 = load i32, i32* %4
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %24, %23
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0ADoste arithmo thesis: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [56 x i8] c"Prepei na dosete enan egkyro arithmo thesis (Max = %d)\0A\00"
@str = [38 x i8] c"H thesi DEN einai kratimeni apo allon\00"
@str.5 = [24 x i8] c"H thesi einai kratimeni\00"
define void @checkReservedSpecific(i32* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, %1
br i1 %8, label %19, label %9
9: ; preds = %2
%10 = add nsw i32 %7, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %9
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
br label %21
17: ; preds = %9
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %21
19: ; preds = %2
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i32 %1)
br label %21
21: ; preds = %15, %17, %19
ret void
}