#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*/ sprintf(char *, char *, char *, ...);
char *appaserver_library_get_http_prompt(char *cgi_directory,
                                         char *server_address,
                                         char ssl_support_yn,
                                         char prepend_http_protocol_yn) {
  static char http_prompt[512];
  if (prepend_http_protocol_yn == 'y') {
    if (ssl_support_yn == 'y') {
      sprintf(http_prompt, "https://%s%s", server_address, cgi_directory);
    } else {
      sprintf(http_prompt, "http://%s%s", server_address, cgi_directory);
    }
  } else {
    sprintf(http_prompt, "%s", cgi_directory);
  }
  return http_prompt;
}


x86 assembly (clang, -O0):
<appaserver_library_get_http_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
movsbl -0x12(%rbp),%eax
cmp    $0x79,%eax
jne    1188 <appaserver_library_get_http_prompt+0x78>
movsbl -0x11(%rbp),%eax
cmp    $0x79,%eax
jne    1166 <appaserver_library_get_http_prompt+0x56>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0x2eed(%rip),%rdi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1183 <appaserver_library_get_http_prompt+0x73>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0x2ecb(%rip),%rdi
lea    0xe91(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    11a1 <appaserver_library_get_http_prompt+0x91>
mov    -0x8(%rbp),%rdx
lea    0x2ead(%rip),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2e98(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_library_get_http_prompt>:
push   %rax
mov    %rdi,%rax
cmp    $0x79,%cl
jne    1141 <appaserver_library_get_http_prompt+0x21>
mov    %rsi,%r8
lea    0x2f0d(%rip),%rdi
cmp    $0x79,%dl
jne    1152 <appaserver_library_get_http_prompt+0x32>
lea    0xec1(%rip),%rsi
jmp    1159 <appaserver_library_get_http_prompt+0x39>
lea    0x2ef8(%rip),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    1166 <appaserver_library_get_http_prompt+0x46>
lea    0xeb4(%rip),%rsi
mov    %r8,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0x2ed3(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@appaserver_library_get_http_prompt.http_prompt = internal global [512 x i8] zeroinitializer
@.str = [13 x i8] c"https://%s%s\00"
@.str.1 = [12 x i8] c"http://%s%s\00"
@.str.2 = [3 x i8] c"%s\00"
define i8* @appaserver_library_get_http_prompt(i8* %0, i8* %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 121
br i1 %11, label %12, label %25
12: ; preds = %4
%13 = load i8, i8* %7
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 121
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8*, i8** %6
%18 = load i8*, i8** %5
%19 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @appaserver_library_get_http_prompt.http_prompt, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %18)
br label %24
20: ; preds = %12
%21 = load i8*, i8** %6
%22 = load i8*, i8** %5
%23 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @appaserver_library_get_http_prompt.http_prompt, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %21, i8* %22)
br label %24
24: ; preds = %20, %16
br label %28
25: ; preds = %4
%26 = load i8*, i8** %5
%27 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @appaserver_library_get_http_prompt.http_prompt, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %25, %24
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @appaserver_library_get_http_prompt.http_prompt, i64 0, i64 0)
}

LLVM IR (-O2):
@appaserver_library_get_http_prompt.http_prompt = internal global [512 x i8] zeroinitializer
@.str = [13 x i8] c"https://%s%s\00"
@.str.1 = [12 x i8] c"http://%s%s\00"
define i8* @appaserver_library_get_http_prompt(i8* %0, i8* %1, i8 signext %2, i8 signext %3) {
%5 = icmp eq i8 %3, 121
br i1 %5, label %6, label %12
6: ; preds = %4
%7 = icmp eq i8 %2, 121
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([512 x i8], [512 x i8]* @appaserver_library_get_http_prompt.http_prompt, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
br label %14
10: ; preds = %6
%11 = tail call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([512 x i8], [512 x i8]* @appaserver_library_get_http_prompt.http_prompt, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %0)
br label %14
12: ; preds = %4
%13 = tail call i8* @strcpy(i8* dereferenceable(1) getelementptr inbounds ([512 x i8], [512 x i8]* @appaserver_library_get_http_prompt.http_prompt, i64 0, i64 0), i8* dereferenceable(1) %0)
br label %14
14: ; preds = %8, %10, %12
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @appaserver_library_get_http_prompt.http_prompt, i64 0, i64 0)
}