#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*/ create_client(char *, char *);
int /*<<< orphan*/ hide_args(int, char **);
int /*<<< orphan*/ memset(char *, char, int /*<<< orphan*/);
char *strdup(char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  char *user, *passwd;
  user = (argv[1]) ? strdup(argv[1]) : NULL;
  passwd = (argv[2]) ? strdup(argv[2]) : NULL;
  if (argv[2]) {
    memset(argv[2], '*', strlen(argv[2]));
  }
  hide_args(argc, argv);
  create_client(user, passwd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     118b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x28(%rbp)
jmp    1196 <main+0x46>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1196 <main+0x46>
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     11c3 <main+0x73>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x30(%rbp)
jmp    11ce <main+0x7e>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    11ce <main+0x7e>
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     120e <main+0xbe>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%edx
mov    $0x2a,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <hide_args@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <create_client@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     1171 <main+0x21>
call   1060 <strdup@plt>
mov    %rax,%r15
jmp    1174 <main+0x24>
xor    %r15d,%r15d
mov    0x10(%rbx),%rbp
test   %rbp,%rbp
je     11a1 <main+0x51>
mov    %rbp,%rdi
call   1060 <strdup@plt>
mov    %rax,%r12
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    $0x2a,%esi
mov    %eax,%edx
call   1040 <memset@plt>
jmp    11a4 <main+0x54>
xor    %r12d,%r12d
mov    %r14d,%edi
mov    %rbx,%rsi
call   1050 <hide_args@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <create_client@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i8* @strdup(i8* %15)
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %12
%19 = phi i8* [ %16, %12 ], [ null, %17 ]
store i8* %19, i8** %6
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = icmp ne i8* %22, null
br i1 %23, label %24, label %29
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i8* @strdup(i8* %27)
br label %30
29: ; preds = %18
br label %30
30: ; preds = %29, %24
%31 = phi i8* [ %28, %24 ], [ null, %29 ]
store i8* %31, i8** %7
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %45
36: ; preds = %30
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 2
%42 = load i8*, i8** %41
%43 = call i32 @strlen(i8* %42)
%44 = call i32 @memset(i8* %39, i8 signext 42, i32 %43)
br label %45
45: ; preds = %36, %30
%46 = load i32, i32* %4
%47 = load i8**, i8*** %5
%48 = call i32 @hide_args(i32 %46, i8** %47)
%49 = load i8*, i8** %6
%50 = load i8*, i8** %7
%51 = call i32 @create_client(i8* %49, i8* %50)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @strdup(i8* %4)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = tail call i8* @strdup(i8* %11)
%15 = tail call i32 @strlen(i8* %11)
%16 = tail call i32 @memset(i8* %11, i8 signext 42, i32 %15)
br label %17
17: ; preds = %8, %13
%18 = phi i8* [ %14, %13 ], [ null, %8 ]
%19 = tail call i32 @hide_args(i32 %0, i8** %1)
%20 = tail call i32 @create_client(i8* %9, i8* %18)
ret i32 0
}