#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 */
scalar_t__ attribute_exists(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ environment_application_name();
char *appaserver_user_select(void) {
  if (attribute_exists(environment_application_name(), "appaserver_user",
                       "full_name")) {
    return "login_name,full_name,password,user_date_format";
  } else if (attribute_exists(environment_application_name(), "appaserver_user",
                              "person_full_name")) {
    return "login_name,person_full_name,password,user_date_format";
  } else {
    return "login_name,'',password,user_date_format";
  }
}


x86 assembly (clang, -O0):
<appaserver_user_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <environment_application_name@plt>
mov    %eax,%edi
lea    0xec8(%rip),%rsi
lea    0xf07(%rip),%rdx
call   1040 <attribute_exists@plt>
cmp    $0x0,%rax
je     115e <appaserver_user_select+0x3e>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119f <appaserver_user_select+0x7f>
mov    $0x0,%al
call   1030 <environment_application_name@plt>
mov    %eax,%edi
lea    0xe92(%rip),%rsi
lea    0xeca(%rip),%rdx
call   1040 <attribute_exists@plt>
cmp    $0x0,%rax
je     1194 <appaserver_user_select+0x74>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119f <appaserver_user_select+0x7f>
lea    0xeeb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_user_select>:
push   %rax
xor    %eax,%eax
call   1030 <environment_application_name@plt>
lea    0xed1(%rip),%rsi
lea    0xf10(%rip),%rdx
mov    %eax,%edi
call   1040 <attribute_exists@plt>
test   %rax,%rax
je     114b <appaserver_user_select+0x2b>
lea    0xec7(%rip),%rax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <environment_application_name@plt>
lea    0xea7(%rip),%rsi
lea    0xedf(%rip),%rdx
mov    %eax,%edi
call   1040 <attribute_exists@plt>
test   %rax,%rax
lea    0xf15(%rip),%rcx
lea    0xed8(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"appaserver_user\00"
@.str.1 = [10 x i8] c"full_name\00"
@.str.2 = [47 x i8] c"login_name,full_name,password,user_date_format\00"
@.str.3 = [17 x i8] c"person_full_name\00"
@.str.4 = [54 x i8] c"login_name,person_full_name,password,user_date_format\00"
@.str.5 = [40 x i8] c"login_name,'',password,user_date_format\00"
define i8* @appaserver_user_select() {
%1 = alloca i8*
%2 = call i32 (...) @environment_application_name()
%3 = call i64 @attribute_exists(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %12
6: ; preds = %0
%7 = call i32 (...) @environment_application_name()
%8 = call i64 @attribute_exists(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
store i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), i8** %1
br label %12
11: ; preds = %6
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i8** %1
br label %12
12: ; preds = %11, %10, %5
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"appaserver_user\00"
@.str.1 = [10 x i8] c"full_name\00"
@.str.2 = [47 x i8] c"login_name,full_name,password,user_date_format\00"
@.str.3 = [17 x i8] c"person_full_name\00"
@.str.4 = [54 x i8] c"login_name,person_full_name,password,user_date_format\00"
@.str.5 = [40 x i8] c"login_name,'',password,user_date_format\00"
define i8* @appaserver_user_select() {
%1 = tail call i32 (...) @environment_application_name()
%2 = tail call i64 @attribute_exists(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i32 (...) @environment_application_name()
%6 = tail call i64 @attribute_exists(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0)
br label %9
9: ; preds = %4, %0
%10 = phi i8* [ getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), %0 ], [ %8, %4 ]
ret i8* %10
}