#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 */
struct tcpSckHanndle {
  int dummy;
};

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ initializationTcpSck(struct tcpSckHanndle *, int, char *,
                                        int, int);
int inputParam(int argc, char **argv, struct tcpSckHanndle *obj) {
  int port = 0;
  char *ip = NULL;
  if (argc < 2) {
    return 0;
  } else if (argc == 3) {
    port = atoi(argv[2]);
  } else if (argc == 4) {
    port = atoi(argv[2]);
    ip = argv[3];
  }
  initializationTcpSck(obj, port, ip, 5, atoi(argv[1]));
  return 1;
}


x86 assembly (clang, -O0):
<inputParam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1158 <inputParam+0x38>
movl   $0x0,-0x4(%rbp)
jmp    11e9 <inputParam+0xc9>
cmpl   $0x3,-0x8(%rbp)
jne    1177 <inputParam+0x57>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    11a2 <inputParam+0x82>
cmpl   $0x4,-0x8(%rbp)
jne    119d <inputParam+0x7d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    11a2 <inputParam+0x82>
jmp    11a7 <inputParam+0x87>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x40(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x30(%rbp),%rdx
mov    %eax,%r8d
mov    $0x5,%ecx
call   1030 <initializationTcpSck@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputParam>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1194 <inputParam+0x74>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
cmp    $0x4,%edi
je     114d <inputParam+0x2d>
cmp    $0x3,%edi
jne    115f <inputParam+0x3f>
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
mov    %eax,%r15d
jmp    1162 <inputParam+0x42>
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
mov    %eax,%r15d
mov    0x18(%rbx),%r12
jmp    1165 <inputParam+0x45>
xor    %r15d,%r15d
xor    %r12d,%r12d
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %r12,%rdx
mov    $0x5,%ecx
mov    %eax,%r8d
call   1030 <initializationTcpSck@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tcpSckHanndle = type { i32 }
define i32 @inputParam(i32 %0, i8** %1, %struct.tcpSckHanndle* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.tcpSckHanndle*
%8 = alloca i32
%9 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.tcpSckHanndle* %2, %struct.tcpSckHanndle** %7
store i32 0, i32* %8
store i8* null, i8** %9
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 0, i32* %4
br label %43
13: ; preds = %3
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 3
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i8**, i8*** %6
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %8
br label %33
21: ; preds = %13
%22 = load i32, i32* %5
%23 = icmp eq i32 %22, 4
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = load i8**, i8*** %6
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %8
%29 = load i8**, i8*** %6
%30 = getelementptr inbounds i8*, i8** %29, i64 3
%31 = load i8*, i8** %30
store i8* %31, i8** %9
br label %32
32: ; preds = %24, %21
br label %33
33: ; preds = %32, %16
br label %34
34: ; preds = %33
%35 = load %struct.tcpSckHanndle*, %struct.tcpSckHanndle** %7
%36 = load i32, i32* %8
%37 = load i8*, i8** %9
%38 = load i8**, i8*** %6
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
%42 = call i32 @initializationTcpSck(%struct.tcpSckHanndle* %35, i32 %36, i8* %37, i32 5, i32 %41)
store i32 1, i32* %4
br label %43
43: ; preds = %34, %12
%44 = load i32, i32* %4
ret i32 %44
}

LLVM IR (-O2):
%struct.tcpSckHanndle = type { i32 }
define i32 @inputParam(i32 %0, i8** nocapture %1, %struct.tcpSckHanndle* %2) {
%4 = icmp slt i32 %0, 2
br i1 %4, label %23, label %5
5: ; preds = %3
switch i32 %0, label %16 [
i32 3, label %6
i32 4, label %10
]
6: ; preds = %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
br label %16
10: ; preds = %5
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = getelementptr inbounds i8*, i8** %1, i64 3
%15 = load i8*, i8** %14
br label %16
16: ; preds = %5, %6, %10
%17 = phi i32 [ %9, %6 ], [ %13, %10 ], [ 0, %5 ]
%18 = phi i8* [ null, %6 ], [ %15, %10 ], [ null, %5 ]
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = tail call i32 @atoi(i8* %20)
%22 = tail call i32 @initializationTcpSck(%struct.tcpSckHanndle* %2, i32 %17, i8* %18, i32 5, i32 %21)
br label %23
23: ; preds = %3, %16
%24 = phi i32 [ 1, %16 ], [ 0, %3 ]
ret i32 %24
}