#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void manageInput(int argc, char **argv, char *hname, char *port) {
  if (argc < 3) {
    printf("Need hostname  port\n");
    printf("./client 127.0.0.1  10001\n");
    exit(0);
  }
  snprintf(hname, 200, "%s", (char *)argv[1]);
  snprintf(port, 200, "%s", (char *)argv[2]);
  return;
}


x86 assembly (clang, -O0):
<manageInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1170 <manageInput+0x40>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    $0xc8,%esi
lea    0xea8(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    $0xc8,%esi
lea    0xe8b(%rip),%rdx
call   1040 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manageInput>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jle    1174 <manageInput+0x44>
mov    %rcx,%r14
mov    %rsi,%rbx
mov    0x8(%rsi),%rcx
lea    0xeb5(%rip),%r15
mov    %rdx,%rdi
mov    $0xc8,%esi
mov    %r15,%rdx
call   1040 <snprintf@plt>
mov    0x10(%rbx),%rcx
mov    %r14,%rdi
mov    $0xc8,%esi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <snprintf@plt>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Need hostname port\0A\00"
@.str.1 = [27 x i8] c"./client 127.0.0.1 10001\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define void @manageInput(i32 %0, i8** %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %4
%16 = load i8*, i8** %7
%17 = load i8**, i8*** %6
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @snprintf(i8* %16, i32 200, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = load i8*, i8** %8
%22 = load i8**, i8*** %6
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @snprintf(i8* %21, i32 200, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %24)
ret void
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%s\00"
@str = [20 x i8] c"Need hostname port\00"
@str.3 = [26 x i8] c"./client 127.0.0.1 10001\00"
define void @manageInput(i32 %0, i8** nocapture %1, i8* %2, i8* %3) {
%5 = icmp slt i32 %0, 3
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %4
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @snprintf(i8* %2, i32 200, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32 @snprintf(i8* %3, i32 200, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %15)
ret void
}