int is_qt_project() {
  char directory[512];
  char sourcedir[512];
  char filename[512];
  char project_name[512];
  char project_type[512];
  get_setting("project type", project_type);
  if (strcmp(project_type, "cpp") == 0) {
    get_setting("directory", directory);
    get_setting("source dir", sourcedir);
    get_setting("project name", project_name);
    sprintf(filename, "%s%c%s%c%s.pro", directory, '/', sourcedir, '/',
            project_name);
    if (file_exists(filename) != 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_qt_project>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa20,%rsp
lea    -0xa10(%rbp),%rsi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1050 <get_setting@plt>
lea    -0xa10(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    121a <is_qt_project+0xda>
lea    -0x210(%rbp),%rsi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1050 <get_setting@plt>
lea    -0x410(%rbp),%rsi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <get_setting@plt>
lea    -0x810(%rbp),%rsi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1050 <get_setting@plt>
lea    -0x610(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    -0x410(%rbp),%r8
lea    -0x810(%rbp),%rax
lea    0xe55(%rip),%rsi
mov    $0x2f,%r9d
mov    %r9d,%ecx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x610(%rbp),%rdi
mov    $0x0,%al
call   1030 <file_exists@plt>
cmp    $0x0,%eax
je     1215 <is_qt_project+0xd5>
movl   $0x1,-0x4(%rbp)
jmp    1221 <is_qt_project+0xe1>
jmp    121a <is_qt_project+0xda>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_qt_project>:
push   %r15
push   %r14
push   %rbx
sub    $0xa10,%rsp
lea    0xebd(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <get_setting@plt>
cmpl   $0x707063,0x10(%rsp)
jne    11eb <is_qt_project+0xbb>
lea    0xea9(%rip),%rdi
lea    0x810(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <get_setting@plt>
lea    0xe9a(%rip),%rdi
lea    0x610(%rsp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <get_setting@plt>
lea    0xe8c(%rip),%rdi
lea    0x210(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <get_setting@plt>
mov    %rbx,(%rsp)
lea    0xe7c(%rip),%rsi
lea    0x410(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
mov    $0x2f,%ecx
mov    %r15,%r8
mov    $0x2f,%r9d
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <file_exists@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    11ed <is_qt_project+0xbd>
xor    %eax,%eax
add    $0xa10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"project type\00"
@.str.1 = [4 x i8] c"cpp\00"
@.str.2 = [10 x i8] c"directory\00"
@.str.3 = [11 x i8] c"source dir\00"
@.str.4 = [13 x i8] c"project name\00"
@.str.5 = [15 x i8] c"%s%c%s%c%s.pro\00"
define i32 @is_qt_project() {
%1 = alloca i32
%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]* %6, i64 0, i64 0
%8 = 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* %7)
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %29
12: ; preds = %0
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%14 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %3, 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]* %5, i64 0, i64 0
%18 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 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 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%21 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%23 = call i32 (i8*, i8*, ...) @sprintf(i8* %19, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %20, i32 47, i8* %21, i32 47, i8* %22)
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @file_exists to i32 (i8*, ...)*)(i8* %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %12
store i32 1, i32* %1
br label %30
28: ; preds = %12
br label %29
29: ; preds = %28, %0
store i32 0, i32* %1
br label %30
30: ; preds = %29, %27
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [13 x i8] c"project type\00"
@.str.2 = [10 x i8] c"directory\00"
@.str.3 = [11 x i8] c"source dir\00"
@.str.4 = [13 x i8] c"project name\00"
@.str.5 = [15 x i8] c"%s%c%s%c%s.pro\00"
define i32 @is_qt_project() {
%1 = alloca [512 x i8]
%2 = alloca [512 x i8]
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = alloca [512 x i8]
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%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 = 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)
%12 = bitcast [512 x i8]* %5 to i32*
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 7368803
br i1 %14, label %15, label %22
15: ; preds = %0
%16 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%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* %7)
%18 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @get_setting to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %9)
%19 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %6, i32 47, i8* %7, i32 47, i8* %9)
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @file_exists to i32 (i8*, ...)*)(i8* %8)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %15, %0
br label %23
23: ; preds = %15, %22
%24 = phi i32 [ 0, %22 ], [ 1, %15 ]
ret i32 %24
}