#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ kai_throw(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  if (argc > 1) {
    fprintf(stderr, "%s does not accept any arguments.\n", argv[0]);
  }
  size_t len = 0;
  char *str = NULL;
  while (getline(&str, &len, stdin) != -1) {
    kai_throw(str);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    116c <main+0x3c>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2e65(%rip),%rax
mov    (%rax),%edx
lea    -0x20(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <getline@plt>
cmp    $0xffffffff,%eax
je     11a9 <main+0x79>
mov    -0x20(%rbp),%rdi
call   1050 <kai_throw@plt>
jmp    117c <main+0x4c>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jl     1156 <main+0x26>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
mov    0x2e7a(%rip),%r15
mov    (%r15),%edx
mov    %rsp,%rdi
lea    0x8(%rsp),%rsi
call   1040 <getline@plt>
cmp    $0xffffffff,%eax
je     11ac <main+0x7c>
mov    %rsp,%r14
lea    0x8(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%rdi
call   1050 <kai_throw@plt>
mov    (%r15),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <getline@plt>
cmp    $0xffffffff,%eax
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"%s does not accept any arguments.\0A\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %10, %2
store i64 0, i64* %6
store i8* null, i8** %7
br label %17
17: ; preds = %21, %16
%18 = load i32, i32* @stdin
%19 = call i32 @getline(i8** %7, i64* %6, i32 %18)
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i8*, i8** %7
%23 = call i32 @kai_throw(i8* %22)
br label %17
24: ; preds = %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"%s does not accept any arguments.\0A\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %2
%11 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%12 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%13 = load i32, i32* @stdin
%14 = call i32 @getline(i8** %4, i64* %3, i32 %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %22, label %16
16: ; preds = %10, %16
%17 = load i8*, i8** %4
%18 = call i32 @kai_throw(i8* %17)
%19 = load i32, i32* @stdin
%20 = call i32 @getline(i8** %4, i64* %3, i32 %19)
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %16
22: ; preds = %16, %10
ret i32 0
}