#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*/ exit(int /*<<< orphan*/);
scalar_t__ get_line(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  char buffer[65536];
  if (argc == 2 && strcmp(argv[1], "nowait") == 0)
    exit(0);
  while (get_line(buffer, stdin))
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10010,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1178 <main+0x48>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1178 <main+0x48>
xor    %edi,%edi
call   1050 <exit@plt>
jmp    117d <main+0x4d>
lea    -0x10010(%rbp),%rdi
mov    0x2e5d(%rip),%rax
mov    (%rax),%esi
call   1030 <get_line@plt>
cmp    $0x0,%rax
je     11a1 <main+0x71>
jmp    117d <main+0x4d>
xor    %eax,%eax
add    $0x10010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x10008,%rsp
cmp    $0x2,%edi
jne    1160 <main+0x30>
mov    0x8(%rsi),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1180 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdi
call   1030 <get_line@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x10008,%rsp
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"nowait\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [65536 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %9, %2
br label %18
18: ; preds = %23, %17
%19 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%20 = load i32, i32* @stdin
%21 = call i64 @get_line(i8* %19, i32 %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %18
br label %18
24: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"nowait\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [65536 x i8]
%4 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 2
br i1 %5, label %7, label %6
6: ; preds = %7, %2
br label %14
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %7
%13 = tail call i32 @exit(i32 0)
unreachable
14: ; preds = %6, %14
%15 = load i32, i32* @stdin
%16 = call i64 @get_line(i8* %4, i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %14
18: ; preds = %14
ret i32 0
}