#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 *create_clone_filename_get_directory_name(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *strdup(char *);
char *create_clone_filename_get_create_application_filename(
    char **directory_name, char *application_name,
    char *appaserver_data_directory, char system_folders_yn) {
  char buffer[1024];
  *directory_name = create_clone_filename_get_directory_name(
      appaserver_data_directory, *directory_name);
  if (system_folders_yn == 'y') {
    sprintf(buffer, "%s/create_%s_appaserver.sh", *directory_name,
            application_name);
  } else {
    sprintf(buffer, "%s/create_%s.sh", *directory_name, application_name);
  }
  return strdup(buffer);
}


x86 assembly (clang, -O0):
<create_clone_filename_get_create_application_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
call   1030 <create_clone_filename_get_directory_name@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
movsbl -0x19(%rbp),%eax
cmp    $0x79,%eax
jne    1196 <create_clone_filename_get_create_application_filename+0x66>
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe74(%rip),%rsi
call   1040 <sprintf@plt>
jmp    11b4 <create_clone_filename_get_create_application_filename+0x84>
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe6c(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x420(%rbp),%rdi
call   1050 <strdup@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_clone_filename_get_create_application_filename>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %ecx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rsi
mov    %rdx,%rdi
call   1030 <create_clone_filename_get_directory_name@plt>
mov    %rax,(%rbx)
cmp    $0x79,%bpl
lea    0xea4(%rip),%rcx
lea    0xeb8(%rip),%rsi
cmove  %rcx,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rdx
mov    %r14,%rcx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%s/create_%s_appaserver.sh\00"
@.str.1 = [16 x i8] c"%s/create_%s.sh\00"
define i8* @create_clone_filename_get_create_application_filename(i8** %0, i8* %1, i8* %2, i8 signext %3) {
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8
%9 = alloca [1024 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** %7
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = call i8* @create_clone_filename_get_directory_name(i8* %10, i8* %12)
%14 = load i8**, i8*** %5
store i8* %13, i8** %14
%15 = load i8, i8* %8
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 121
br i1 %17, label %18, label %24
18: ; preds = %4
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%20 = load i8**, i8*** %5
%21 = load i8*, i8** %20
%22 = load i8*, i8** %6
%23 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %21, i8* %22)
br label %30
24: ; preds = %4
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%26 = load i8**, i8*** %5
%27 = load i8*, i8** %26
%28 = load i8*, i8** %6
%29 = call i32 @sprintf(i8* %25, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %27, i8* %28)
br label %30
30: ; preds = %24, %18
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%32 = call i8* @strdup(i8* %31)
ret i8* %32
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s/create_%s_appaserver.sh\00"
@.str.1 = [16 x i8] c"%s/create_%s.sh\00"
define noalias i8* @create_clone_filename_get_create_application_filename(i8** nocapture %0, i8* %1, i8* %2, i8 signext %3) {
%5 = alloca [1024 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %0
%8 = tail call i8* @create_clone_filename_get_directory_name(i8* %2, i8* %7)
store i8* %8, i8** %0
%9 = icmp eq i8 %3, 121
%10 = select i1 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0)
%11 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) %10, i8* %8, i8* %1)
%12 = call i8* @strdup(i8* %6)
ret i8* %12
}