#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 *format_initial_capital_cr(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
char *strdup(char *);
char *pair_folder_button_string(char *many_folder_name,
                                char *keystrokes_save_function,
                                char *pair_folder_onclick_function) {
  char folder_button_string[2048];
  char buffer[128];
  sprintf(folder_button_string,
          "<button onClick=\"%s %s document.forms[0].submit();\">"
          "%s</button>\n",
          keystrokes_save_function, pair_folder_onclick_function,
          format_initial_capital_cr(buffer, many_folder_name));
  return strdup(folder_button_string);
}


x86 assembly (clang, -O0):
<pair_folder_button_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8c0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x820(%rbp),%rax
mov    %rax,-0x8b8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8b0(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8a8(%rbp)
lea    -0x8a0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <format_initial_capital_cr@plt>
mov    -0x8b8(%rbp),%rdi
mov    -0x8b0(%rbp),%rdx
mov    -0x8a8(%rbp),%rcx
mov    %rax,%r8
lea    0xe66(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x820(%rbp),%rdi
call   1050 <strdup@plt>
add    $0x8c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_folder_button_string>:
push   %r15
push   %r14
push   %rbx
sub    $0x880,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <format_initial_capital_cr@plt>
lea    0xeac(%rip),%rsi
lea    0x80(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %rax,%r8
call   1040 <sprintf@plt>
mov    %r15,%rdi
call   1050 <strdup@plt>
add    $0x880,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [65 x i8] c"<button onClick=\22%s %s document.forms[0].submit();\22>%s</button>\0A\00"
define i8* @pair_folder_button_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [2048 x i8]
%8 = alloca [128 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%13 = load i8*, i8** %4
%14 = call i8* @format_initial_capital_cr(i8* %12, i8* %13)
%15 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %14)
%16 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%17 = call i8* @strdup(i8* %16)
ret i8* %17
}

LLVM IR (-O2):
@.str = [65 x i8] c"<button onClick=\22%s %s document.forms[0].submit();\22>%s</button>\0A\00"
define noalias i8* @pair_folder_button_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca [2048 x i8]
%5 = alloca [128 x i8]
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%8 = call i8* @format_initial_capital_cr(i8* %7, i8* %0)
%9 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %8)
%10 = call i8* @strdup(i8* %6)
ret i8* %10
}