#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_18__ TYPE_8__;
typedef struct TYPE_17__ TYPE_7__;
typedef struct TYPE_16__ TYPE_6__;
typedef struct TYPE_15__ TYPE_5__;
typedef struct TYPE_14__ TYPE_4__;
typedef struct TYPE_13__ TYPE_3__;
typedef struct TYPE_12__ TYPE_2__;
typedef struct TYPE_11__ TYPE_1__;

/* Type definitions */
typedef int uint32_t;
struct hostent {
  int /*<<< orphan*/ *h_addr_list;
};
struct TYPE_14__ {
  int net;
  int host;
  int lh;
  int impno;
};
struct TYPE_15__ {
  TYPE_4__ ip_addr;
};
struct TYPE_16__ {
  TYPE_5__ bp_address_u;
};
struct TYPE_17__ {
  char *client_name;
  char *domain_name;
  TYPE_6__ router_address;
};
typedef TYPE_7__ bp_whoami_res;
struct TYPE_11__ {
  int net;
  int host;
  int lh;
  int impno;
};
struct TYPE_12__ {
  TYPE_1__ ip_addr;
};
struct TYPE_13__ {
  TYPE_2__ bp_address_u;
  int /*<<< orphan*/ address_type;
};
struct TYPE_18__ {
  TYPE_3__ client_address;
};
typedef TYPE_8__ bp_whoami_arg;
typedef int /*<<< orphan*/ addr;
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
int /*<<< orphan*/ BOOTPARAMPROG;
int /*<<< orphan*/ BOOTPARAMVERS;
int /*<<< orphan*/ IP_ADDR_TYPE;
TYPE_7__ *bootparamproc_whoami_1(TYPE_8__ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *clnt_create(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                                char *);
int /*<<< orphan*/ errx(int, char *, ...);
struct hostent *gethostbyname(char *);
int htonl(int);
int /*<<< orphan*/ memcpy(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ warnx(char *);
int main(int argc, char **argv) {
  CLIENT *cli;
  bp_whoami_res *out;
  bp_whoami_arg bp;
  struct hostent *hp;
  uint32_t addr;
  if (argc < 2) {
    warnx("usage: test <hostname>");
    errx(1, "Always talks to bootparamd at localhost");
  }
  if ((hp = gethostbyname(argv[1])) == NULL)
    errx(1, "Cannot resolve `%s'", argv[1]);
  printf("Creating client for localhost\n");
  cli = clnt_create("localhost", BOOTPARAMPROG, BOOTPARAMVERS, "udp");
  if (!cli)
    errx(1, "Failed to create client");
  memcpy(&addr, hp->h_addr_list[0], sizeof(addr));
  addr = htonl(addr);
  bp.client_address.address_type = IP_ADDR_TYPE;
  bp.client_address.bp_address_u.ip_addr.net = (addr >> 24) & 0xff;
  bp.client_address.bp_address_u.ip_addr.host = (addr >> 16) & 0xff;
  bp.client_address.bp_address_u.ip_addr.lh = (addr >> 8) & 0xff;
  bp.client_address.bp_address_u.ip_addr.impno = (addr >> 0) & 0xff;
  if ((out = bootparamproc_whoami_1(&bp, cli)) != NULL) {
    printf("Success [host=%s, domain=%s, gw=%d.%d.%d.%d]\n", out->client_name,
           out->domain_name,
           out->router_address.bp_address_u.ip_addr.net & 0xff,
           out->router_address.bp_address_u.ip_addr.host & 0xff,
           out->router_address.bp_address_u.ip_addr.lh & 0xff,
           out->router_address.bp_address_u.ip_addr.impno & 0xff);
  } else
    printf("Fail\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11bf <main+0x3f>
lea    0xe59(%rip),%rdi
call   1060 <warnx@plt>
mov    $0x1,%edi
lea    0xe5f(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <gethostbyname@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    11f5 <main+0x75>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x1,%edi
lea    0xe51(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2dce(%rip),%rax
mov    (%rax),%esi
mov    0x2dbd(%rip),%rax
mov    (%rax),%edx
lea    0xe19(%rip),%rdi
lea    0xe4f(%rip),%rcx
call   10a0 <clnt_create@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    124a <main+0xca>
mov    $0x1,%edi
lea    0xe33(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
mov    -0x40(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    -0x44(%rbp),%rdi
mov    $0x4,%edx
call   1090 <memcpy@plt>
mov    -0x44(%rbp),%edi
call   1070 <htonl@plt>
mov    %eax,-0x44(%rbp)
mov    0x2d6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x44(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %eax,-0x38(%rbp)
mov    -0x44(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x34(%rbp)
mov    -0x44(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x30(%rbp)
mov    -0x44(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x38(%rbp),%rdi
call   1030 <bootparamproc_whoami_1@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1327 <main+0x1a7>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%ecx
and    $0xff,%ecx
mov    -0x20(%rbp),%rax
mov    0x14(%rax),%r8d
and    $0xff,%r8d
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%r9d
and    $0xff,%r9d
mov    -0x20(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0xff,%eax
lea    0xd76(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1335 <main+0x1b5>
lea    0xd8e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     11c0 <main+0x30>
lea    0xe58(%rip),%rdi
call   1070 <warnx@plt>
lea    0xe63(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <errx@plt>
mov    0x8(%rbx),%rdi
call   1090 <gethostbyname@plt>
mov    %rax,%r15
test   %rax,%rax
jne    11e8 <main+0x58>
mov    0x8(%rbx),%rdx
lea    0xe63(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <errx@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%esi
mov    0x2dcc(%rip),%rax
mov    (%rax),%edx
lea    0xea4(%rip),%rdi
lea    0xe3f(%rip),%rcx
call   10b0 <clnt_create@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1234 <main+0xa4>
lea    0xe2f(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <errx@plt>
mov    (%r15),%rax
mov    (%rax),%esi
lea    0x14(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <memcpy@plt>
mov    0x14(%rsp),%edi
call   1080 <htonl@plt>
mov    %eax,0x14(%rsp)
mov    0x2d84(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x28(%rsp)
mov    %eax,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,0x18(%rsp)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x1c(%rsp)
mov    %edx,0x20(%rsp)
mov    %esi,0x24(%rsp)
lea    0x18(%rsp),%rdi
mov    %r14,%rsi
call   1040 <bootparamproc_whoami_1@plt>
test   %rax,%rax
je     12c1 <main+0x131>
mov    (%rax),%rsi
mov    0x8(%rax),%rdx
movzbl 0x10(%rax),%ecx
movzbl 0x14(%rax),%r8d
movzbl 0x18(%rax),%r9d
movzbl 0x1c(%rax),%eax
mov    %eax,(%rsp)
lea    0xdb7(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    12cd <main+0x13d>
lea    0xdf3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_17__ = type { i8*, i8*, %struct.TYPE_16__ }
%struct.TYPE_16__ = type { %struct.TYPE_15__ }
%struct.TYPE_15__ = type { %struct.TYPE_14__ }
%struct.TYPE_14__ = type { i32, i32, i32, i32 }
%struct.TYPE_18__ = type { %struct.TYPE_13__ }
%struct.TYPE_13__ = type { %struct.TYPE_12__, i32 }
%struct.TYPE_12__ = type { %struct.TYPE_11__ }
%struct.TYPE_11__ = type { i32, i32, i32, i32 }
%struct.hostent = type { i32* }
@.str = [23 x i8] c"usage: test <hostname>\00"
@.str.1 = [40 x i8] c"Always talks to bootparamd at localhost\00"
@.str.2 = [20 x i8] c"Cannot resolve `%s'\00"
@.str.3 = [31 x i8] c"Creating client for localhost\0A\00"
@.str.4 = [10 x i8] c"localhost\00"
@BOOTPARAMPROG = global i32 0
@BOOTPARAMVERS = global i32 0
@.str.5 = [4 x i8] c"udp\00"
@.str.6 = [24 x i8] c"Failed to create client\00"
@IP_ADDR_TYPE = global i32 0
@.str.7 = [46 x i8] c"Success [host=%s, domain=%s, gw=%d.%d.%d.%d]\0A\00"
@.str.8 = [6 x i8] c"Fail\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca %struct.TYPE_17__*
%8 = alloca %struct.TYPE_18__
%9 = alloca %struct.hostent*
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @warnx(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %13, %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call %struct.hostent* @gethostbyname(i8* %19)
store %struct.hostent* %20, %struct.hostent** %9
%21 = icmp eq %struct.hostent* %20, null
br i1 %21, label %22, label %27
22: ; preds = %16
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %22, %16
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%29 = load i32, i32* @BOOTPARAMPROG
%30 = load i32, i32* @BOOTPARAMVERS
%31 = call i32* @clnt_create(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %29, i32 %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
store i32* %31, i32** %6
%32 = load i32*, i32** %6
%33 = icmp ne i32* %32, null
br i1 %33, label %36, label %34
34: ; preds = %27
%35 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %36
36: ; preds = %34, %27
%37 = load %struct.hostent*, %struct.hostent** %9
%38 = getelementptr inbounds %struct.hostent, %struct.hostent* %37, i32 0, i32 0
%39 = load i32*, i32** %38
%40 = getelementptr inbounds i32, i32* %39, i64 0
%41 = load i32, i32* %40
%42 = call i32 @memcpy(i32* %10, i32 %41, i32 4)
%43 = load i32, i32* %10
%44 = call i32 @htonl(i32 %43)
store i32 %44, i32* %10
%45 = load i32, i32* @IP_ADDR_TYPE
%46 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %8, i32 0, i32 0
%47 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %46, i32 0, i32 1
store i32 %45, i32* %47
%48 = load i32, i32* %10
%49 = ashr i32 %48, 24
%50 = and i32 %49, 255
%51 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %8, i32 0, i32 0
%52 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %51, i32 0, i32 0
%53 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %52, i32 0, i32 0
%54 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %53, i32 0, i32 0
store i32 %50, i32* %54
%55 = load i32, i32* %10
%56 = ashr i32 %55, 16
%57 = and i32 %56, 255
%58 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %8, i32 0, i32 0
%59 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %58, i32 0, i32 0
%60 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %59, i32 0, i32 0
%61 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %60, i32 0, i32 1
store i32 %57, i32* %61
%62 = load i32, i32* %10
%63 = ashr i32 %62, 8
%64 = and i32 %63, 255
%65 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %8, i32 0, i32 0
%66 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %65, i32 0, i32 0
%67 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %66, i32 0, i32 0
%68 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %67, i32 0, i32 2
store i32 %64, i32* %68
%69 = load i32, i32* %10
%70 = ashr i32 %69, 0
%71 = and i32 %70, 255
%72 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %8, i32 0, i32 0
%73 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %72, i32 0, i32 0
%74 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %73, i32 0, i32 0
%75 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %74, i32 0, i32 3
store i32 %71, i32* %75
%76 = load i32*, i32** %6
%77 = call %struct.TYPE_17__* @bootparamproc_whoami_1(%struct.TYPE_18__* %8, i32* %76)
store %struct.TYPE_17__* %77, %struct.TYPE_17__** %7
%78 = icmp ne %struct.TYPE_17__* %77, null
br i1 %78, label %79, label %115
79: ; preds = %36
%80 = load %struct.TYPE_17__*, %struct.TYPE_17__** %7
%81 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %80, i32 0, i32 0
%82 = load i8*, i8** %81
%83 = load %struct.TYPE_17__*, %struct.TYPE_17__** %7
%84 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %83, i32 0, i32 1
%85 = load i8*, i8** %84
%86 = load %struct.TYPE_17__*, %struct.TYPE_17__** %7
%87 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %86, i32 0, i32 2
%88 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %87, i32 0, i32 0
%89 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %88, i32 0, i32 0
%90 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %89, i32 0, i32 0
%91 = load i32, i32* %90
%92 = and i32 %91, 255
%93 = load %struct.TYPE_17__*, %struct.TYPE_17__** %7
%94 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %93, i32 0, i32 2
%95 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %94, i32 0, i32 0
%96 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %95, i32 0, i32 0
%97 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %96, i32 0, i32 1
%98 = load i32, i32* %97
%99 = and i32 %98, 255
%100 = load %struct.TYPE_17__*, %struct.TYPE_17__** %7
%101 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %100, i32 0, i32 2
%102 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %101, i32 0, i32 0
%103 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %102, i32 0, i32 0
%104 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %103, i32 0, i32 2
%105 = load i32, i32* %104
%106 = and i32 %105, 255
%107 = load %struct.TYPE_17__*, %struct.TYPE_17__** %7
%108 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %107, i32 0, i32 2
%109 = getelementptr inbounds %struct.TYPE_16__, %struct.TYPE_16__* %108, i32 0, i32 0
%110 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %109, i32 0, i32 0
%111 = getelementptr inbounds %struct.TYPE_14__, %struct.TYPE_14__* %110, i32 0, i32 3
%112 = load i32, i32* %111
%113 = and i32 %112, 255
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0), i8* %82, i8* %85, i32 %92, i32 %99, i32 %106, i32 %113)
br label %117
115: ; preds = %36
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %117
117: ; preds = %115, %79
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_18__ = type { %struct.TYPE_13__ }
%struct.TYPE_13__ = type { %struct.TYPE_12__, i32 }
%struct.TYPE_12__ = type { %struct.TYPE_11__ }
%struct.TYPE_11__ = type { i32, i32, i32, i32 }
%struct.hostent = type { i32* }
%struct.TYPE_17__ = type { i8*, i8*, %struct.TYPE_16__ }
%struct.TYPE_16__ = type { %struct.TYPE_15__ }
%struct.TYPE_15__ = type { %struct.TYPE_14__ }
%struct.TYPE_14__ = type { i32, i32, i32, i32 }
@.str = [23 x i8] c"usage: test <hostname>\00"
@.str.1 = [40 x i8] c"Always talks to bootparamd at localhost\00"
@.str.2 = [20 x i8] c"Cannot resolve `%s'\00"
@.str.4 = [10 x i8] c"localhost\00"
@BOOTPARAMPROG = global i32 0
@BOOTPARAMVERS = global i32 0
@.str.5 = [4 x i8] c"udp\00"
@.str.6 = [24 x i8] c"Failed to create client\00"
@IP_ADDR_TYPE = global i32 0
@.str.7 = [46 x i8] c"Success [host=%s, domain=%s, gw=%d.%d.%d.%d]\0A\00"
@str = [30 x i8] c"Creating client for localhost\00"
@str.9 = [5 x i8] c"Fail\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.TYPE_18__
%4 = alloca i32
%5 = bitcast %struct.TYPE_18__* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = icmp slt i32 %0, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 @warnx(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call %struct.hostent* @gethostbyname(i8* %13)
%15 = icmp eq %struct.hostent* %14, null
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i8*, i8** %12
%18 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %16, %11
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%21 = load i32, i32* @BOOTPARAMPROG
%22 = load i32, i32* @BOOTPARAMVERS
%23 = tail call i32* @clnt_create(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %21, i32 %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %27
27: ; preds = %25, %19
%28 = getelementptr inbounds %struct.hostent, %struct.hostent* %14, i64 0, i32 0
%29 = load i32*, i32** %28
%30 = load i32, i32* %29
%31 = call i32 @memcpy(i32* %4, i32 %30, i32 4)
%32 = load i32, i32* %4
%33 = call i32 @htonl(i32 %32)
store i32 %33, i32* %4
%34 = load i32, i32* @IP_ADDR_TYPE
%35 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %3, i64 0, i32 0, i32 1
store i32 %34, i32* %35
%36 = lshr i32 %33, 24
%37 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %3, i64 0, i32 0, i32 0, i32 0, i32 0
store i32 %36, i32* %37
%38 = lshr i32 %33, 16
%39 = and i32 %38, 255
%40 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %3, i64 0, i32 0, i32 0, i32 0, i32 1
store i32 %39, i32* %40
%41 = lshr i32 %33, 8
%42 = and i32 %41, 255
%43 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %3, i64 0, i32 0, i32 0, i32 0, i32 2
store i32 %42, i32* %43
%44 = and i32 %33, 255
%45 = getelementptr inbounds %struct.TYPE_18__, %struct.TYPE_18__* %3, i64 0, i32 0, i32 0, i32 0, i32 3
store i32 %44, i32* %45
%46 = call %struct.TYPE_17__* @bootparamproc_whoami_1(%struct.TYPE_18__* %3, i32* %23)
%47 = icmp eq %struct.TYPE_17__* %46, null
br i1 %47, label %66, label %48
48: ; preds = %27
%49 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %46, i64 0, i32 0
%50 = load i8*, i8** %49
%51 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %46, i64 0, i32 1
%52 = load i8*, i8** %51
%53 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %46, i64 0, i32 2, i32 0, i32 0, i32 0
%54 = load i32, i32* %53
%55 = and i32 %54, 255
%56 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %46, i64 0, i32 2, i32 0, i32 0, i32 1
%57 = load i32, i32* %56
%58 = and i32 %57, 255
%59 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %46, i64 0, i32 2, i32 0, i32 0, i32 2
%60 = load i32, i32* %59
%61 = and i32 %60, 255
%62 = getelementptr inbounds %struct.TYPE_17__, %struct.TYPE_17__* %46, i64 0, i32 2, i32 0, i32 0, i32 3
%63 = load i32, i32* %62
%64 = and i32 %63, 255
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0), i8* %50, i8* %52, i32 %55, i32 %58, i32 %61, i32 %64)
br label %68
66: ; preds = %27
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.9, i64 0, i64 0))
br label %68
68: ; preds = %66, %48
ret i32 0
}