#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 */
char *appaserver_library_get_http_prompt(char *, char *, int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ application_prepend_http_protocol_yn(char *);
int /*<<< orphan*/ application_ssl_support_yn(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *,
                           char *, char *, char *);
char *appaserver_library_prelookup_button_control_string(
    char *application_name, char *cgi_directory, char *server_address,
    char *login_name, char *session, char *folder_name,
    char *lookup_before_drop_down_base_folder_name, char *role_name,
    char *state) {
  static char control_string[1024];
  char *use_folder_name;
  if (lookup_before_drop_down_base_folder_name)
    use_folder_name = lookup_before_drop_down_base_folder_name;
  else
    use_folder_name = folder_name;
  sprintf(control_string, "%s/post_choose_folder?%s+%s+%s+%s+%s+%s",
          appaserver_library_get_http_prompt(
              cgi_directory, server_address,
              application_ssl_support_yn(application_name),
              application_prepend_http_protocol_yn(application_name)),
          login_name, application_name, session, use_folder_name, role_name,
          state);
  return control_string;
}


x86 assembly (clang, -O0):
<appaserver_library_prelookup_button_control_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x0,0x10(%rbp)
je     1184 <appaserver_library_prelookup_button_control_string+0x44>
mov    0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    118c <appaserver_library_prelookup_button_control_string+0x4c>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <application_ssl_support_yn@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <application_prepend_http_protocol_yn@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x3c(%rbp),%edx
mov    %eax,%ecx
call   1030 <appaserver_library_get_http_prompt@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x38(%rbp),%r11
mov    0x18(%rbp),%r10
mov    0x20(%rbp),%rax
lea    0x2e6b(%rip),%rdi
lea    0xe14(%rip),%rsi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1060 <sprintf@plt>
lea    0x2e4a(%rip),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_library_prelookup_button_control_string>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%rbx
mov    %r8,0x20(%rsp)
mov    %rcx,%r15
mov    %rdx,%r13
mov    %rsi,%rbp
mov    %rdi,%r12
mov    0x60(%rsp),%rax
test   %rax,%rax
cmovne %rax,%rbx
call   1050 <application_ssl_support_yn@plt>
mov    %eax,%r14d
mov    %r12,%rdi
call   1040 <application_prepend_http_protocol_yn@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r14d,%edx
mov    %eax,%ecx
call   1030 <appaserver_library_get_http_prompt@plt>
movups 0x68(%rsp),%xmm0
movups %xmm0,0x8(%rsp)
mov    %rbx,(%rsp)
lea    0x2ead(%rip),%rbx
lea    0xe56(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
mov    %r15,%rcx
mov    %r12,%r8
mov    0x20(%rsp),%r9
call   1060 <sprintf@plt>
mov    %rbx,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@appaserver_library_prelookup_button_control_string.control_string = internal global [1024 x i8] zeroinitializer
@.str = [40 x i8] c"%s/post_choose_folder?%s+%s+%s+%s+%s+%s\00"
define i8* @appaserver_library_prelookup_button_control_string(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8) {
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
store i8* %0, i8** %10
store i8* %1, i8** %11
store i8* %2, i8** %12
store i8* %3, i8** %13
store i8* %4, i8** %14
store i8* %5, i8** %15
store i8* %6, i8** %16
store i8* %7, i8** %17
store i8* %8, i8** %18
%20 = load i8*, i8** %16
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %24
22: ; preds = %9
%23 = load i8*, i8** %16
store i8* %23, i8** %19
br label %26
24: ; preds = %9
%25 = load i8*, i8** %15
store i8* %25, i8** %19
br label %26
26: ; preds = %24, %22
%27 = load i8*, i8** %11
%28 = load i8*, i8** %12
%29 = load i8*, i8** %10
%30 = call i32 @application_ssl_support_yn(i8* %29)
%31 = load i8*, i8** %10
%32 = call i32 @application_prepend_http_protocol_yn(i8* %31)
%33 = call i8* @appaserver_library_get_http_prompt(i8* %27, i8* %28, i32 %30, i32 %32)
%34 = load i8*, i8** %13
%35 = load i8*, i8** %10
%36 = load i8*, i8** %14
%37 = load i8*, i8** %19
%38 = load i8*, i8** %17
%39 = load i8*, i8** %18
%40 = call i32 @sprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @appaserver_library_prelookup_button_control_string.control_string, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %33, i8* %34, i8* %35, i8* %36, i8* %37, i8* %38, i8* %39)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @appaserver_library_prelookup_button_control_string.control_string, i64 0, i64 0)
}

LLVM IR (-O2):
@appaserver_library_prelookup_button_control_string.control_string = internal global [1024 x i8] zeroinitializer
@.str = [40 x i8] c"%s/post_choose_folder?%s+%s+%s+%s+%s+%s\00"
define i8* @appaserver_library_prelookup_button_control_string(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8) {
%10 = icmp eq i8* %6, null
%11 = select i1 %10, i8* %5, i8* %6
%12 = tail call i32 @application_ssl_support_yn(i8* %0)
%13 = tail call i32 @application_prepend_http_protocol_yn(i8* %0)
%14 = tail call i8* @appaserver_library_get_http_prompt(i8* %1, i8* %2, i32 %12, i32 %13)
%15 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1024 x i8], [1024 x i8]* @appaserver_library_prelookup_button_control_string.control_string, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %3, i8* %0, i8* %4, i8* %11, i8* %7, i8* %8)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @appaserver_library_prelookup_button_control_string.control_string, i64 0, i64 0)
}