#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_hostname(char const *);
char *_is_ip4addr(char const *);
char *_is_ip6addr(char const *);
char const *_is_host(char const *peek) {
  if ((peek = _is_hostname(peek)))
    return peek;
  else if ((peek = _is_ip4addr(peek)))
    return peek;
  else if ((peek = _is_ip6addr(peek)))
    return peek;
  return NULL;
}


x86 assembly (clang, -O0):
<_is_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_is_hostname@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1160 <_is_host+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ba <_is_host+0x8a>
mov    -0x10(%rbp),%rdi
call   1050 <_is_ip4addr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1184 <_is_host+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ba <_is_host+0x8a>
mov    -0x10(%rbp),%rdi
call   1030 <_is_ip6addr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     11a8 <_is_host+0x78>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ba <_is_host+0x8a>
jmp    11ad <_is_host+0x7d>
jmp    11b2 <_is_host+0x82>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_host>:
push   %rax
call   1040 <_is_hostname@plt>
test   %rax,%rax
jne    1147 <_is_host+0x17>
xor    %edi,%edi
call   1050 <_is_ip4addr@plt>
test   %rax,%rax
je     1149 <_is_host+0x19>
pop    %rcx
ret
xor    %edi,%edi
pop    %rax
jmp    1030 <_is_ip6addr@plt>

LLVM IR (-O0):
define i8* @_is_host(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i8* @_is_hostname(i8* %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %3
store i8* %8, i8** %2
br label %24
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i8* @_is_ip4addr(i8* %10)
store i8* %11, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i8*, i8** %3
store i8* %14, i8** %2
br label %24
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i8* @_is_ip6addr(i8* %16)
store i8* %17, i8** %3
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i8*, i8** %3
store i8* %20, i8** %2
br label %24
21: ; preds = %15
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
store i8* null, i8** %2
br label %24
24: ; preds = %23, %19, %13, %7
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
define i8* @_is_host(i8* %0) {
%2 = tail call i8* @_is_hostname(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i8* @_is_ip4addr(i8* null)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i8* @_is_ip6addr(i8* null)
br label %9
9: ; preds = %7, %4, %1
%10 = phi i8* [ %2, %1 ], [ %5, %4 ], [ %8, %7 ]
ret i8* %10
}