int save_slack() {
  char directory[512];
  char commandstr[512];
  char subdir[512];
  int retval = 0;
  get_setting("directory", directory);
  sprintf(subdir, "%s%c%s", directory, '/', "slackpackage");
  if (directory_exists(subdir) == 0) {
    sprintf(commandstr, "%s %s", "mkdir", subdir);
    retval = system(commandstr);
  }
  save_doinst(directory);
  save_slack_desc(directory);
  save_slackbuild(directory);
  return retval;
}


x86 assembly (clang, -O0):
<save_slack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x610,%rsp
movl   $0x0,-0x604(%rbp)
lea    -0x200(%rbp),%rsi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1060 <get_setting@plt>
lea    -0x600(%rbp),%rdi
lea    -0x200(%rbp),%rdx
lea    0xe5b(%rip),%rsi
mov    $0x2f,%ecx
lea    0xe56(%rip),%r8
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0x600(%rbp),%rdi
mov    $0x0,%al
call   1050 <directory_exists@plt>
cmp    $0x0,%eax
jne    1210 <save_slack+0xa0>
lea    -0x400(%rbp),%rdi
lea    -0x600(%rbp),%rcx
lea    0xe30(%rip),%rsi
lea    0xe2f(%rip),%rdx
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0x400(%rbp),%rdi
mov    $0x0,%al
call   1040 <system@plt>
mov    %eax,-0x604(%rbp)
lea    -0x200(%rbp),%rdi
mov    $0x0,%al
call   1070 <save_doinst@plt>
lea    -0x200(%rbp),%rdi
mov    $0x0,%al
call   1090 <save_slack_desc@plt>
lea    -0x200(%rbp),%rdi
mov    $0x0,%al
call   1030 <save_slackbuild@plt>
mov    -0x604(%rbp),%eax
add    $0x610,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_slack>:
push   %rbp
push   %r14
push   %rbx
sub    $0x600,%rsp
lea    0xe7e(%rip),%rdi
xor    %r14d,%r14d
lea    0x200(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <get_setting@plt>
lea    0xe6c(%rip),%rsi
lea    0xe6c(%rip),%r8
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    $0x2f,%ecx
xor    %eax,%eax
call   1080 <sprintf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <directory_exists@plt>
test   %eax,%eax
jne    11f8 <save_slack+0x88>
lea    0xe4f(%rip),%rsi
lea    0xe4e(%rip),%rdx
lea    0x400(%rsp),%rbx
mov    %rsp,%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <system@plt>
mov    %eax,%r14d
lea    0x200(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <save_doinst@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <save_slack_desc@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <save_slackbuild@plt>
mov    %r14d,%eax
add    $0x600,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"directory\00"
@.str.1 = [7 x i8] c"%s%c%s\00"
@.str.2 = [13 x i8] c"slackpackage\00"
@.str.3 = [6 x i8] c"%s %s\00"
@.str.4 = [6 x i8] c"mkdir\00"
define i32 @save_slack() {
%1 = alloca [512 x i8]
%2 = alloca [512 x i8]
%3 = alloca [512 x i8]
%4 = alloca i32
store i32 0, i32* %4
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 47, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @directory_exists to i32 (i8*, ...)*)(i8* %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %0
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%16 = call i32 (i8*, i8*, ...) @sprintf(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %13, %0
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @save_doinst to i32 (i8*, ...)*)(i8* %20)
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @save_slack_desc to i32 (i8*, ...)*)(i8* %22)
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @save_slackbuild to i32 (i8*, ...)*)(i8* %24)
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
@.str = [10 x i8] c"directory\00"
@.str.1 = [7 x i8] c"%s%c%s\00"
@.str.2 = [13 x i8] c"slackpackage\00"
@.str.3 = [6 x i8] c"%s %s\00"
@.str.4 = [6 x i8] c"mkdir\00"
define i32 @save_slack() {
%1 = alloca [512 x i8]
%2 = alloca [512 x i8]
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 47, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @directory_exists to i32 (i8*, ...)*)(i8* %6)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %5)
br label %14
14: ; preds = %11, %0
%15 = phi i32 [ %13, %11 ], [ 0, %0 ]
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @save_doinst to i32 (i8*, ...)*)(i8* %4)
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @save_slack_desc to i32 (i8*, ...)*)(i8* %4)
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @save_slackbuild to i32 (i8*, ...)*)(i8* %4)
ret i32 %15
}