#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 *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strdup(char *);
char *attribute_list_sys_string(char *folder_name) {
  char sys_string[1024];
  if (folder_name && *folder_name) {
    sprintf(sys_string, "folder_attribute_list.sh %s", folder_name);
  } else {
    strcpy(sys_string, "folder_attribute_list.sh");
  }
  return strdup(sys_string);
}


x86 assembly (clang, -O0):
<attribute_list_sys_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1176 <attribute_list_sys_string+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1176 <attribute_list_sys_string+0x46>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1189 <attribute_list_sys_string+0x59>
lea    -0x410(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x410(%rbp),%rdi
call   1050 <strdup@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attribute_list_sys_string>:
sub    $0x408,%rsp
test   %rdi,%rdi
je     1155 <attribute_list_sys_string+0x25>
mov    %rdi,%rdx
cmpb   $0x0,(%rdi)
je     1155 <attribute_list_sys_string+0x25>
lea    0xeb5(%rip),%rsi
mov    %rsp,%rdi
call   1040 <sprintf@plt>
jmp    1164 <attribute_list_sys_string+0x34>
lea    0xec0(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
mov    %rsp,%rdi
call   1050 <strdup@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"folder_attribute_list.sh %s\00"
@.str.1 = [25 x i8] c"folder_attribute_list.sh\00"
define i8* @attribute_list_sys_string(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%13 = load i8*, i8** %2
%14 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %18
15: ; preds = %6, %1
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %11
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%20 = call i8* @strdup(i8* %19)
ret i8* %20
}

LLVM IR (-O2):
@.str = [28 x i8] c"folder_attribute_list.sh %s\00"
@.str.1 = [25 x i8] c"folder_attribute_list.sh\00"
define noalias i8* @attribute_list_sys_string(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %12
10: ; preds = %5, %1
%11 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = call i8* @strdup(i8* %3)
ret i8* %13
}