#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_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char **getuserhost();
int /*<<< orphan*/ printf(char *, char *, char *);
int readline();
int main(int argc, char **argv) {
  while (1) {
    char **userdata;
    userdata = getuserhost();
    printf("coroshell : %s@%s > ", userdata[0], userdata[1]);
    int retval = readline();
    if (retval == -1) {
      exit(EXIT_FAILURE);
    }
  }
}


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)
mov    $0x0,%al
call   1050 <getuserhost@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <readline@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    119e <main+0x5e>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
jmp    1156 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getuserhost@plt>
mov    (%rax),%rsi
mov    0x8(%rax),%rdx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <readline@plt>
cmp    $0xffffffff,%eax
jne    1150 <main+0x10>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"coroshell : %s@%s > \00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i8** (...) @getuserhost()
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %4, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %7)
%9 = tail call i32 (...) @readline()
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
}