void save_makefile_scala(char *filename) {
  char str[512];
  char project_type[512];
  char project_name[512];
  char compile_args[512];
  char sourcedir[512];
  char build_dir[512];
  get_setting("project name", project_name);
  get_setting("project type", project_type);
  get_setting("compile", compile_args);
  get_setting("source dir", sourcedir);
  get_setting("build dir", build_dir);
  if (strcmp(project_type, "scala") == 0) {
    if (is_library(project_name) == 0) {
      if (empty_makefile_section(filename, "all") == 1) {
        sprintf(str, "scalac %s%c*.scala %s -sourcepath %s -d %s", sourcedir,
                '/', compile_args, sourcedir, build_dir);
        add_makefile_entry_to_file(filename, "all", str);
      }
      if (empty_makefile_section(filename, "debug") == 1) {
        sprintf(str, "scalac -g %s%c*.scala %s -sourcepath %s -d %s", sourcedir,
                '/', compile_args, sourcedir, build_dir);
        add_makefile_entry_to_file(filename, "debug", str);
      }
    } else {
    }
  }
}


x86 assembly (clang, -O0):
<save_makefile_scala>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc20,%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    -0xc10(%rbp),%rsi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1040 <get_setting@plt>
lea    -0x410(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    12f6 <save_makefile_scala+0x196>
lea    -0x610(%rbp),%rdi
mov    $0x0,%al
call   1050 <is_library@plt>
cmp    $0x0,%eax
jne    12ec <save_makefile_scala+0x18c>
mov    -0x8(%rbp),%rdi
lea    0xe27(%rip),%rsi
mov    $0x0,%al
call   1060 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    1279 <save_makefile_scala+0x119>
lea    -0x210(%rbp),%rdi
lea    -0xa10(%rbp),%rdx
lea    -0x810(%rbp),%r8
lea    -0xa10(%rbp),%r9
lea    -0xc10(%rbp),%rax
lea    0xdf1(%rip),%rsi
mov    $0x2f,%ecx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xdcb(%rip),%rsi
mov    $0x0,%al
call   1080 <add_makefile_entry_to_file@plt>
mov    -0x8(%rbp),%rdi
lea    0xde8(%rip),%rsi
mov    $0x0,%al
call   1060 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    12e7 <save_makefile_scala+0x187>
lea    -0x210(%rbp),%rdi
lea    -0xa10(%rbp),%rdx
lea    -0x810(%rbp),%r8
lea    -0xa10(%rbp),%r9
lea    -0xc10(%rbp),%rax
lea    0xdb4(%rip),%rsi
mov    $0x2f,%ecx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    0xd8c(%rip),%rsi
mov    $0x0,%al
call   1080 <add_makefile_entry_to_file@plt>
jmp    12f1 <save_makefile_scala+0x191>
jmp    12f1 <save_makefile_scala+0x191>
jmp    12f6 <save_makefile_scala+0x196>
add    $0xc20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_makefile_scala>:
push   %r15
push   %r14
push   %rbx
sub    $0xc10,%rsp
mov    %rdi,%r14
lea    0xe9a(%rip),%rdi
lea    0x610(%rsp),%rsi
xor    %eax,%eax
call   1030 <get_setting@plt>
lea    0xe91(%rip),%rdi
lea    0x410(%rsp),%rsi
xor    %eax,%eax
call   1030 <get_setting@plt>
lea    0xe88(%rip),%rdi
lea    0x210(%rsp),%rsi
xor    %eax,%eax
call   1030 <get_setting@plt>
lea    0xe7a(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <get_setting@plt>
lea    0xe72(%rip),%rdi
lea    0xa10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <get_setting@plt>
mov    $0x6c616373,%eax
xor    0x410(%rsp),%eax
movzwl 0x414(%rsp),%ecx
xor    $0x61,%ecx
or     %eax,%ecx
jne    12bb <save_makefile_scala+0x16b>
lea    0x610(%rsp),%rdi
xor    %eax,%eax
call   1040 <is_library@plt>
test   %eax,%eax
jne    12bb <save_makefile_scala+0x16b>
lea    0xe33(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    125f <save_makefile_scala+0x10f>
mov    %rbx,(%rsp)
lea    0xe1d(%rip),%rsi
lea    0x810(%rsp),%r15
lea    0x210(%rsp),%r8
lea    0x10(%rsp),%rdx
mov    %r15,%rdi
mov    $0x2f,%ecx
mov    %rdx,%r9
xor    %eax,%eax
call   1060 <sprintf@plt>
lea    0xdeb(%rip),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1070 <add_makefile_entry_to_file@plt>
lea    0xe06(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <empty_makefile_section@plt>
cmp    $0x1,%eax
jne    12bb <save_makefile_scala+0x16b>
mov    %rbx,(%rsp)
lea    0xdf2(%rip),%rsi
lea    0x810(%rsp),%rbx
lea    0x210(%rsp),%r8
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x2f,%ecx
mov    %rdx,%r9
xor    %eax,%eax
call   1060 <sprintf@plt>
lea    0xdbe(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <add_makefile_entry_to_file@plt>
add    $0xc10,%rsp
pop    %rbx
pop    %r14
pop    %r15
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 = [10 x i8] c"build dir\00"
@.str.5 = [6 x i8] c"scala\00"
@.str.6 = [4 x i8] c"all\00"
@.str.7 = [43 x i8] c"scalac %s%c*.scala %s -sourcepath %s -d %s\00"
@.str.8 = [6 x i8] c"debug\00"
@.str.9 = [46 x i8] c"scalac -g %s%c*.scala %s -sourcepath %s -d %s\00"
define void @save_makefile_scala(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]* %5, i64 0, i64 0
%10 = 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)
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %4, 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.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%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* %13)
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%16 = 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* %15)
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%18 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %57
22: ; preds = %1
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%24 = call i32 (i8*, ...) bitcast (i32 (...)* @is_library to i32 (i8*, ...)*)(i8* %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %55
26: ; preds = %22
%27 = load i8*, i8** %2
%28 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @empty_makefile_section to i32 (i8*, i8*, ...)*)(i8* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %40
30: ; preds = %26
%31 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%32 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%33 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%35 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%36 = call i32 (i8*, i8*, ...) @sprintf(i8* %31, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i8* %32, i32 47, i8* %33, i8* %34, i8* %35)
%37 = load i8*, i8** %2
%38 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%39 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @add_makefile_entry_to_file to i32 (i8*, i8*, i8*, ...)*)(i8* %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %38)
br label %40
40: ; preds = %30, %26
%41 = load i8*, i8** %2
%42 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @empty_makefile_section to i32 (i8*, i8*, ...)*)(i8* %41, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%43 = icmp eq i32 %42, 1
br i1 %43, label %44, label %54
44: ; preds = %40
%45 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%46 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%47 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%48 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%50 = call i32 (i8*, i8*, ...) @sprintf(i8* %45, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0), i8* %46, i32 47, i8* %47, i8* %48, i8* %49)
%51 = load i8*, i8** %2
%52 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%53 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @add_makefile_entry_to_file to i32 (i8*, i8*, i8*, ...)*)(i8* %51, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %52)
br label %54
54: ; preds = %44, %40
br label %56
55: ; preds = %22
br label %56
56: ; preds = %55, %54
br label %57
57: ; preds = %56, %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 = [10 x i8] c"build dir\00"
@.str.5 = [6 x i8] c"scala\00"
@.str.6 = [4 x i8] c"all\00"
@.str.7 = [43 x i8] c"scalac %s%c*.scala %s -sourcepath %s -d %s\00"
@.str.8 = [6 x i8] c"debug\00"
@.str.9 = [46 x i8] c"scalac -g %s%c*.scala %s -sourcepath %s -d %s\00"
define void @save_makefile_scala(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 (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* %10)
%15 = 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* %9)
%16 = 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* %11)
%17 = 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* %12)
%18 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %13)
%19 = call i32 @bcmp(i8* dereferenceable(6) %9, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64 6)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %36
21: ; preds = %1
%22 = call i32 (i8*, ...) bitcast (i32 (...)* @is_library to i32 (i8*, ...)*)(i8* %10)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %36
24: ; preds = %21
%25 = 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.6, i64 0, i64 0))
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i8* %12, i32 47, i8* %11, i8* %12, i8* %13)
%29 = 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.6, i64 0, i64 0), i8* %8)
br label %30
30: ; preds = %27, %24
%31 = 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.8, i64 0, i64 0))
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0), i8* %12, i32 47, i8* %11, i8* %12, i8* %13)
%35 = 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.8, i64 0, i64 0), i8* %8)
br label %36
36: ; preds = %33, %30, %21, %1
ret void
}