#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 *, int);
int phAddVline(const char *username, const char *server, const char *proxy,
               int regTimeout) {
  char reqbuf[1000];
  snprintf(reqbuf, sizeof(reqbuf), "ADDVL U=%s S=%s P=%s T=%d", username,
           server ? server : "", proxy ? proxy : "", regTimeout);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phAddVline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x420(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x418(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116e <phAddVline+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x428(%rbp)
jmp    1181 <phAddVline+0x61>
lea    0xea4(%rip),%rax
mov    %rax,-0x428(%rbp)
jmp    1181 <phAddVline+0x61>
mov    -0x428(%rbp),%rax
mov    %rax,-0x430(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11aa <phAddVline+0x8a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x438(%rbp)
jmp    11bd <phAddVline+0x9d>
lea    0xe68(%rip),%rax
mov    %rax,-0x438(%rbp)
jmp    11bd <phAddVline+0x9d>
mov    -0x430(%rbp),%r8
mov    -0x418(%rbp),%rcx
mov    -0x420(%rbp),%rdi
mov    -0x438(%rbp),%r9
mov    -0x1c(%rbp),%eax
mov    $0x3e8,%esi
lea    0xe18(%rip),%rdx
mov    %eax,(%rsp)
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phAddVline>:
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%r8
test   %rsi,%rsi
lea    0xee4(%rip),%r9
cmove  %r9,%r8
mov    %rdi,%rax
test   %rdx,%rdx
cmovne %rdx,%r9
mov    %ecx,(%rsp)
lea    0xeb3(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    %rax,%rcx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x400,%rsp
pop    %rbx
ret

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

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