#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 */
char *_is_host(char const *);
char *_is_nickname(char const *);
char *_is_single_terminal(char const *, char);
char *_is_user(char const *);
char const *_is_prefix_nickname(char const *la) {
  char const *peek;
  char const *tmp;
  if (!(peek = _is_nickname(la)))
    return 0;
  tmp = peek;
  if ((tmp = _is_single_terminal(peek, '!'))) {
    if (!(tmp = _is_user(tmp)))
      return NULL;
    if (!(tmp = _is_single_terminal(tmp, '@')))
      return NULL;
    if (!(tmp = _is_host(tmp)))
      return NULL;
    peek = tmp;
  } else if ((tmp = _is_single_terminal(peek, '@'))) {
    if (!(tmp = _is_host(tmp)))
      return NULL;
    peek = tmp;
  }
  if (!(peek = _is_single_terminal(peek, ' ')))
    return NULL;
  return peek;
}


x86 assembly (clang, -O0):
<_is_prefix_nickname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <_is_nickname@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1170 <_is_prefix_nickname+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1290 <_is_prefix_nickname+0x150>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x21,%esi
call   1040 <_is_single_terminal@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1212 <_is_prefix_nickname+0xd2>
mov    -0x20(%rbp),%rdi
call   1030 <_is_user@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    11b8 <_is_prefix_nickname+0x78>
movq   $0x0,-0x8(%rbp)
jmp    1290 <_is_prefix_nickname+0x150>
mov    -0x20(%rbp),%rdi
mov    $0x40,%esi
call   1040 <_is_single_terminal@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    11e1 <_is_prefix_nickname+0xa1>
movq   $0x0,-0x8(%rbp)
jmp    1290 <_is_prefix_nickname+0x150>
mov    -0x20(%rbp),%rdi
call   1050 <_is_host@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1205 <_is_prefix_nickname+0xc5>
movq   $0x0,-0x8(%rbp)
jmp    1290 <_is_prefix_nickname+0x150>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    125f <_is_prefix_nickname+0x11f>
mov    -0x18(%rbp),%rdi
mov    $0x40,%esi
call   1040 <_is_single_terminal@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     125a <_is_prefix_nickname+0x11a>
mov    -0x20(%rbp),%rdi
call   1050 <_is_host@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1252 <_is_prefix_nickname+0x112>
movq   $0x0,-0x8(%rbp)
jmp    1290 <_is_prefix_nickname+0x150>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    125f <_is_prefix_nickname+0x11f>
mov    -0x18(%rbp),%rdi
mov    $0x20,%esi
call   1040 <_is_single_terminal@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1288 <_is_prefix_nickname+0x148>
movq   $0x0,-0x8(%rbp)
jmp    1290 <_is_prefix_nickname+0x150>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_prefix_nickname>:
push   %rbx
call   1060 <_is_nickname@plt>
test   %rax,%rax
je     11b1 <_is_prefix_nickname+0x71>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x21,%esi
call   1040 <_is_single_terminal@plt>
test   %rax,%rax
je     1181 <_is_prefix_nickname+0x41>
mov    %rax,%rdi
call   1030 <_is_user@plt>
test   %rax,%rax
je     11b1 <_is_prefix_nickname+0x71>
mov    %rax,%rdi
mov    $0x40,%esi
call   1040 <_is_single_terminal@plt>
test   %rax,%rax
jne    1193 <_is_prefix_nickname+0x53>
jmp    11b1 <_is_prefix_nickname+0x71>
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <_is_single_terminal@plt>
test   %rax,%rax
je     11a3 <_is_prefix_nickname+0x63>
mov    %rax,%rdi
call   1050 <_is_host@plt>
mov    %rax,%rbx
test   %rax,%rax
je     11b1 <_is_prefix_nickname+0x71>
mov    %rbx,%rdi
mov    $0x20,%esi
pop    %rbx
jmp    1040 <_is_single_terminal@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_is_prefix_nickname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @_is_nickname(i8* %6)
store i8* %7, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %51
10: ; preds = %1
%11 = load i8*, i8** %4
store i8* %11, i8** %5
%12 = load i8*, i8** %4
%13 = call i8* @_is_single_terminal(i8* %12, i8 signext 33)
store i8* %13, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %32
15: ; preds = %10
%16 = load i8*, i8** %5
%17 = call i8* @_is_user(i8* %16)
store i8* %17, i8** %5
%18 = icmp ne i8* %17, null
br i1 %18, label %20, label %19
19: ; preds = %15
store i8* null, i8** %2
br label %51
20: ; preds = %15
%21 = load i8*, i8** %5
%22 = call i8* @_is_single_terminal(i8* %21, i8 signext 64)
store i8* %22, i8** %5
%23 = icmp ne i8* %22, null
br i1 %23, label %25, label %24
24: ; preds = %20
store i8* null, i8** %2
br label %51
25: ; preds = %20
%26 = load i8*, i8** %5
%27 = call i8* @_is_host(i8* %26)
store i8* %27, i8** %5
%28 = icmp ne i8* %27, null
br i1 %28, label %30, label %29
29: ; preds = %25
store i8* null, i8** %2
br label %51
30: ; preds = %25
%31 = load i8*, i8** %5
store i8* %31, i8** %4
br label %44
32: ; preds = %10
%33 = load i8*, i8** %4
%34 = call i8* @_is_single_terminal(i8* %33, i8 signext 64)
store i8* %34, i8** %5
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %43
36: ; preds = %32
%37 = load i8*, i8** %5
%38 = call i8* @_is_host(i8* %37)
store i8* %38, i8** %5
%39 = icmp ne i8* %38, null
br i1 %39, label %41, label %40
40: ; preds = %36
store i8* null, i8** %2
br label %51
41: ; preds = %36
%42 = load i8*, i8** %5
store i8* %42, i8** %4
br label %43
43: ; preds = %41, %32
br label %44
44: ; preds = %43, %30
%45 = load i8*, i8** %4
%46 = call i8* @_is_single_terminal(i8* %45, i8 signext 32)
store i8* %46, i8** %4
%47 = icmp ne i8* %46, null
br i1 %47, label %49, label %48
48: ; preds = %44
store i8* null, i8** %2
br label %51
49: ; preds = %44
%50 = load i8*, i8** %4
store i8* %50, i8** %2
br label %51
51: ; preds = %49, %48, %40, %29, %24, %19, %9
%52 = load i8*, i8** %2
ret i8* %52
}

LLVM IR (-O2):
define i8* @_is_prefix_nickname(i8* %0) {
%2 = tail call i8* @_is_nickname(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %25, label %4
4: ; preds = %1
%5 = tail call i8* @_is_single_terminal(i8* %2, i8 signext 33)
%6 = icmp eq i8* %5, null
br i1 %6, label %16, label %7
7: ; preds = %4
%8 = tail call i8* @_is_user(i8* %5)
%9 = icmp eq i8* %8, null
br i1 %9, label %25, label %10
10: ; preds = %7
%11 = tail call i8* @_is_single_terminal(i8* %8, i8 signext 64)
%12 = icmp eq i8* %11, null
br i1 %12, label %25, label %13
13: ; preds = %10
%14 = tail call i8* @_is_host(i8* %11)
%15 = icmp eq i8* %14, null
br i1 %15, label %25, label %22
16: ; preds = %4
%17 = tail call i8* @_is_single_terminal(i8* %2, i8 signext 64)
%18 = icmp eq i8* %17, null
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = tail call i8* @_is_host(i8* %17)
%21 = icmp eq i8* %20, null
br i1 %21, label %25, label %22
22: ; preds = %19, %13, %16
%23 = phi i8* [ %2, %16 ], [ %14, %13 ], [ %20, %19 ]
%24 = tail call i8* @_is_single_terminal(i8* %23, i8 signext 32)
br label %25
25: ; preds = %22, %19, %13, %10, %7, %1
%26 = phi i8* [ null, %1 ], [ null, %7 ], [ null, %10 ], [ null, %13 ], [ null, %19 ], [ %24, %22 ]
ret i8* %26
}