#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 empty_makefile_section(char *, char *);
int /*<<< orphan*/ get_setting(char *, char *);
scalar_t__ is_library(char *);
scalar_t__ is_qt_project();
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
scalar_t__ strcmp(char *, char *);
void save_makefile_cpp(char *filename) {
  char str[512];
  char c_standard[512];
  char project_type[512];
  char project_name[512];
  char compile_args[512];
  char sourcedir[512];
  get_setting("project name", project_name);
  get_setting("project type", project_type);
  get_setting("c standard", c_standard);
  if (strcmp(c_standard, "gnu99") == 0) {
    sprintf(c_standard, "%s", "c++11");
  }
  get_setting("compile", compile_args);
  get_setting("source dir", sourcedir);
  if ((strcmp(project_type, "c++") == 0) ||
      (strcmp(project_type, "C++") == 0) ||
      (strcmp(project_type, "cpp") == 0) ||
      (strcmp(project_type, "CPP") == 0)) {
    if (is_library(project_name) == 0) {
      if (is_qt_project() != 0) {
        sprintf(str, "%s",
                "qmake ${CURDIR}/src/${APP}.pro -o "
                "${GUI_DIR}/Makefile");
        add_makefile_entry_to_file(filename, "all", str);
        add_makefile_entry_to_file(filename, "debug", str);
        sprintf(str, "%s", "$(MAKE) -C $(GUI_DIR)");
        add_makefile_entry_to_file(filename, "all", str);
        sprintf(str, "%s", "$(MAKE) -C $(GUI_DIR)/ debug");
        add_makefile_entry_to_file(filename, "debug", str);
      } else {
        if (empty_makefile_section(filename, "all") == 1) {
          sprintf(str,
                  "g++ -Wall -pedantic -O3 -std=%s "
                  "-o ${APP} %s/*.cpp -I%s %s",
                  c_standard, sourcedir, sourcedir, compile_args);
          add_makefile_entry_to_file(filename, "all", str);
        }
        if (empty_makefile_section(filename, "debug") == 1) {
          sprintf(str,
                  "g++ -Wall -pedantic -g -std=%s "
                  "-o ${APP} %s/*.cpp -I%s %s",
                  c_standard, sourcedir, sourcedir, compile_args);
          add_makefile_entry_to_file(filename, "debug", str);
        }
      }
    } else {
      if (empty_makefile_section(filename, "all") == 1) {
        sprintf(str,
                "g++ -shared -Wl,-soname,${SONAME} "
                "-pedantic -fPIC -O3 -std=%s "
                "-o ${LIBNAME} %s/*.cpp -I%s %s",
                c_standard, sourcedir, sourcedir, compile_args);
        add_makefile_entry_to_file(filename, "all", str);
      }
      if (empty_makefile_section(filename, "debug") == 1) {
        sprintf(str,
                "g++ -shared -Wl,-soname,${SONAME} "
                "-pedantic -fPIC -g -std=%s "
                "-o ${LIBNAME} %s/*.cpp -I%s %s",
                c_standard, sourcedir, sourcedir, compile_args);
        add_makefile_entry_to_file(filename, "debug", str);
      }
    }
  }
}


x86 assembly (clang, -O0):
<save_makefile_cpp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x810(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0x610(%rbp),%rsi
lea    0xe6d(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0x410(%rbp),%rsi
lea    0xe67(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0x410(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f1 <save_makefile_cpp+0x81>
lea    -0x410(%rbp),%rdi
lea    0xfad(%rip),%rsi
lea    0xe41(%rip),%rdx
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0xa10(%rbp),%rsi
lea    0xe32(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0xc10(%rbp),%rsi
lea    0xe27(%rip),%rdi
call   1050 <get_setting@plt>
lea    -0x610(%rbp),%rdi
lea    0xe1f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     128b <save_makefile_cpp+0x11b>
lea    -0x610(%rbp),%rdi
lea    0xe06(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     128b <save_makefile_cpp+0x11b>
lea    -0x610(%rbp),%rdi
lea    0xded(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     128b <save_makefile_cpp+0x11b>
lea    -0x610(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    14ff <save_makefile_cpp+0x38f>
lea    -0x810(%rbp),%rdi
call   1060 <is_library@plt>
cmp    $0x0,%rax
jne    1433 <save_makefile_cpp+0x2c3>
mov    $0x0,%al
call   1030 <is_qt_project@plt>
cmp    $0x0,%rax
je     1367 <save_makefile_cpp+0x1f7>
lea    -0x210(%rbp),%rdi
lea    0xed0(%rip),%rsi
lea    0xd8d(%rip),%rdx
mov    $0x0,%al
call   1080 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xdaa(%rip),%rsi
call   1090 <add_makefile_entry_to_file@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xdc4(%rip),%rsi
call   1090 <add_makefile_entry_to_file@plt>
lea    -0x210(%rbp),%rdi
lea    0xe86(%rip),%rsi
lea    0xd7d(%rip),%rdx
mov    $0x0,%al
call   1080 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xd60(%rip),%rsi
call   1090 <add_makefile_entry_to_file@plt>
lea    -0x210(%rbp),%rdi
lea    0xe53(%rip),%rsi
lea    0xd60(%rip),%rdx
mov    $0x0,%al
call   1080 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xd5e(%rip),%rsi
call   1090 <add_makefile_entry_to_file@plt>
jmp    142e <save_makefile_cpp+0x2be>
mov    -0x8(%rbp),%rdi
lea    0xd18(%rip),%rsi
call   1070 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    13c8 <save_makefile_cpp+0x258>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rdx
lea    -0xc10(%rbp),%rcx
lea    -0xc10(%rbp),%r8
lea    -0xa10(%rbp),%r9
lea    0xd17(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xcc7(%rip),%rsi
call   1090 <add_makefile_entry_to_file@plt>
mov    -0x8(%rbp),%rdi
lea    0xce8(%rip),%rsi
call   1070 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    1429 <save_makefile_cpp+0x2b9>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rdx
lea    -0xc10(%rbp),%rcx
lea    -0xc10(%rbp),%r8
lea    -0xa10(%rbp),%r9
lea    0xcf1(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xc97(%rip),%rsi
call   1090 <add_makefile_entry_to_file@plt>
jmp    142e <save_makefile_cpp+0x2be>
jmp    14fa <save_makefile_cpp+0x38a>
mov    -0x8(%rbp),%rdi
lea    0xc4c(%rip),%rsi
call   1070 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    1494 <save_makefile_cpp+0x324>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rdx
lea    -0xc10(%rbp),%rcx
lea    -0xc10(%rbp),%r8
lea    -0xa10(%rbp),%r9
lea    0xcc0(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xbfb(%rip),%rsi
call   1090 <add_makefile_entry_to_file@plt>
mov    -0x8(%rbp),%rdi
lea    0xc1c(%rip),%rsi
call   1070 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    14f5 <save_makefile_cpp+0x385>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rdx
lea    -0xc10(%rbp),%rcx
lea    -0xc10(%rbp),%r8
lea    -0xa10(%rbp),%r9
lea    0xcbc(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xbcb(%rip),%rsi
call   1090 <add_makefile_entry_to_file@plt>
jmp    14fa <save_makefile_cpp+0x38a>
jmp    14ff <save_makefile_cpp+0x38f>
add    $0xc10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_makefile_cpp>:
push   %r15
push   %r14
push   %rbx
sub    $0xc00,%rsp
mov    %rdi,%r14
lea    0xe7a(%rip),%rdi
lea    0xa00(%rsp),%rsi
call   1050 <get_setting@plt>
lea    0xe73(%rip),%rdi
lea    0x800(%rsp),%rsi
call   1050 <get_setting@plt>
lea    0xe6c(%rip),%rdi
lea    0x200(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <get_setting@plt>
lea    0xe60(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11e7 <save_makefile_cpp+0x77>
movw   $0x31,0x204(%rsp)
movl   $0x312b2b63,0x200(%rsp)
63 2b 2b 31
lea    0xe43(%rip),%rdi
lea    0x600(%rsp),%rsi
call   1050 <get_setting@plt>
lea    0xe37(%rip),%rdi
lea    0x400(%rsp),%rsi
call   1050 <get_setting@plt>
lea    0xe2e(%rip),%rsi
lea    0x800(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1277 <save_makefile_cpp+0x107>
lea    0xe19(%rip),%rsi
lea    0x800(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1277 <save_makefile_cpp+0x107>
lea    0xe04(%rip),%rsi
lea    0x800(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1277 <save_makefile_cpp+0x107>
lea    0xdef(%rip),%rsi
lea    0x800(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    13e8 <save_makefile_cpp+0x278>
lea    0xa00(%rsp),%rdi
call   1060 <is_library@plt>
test   %rax,%rax
je     132b <save_makefile_cpp+0x1bb>
lea    0xdf6(%rip),%rsi
mov    %r14,%rdi
call   1070 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    12e2 <save_makefile_cpp+0x172>
lea    0xe8e(%rip),%rsi
mov    %rsp,%rbx
lea    0x200(%rsp),%rdx
lea    0x400(%rsp),%rcx
lea    0x600(%rsp),%r9
mov    %rbx,%rdi
mov    %rcx,%r8
xor    %eax,%eax
call   1080 <sprintf@plt>
lea    0xdb3(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1090 <add_makefile_entry_to_file@plt>
lea    0xdd2(%rip),%rsi
mov    %r14,%rdi
call   1070 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    13e8 <save_makefile_cpp+0x278>
lea    0xe92(%rip),%rsi
mov    %rsp,%rdi
lea    0x200(%rsp),%rdx
lea    0x400(%rsp),%rcx
lea    0x600(%rsp),%r9
mov    %rcx,%r8
xor    %eax,%eax
call   1080 <sprintf@plt>
jmp    13d6 <save_makefile_cpp+0x266>
xor    %eax,%eax
call   1030 <is_qt_project@plt>
test   %rax,%rax
je     13f5 <save_makefile_cpp+0x285>
movups 0xd32(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xd16(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xcfa(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x656c6966656b61,%rax
mov    %rax,0x2e(%rsp)
lea    0xd16(%rip),%r15
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1090 <add_makefile_entry_to_file@plt>
lea    0xd2f(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1090 <add_makefile_entry_to_file@plt>
movabs $0x295249445f4955,%rax
mov    %rax,0xe(%rsp)
movups 0xce1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1090 <add_makefile_entry_to_file@plt>
movups 0xcde(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xce0(%rip),%xmm0
movups %xmm0,0xd(%rsp)
lea    0xcde(%rip),%rsi
mov    %rsp,%rdx
mov    %r14,%rdi
call   1090 <add_makefile_entry_to_file@plt>
add    $0xc00,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xc8e(%rip),%rsi
mov    %r14,%rdi
call   1070 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    144a <save_makefile_cpp+0x2da>
lea    0xcb1(%rip),%rsi
mov    %rsp,%rbx
lea    0x200(%rsp),%rdx
lea    0x400(%rsp),%rcx
lea    0x600(%rsp),%r9
mov    %rbx,%rdi
mov    %rcx,%r8
xor    %eax,%eax
call   1080 <sprintf@plt>
lea    0xc4b(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1090 <add_makefile_entry_to_file@plt>
lea    0xc6a(%rip),%rsi
mov    %r14,%rdi
call   1070 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    13e8 <save_makefile_cpp+0x278>
lea    0xc97(%rip),%rsi
jmp    1301 <save_makefile_cpp+0x191>

LLVM IR (-O0):
@.str = [13 x i8] c"project name\00"
@.str.1 = [13 x i8] c"project type\00"
@.str.2 = [11 x i8] c"c standard\00"
@.str.3 = [6 x i8] c"gnu99\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [6 x i8] c"c++11\00"
@.str.6 = [8 x i8] c"compile\00"
@.str.7 = [11 x i8] c"source dir\00"
@.str.8 = [4 x i8] c"c++\00"
@.str.9 = [4 x i8] c"C++\00"
@.str.10 = [4 x i8] c"cpp\00"
@.str.11 = [4 x i8] c"CPP\00"
@.str.12 = [54 x i8] c"qmake ${CURDIR}/src/${APP}.pro -o ${GUI_DIR}/Makefile\00"
@.str.13 = [4 x i8] c"all\00"
@.str.14 = [6 x i8] c"debug\00"
@.str.15 = [22 x i8] c"$(MAKE) -C $(GUI_DIR)\00"
@.str.16 = [29 x i8] c"$(MAKE) -C $(GUI_DIR)/ debug\00"
@.str.17 = [59 x i8] c"g++ -Wall -pedantic -O3 -std=%s -o ${APP} %s/*.cpp -I%s %s\00"
@.str.18 = [58 x i8] c"g++ -Wall -pedantic -g -std=%s -o ${APP} %s/*.cpp -I%s %s\00"
@.str.19 = [93 x i8] c"g++ -shared -Wl,-soname,${SONAME} -pedantic -fPIC -O3 -std=%s -o ${LIBNAME} %s/*.cpp -I%s %s\00"
@.str.20 = [92 x i8] c"g++ -shared -Wl,-soname,${SONAME} -pedantic -fPIC -g -std=%s -o ${LIBNAME} %s/*.cpp -I%s %s\00"
define void @save_makefile_cpp(i8* %0) {
%2 = alloca i8*
%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]
store i8* %0, i8** %2
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%10 = call i32 @get_setting(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = call i32 @get_setting(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%14 = call i32 @get_setting(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %1
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%20 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %21
21: ; preds = %18, %1
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%23 = call i32 @get_setting(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%25 = call i32 @get_setting(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %41, label %29
29: ; preds = %21
%30 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %41, label %33
33: ; preds = %29
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %127
41: ; preds = %37, %33, %29, %21
%42 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%43 = call i64 @is_library(i8* %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %97
45: ; preds = %41
%46 = call i64 (...) @is_qt_project()
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %67
48: ; preds = %45
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%50 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0))
%51 = load i8*, i8** %2
%52 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%53 = call i32 @add_makefile_entry_to_file(i8* %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %52)
%54 = load i8*, i8** %2
%55 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%56 = call i32 @add_makefile_entry_to_file(i8* %54, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %55)
%57 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%58 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%59 = load i8*, i8** %2
%60 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%61 = call i32 @add_makefile_entry_to_file(i8* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %60)
%62 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%63 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.16, i64 0, i64 0))
%64 = load i8*, i8** %2
%65 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%66 = call i32 @add_makefile_entry_to_file(i8* %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %65)
br label %96
67: ; preds = %45
%68 = load i8*, i8** %2
%69 = call i32 @empty_makefile_section(i8* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%70 = icmp eq i32 %69, 1
br i1 %70, label %71, label %81
71: ; preds = %67
%72 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%73 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%74 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%75 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%76 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%77 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %72, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.17, i64 0, i64 0), i8* %73, i8* %74, i8* %75, i8* %76)
%78 = load i8*, i8** %2
%79 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%80 = call i32 @add_makefile_entry_to_file(i8* %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %79)
br label %81
81: ; preds = %71, %67
%82 = load i8*, i8** %2
%83 = call i32 @empty_makefile_section(i8* %82, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%84 = icmp eq i32 %83, 1
br i1 %84, label %85, label %95
85: ; preds = %81
%86 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%87 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%88 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%89 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%90 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%91 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %86, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.18, i64 0, i64 0), i8* %87, i8* %88, i8* %89, i8* %90)
%92 = load i8*, i8** %2
%93 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%94 = call i32 @add_makefile_entry_to_file(i8* %92, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %93)
br label %95
95: ; preds = %85, %81
br label %96
96: ; preds = %95, %48
br label %126
97: ; preds = %41
%98 = load i8*, i8** %2
%99 = call i32 @empty_makefile_section(i8* %98, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%100 = icmp eq i32 %99, 1
br i1 %100, label %101, label %111
101: ; preds = %97
%102 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%103 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%104 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%105 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%106 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%107 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %102, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.19, i64 0, i64 0), i8* %103, i8* %104, i8* %105, i8* %106)
%108 = load i8*, i8** %2
%109 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%110 = call i32 @add_makefile_entry_to_file(i8* %108, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %109)
br label %111
111: ; preds = %101, %97
%112 = load i8*, i8** %2
%113 = call i32 @empty_makefile_section(i8* %112, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%114 = icmp eq i32 %113, 1
br i1 %114, label %115, label %125
115: ; preds = %111
%116 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%117 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%118 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%119 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%120 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%121 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %116, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.20, i64 0, i64 0), i8* %117, i8* %118, i8* %119, i8* %120)
%122 = load i8*, i8** %2
%123 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%124 = call i32 @add_makefile_entry_to_file(i8* %122, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %123)
br label %125
125: ; preds = %115, %111
br label %126
126: ; preds = %125, %96
br label %127
127: ; preds = %126, %37
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"project name\00"
@.str.1 = [13 x i8] c"project type\00"
@.str.2 = [11 x i8] c"c standard\00"
@.str.3 = [6 x i8] c"gnu99\00"
@.str.5 = [6 x i8] c"c++11\00"
@.str.6 = [8 x i8] c"compile\00"
@.str.7 = [11 x i8] c"source dir\00"
@.str.8 = [4 x i8] c"c++\00"
@.str.9 = [4 x i8] c"C++\00"
@.str.10 = [4 x i8] c"cpp\00"
@.str.11 = [4 x i8] c"CPP\00"
@.str.12 = [54 x i8] c"qmake ${CURDIR}/src/${APP}.pro -o ${GUI_DIR}/Makefile\00"
@.str.13 = [4 x i8] c"all\00"
@.str.14 = [6 x i8] c"debug\00"
@.str.15 = [22 x i8] c"$(MAKE) -C $(GUI_DIR)\00"
@.str.16 = [29 x i8] c"$(MAKE) -C $(GUI_DIR)/ debug\00"
@.str.17 = [59 x i8] c"g++ -Wall -pedantic -O3 -std=%s -o ${APP} %s/*.cpp -I%s %s\00"
@.str.18 = [58 x i8] c"g++ -Wall -pedantic -g -std=%s -o ${APP} %s/*.cpp -I%s %s\00"
@.str.19 = [93 x i8] c"g++ -shared -Wl,-soname,${SONAME} -pedantic -fPIC -O3 -std=%s -o ${LIBNAME} %s/*.cpp -I%s %s\00"
@.str.20 = [92 x i8] c"g++ -shared -Wl,-soname,${SONAME} -pedantic -fPIC -g -std=%s -o ${LIBNAME} %s/*.cpp -I%s %s\00"
define void @save_makefile_cpp(i8* %0) {
%2 = alloca [512 x i8]
%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 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%14 = call i32 @get_setting(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %11)
%15 = call i32 @get_setting(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%16 = call i32 @get_setting(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%17 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %1
br label %20
20: ; preds = %19, %1
%21 = call i32 @get_setting(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %12)
%22 = call i32 @get_setting(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %13)
%23 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %34, label %25
25: ; preds = %20
%26 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %34, label %28
28: ; preds = %25
%29 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %34, label %31
31: ; preds = %28
%32 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %68
34: ; preds = %31, %28, %25, %20
%35 = call i64 @is_library(i8* %11)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %55
37: ; preds = %34
%38 = call i64 (...) @is_qt_project()
%39 = icmp eq i64 %38, 0
br i1 %39, label %44, label %40
40: ; preds = %37
%41 = call i32 @add_makefile_entry_to_file(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %8)
%42 = call i32 @add_makefile_entry_to_file(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %8)
%43 = call i32 @add_makefile_entry_to_file(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %8)
br label %66
44: ; preds = %37
%45 = call i32 @empty_makefile_section(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.17, i64 0, i64 0), i8* %9, i8* %13, i8* %13, i8* %12)
%49 = call i32 @add_makefile_entry_to_file(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %8)
br label %50
50: ; preds = %47, %44
%51 = call i32 @empty_makefile_section(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%52 = icmp eq i32 %51, 1
br i1 %52, label %53, label %68
53: ; preds = %50
%54 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.18, i64 0, i64 0), i8* %9, i8* %13, i8* %13, i8* %12)
br label %66
55: ; preds = %34
%56 = call i32 @empty_makefile_section(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%57 = icmp eq i32 %56, 1
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @.str.19, i64 0, i64 0), i8* %9, i8* %13, i8* %13, i8* %12)
%60 = call i32 @add_makefile_entry_to_file(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %8)
br label %61
61: ; preds = %58, %55
%62 = call i32 @empty_makefile_section(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%63 = icmp eq i32 %62, 1
br i1 %63, label %64, label %68
64: ; preds = %61
%65 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @.str.20, i64 0, i64 0), i8* %9, i8* %13, i8* %13, i8* %12)
br label %66
66: ; preds = %64, %40, %53
%67 = call i32 @add_makefile_entry_to_file(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %8)
br label %68
68: ; preds = %66, %50, %61, %31
ret void
}