#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 */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *,
                            char const *, char const *, int);
int phAddVline2(const char *displayname, const char *username,
                const char *server, const char *proxy, int regTimeout) {
  char reqbuf[1000];
  snprintf(reqbuf, sizeof(reqbuf), "ADDVL DN=<%s> U=%s S=%s P=%s T=%d",
           displayname ? displayname : "", username, server ? server : "",
           proxy ? proxy : "", regTimeout);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phAddVline2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x418(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1168 <phAddVline2+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,-0x420(%rbp)
jmp    117b <phAddVline2+0x5b>
lea    0xeb2(%rip),%rax
mov    %rax,-0x420(%rbp)
jmp    117b <phAddVline2+0x5b>
mov    -0x420(%rbp),%rax
mov    %rax,-0x430(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x428(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11af <phAddVline2+0x8f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x438(%rbp)
jmp    11c2 <phAddVline2+0xa2>
lea    0xe6b(%rip),%rax
mov    %rax,-0x438(%rbp)
jmp    11c2 <phAddVline2+0xa2>
mov    -0x438(%rbp),%rax
mov    %rax,-0x440(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11eb <phAddVline2+0xcb>
mov    -0x20(%rbp),%rax
mov    %rax,-0x448(%rbp)
jmp    11fe <phAddVline2+0xde>
lea    0xe2f(%rip),%rax
mov    %rax,-0x448(%rbp)
jmp    11fe <phAddVline2+0xde>
mov    -0x440(%rbp),%r9
mov    -0x428(%rbp),%r8
mov    -0x430(%rbp),%rcx
mov    -0x418(%rbp),%rdi
mov    -0x448(%rbp),%r10
mov    -0x24(%rbp),%eax
mov    $0x3e8,%esi
lea    0xdd0(%rip),%rdx
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phAddVline2>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rdi,%r11
test   %rdi,%rdi
lea    0xeec(%rip),%rdi
cmove  %rdi,%r11
mov    %rdx,%r9
test   %rdx,%rdx
cmove  %rdi,%r9
mov    %r8d,%r10d
mov    %rcx,%rax
mov    %rsi,%r8
test   %rcx,%rcx
cmove  %rdi,%rax
lea    0xea6(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    %r11,%rcx
push   %r10
push   %rax
call   1030 <snprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"ADDVL DN=<%s> U=%s S=%s P=%s T=%d\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @phAddVline2(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [1000 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %5
%16 = load i8*, i8** %6
br label %18
17: ; preds = %5
br label %18
18: ; preds = %17, %15
%19 = phi i8* [ %16, %15 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %17 ]
%20 = load i8*, i8** %7
%21 = load i8*, i8** %8
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i8*, i8** %8
br label %26
25: ; preds = %18
br label %26
26: ; preds = %25, %23
%27 = phi i8* [ %24, %23 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %25 ]
%28 = load i8*, i8** %9
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = load i8*, i8** %9
br label %33
32: ; preds = %26
br label %33
33: ; preds = %32, %30
%34 = phi i8* [ %31, %30 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %32 ]
%35 = load i32, i32* %10
%36 = call i32 @snprintf(i8* %12, i32 1000, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20, i8* %27, i8* %34, i32 %35)
%37 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%38 = call i32 @ph_rpc(i8* %37)
ret i32 %38
}

LLVM IR (-O2):
@.str = [34 x i8] c"ADDVL DN=<%s> U=%s S=%s P=%s T=%d\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @phAddVline2(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca [1000 x i8]
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%8 = icmp eq i8* %0, null
%9 = select i1 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %0
%10 = icmp eq i8* %2, null
%11 = select i1 %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %2
%12 = icmp eq i8* %3, null
%13 = select i1 %12, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %3
%14 = call i32 @snprintf(i8* %7, i32 1000, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %1, i8* %11, i8* %13, i32 %4)
%15 = call i32 @ph_rpc(i8* %7)
ret i32 %15
}