#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 */
typedef struct TYPE_7__ TYPE_2__;
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ xdrproc_t;
typedef int u_long;
struct TYPE_6__ {
  int /*<<< orphan*/ ypbind_binding_port;
  int /*<<< orphan*/ ypbind_binding_addr;
};
struct ypbind_setdom {
  char *ypsetdom_domain;
  int /*<<< orphan*/ ypsetdom_vers;
  TYPE_1__ ypsetdom_binding;
};
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct sockaddr_in {
  int dummy;
};
struct hostent {
  unsigned long **h_addr_list;
};
typedef int /*<<< orphan*/ server_addr;
struct TYPE_7__ {
  int /*<<< orphan*/ cl_auth;
};
typedef TYPE_2__ CLIENT;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_UDP;
int RPC_ANYSOCK;
int /*<<< orphan*/ YPBINDPROC_SETDOM;
int /*<<< orphan*/ YPBINDPROG;
int /*<<< orphan*/ YPBINDVERS;
int YPERR_YPBIND;
int /*<<< orphan*/ YPPROC_NULL;
int /*<<< orphan*/ YPPROG;
int /*<<< orphan*/ YPVERS;
int /*<<< orphan*/ authunix_create_default();
int /*<<< orphan*/ bcopy(unsigned long *, int *, int);
int /*<<< orphan*/ bzero(struct ypbind_setdom *, int);
int clnt_call(TYPE_2__ *, int /*<<< orphan*/, int /*<<< orphan*/,
              struct ypbind_setdom *, int /*<<< orphan*/, int /*<<< orphan*/ *,
              struct timeval);
int /*<<< orphan*/ clnt_destroy(TYPE_2__ *);
TYPE_2__ *clntudp_create(struct sockaddr_in *, int /*<<< orphan*/,
                         int /*<<< orphan*/, struct timeval, int *);
int /*<<< orphan*/ errx(int, char *, char *);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ getrpcport(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int htons(int /*<<< orphan*/);
unsigned long inet_addr(char *);
int /*<<< orphan*/ warnx(char *, char *);
scalar_t__ xdr_void;
scalar_t__ xdr_ypbind_setdom;
char *yperr_string(int);
int bind_tohost(struct sockaddr_in *sin, char *dom, char *server) {
  struct ypbind_setdom ypsd;
  struct timeval tv;
  struct hostent *hp;
  CLIENT *client;
  int sock, port;
  int r;
  unsigned long server_addr;
  if ((port = htons(getrpcport(server, YPPROG, YPPROC_NULL, IPPROTO_UDP))) == 0)
    errx(1, "%s not running ypserv", server);
  bzero(&ypsd, sizeof ypsd);
  if ((hp = gethostbyname(server)) != NULL) {
    bcopy(hp->h_addr_list[0],
          (u_long *)&ypsd.ypsetdom_binding.ypbind_binding_addr,
          sizeof(unsigned long));
  } else if ((long)(server_addr = inet_addr(server)) == -1) {
    errx(1, "can't find address for %s", server);
  } else
    bcopy(&server_addr, (u_long *)&ypsd.ypsetdom_binding.ypbind_binding_addr,
          sizeof(server_addr));
  ypsd.ypsetdom_domain = dom;
  *(u_long *)&ypsd.ypsetdom_binding.ypbind_binding_port = port;
  ypsd.ypsetdom_vers = YPVERS;
  tv.tv_sec = 15;
  tv.tv_usec = 0;
  sock = RPC_ANYSOCK;
  client = clntudp_create(sin, YPBINDPROG, YPBINDVERS, tv, &sock);
  if (client == NULL) {
    warnx("can't yp_bind, reason: %s", yperr_string(YPERR_YPBIND));
    return (YPERR_YPBIND);
  }
  client->cl_auth = authunix_create_default();
  r = clnt_call(client, YPBINDPROC_SETDOM, (xdrproc_t)xdr_ypbind_setdom, &ypsd,
                (xdrproc_t)xdr_void, NULL, tv);
  if (r) {
    warnx("sorry, cannot ypset for domain %s on host - make sure ypbind was "
          "started with -ypset or -ypsetme",
          dom);
    clnt_destroy(client);
    return (YPERR_YPBIND);
  }
  clnt_destroy(client);
  return (0);
}


x86 assembly (clang, -O0):
<bind_tohost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2de6(%rip),%rax
mov    (%rax),%esi
mov    0x2dad(%rip),%rax
mov    (%rax),%edx
mov    0x2d84(%rip),%rax
mov    (%rax),%ecx
call   1030 <getrpcport@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,-0x60(%rbp)
cmp    $0x0,%eax
jne    1233 <bind_tohost+0x63>
mov    -0x20(%rbp),%rdx
mov    $0x1,%edi
lea    0xdd2(%rip),%rsi
call   1040 <errx@plt>
lea    -0x38(%rbp),%rdi
mov    $0x18,%esi
call   10e0 <bzero@plt>
mov    -0x20(%rbp),%rdi
call   1080 <gethostbyname@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
je     127d <bind_tohost+0xad>
mov    -0x50(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
lea    -0x38(%rbp),%rsi
add    $0xc,%rsi
add    $0x4,%rsi
mov    $0x8,%edx
call   10b0 <bcopy@plt>
jmp    12cd <bind_tohost+0xfd>
mov    -0x20(%rbp),%rdi
call   1070 <inet_addr@plt>
mov    %rax,-0x70(%rbp)
cmp    $0xffffffffffffffff,%rax
jne    12ae <bind_tohost+0xde>
mov    -0x20(%rbp),%rdx
mov    $0x1,%edi
lea    0xd72(%rip),%rsi
call   1040 <errx@plt>
jmp    12c8 <bind_tohost+0xf8>
lea    -0x38(%rbp),%rsi
add    $0xc,%rsi
add    $0x4,%rsi
lea    -0x70(%rbp),%rdi
mov    $0x8,%edx
call   10b0 <bcopy@plt>
jmp    12cd <bind_tohost+0xfd>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2ce6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
movl   $0xf,-0x48(%rbp)
movq   $0x0,-0x40(%rbp)
mov    0x2ce3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ca3(%rip),%rax
mov    (%rax),%esi
mov    0x2ca2(%rip),%rax
mov    (%rax),%edx
mov    -0x48(%rbp),%ecx
mov    -0x40(%rbp),%r8
lea    -0x5c(%rbp),%r9
call   10f0 <clntudp_create@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1365 <bind_tohost+0x195>
mov    0x2c5a(%rip),%rax
mov    (%rax),%edi
call   10a0 <yperr_string@plt>
mov    %rax,%rsi
lea    0xce1(%rip),%rdi
call   1060 <warnx@plt>
mov    0x2c3d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1403 <bind_tohost+0x233>
mov    $0x0,%al
call   1090 <authunix_create_default@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x58(%rbp),%rdi
mov    0x2c21(%rip),%rax
mov    (%rax),%esi
mov    0x2c60(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edx
mov    0x2c3c(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r8d
lea    -0x38(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
lea    -0x48(%rbp),%rax
mov    (%rax),%r10
mov    %r10,(%rsp)
mov    0x8(%rax),%rax
mov    %rax,0x8(%rsp)
call   10c0 <clnt_call@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     13f3 <bind_tohost+0x223>
mov    -0x18(%rbp),%rsi
lea    0xc76(%rip),%rdi
call   1060 <warnx@plt>
mov    -0x58(%rbp),%rdi
call   10d0 <clnt_destroy@plt>
mov    0x2baf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1403 <bind_tohost+0x233>
mov    -0x58(%rbp),%rdi
call   10d0 <clnt_destroy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_tohost>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2dfe(%rip),%rax
mov    (%rax),%esi
mov    0x2dc5(%rip),%rax
mov    (%rax),%edx
mov    0x2d9c(%rip),%rax
mov    (%rax),%ecx
mov    %rbx,%rdi
call   1030 <getrpcport@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1217 <bind_tohost+0x57>
lea    0xdf6(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1040 <errx@plt>
lea    0x20(%rsp),%rdi
mov    $0x18,%esi
call   10d0 <bzero@plt>
mov    %rbx,%rdi
call   1080 <gethostbyname@plt>
test   %rax,%rax
je     123e <bind_tohost+0x7e>
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
jmp    1250 <bind_tohost+0x90>
mov    %rbx,%rdi
call   1070 <inet_addr@plt>
cmp    $0xffffffffffffffff,%rax
je     1354 <bind_tohost+0x194>
mov    %rax,0x30(%rsp)
mov    %r14,0x20(%rsp)
mov    %ebp,0x2c(%rsp)
mov    0x2d63(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x28(%rsp)
movl   $0xf,0x38(%rsp)
movq   $0x0,0x40(%rsp)
mov    0x2d5d(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
mov    0x2d20(%rip),%rax
mov    (%rax),%esi
mov    0x2d1f(%rip),%rax
mov    (%rax),%edx
lea    0x1c(%rsp),%r9
mov    %r15,%rdi
mov    $0xf,%ecx
xor    %r8d,%r8d
call   10e0 <clntudp_create@plt>
test   %rax,%rax
je     131e <bind_tohost+0x15e>
mov    %rax,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1090 <authunix_create_default@plt>
mov    %eax,(%rbx)
mov    0x2cd6(%rip),%rax
mov    (%rax),%esi
mov    0x2d15(%rip),%rax
mov    (%rax),%edx
mov    0x2cf4(%rip),%rax
mov    (%rax),%r8d
movups 0x38(%rsp),%xmm0
movups %xmm0,(%rsp)
lea    0x20(%rsp),%rcx
mov    %rbx,%rdi
xor    %r9d,%r9d
call   10b0 <clnt_call@plt>
test   %eax,%eax
je     133f <bind_tohost+0x17f>
lea    0xd47(%rip),%rdi
mov    %r14,%rsi
call   1060 <warnx@plt>
mov    %rbx,%rdi
call   10c0 <clnt_destroy@plt>
mov    0x2c7e(%rip),%rax
mov    (%rax),%ebp
jmp    1347 <bind_tohost+0x187>
mov    0x2c73(%rip),%rbx
mov    (%rbx),%edi
call   10a0 <yperr_string@plt>
lea    0xcfd(%rip),%rdi
mov    %rax,%rsi
call   1060 <warnx@plt>
mov    (%rbx),%ebp
jmp    1347 <bind_tohost+0x187>
mov    %rbx,%rdi
call   10c0 <clnt_destroy@plt>
mov    %ebp,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcbb(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1040 <errx@plt>
jmp    1255 <bind_tohost+0x95>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.ypbind_setdom = type { i8*, i32, %struct.TYPE_6__ }
%struct.TYPE_6__ = type { i32, i32 }
%struct.timeval = type { i32, i64 }
%struct.hostent = type { i64** }
%struct.TYPE_7__ = type { i32 }
@YPPROG = global i32 0
@YPPROC_NULL = global i32 0
@IPPROTO_UDP = global i32 0
@.str = [22 x i8] c"%s not running ypserv\00"
@.str.1 = [26 x i8] c"can't find address for %s\00"
@YPVERS = global i32 0
@RPC_ANYSOCK = global i32 0
@YPBINDPROG = global i32 0
@YPBINDVERS = global i32 0
@.str.2 = [26 x i8] c"can't yp_bind, reason: %s\00"
@YPERR_YPBIND = global i32 0
@YPBINDPROC_SETDOM = global i32 0
@xdr_ypbind_setdom = global i64 0
@xdr_void = global i64 0
@.str.3 = [97 x i8] c"sorry, cannot ypset for domain %s on host - make sure ypbind was started with -ypset or -ypsetme\00"
define i32 @bind_tohost(%struct.sockaddr_in* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr_in*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca %struct.ypbind_setdom
%9 = alloca %struct.timeval
%10 = alloca %struct.hostent*
%11 = alloca %struct.TYPE_7__*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%16 = load i8*, i8** %7
%17 = load i32, i32* @YPPROG
%18 = load i32, i32* @YPPROC_NULL
%19 = load i32, i32* @IPPROTO_UDP
%20 = call i32 @getrpcport(i8* %16, i32 %17, i32 %18, i32 %19)
%21 = call i32 @htons(i32 %20)
store i32 %21, i32* %13
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %3
%24 = load i8*, i8** %7
%25 = call i32 @errx(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %23, %3
%27 = call i32 @bzero(%struct.ypbind_setdom* %8, i32 24)
%28 = load i8*, i8** %7
%29 = call %struct.hostent* @gethostbyname(i8* %28)
store %struct.hostent* %29, %struct.hostent** %10
%30 = icmp ne %struct.hostent* %29, null
br i1 %30, label %31, label %40
31: ; preds = %26
%32 = load %struct.hostent*, %struct.hostent** %10
%33 = getelementptr inbounds %struct.hostent, %struct.hostent* %32, i32 0, i32 0
%34 = load i64**, i64*** %33
%35 = getelementptr inbounds i64*, i64** %34, i64 0
%36 = load i64*, i64** %35
%37 = getelementptr inbounds %struct.ypbind_setdom, %struct.ypbind_setdom* %8, i32 0, i32 2
%38 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %37, i32 0, i32 1
%39 = call i32 @bcopy(i64* %36, i32* %38, i32 8)
br label %52
40: ; preds = %26
%41 = load i8*, i8** %7
%42 = call i64 @inet_addr(i8* %41)
store i64 %42, i64* %15
%43 = icmp eq i64 %42, -1
br i1 %43, label %44, label %47
44: ; preds = %40
%45 = load i8*, i8** %7
%46 = call i32 @errx(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %45)
br label %51
47: ; preds = %40
%48 = getelementptr inbounds %struct.ypbind_setdom, %struct.ypbind_setdom* %8, i32 0, i32 2
%49 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %48, i32 0, i32 1
%50 = call i32 @bcopy(i64* %15, i32* %49, i32 8)
br label %51
51: ; preds = %47, %44
br label %52
52: ; preds = %51, %31
%53 = load i8*, i8** %6
%54 = getelementptr inbounds %struct.ypbind_setdom, %struct.ypbind_setdom* %8, i32 0, i32 0
store i8* %53, i8** %54
%55 = load i32, i32* %13
%56 = getelementptr inbounds %struct.ypbind_setdom, %struct.ypbind_setdom* %8, i32 0, i32 2
%57 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %56, i32 0, i32 0
store i32 %55, i32* %57
%58 = load i32, i32* @YPVERS
%59 = getelementptr inbounds %struct.ypbind_setdom, %struct.ypbind_setdom* %8, i32 0, i32 1
store i32 %58, i32* %59
%60 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
store i32 15, i32* %60
%61 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
store i64 0, i64* %61
%62 = load i32, i32* @RPC_ANYSOCK
store i32 %62, i32* %12
%63 = load %struct.sockaddr_in*, %struct.sockaddr_in** %5
%64 = load i32, i32* @YPBINDPROG
%65 = load i32, i32* @YPBINDVERS
%66 = bitcast %struct.timeval* %9 to { i32, i64 }*
%67 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %66, i32 0, i32 0
%68 = load i32, i32* %67
%69 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %66, i32 0, i32 1
%70 = load i64, i64* %69
%71 = call %struct.TYPE_7__* @clntudp_create(%struct.sockaddr_in* %63, i32 %64, i32 %65, i32 %68, i64 %70, i32* %12)
store %struct.TYPE_7__* %71, %struct.TYPE_7__** %11
%72 = load %struct.TYPE_7__*, %struct.TYPE_7__** %11
%73 = icmp eq %struct.TYPE_7__* %72, null
br i1 %73, label %74, label %79
74: ; preds = %52
%75 = load i32, i32* @YPERR_YPBIND
%76 = call i8* @yperr_string(i32 %75)
%77 = call i32 @warnx(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %76)
%78 = load i32, i32* @YPERR_YPBIND
store i32 %78, i32* %4
br label %101
79: ; preds = %52
%80 = call i32 (...) @authunix_create_default()
%81 = load %struct.TYPE_7__*, %struct.TYPE_7__** %11
%82 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %81, i32 0, i32 0
store i32 %80, i32* %82
%83 = load %struct.TYPE_7__*, %struct.TYPE_7__** %11
%84 = load i32, i32* @YPBINDPROC_SETDOM
%85 = load i64, i64* @xdr_ypbind_setdom
%86 = trunc i64 %85 to i32
%87 = load i64, i64* @xdr_void
%88 = trunc i64 %87 to i32
%89 = call i32 @clnt_call(%struct.TYPE_7__* %83, i32 %84, i32 %86, %struct.ypbind_setdom* %8, i32 %88, i32* null, %struct.timeval* byval(%struct.timeval) align 8 %9)
store i32 %89, i32* %14
%90 = load i32, i32* %14
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %98
92: ; preds = %79
%93 = load i8*, i8** %6
%94 = call i32 @warnx(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.3, i64 0, i64 0), i8* %93)
%95 = load %struct.TYPE_7__*, %struct.TYPE_7__** %11
%96 = call i32 @clnt_destroy(%struct.TYPE_7__* %95)
%97 = load i32, i32* @YPERR_YPBIND
store i32 %97, i32* %4
br label %101
98: ; preds = %79
%99 = load %struct.TYPE_7__*, %struct.TYPE_7__** %11
%100 = call i32 @clnt_destroy(%struct.TYPE_7__* %99)
store i32 0, i32* %4
br label %101
101: ; preds = %98, %92, %74
%102 = load i32, i32* %4
ret i32 %102
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.ypbind_setdom = type { i8*, i32, %struct.TYPE_6__ }
%struct.TYPE_6__ = type { i32, i32 }
%struct.timeval = type { i32, i64 }
%struct.hostent = type { i64** }
%struct.TYPE_7__ = type { i32 }
@YPPROG = global i32 0
@YPPROC_NULL = global i32 0
@IPPROTO_UDP = global i32 0
@.str = [22 x i8] c"%s not running ypserv\00"
@.str.1 = [26 x i8] c"can't find address for %s\00"
@YPVERS = global i32 0
@RPC_ANYSOCK = global i32 0
@YPBINDPROG = global i32 0
@YPBINDVERS = global i32 0
@.str.2 = [26 x i8] c"can't yp_bind, reason: %s\00"
@YPERR_YPBIND = global i32 0
@YPBINDPROC_SETDOM = global i32 0
@xdr_ypbind_setdom = global i64 0
@xdr_void = global i64 0
@.str.3 = [97 x i8] c"sorry, cannot ypset for domain %s on host - make sure ypbind was started with -ypset or -ypsetme\00"
define i32 @bind_tohost(%struct.sockaddr_in* %0, i8* %1, i8* %2) {
%4 = alloca %struct.ypbind_setdom
%5 = alloca %struct.timeval
%6 = alloca i32
%7 = bitcast %struct.ypbind_setdom* %4 to i8*
%8 = bitcast %struct.timeval* %5 to i8*
%9 = bitcast i32* %6 to i8*
%10 = load i32, i32* @YPPROG
%11 = load i32, i32* @YPPROC_NULL
%12 = load i32, i32* @IPPROTO_UDP
%13 = tail call i32 @getrpcport(i8* %2, i32 %10, i32 %11, i32 %12)
%14 = tail call i32 @htons(i32 %13)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %18
18: ; preds = %16, %3
%19 = call i32 @bzero(%struct.ypbind_setdom* %4, i32 24)
%20 = tail call %struct.hostent* @gethostbyname(i8* %2)
%21 = icmp eq %struct.hostent* %20, null
br i1 %21, label %29, label %22
22: ; preds = %18
%23 = getelementptr inbounds %struct.hostent, %struct.hostent* %20, i64 0, i32 0
%24 = load i64**, i64*** %23
%25 = load i64*, i64** %24
%26 = getelementptr inbounds %struct.ypbind_setdom, %struct.ypbind_setdom* %4, i64 0, i32 2, i32 1
%27 = bitcast i32* %26 to i64*
%28 = load i64, i64* %25
store i64 %28, i64* %27
br label %37
29: ; preds = %18
%30 = tail call i64 @inet_addr(i8* %2)
%31 = icmp eq i64 %30, -1
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %37
34: ; preds = %29
%35 = getelementptr inbounds %struct.ypbind_setdom, %struct.ypbind_setdom* %4, i64 0, i32 2, i32 1
%36 = bitcast i32* %35 to i64*
store i64 %30, i64* %36
br label %37
37: ; preds = %32, %34, %22
%38 = getelementptr inbounds %struct.ypbind_setdom, %struct.ypbind_setdom* %4, i64 0, i32 0
store i8* %1, i8** %38
%39 = getelementptr inbounds %struct.ypbind_setdom, %struct.ypbind_setdom* %4, i64 0, i32 2, i32 0
store i32 %14, i32* %39
%40 = load i32, i32* @YPVERS
%41 = getelementptr inbounds %struct.ypbind_setdom, %struct.ypbind_setdom* %4, i64 0, i32 1
store i32 %40, i32* %41
%42 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
store i32 15, i32* %42
%43 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
store i64 0, i64* %43
%44 = load i32, i32* @RPC_ANYSOCK
store i32 %44, i32* %6
%45 = load i32, i32* @YPBINDPROG
%46 = load i32, i32* @YPBINDVERS
%47 = call %struct.TYPE_7__* @clntudp_create(%struct.sockaddr_in* %0, i32 %45, i32 %46, i32 15, i64 0, i32* %6)
%48 = icmp eq %struct.TYPE_7__* %47, null
br i1 %48, label %49, label %54
49: ; preds = %37
%50 = load i32, i32* @YPERR_YPBIND
%51 = call i8* @yperr_string(i32 %50)
%52 = call i32 @warnx(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %51)
%53 = load i32, i32* @YPERR_YPBIND
br label %70
54: ; preds = %37
%55 = call i32 (...) @authunix_create_default()
%56 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %47, i64 0, i32 0
store i32 %55, i32* %56
%57 = load i32, i32* @YPBINDPROC_SETDOM
%58 = load i64, i64* @xdr_ypbind_setdom
%59 = trunc i64 %58 to i32
%60 = load i64, i64* @xdr_void
%61 = trunc i64 %60 to i32
%62 = call i32 @clnt_call(%struct.TYPE_7__* %47, i32 %57, i32 %59, %struct.ypbind_setdom* %4, i32 %61, i32* null, %struct.timeval* byval(%struct.timeval) align 8 %5)
%63 = icmp eq i32 %62, 0
br i1 %63, label %68, label %64
64: ; preds = %54
%65 = call i32 @warnx(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%66 = call i32 @clnt_destroy(%struct.TYPE_7__* %47)
%67 = load i32, i32* @YPERR_YPBIND
br label %70
68: ; preds = %54
%69 = call i32 @clnt_destroy(%struct.TYPE_7__* %47)
br label %70
70: ; preds = %68, %64, %49
%71 = phi i32 [ %53, %49 ], [ %67, %64 ], [ 0, %68 ]
ret i32 %71
}