void save_makefile_vala(char *filename) {
  char str[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("compile", compile_args);
  get_setting("source dir", sourcedir);
  if (strcmp(project_type, "vala") == 0) {
    if (is_library(project_name) == 0) {
      if (empty_makefile_section(filename, "all") == 1) {
        sprintf(str, "valac %s%c*.vala %s --basedir %s -o ${APP}", sourcedir,
                '/', compile_args, sourcedir);
        add_makefile_entry_to_file(filename, "all", str);
      }
      if (empty_makefile_section(filename, "debug") == 1) {
        sprintf(str,
                "valac -g --save-temps %s%c*.vala %s "
                "--basedir %s -o ${APP}",
                sourcedir, '/', compile_args, sourcedir);
        add_makefile_entry_to_file(filename, "debug", str);
      }
    } else {
    }
  }
}


x86 assembly (clang, -O0):
<save_makefile_vala>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x610(%rbp),%rsi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <get_setting@plt>
lea    -0x410(%rbp),%rsi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1040 <get_setting@plt>
lea    -0x810(%rbp),%rsi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1040 <get_setting@plt>
lea    -0xa10(%rbp),%rsi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <get_setting@plt>
lea    -0x410(%rbp),%rdi
lea    0xe5c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    12cb <save_makefile_vala+0x16b>
lea    -0x610(%rbp),%rdi
mov    $0x0,%al
call   1050 <is_library@plt>
cmp    $0x0,%eax
jne    12c1 <save_makefile_vala+0x161>
mov    -0x8(%rbp),%rdi
lea    0xe31(%rip),%rsi
mov    $0x0,%al
call   1060 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    1259 <save_makefile_vala+0xf9>
lea    -0x210(%rbp),%rdi
lea    -0xa10(%rbp),%rdx
lea    -0x810(%rbp),%r8
lea    -0xa10(%rbp),%r9
lea    0xe02(%rip),%rsi
mov    $0x2f,%ecx
mov    $0x0,%al
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xde0(%rip),%rsi
mov    $0x0,%al
call   1080 <add_makefile_entry_to_file@plt>
mov    -0x8(%rbp),%rdi
lea    0xdfd(%rip),%rsi
mov    $0x0,%al
call   1060 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    12bc <save_makefile_vala+0x15c>
lea    -0x210(%rbp),%rdi
lea    -0xa10(%rbp),%rdx
lea    -0x810(%rbp),%r8
lea    -0xa10(%rbp),%r9
lea    0xdd0(%rip),%rsi
mov    $0x2f,%ecx
mov    $0x0,%al
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xdac(%rip),%rsi
mov    $0x0,%al
call   1080 <add_makefile_entry_to_file@plt>
jmp    12c6 <save_makefile_vala+0x166>
jmp    12c6 <save_makefile_vala+0x166>
jmp    12cb <save_makefile_vala+0x16b>
add    $0xa10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_makefile_vala>:
push   %r14
push   %rbx
sub    $0xa08,%rsp
mov    %rdi,%rbx
lea    0xe9c(%rip),%rdi
lea    0x600(%rsp),%rsi
xor    %eax,%eax
call   1030 <get_setting@plt>
lea    0xe93(%rip),%rdi
lea    0x400(%rsp),%rsi
xor    %eax,%eax
call   1030 <get_setting@plt>
lea    0xe8a(%rip),%rdi
lea    0x200(%rsp),%rsi
xor    %eax,%eax
call   1030 <get_setting@plt>
lea    0xe7c(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <get_setting@plt>
mov    $0x616c6176,%eax
xor    0x400(%rsp),%eax
movzbl 0x404(%rsp),%ecx
or     %eax,%ecx
jne    128f <save_makefile_vala+0x13f>
lea    0x600(%rsp),%rdi
xor    %eax,%eax
call   1040 <is_library@plt>
test   %eax,%eax
jne    128f <save_makefile_vala+0x13f>
lea    0xe48(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    1239 <save_makefile_vala+0xe9>
lea    0xe36(%rip),%rsi
lea    0x800(%rsp),%r14
lea    0x200(%rsp),%r8
mov    %rsp,%rdx
mov    %r14,%rdi
mov    $0x2f,%ecx
mov    %rdx,%r9
xor    %eax,%eax
call   1060 <sprintf@plt>
lea    0xe06(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <add_makefile_entry_to_file@plt>
lea    0xe21(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    128f <save_makefile_vala+0x13f>
lea    0xe11(%rip),%rsi
lea    0x800(%rsp),%r14
lea    0x200(%rsp),%r8
mov    %rsp,%rdx
mov    %r14,%rdi
mov    $0x2f,%ecx
mov    %rdx,%r9
xor    %eax,%eax
call   1060 <sprintf@plt>
lea    0xddf(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <add_makefile_entry_to_file@plt>
add    $0xa08,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"project name\00"
@.str.1 = [13 x i8] c"project type\00"
@.str.2 = [8 x i8] c"compile\00"
@.str.3 = [11 x i8] c"source dir\00"
@.str.4 = [5 x i8] c"vala\00"
@.str.5 = [4 x i8] c"all\00"
@.str.6 = [43 x i8] c"valac %s%c*.vala %s --basedir %s -o ${APP}\00"
@.str.7 = [6 x i8] c"debug\00"
@.str.8 = [59 x i8] c"valac -g --save-temps %s%c*.vala %s --basedir %s -o ${APP}\00"
define void @save_makefile_vala(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]
store i8* %0, i8** %2
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%13 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%15 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %52
19: ; preds = %1
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @is_library to i32 (i8*, ...)*)(i8* %20)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %50
23: ; preds = %19
%24 = load i8*, i8** %2
%25 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @empty_makefile_section to i32 (i8*, i8*, ...)*)(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %36
27: ; preds = %23
%28 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%29 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%30 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%31 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%32 = call i32 (i8*, i8*, ...) @sprintf(i8* %28, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %29, i32 47, i8* %30, i8* %31)
%33 = load i8*, i8** %2
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%35 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @add_makefile_entry_to_file to i32 (i8*, i8*, i8*, ...)*)(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %34)
br label %36
36: ; preds = %27, %23
%37 = load i8*, i8** %2
%38 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @empty_makefile_section to i32 (i8*, i8*, ...)*)(i8* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %49
40: ; preds = %36
%41 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%42 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%43 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%44 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%45 = call i32 (i8*, i8*, ...) @sprintf(i8* %41, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0), i8* %42, i32 47, i8* %43, i8* %44)
%46 = load i8*, i8** %2
%47 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%48 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @add_makefile_entry_to_file to i32 (i8*, i8*, i8*, ...)*)(i8* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %40, %36
br label %51
50: ; preds = %19
br label %51
51: ; preds = %50, %49
br label %52
52: ; preds = %51, %1
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"project name\00"
@.str.1 = [13 x i8] c"project type\00"
@.str.2 = [8 x i8] c"compile\00"
@.str.3 = [11 x i8] c"source dir\00"
@.str.4 = [5 x i8] c"vala\00"
@.str.5 = [4 x i8] c"all\00"
@.str.6 = [43 x i8] c"valac %s%c*.vala %s --basedir %s -o ${APP}\00"
@.str.7 = [6 x i8] c"debug\00"
@.str.8 = [59 x i8] c"valac -g --save-temps %s%c*.vala %s --basedir %s -o ${APP}\00"
define void @save_makefile_vala(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 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%12 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9)
%13 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%14 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%15 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %11)
%16 = call i32 @bcmp(i8* dereferenceable(5) %8, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 5)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %33
18: ; preds = %1
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @is_library to i32 (i8*, ...)*)(i8* %9)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %33
21: ; preds = %18
%22 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @empty_makefile_section to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %11, i32 47, i8* %10, i8* %11)
%26 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @add_makefile_entry_to_file to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %7)
br label %27
27: ; preds = %24, %21
%28 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @empty_makefile_section to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0), i8* %11, i32 47, i8* %10, i8* %11)
%32 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @add_makefile_entry_to_file to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %7)
br label %33
33: ; preds = %30, %27, %18, %1
ret void
}