#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 init_client(int *sock, char *host, int port) {
  unsigned char ip[4];
  short p = 0;
  if (!host_ip(host, &(ip[0]))) {
    return (0);
  }
  if (p != 0)
    port = p;
  return (init_client_ip(sock, ip, port));
}


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)
movw   $0x0,-0x22(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <host_ip@plt>
cmp    $0x0,%eax
jne    115b <init_client+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1182 <init_client+0x62>
movswl -0x22(%rbp),%eax
cmp    $0x0,%eax
je     116f <init_client+0x4f>
movswl -0x22(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <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   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
call   1030 <host_ip@plt>
test   %eax,%eax
je     114d <init_client+0x2d>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <init_client_ip@plt>
jmp    114f <init_client+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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