#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*/ printf(char *, char *, char *, char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void appaserver_library_output_ftp_prompt(char *output_filename, char *prompt,
                                          char *target, char *mime_type) {
  char mime_type_prompt[128];
  if (mime_type && *mime_type) {
    sprintf(mime_type_prompt, "type=\"%s\"", mime_type);
  } else {
    *mime_type_prompt = '\0';
  }
  if (target && *target) {
    printf("<br><a %s href=\"%s\" target=\"%s\">%s</a>\n", mime_type_prompt,
           output_filename, target, prompt);
  } else {
    printf("<br><a %s href=\"%s\">%s</a>\n", mime_type_prompt, output_filename,
           prompt);
  }
}


x86 assembly (clang, -O0):
<appaserver_library_output_ftp_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1172 <appaserver_library_output_ftp_prompt+0x52>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1172 <appaserver_library_output_ftp_prompt+0x52>
lea    -0xa0(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1179 <appaserver_library_output_ftp_prompt+0x59>
movb   $0x0,-0xa0(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11ba <appaserver_library_output_ftp_prompt+0x9a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11ba <appaserver_library_output_ftp_prompt+0x9a>
lea    -0xa0(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d7 <appaserver_library_output_ftp_prompt+0xb7>
lea    -0xa0(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_library_output_ftp_prompt>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
test   %rcx,%rcx
je     1158 <appaserver_library_output_ftp_prompt+0x38>
cmpb   $0x0,(%rcx)
je     1158 <appaserver_library_output_ftp_prompt+0x38>
lea    0xeba(%rip),%rsi
mov    %rsp,%rdi
mov    %rcx,%rdx
call   1040 <sprintf@plt>
test   %rbx,%rbx
jne    1161 <appaserver_library_output_ftp_prompt+0x41>
jmp    1182 <appaserver_library_output_ftp_prompt+0x62>
movb   $0x0,(%rsp)
test   %rbx,%rbx
je     1182 <appaserver_library_output_ftp_prompt+0x62>
cmpb   $0x0,(%rbx)
je     1182 <appaserver_library_output_ftp_prompt+0x62>
lea    0xe9d(%rip),%rdi
mov    %rsp,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1199 <appaserver_library_output_ftp_prompt+0x79>
lea    0xea9(%rip),%rdi
mov    %rsp,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"type=\22%s\22\00"
@.str.1 = [40 x i8] c"<br><a %s href=\22%s\22 target=\22%s\22>%s</a>\0A\00"
@.str.2 = [28 x i8] c"<br><a %s href=\22%s\22>%s</a>\0A\00"
define void @appaserver_library_output_ftp_prompt(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [128 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i8*, i8** %8
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%19 = load i8*, i8** %8
%20 = call i32 @sprintf(i8* %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %19)
br label %23
21: ; preds = %12, %4
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
store i8 0, i8* %22
br label %23
23: ; preds = %21, %17
%24 = load i8*, i8** %7
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %37
26: ; preds = %23
%27 = load i8*, i8** %7
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %37
31: ; preds = %26
%32 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%33 = load i8*, i8** %5
%34 = load i8*, i8** %7
%35 = load i8*, i8** %6
%36 = call i32 (i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %32, i8* %33, i8* %34, i8* %35)
br label %42
37: ; preds = %26, %23
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%39 = load i8*, i8** %5
%40 = load i8*, i8** %6
%41 = call i32 (i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %38, i8* %39, i8* %40)
br label %42
42: ; preds = %37, %31
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"type=\22%s\22\00"
@.str.1 = [40 x i8] c"<br><a %s href=\22%s\22 target=\22%s\22>%s</a>\0A\00"
@.str.2 = [28 x i8] c"<br><a %s href=\22%s\22>%s</a>\0A\00"
define void @appaserver_library_output_ftp_prompt(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [128 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = icmp eq i8* %3, null
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %14
13: ; preds = %8, %4
store i8 0, i8* %6
br label %14
14: ; preds = %13, %11
%15 = icmp eq i8* %2, null
br i1 %15, label %21, label %16
16: ; preds = %14
%17 = load i8, i8* %2
%18 = icmp eq i8 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = call i32 (i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %0, i8* %2, i8* %1)
br label %23
21: ; preds = %16, %14
%22 = call i32 (i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %0, i8* %1)
br label %23
23: ; preds = %21, %19
ret void
}