#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*/ beginServer();
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ *strstr(char *, char *);
int initScreen() {
  printf("To being accepting clients type /START\n");
  char buffer[1024];
  while (1) {
    bzero(buffer, 1024);
    fgets(buffer, 1024 - 1, stdin);
    if (strstr(buffer, "/START") != NULL) {
      break;
    }
  }
  beginServer();
  return 0;
}


x86 assembly (clang, -O0):
<initScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1060 <bzero@plt>
lea    -0x400(%rbp),%rdi
mov    0x2e62(%rip),%rax
mov    (%rax),%edx
mov    $0x3ff,%esi
call   1040 <fgets@plt>
lea    -0x400(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     11b4 <initScreen+0x64>
jmp    11b9 <initScreen+0x69>
jmp    1167 <initScreen+0x17>
mov    $0x0,%al
call   1050 <beginServer@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initScreen>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    0x2e76(%rip),%r15
lea    0xea7(%rip),%r14
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x400,%esi
call   1060 <bzero@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x3ff,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strstr@plt>
test   %rax,%rax
je     1180 <initScreen+0x30>
xor    %eax,%eax
call   1050 <beginServer@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [40 x i8] c"To being accepting clients type /START\0A\00"
@stdin = global i32 0
@.str.1 = [7 x i8] c"/START\00"
define i32 @initScreen() {
%1 = alloca [1024 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %13
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = call i32 @bzero(i8* %4, i32 1024)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 1023, i32 %7)
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%10 = call i32* @strstr(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %13
12: ; preds = %3
br label %14
13: ; preds = %3
br label %3
14: ; preds = %12
%15 = call i32 (...) @beginServer()
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [7 x i8] c"/START\00"
@str = [39 x i8] c"To being accepting clients type /START\00"
define i32 @initScreen() {
%1 = alloca [1024 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
br label %4
4: ; preds = %4, %0
%5 = call i32 @bzero(i8* %3, i32 1024)
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %3, i32 1023, i32 %6)
%8 = call i32* @strstr(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %4, label %10
10: ; preds = %4
%11 = call i32 (...) @beginServer()
ret i32 0
}