#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 */
scalar_t__ isWindow(int, int);
int /*<<< orphan*/ printf(char *, ...);
void showBlanks(int layout[], int maxSeats) {
  int i, blanks = 0;
  printf("\nDiathesimes theseis\n");
  printf("-------------------\n");
  for (i = 0; i < maxSeats; i++) {
    if (!layout[i]) {
      if (blanks % 10) {
        printf(", ");
      }
      blanks++;
      if (isWindow(maxSeats, i + 1)) {
        printf("[%d]", i + 1);
      } else {
        printf("%d", i + 1);
      }
      if (!(blanks % 10)) {
        printf("\n");
      }
    }
  }
  if (!blanks) {
    printf("Den yparxei kamia diathesimi thsei!\n");
  } else {
    printf("\nSynolo: %d\n", blanks);
  }
}


x86 assembly (clang, -O0):
<showBlanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1221 <showBlanks+0x101>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    120e <showBlanks+0xee>
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1199 <showBlanks+0x79>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
add    $0x1,%esi
call   1030 <isWindow@plt>
cmp    $0x0,%rax
je     11d3 <showBlanks+0xb3>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e7 <showBlanks+0xc7>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1209 <showBlanks+0xe9>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    120e <showBlanks+0xee>
jmp    1213 <showBlanks+0xf3>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <showBlanks+0x39>
cmpl   $0x0,-0x14(%rbp)
jne    123e <showBlanks+0x11e>
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    124f <showBlanks+0x12f>
mov    -0x14(%rbp),%esi
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showBlanks>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r12
lea    0xec0(%rip),%rdi
call   1040 <puts@plt>
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
test   %r14d,%r14d
jle    122f <showBlanks+0xef>
mov    %r14d,%r13d
lea    0xe87(%rip),%r15
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    1199 <showBlanks+0x59>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    %r13,%rbx
je     120d <showBlanks+0xcd>
cmpl   $0x0,(%r12,%rbx,4)
jne    1190 <showBlanks+0x50>
imul   $0xcccccccd,%ebp,%eax
add    $0x19999998,%eax
ror    %eax
cmp    $0x19999999,%eax
jb     11c2 <showBlanks+0x82>
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
add    $0x1,%rbx
mov    %r14d,%edi
mov    %ebx,%esi
call   1050 <isWindow@plt>
test   %rax,%rax
mov    %r15,%rdi
lea    0xe28(%rip),%rax
cmove  %rax,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
imul   $0xcccccccd,%ebp,%eax
add    $0x19999998,%eax
ror    %eax
cmp    $0x19999998,%eax
ja     1194 <showBlanks+0x54>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1194 <showBlanks+0x54>
test   %ebp,%ebp
je     122f <showBlanks+0xef>
lea    0xdf3(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <printf@plt>
lea    0xe0b(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str.2 = [3 x i8] c", \00"
@.str.3 = [5 x i8] c"[%d]\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.7 = [13 x i8] c"\0ASynolo: %d\0A\00"
@str = [21 x i8] c"\0ADiathesimes theseis\00"
@str.8 = [20 x i8] c"-------------------\00"
@str.9 = [36 x i8] c"Den yparxei kamia diathesimi thsei!\00"
define void @showBlanks(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.8, i64 0, i64 0))
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %39
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %33
%9 = phi i64 [ 0, %6 ], [ %34, %33 ]
%10 = phi i32 [ 0, %6 ], [ %35, %33 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %9
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = add nuw nsw i64 %9, 1
br label %33
16: ; preds = %8
%17 = srem i32 %10, 10
%18 = icmp eq i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %16
%22 = add nsw i32 %10, 1
%23 = add nuw nsw i64 %9, 1
%24 = trunc i64 %23 to i32
%25 = tail call i64 @isWindow(i32 %1, i32 %24)
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %27, i32 %24)
%29 = srem i32 %22, 10
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %21
%32 = tail call i32 @putchar(i32 10)
br label %33
33: ; preds = %14, %31, %21
%34 = phi i64 [ %15, %14 ], [ %23, %31 ], [ %23, %21 ]
%35 = phi i32 [ %10, %14 ], [ %22, %31 ], [ %22, %21 ]
%36 = icmp eq i64 %34, %7
br i1 %36, label %37, label %8
37: ; preds = %33
%38 = icmp eq i32 %35, 0
br i1 %38, label %39, label %41
39: ; preds = %2, %37
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.9, i64 0, i64 0))
br label %43
41: ; preds = %37
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %35)
br label %43
43: ; preds = %41, %39
ret void
}