#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*/ host_ip(char *, unsigned char *);
int init_client_ip(int *, unsigned char *, int, int);
int /*<<< orphan*/ memset(unsigned char *, char, int);
int init_client(int *sock, char *host, int port, int type) {
  unsigned char ip[4];
  memset(ip, '\0', sizeof ip);
  if (!host_ip(host, &(ip[0])))
    return 0;
  return init_client_ip(sock, ip, port, type);
}


x86 assembly (clang, -O0):
<init_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
lea    -0x24(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <host_ip@plt>
cmp    $0x0,%eax
jne    1178 <init_client+0x48>
movl   $0x0,-0x4(%rbp)
jmp    118e <init_client+0x5e>
mov    -0x10(%rbp),%rdi
lea    -0x24(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1050 <init_client_ip@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_client>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%r12
lea    0x4(%rsp),%r13
xor    %ebp,%ebp
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <host_ip@plt>
test   %eax,%eax
je     1181 <init_client+0x51>
lea    0x4(%rsp),%rsi
mov    %r12,%rdi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1050 <init_client_ip@plt>
mov    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @init_client(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca [4 x i8]
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%12 = call i32 @memset(i8* %11, i8 signext 0, i32 4)
%13 = load i8*, i8** %7
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%15 = call i32 @host_ip(i8* %13, i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %4
store i32 0, i32* %5
br label %24
18: ; preds = %4
%19 = load i32*, i32** %6
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = call i32 @init_client_ip(i32* %19, i8* %20, i32 %21, i32 %22)
store i32 %23, i32* %5
br label %24
24: ; preds = %18, %17
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @init_client(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [4 x i8]
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i8 signext 0, i32 4)
%8 = call i32 @host_ip(i8* %1, i8* %6)
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = call i32 @init_client_ip(i32* %0, i8* %6, i32 %2, i32 %3)
br label %12
12: ; preds = %4, %10
%13 = phi i32 [ %11, %10 ], [ 0, %4 ]
ret i32 %13
}