#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*/ add_makefile_entry_to_file(char *, char *, char *);
int /*<<< orphan*/ get_setting(char *, char *);
scalar_t__ is_library(char *);
scalar_t__ is_qt_project();
int /*<<< orphan*/ replace_build_script_version(char *, char *, char *);
int /*<<< orphan*/ save_makefile_as(char *);
int /*<<< orphan*/ save_makefile_c(char *);
int /*<<< orphan*/ save_makefile_cpp(char *);
int /*<<< orphan*/ save_makefile_install(char *, char *, int, char **, char *,
                                         char *, char *, char *, char *);
int /*<<< orphan*/ save_makefile_java(char *);
int /*<<< orphan*/ save_makefile_scala(char *);
int /*<<< orphan*/ save_makefile_uninstall(char *, char *, char *, int,
                                           char **);
int /*<<< orphan*/ save_makefile_vala(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
void save_makefile(int no_of_binaries, char **binaries) {
  char directory[512];
  char filename[512];
  char str[512];
  char svg_filename[512];
  char project_type[512];
  char project_version[512];
  char project_name[512];
  char compile_args[512];
  char commandline[512];
  char sourcedir[512];
  get_setting("directory", directory);
  get_setting("project type", project_type);
  get_setting("project name", project_name);
  get_setting("version", project_version);
  get_setting("compile", compile_args);
  get_setting("commandline", commandline);
  get_setting("source dir", sourcedir);
  sprintf(filename, "%s%cMakefile", directory, '/');
  save_makefile_as(filename);
  add_makefile_entry_to_file(filename, "source",
                             "tar -cvf ../${APP}_${VERSION}.orig.tar "
                             "../${APP}-${VERSION} --exclude-vcs");
  add_makefile_entry_to_file(filename, "source",
                             "gzip -f9n ../${APP}_${VERSION}.orig.tar");
  add_makefile_entry_to_file(filename, "sourcedeb",
                             "tar -cvf ../${APP}_${VERSION}.orig.tar "
                             "../${APP}-${VERSION} --exclude-vcs "
                             "--exclude 'debian'");
  add_makefile_entry_to_file(filename, "sourcedeb",
                             "gzip -f9n ../${APP}_${VERSION}.orig.tar");
  save_makefile_install(filename, "install", no_of_binaries, binaries,
                        project_name, project_type, commandline, directory,
                        svg_filename);
  save_makefile_uninstall(filename, project_name, commandline, no_of_binaries,
                          binaries);
  if (is_library(project_name) != 0) {
    save_makefile_install(filename, "instlib", no_of_binaries, binaries,
                          project_name, project_type, commandline, directory,
                          svg_filename);
  }
  save_makefile_c(filename);
  save_makefile_cpp(filename);
  save_makefile_vala(filename);
  save_makefile_scala(filename);
  save_makefile_java(filename);
  if (is_library(project_name) == 0) {
    sprintf(str,
            "%s ${APP} \\#* \\.#* gnuplot* "
            "*.png %s/*.substvars %s/*.log",
            "rm -f", "debian", "debian");
  } else {
    sprintf(str,
            "%s ${LIBNAME} \\#* \\.#* gnuplot* "
            "*.png %s/*.substvars %s/*.log",
            "rm -f", "debian", "debian");
  }
  add_makefile_entry_to_file(filename, "clean", str);
  sprintf(str, "%sr deb.* %s/${APP} %s/${ARCH_TYPE}", "rm -f", "debian",
          "rpmpackage");
  add_makefile_entry_to_file(filename, "clean", str);
  add_makefile_entry_to_file(filename, "clean",
                             "rm -f ../${APP}*.deb "
                             "../${APP}*.changes "
                             "../${APP}*.asc "
                             "../${APP}*.dsc");
  sprintf(str, "%s %s/*.src.rpm %s/*.gz %s/*.xz", "rm -f", "rpmpackage",
          "archpackage", "archpackage");
  add_makefile_entry_to_file(filename, "clean", str);
  sprintf(str, "%s %s/*.gz %s/*.pet %s/*.txz", "rm -f", "puppypackage",
          "puppypackage", "slackpackage");
  add_makefile_entry_to_file(filename, "clean", str);
  if (is_qt_project() != 0) {
    sprintf(str, "%sr ${GUI_DIR}", "rm -f");
    add_makefile_entry_to_file(filename, "clean", str);
  }
  replace_build_script_version(filename, project_name, project_version);
}


x86 assembly (clang, -O0):
<save_makefile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1430,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rsi
lea    0xe00(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0xa10(%rbp),%rsi
lea    0xdf7(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0xe10(%rbp),%rsi
lea    0xdf1(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0xc10(%rbp),%rsi
lea    0xdeb(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0x1010(%rbp),%rsi
lea    0xde0(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0x1210(%rbp),%rsi
lea    0xdd5(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0x1410(%rbp),%rsi
lea    0xdce(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0x410(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xdbf(%rip),%rsi
mov    $0x2f,%ecx
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1090 <save_makefile_as@plt>
lea    -0x410(%rbp),%rdi
lea    0xda6(%rip),%rsi
lea    0xda6(%rip),%rdx
call   10e0 <add_makefile_entry_to_file@plt>
lea    -0x410(%rbp),%rdi
lea    0xd8c(%rip),%rsi
lea    0xdd6(%rip),%rdx
call   10e0 <add_makefile_entry_to_file@plt>
lea    -0x410(%rbp),%rdi
lea    0xdeb(%rip),%rsi
lea    0xdee(%rip),%rdx
call   10e0 <add_makefile_entry_to_file@plt>
lea    -0x410(%rbp),%rdi
lea    0xdd1(%rip),%rsi
lea    0xda2(%rip),%rdx
call   10e0 <add_makefile_entry_to_file@plt>
lea    -0x410(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    -0xe10(%rbp),%r8
lea    -0xa10(%rbp),%r9
lea    -0x1210(%rbp),%r11
lea    -0x210(%rbp),%r10
lea    -0x810(%rbp),%rax
lea    0xdf4(%rip),%rsi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <save_makefile_install@plt>
lea    -0x410(%rbp),%rdi
lea    -0xe10(%rbp),%rsi
lea    -0x1210(%rbp),%rdx
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
call   10b0 <save_makefile_uninstall@plt>
lea    -0xe10(%rbp),%rdi
call   1060 <is_library@plt>
cmp    $0x0,%rax
je     13d9 <save_makefile+0x1f9>
lea    -0x410(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    -0xe10(%rbp),%r8
lea    -0xa10(%rbp),%r9
lea    -0x1210(%rbp),%r11
lea    -0x210(%rbp),%r10
lea    -0x810(%rbp),%rax
lea    0xd7a(%rip),%rsi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <save_makefile_install@plt>
lea    -0x410(%rbp),%rdi
call   1070 <save_makefile_c@plt>
lea    -0x410(%rbp),%rdi
call   1080 <save_makefile_cpp@plt>
lea    -0x410(%rbp),%rdi
call   10a0 <save_makefile_vala@plt>
lea    -0x410(%rbp),%rdi
call   1100 <save_makefile_scala@plt>
lea    -0x410(%rbp),%rdi
call   10c0 <save_makefile_java@plt>
lea    -0xe10(%rbp),%rdi
call   1060 <is_library@plt>
cmp    $0x0,%rax
jne    1456 <save_makefile+0x276>
lea    -0x610(%rbp),%rdi
lea    0xd0f(%rip),%rsi
lea    0xd42(%rip),%rdx
lea    0xd41(%rip),%r8
mov    %r8,%rcx
mov    $0x0,%al
call   10d0 <sprintf@plt>
jmp    147c <save_makefile+0x29c>
lea    -0x610(%rbp),%rdi
lea    0xd2b(%rip),%rsi
lea    0xd17(%rip),%rdx
lea    0xd16(%rip),%r8
mov    %r8,%rcx
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x610(%rbp),%rdx
lea    0xd3c(%rip),%rsi
call   10e0 <add_makefile_entry_to_file@plt>
lea    -0x610(%rbp),%rdi
lea    0xd2f(%rip),%rsi
lea    0xcd7(%rip),%rdx
lea    0xcd6(%rip),%rcx
lea    0xd3e(%rip),%r8
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x610(%rbp),%rdx
lea    0xcf8(%rip),%rsi
call   10e0 <add_makefile_entry_to_file@plt>
lea    -0x410(%rbp),%rdi
lea    0xce5(%rip),%rsi
lea    0xd13(%rip),%rdx
call   10e0 <add_makefile_entry_to_file@plt>
lea    -0x610(%rbp),%rdi
lea    0xd46(%rip),%rsi
lea    0xc79(%rip),%rdx
lea    0xce7(%rip),%rcx
lea    0xd51(%rip),%r9
mov    %r9,%r8
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x610(%rbp),%rdx
lea    0xc97(%rip),%rsi
call   10e0 <add_makefile_entry_to_file@plt>
lea    -0x610(%rbp),%rdi
lea    0xd2b(%rip),%rsi
lea    0xc32(%rip),%rdx
lea    0xd3a(%rip),%r8
lea    0xd40(%rip),%r9
mov    %r8,%rcx
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x610(%rbp),%rdx
lea    0xc50(%rip),%rsi
call   10e0 <add_makefile_entry_to_file@plt>
mov    $0x0,%al
call   1030 <is_qt_project@plt>
cmp    $0x0,%rax
je     15c9 <save_makefile+0x3e9>
lea    -0x610(%rbp),%rdi
lea    0xd0a(%rip),%rsi
lea    0xbda(%rip),%rdx
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x610(%rbp),%rdx
lea    0xc09(%rip),%rsi
call   10e0 <add_makefile_entry_to_file@plt>
lea    -0x410(%rbp),%rdi
lea    -0xe10(%rbp),%rsi
lea    -0xc10(%rbp),%rdx
call   10f0 <replace_build_script_version@plt>
add    $0x1430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_makefile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1418,%rsp
mov    %rsi,0x8(%rsp)
mov    %edi,%ebp
lea    0xe01(%rip),%rdi
lea    0xe10(%rsp),%r12
mov    %r12,%rsi
call   1050 <get_setting@plt>
lea    0xdf4(%rip),%rdi
lea    0x410(%rsp),%rsi
call   1050 <get_setting@plt>
lea    0xded(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <get_setting@plt>
lea    0xde9(%rip),%rdi
lea    0x810(%rsp),%rsi
call   1050 <get_setting@plt>
lea    0xddd(%rip),%rdi
lea    0x1210(%rsp),%rsi
call   1050 <get_setting@plt>
lea    0xdd1(%rip),%rdi
lea    0x610(%rsp),%rsi
call   1050 <get_setting@plt>
lea    0xdc9(%rip),%rdi
lea    0x1010(%rsp),%rsi
call   1050 <get_setting@plt>
lea    0xdc0(%rip),%rsi
lea    0x210(%rsp),%r13
mov    %r13,%rdi
mov    %r12,%rdx
mov    $0x2f,%ecx
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %r13,%rdi
call   1090 <save_makefile_as@plt>
lea    0xda4(%rip),%r14
lea    0xda4(%rip),%rdx
mov    %r13,%rdi
mov    %r14,%rsi
call   10e0 <add_makefile_entry_to_file@plt>
lea    0xddc(%rip),%r15
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   10e0 <add_makefile_entry_to_file@plt>
lea    0xdef(%rip),%rbx
lea    0xdf2(%rip),%rdx
mov    %r13,%rdi
mov    %rbx,%rsi
call   10e0 <add_makefile_entry_to_file@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
lea    0x610(%rsp),%r15
call   10e0 <add_makefile_entry_to_file@plt>
sub    $0x8,%rsp
lea    0xa18(%rsp),%rax
lea    0xe1b(%rip),%rsi
mov    %r13,%rdi
mov    %ebp,%ebx
mov    %ebp,%edx
mov    0x10(%rsp),%rbp
mov    %rbp,%rcx
lea    0x18(%rsp),%r14
mov    %r14,%r8
lea    0x418(%rsp),%r9
push   %rax
push   %r12
push   %r15
call   1040 <save_makefile_install@plt>
add    $0x20,%rsp
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
mov    %rbp,%r8
call   10b0 <save_makefile_uninstall@plt>
mov    %r14,%rdi
call   1060 <is_library@plt>
test   %rax,%rax
je     13ac <save_makefile+0x1cc>
sub    $0x8,%rsp
lea    0xdcb(%rip),%rsi
lea    0x218(%rsp),%rdi
lea    0x18(%rsp),%r8
lea    0x418(%rsp),%r9
mov    %ebx,%edx
mov    %rbp,%rcx
lea    0xa18(%rsp),%rax
push   %rax
lea    0xe20(%rsp),%rax
push   %rax
push   %r15
call   1040 <save_makefile_install@plt>
add    $0x20,%rsp
lea    0x210(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <save_makefile_c@plt>
mov    %rbx,%rdi
call   1080 <save_makefile_cpp@plt>
mov    %rbx,%rdi
call   10a0 <save_makefile_vala@plt>
mov    %rbx,%rdi
call   1100 <save_makefile_scala@plt>
mov    %rbx,%rdi
call   10c0 <save_makefile_java@plt>
lea    0x10(%rsp),%rdi
call   1060 <is_library@plt>
test   %rax,%rax
lea    0xd58(%rip),%rax
lea    0xd98(%rip),%rsi
cmove  %rax,%rsi
lea    0xd80(%rip),%r14
lea    0xd7f(%rip),%r12
lea    0xc10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %r12,%r8
xor    %eax,%eax
call   10d0 <sprintf@plt>
lea    0xda2(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   10e0 <add_makefile_entry_to_file@plt>
lea    0xd93(%rip),%rsi
lea    0xdb0(%rip),%r13
mov    %rbp,%rdi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %r13,%r8
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   10e0 <add_makefile_entry_to_file@plt>
lea    0xd93(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   10e0 <add_makefile_entry_to_file@plt>
lea    0xdc7(%rip),%rsi
lea    0xde0(%rip),%r8
mov    %rbp,%rdi
mov    %r14,%rdx
mov    %r13,%rcx
mov    %r8,%r9
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   10e0 <add_makefile_entry_to_file@plt>
lea    0xdc4(%rip),%rsi
lea    0xdda(%rip),%rcx
lea    0xde0(%rip),%r9
mov    %rbp,%rdi
mov    %r14,%rdx
mov    %rcx,%r8
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   10e0 <add_makefile_entry_to_file@plt>
xor    %eax,%eax
call   1030 <is_qt_project@plt>
test   %rax,%rax
je     151f <save_makefile+0x33f>
lea    0xdbc(%rip),%rsi
lea    0xc8c(%rip),%rdx
lea    0xc10(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   10d0 <sprintf@plt>
lea    0xcbe(%rip),%rsi
lea    0x210(%rsp),%rdi
mov    %rbx,%rdx
call   10e0 <add_makefile_entry_to_file@plt>
lea    0x210(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x810(%rsp),%rdx
call   10f0 <replace_build_script_version@plt>
add    $0x1418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"directory\00"
@.str.1 = [13 x i8] c"project type\00"
@.str.2 = [13 x i8] c"project name\00"
@.str.3 = [8 x i8] c"version\00"
@.str.4 = [8 x i8] c"compile\00"
@.str.5 = [12 x i8] c"commandline\00"
@.str.6 = [11 x i8] c"source dir\00"
@.str.7 = [13 x i8] c"%s%cMakefile\00"
@.str.8 = [7 x i8] c"source\00"
@.str.9 = [74 x i8] c"tar -cvf ../${APP}_${VERSION}.orig.tar ../${APP}-${VERSION} --exclude-vcs\00"
@.str.10 = [40 x i8] c"gzip -f9n ../${APP}_${VERSION}.orig.tar\00"
@.str.11 = [10 x i8] c"sourcedeb\00"
@.str.12 = [93 x i8] c"tar -cvf ../${APP}_${VERSION}.orig.tar ../${APP}-${VERSION} --exclude-vcs --exclude 'debian'\00"
@.str.13 = [8 x i8] c"install\00"
@.str.14 = [8 x i8] c"instlib\00"
@.str.15 = [58 x i8] c"%s ${APP} \\#* \\.#* gnuplot* *.png %s/*.substvars %s/*.log\00"
@.str.16 = [6 x i8] c"rm -f\00"
@.str.17 = [7 x i8] c"debian\00"
@.str.18 = [62 x i8] c"%s ${LIBNAME} \\#* \\.#* gnuplot* *.png %s/*.substvars %s/*.log\00"
@.str.19 = [6 x i8] c"clean\00"
@.str.20 = [36 x i8] c"%sr deb.* %s/${APP} %s/${ARCH_TYPE}\00"
@.str.21 = [11 x i8] c"rpmpackage\00"
@.str.22 = [70 x i8] c"rm -f ../${APP}*.deb ../${APP}*.changes ../${APP}*.asc ../${APP}*.dsc\00"
@.str.23 = [32 x i8] c"%s %s/*.src.rpm %s/*.gz %s/*.xz\00"
@.str.24 = [12 x i8] c"archpackage\00"
@.str.25 = [29 x i8] c"%s %s/*.gz %s/*.pet %s/*.txz\00"
@.str.26 = [13 x i8] c"puppypackage\00"
@.str.27 = [13 x i8] c"slackpackage\00"
@.str.28 = [15 x i8] c"%sr ${GUI_DIR}\00"
define void @save_makefile(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [512 x i8]
%6 = alloca [512 x i8]
%7 = alloca [512 x i8]
%8 = alloca [512 x i8]
%9 = alloca [512 x i8]
%10 = alloca [512 x i8]
%11 = alloca [512 x i8]
%12 = alloca [512 x i8]
%13 = alloca [512 x i8]
%14 = alloca [512 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%16 = call i32 @get_setting(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%18 = call i32 @get_setting(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%20 = call i32 @get_setting(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%22 = call i32 @get_setting(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%24 = call i32 @get_setting(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%26 = call i32 @get_setting(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
%28 = call i32 @get_setting(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%30 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%31 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %29, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %30, i32 47)
%32 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%33 = call i32 @save_makefile_as(i8* %32)
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%35 = call i32 @add_makefile_entry_to_file(i8* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.9, i64 0, i64 0))
%36 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%37 = call i32 @add_makefile_entry_to_file(i8* %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0))
%38 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%39 = call i32 @add_makefile_entry_to_file(i8* %38, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.12, i64 0, i64 0))
%40 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%41 = call i32 @add_makefile_entry_to_file(i8* %40, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0))
%42 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%43 = load i32, i32* %3
%44 = load i8**, i8*** %4
%45 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%46 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%47 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%48 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%50 = call i32 @save_makefile_install(i8* %42, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 %43, i8** %44, i8* %45, i8* %46, i8* %47, i8* %48, i8* %49)
%51 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%52 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%53 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%54 = load i32, i32* %3
%55 = load i8**, i8*** %4
%56 = call i32 @save_makefile_uninstall(i8* %51, i8* %52, i8* %53, i32 %54, i8** %55)
%57 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%58 = call i64 @is_library(i8* %57)
%59 = icmp ne i64 %58, 0
br i1 %59, label %60, label %70
60: ; preds = %2
%61 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%62 = load i32, i32* %3
%63 = load i8**, i8*** %4
%64 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%65 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%66 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%67 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%68 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%69 = call i32 @save_makefile_install(i8* %61, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %62, i8** %63, i8* %64, i8* %65, i8* %66, i8* %67, i8* %68)
br label %70
70: ; preds = %60, %2
%71 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%72 = call i32 @save_makefile_c(i8* %71)
%73 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%74 = call i32 @save_makefile_cpp(i8* %73)
%75 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%76 = call i32 @save_makefile_vala(i8* %75)
%77 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%78 = call i32 @save_makefile_scala(i8* %77)
%79 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%80 = call i32 @save_makefile_java(i8* %79)
%81 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%82 = call i64 @is_library(i8* %81)
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %70
%85 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%86 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %85, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
br label %90
87: ; preds = %70
%88 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%89 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %88, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
br label %90
90: ; preds = %87, %84
%91 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%92 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%93 = call i32 @add_makefile_entry_to_file(i8* %91, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %92)
%94 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%95 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %94, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0))
%96 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%97 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%98 = call i32 @add_makefile_entry_to_file(i8* %96, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %97)
%99 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%100 = call i32 @add_makefile_entry_to_file(i8* %99, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.22, i64 0, i64 0))
%101 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%102 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %101, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.24, i64 0, i64 0))
%103 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%104 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%105 = call i32 @add_makefile_entry_to_file(i8* %103, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %104)
%106 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%107 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %106, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.27, i64 0, i64 0))
%108 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%109 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%110 = call i32 @add_makefile_entry_to_file(i8* %108, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %109)
%111 = call i64 (...) @is_qt_project()
%112 = icmp ne i64 %111, 0
br i1 %112, label %113, label %119
113: ; preds = %90
%114 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%115 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %114, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%116 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%117 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%118 = call i32 @add_makefile_entry_to_file(i8* %116, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %117)
br label %119
119: ; preds = %113, %90
%120 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%121 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%122 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%123 = call i32 @replace_build_script_version(i8* %120, i8* %121, i8* %122)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"directory\00"
@.str.1 = [13 x i8] c"project type\00"
@.str.2 = [13 x i8] c"project name\00"
@.str.3 = [8 x i8] c"version\00"
@.str.4 = [8 x i8] c"compile\00"
@.str.5 = [12 x i8] c"commandline\00"
@.str.6 = [11 x i8] c"source dir\00"
@.str.7 = [13 x i8] c"%s%cMakefile\00"
@.str.8 = [7 x i8] c"source\00"
@.str.9 = [74 x i8] c"tar -cvf ../${APP}_${VERSION}.orig.tar ../${APP}-${VERSION} --exclude-vcs\00"
@.str.10 = [40 x i8] c"gzip -f9n ../${APP}_${VERSION}.orig.tar\00"
@.str.11 = [10 x i8] c"sourcedeb\00"
@.str.12 = [93 x i8] c"tar -cvf ../${APP}_${VERSION}.orig.tar ../${APP}-${VERSION} --exclude-vcs --exclude 'debian'\00"
@.str.13 = [8 x i8] c"install\00"
@.str.14 = [8 x i8] c"instlib\00"
@.str.15 = [58 x i8] c"%s ${APP} \\#* \\.#* gnuplot* *.png %s/*.substvars %s/*.log\00"
@.str.16 = [6 x i8] c"rm -f\00"
@.str.17 = [7 x i8] c"debian\00"
@.str.18 = [62 x i8] c"%s ${LIBNAME} \\#* \\.#* gnuplot* *.png %s/*.substvars %s/*.log\00"
@.str.19 = [6 x i8] c"clean\00"
@.str.20 = [36 x i8] c"%sr deb.* %s/${APP} %s/${ARCH_TYPE}\00"
@.str.21 = [11 x i8] c"rpmpackage\00"
@.str.22 = [70 x i8] c"rm -f ../${APP}*.deb ../${APP}*.changes ../${APP}*.asc ../${APP}*.dsc\00"
@.str.23 = [32 x i8] c"%s %s/*.src.rpm %s/*.gz %s/*.xz\00"
@.str.24 = [12 x i8] c"archpackage\00"
@.str.25 = [29 x i8] c"%s %s/*.gz %s/*.pet %s/*.txz\00"
@.str.26 = [13 x i8] c"puppypackage\00"
@.str.27 = [13 x i8] c"slackpackage\00"
@.str.28 = [15 x i8] c"%sr ${GUI_DIR}\00"
define void @save_makefile(i32 %0, i8** %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = alloca [512 x i8]
%6 = alloca [512 x i8]
%7 = alloca [512 x i8]
%8 = alloca [512 x i8]
%9 = alloca [512 x i8]
%10 = alloca [512 x i8]
%11 = alloca [512 x i8]
%12 = alloca [512 x i8]
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%21 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%23 = call i32 @get_setting(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %13)
%24 = call i32 @get_setting(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%25 = call i32 @get_setting(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%26 = call i32 @get_setting(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%27 = call i32 @get_setting(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %20)
%28 = call i32 @get_setting(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %21)
%29 = call i32 @get_setting(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %22)
%30 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %13, i32 47)
%31 = call i32 @save_makefile_as(i8* %14)
%32 = call i32 @add_makefile_entry_to_file(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.9, i64 0, i64 0))
%33 = call i32 @add_makefile_entry_to_file(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0))
%34 = call i32 @add_makefile_entry_to_file(i8* %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.12, i64 0, i64 0))
%35 = call i32 @add_makefile_entry_to_file(i8* %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0))
%36 = call i32 @save_makefile_install(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 %0, i8** %1, i8* %19, i8* %17, i8* %21, i8* %13, i8* %16)
%37 = call i32 @save_makefile_uninstall(i8* %14, i8* %19, i8* %21, i32 %0, i8** %1)
%38 = call i64 @is_library(i8* %19)
%39 = icmp eq i64 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %2
%41 = call i32 @save_makefile_install(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %0, i8** %1, i8* %19, i8* %17, i8* %21, i8* %13, i8* %16)
br label %42
42: ; preds = %40, %2
%43 = call i32 @save_makefile_c(i8* %14)
%44 = call i32 @save_makefile_cpp(i8* %14)
%45 = call i32 @save_makefile_vala(i8* %14)
%46 = call i32 @save_makefile_scala(i8* %14)
%47 = call i32 @save_makefile_java(i8* %14)
%48 = call i64 @is_library(i8* %19)
%49 = icmp eq i64 %48, 0
%50 = select i1 %49, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.18, i64 0, i64 0)
%51 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
%52 = call i32 @add_makefile_entry_to_file(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %15)
%53 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0))
%54 = call i32 @add_makefile_entry_to_file(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %15)
%55 = call i32 @add_makefile_entry_to_file(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.22, i64 0, i64 0))
%56 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.24, i64 0, i64 0))
%57 = call i32 @add_makefile_entry_to_file(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %15)
%58 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.27, i64 0, i64 0))
%59 = call i32 @add_makefile_entry_to_file(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %15)
%60 = call i64 (...) @is_qt_project()
%61 = icmp eq i64 %60, 0
br i1 %61, label %65, label %62
62: ; preds = %42
%63 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%64 = call i32 @add_makefile_entry_to_file(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %15)
br label %65
65: ; preds = %62, %42
%66 = call i32 @replace_build_script_version(i8* %14, i8* %19, i8* %18)
ret void
}