int save_arch() {
  char directory[512];
  char arch_directory[512];
  char commandstr[512];
  int retval = 0;
  get_setting("directory", directory);
  sprintf(arch_directory, "%s%c%s", directory, '/', "archpackage");
  if (directory_exists(arch_directory) == 0) {
    sprintf(commandstr, "%s %s", "mkdir", arch_directory);
    retval = system(commandstr);
  }
  save_PKGBUILD(arch_directory);
  save_script(directory);
  return retval;
}


x86 assembly (clang, -O0):
<save_arch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x610,%rsp
movl   $0x0,-0x604(%rbp)
lea    -0x200(%rbp),%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1060 <get_setting@plt>
lea    -0x400(%rbp),%rdi
lea    -0x200(%rbp),%rdx
lea    0xe6b(%rip),%rsi
mov    $0x2f,%ecx
lea    0xe66(%rip),%r8
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0x400(%rbp),%rdi
mov    $0x0,%al
call   1050 <directory_exists@plt>
cmp    $0x0,%eax
jne    1200 <save_arch+0xa0>
lea    -0x600(%rbp),%rdi
lea    -0x400(%rbp),%rcx
lea    0xe3f(%rip),%rsi
lea    0xe3e(%rip),%rdx
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0x600(%rbp),%rdi
mov    $0x0,%al
call   1040 <system@plt>
mov    %eax,-0x604(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x0,%al
call   1030 <save_PKGBUILD@plt>
lea    -0x200(%rbp),%rdi
mov    $0x0,%al
call   1070 <save_script@plt>
mov    -0x604(%rbp),%eax
add    $0x610,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_arch>:
push   %rbp
push   %r14
push   %rbx
sub    $0x600,%rsp
lea    0xe8e(%rip),%rdi
xor    %r14d,%r14d
lea    0x200(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <get_setting@plt>
lea    0xe7c(%rip),%rsi
lea    0xe7c(%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    11e8 <save_arch+0x88>
lea    0xe5e(%rip),%rsi
lea    0xe5d(%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
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <save_PKGBUILD@plt>
lea    0x200(%rsp),%rdi
xor    %eax,%eax
call   1070 <save_script@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 = [12 x i8] c"archpackage\00"
@.str.3 = [6 x i8] c"%s %s\00"
@.str.4 = [6 x i8] c"mkdir\00"
define i32 @save_arch() {
%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]* %2, 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 ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %2, 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]* %3, i64 0, i64 0
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %2, 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]* %3, 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]* %2, i64 0, i64 0
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @save_PKGBUILD 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_script to i32 (i8*, ...)*)(i8* %22)
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
@.str = [10 x i8] c"directory\00"
@.str.1 = [7 x i8] c"%s%c%s\00"
@.str.2 = [12 x i8] c"archpackage\00"
@.str.3 = [6 x i8] c"%s %s\00"
@.str.4 = [6 x i8] c"mkdir\00"
define i32 @save_arch() {
%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* %5, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 47, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @directory_exists to i32 (i8*, ...)*)(i8* %5)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, 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* %5)
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %6)
br label %14
14: ; preds = %11, %0
%15 = phi i32 [ %13, %11 ], [ 0, %0 ]
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @save_PKGBUILD to i32 (i8*, ...)*)(i8* %5)
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @save_script to i32 (i8*, ...)*)(i8* %4)
ret i32 %15
}