#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int callback(void *unused, int argc, char **argv, char **az_col_name) {
  if (argc != 3) {
    return 1;
  } else if (access(argv[1], F_OK) == -1) {
    return 0;
  }
  printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
         "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" "
         "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
         "<plist version=\"1.0\">\n"
         "<dict>\n"
         "<key>%s</key>\n"
         "<dict>\n"
         "<key>DBGArchitecture</key>\n"
         "<string>%s</string>\n"
         "<key>DBGDSYMPath</key>\n"
         "<string>%s</string>\n"
         "</dict>\n"
         "</dict>\n"
         "</plist>\n",
         argv[0], argv[2], argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpl   $0x3,-0x14(%rbp)
je     114d <callback+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    11a7 <callback+0x87>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    1178 <callback+0x58>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <callback+0x87>
jmp    117d <callback+0x5d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rdx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%esi
jne    1160 <callback+0x40>
mov    %rdx,%rbx
mov    0x8(%rdx),%rdi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
xor    %ebp,%ebp
cmp    $0xffffffff,%eax
je     1160 <callback+0x40>
mov    0x10(%rbx),%rdx
mov    (%rbx),%rsi
mov    0x8(%rbx),%rcx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_OK = global i32 0
@.str = [308 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A<!DOCTYPE plist PUBLIC \22-//Apple//DTD PLIST 1.0//EN\22 \22http://www.apple.com/DTDs/PropertyList-1.0.dtd\22>\0A<plist version=\221.0\22>\0A<dict>\0A<key>%s</key>\0A<dict>\0A<key>DBGArchitecture</key>\0A<string>%s</string>\0A<key>DBGDSYMPath</key>\0A<string>%s</string>\0A</dict>\0A</dict>\0A</plist>\0A\00"
define i32 @callback(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i8**
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
%10 = load i32, i32* %7
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %13
12: ; preds = %4
store i32 1, i32* %5
br label %33
13: ; preds = %4
%14 = load i8**, i8*** %8
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i32, i32* @F_OK
%18 = call i32 @access(i8* %16, i32 %17)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %21
20: ; preds = %13
store i32 0, i32* %5
br label %33
21: ; preds = %13
br label %22
22: ; preds = %21
%23 = load i8**, i8*** %8
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = load i8**, i8*** %8
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = load i8**, i8*** %8
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @printf(i8* getelementptr inbounds ([308 x i8], [308 x i8]* @.str, i64 0, i64 0), i8* %25, i8* %28, i8* %31)
store i32 0, i32* %5
br label %33
33: ; preds = %22, %20, %12
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
@F_OK = global i32 0
@.str = [308 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A<!DOCTYPE plist PUBLIC \22-//Apple//DTD PLIST 1.0//EN\22 \22http://www.apple.com/DTDs/PropertyList-1.0.dtd\22>\0A<plist version=\221.0\22>\0A<dict>\0A<key>%s</key>\0A<dict>\0A<key>DBGArchitecture</key>\0A<string>%s</string>\0A<key>DBGDSYMPath</key>\0A<string>%s</string>\0A</dict>\0A</dict>\0A</plist>\0A\00"
define i32 @callback(i8* nocapture readnone %0, i32 %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = icmp eq i32 %1, 3
br i1 %5, label %6, label %18
6: ; preds = %4
%7 = getelementptr inbounds i8*, i8** %2, i64 1
%8 = load i8*, i8** %7
%9 = load i32, i32* @F_OK
%10 = tail call i32 @access(i8* %8, i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %18, label %12
12: ; preds = %6
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8*, i8** %2, i64 2
%15 = load i8*, i8** %14
%16 = load i8*, i8** %7
%17 = tail call i32 @printf(i8* getelementptr inbounds ([308 x i8], [308 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %15, i8* %16)
br label %18
18: ; preds = %6, %4, %12
%19 = phi i32 [ 0, %12 ], [ 1, %4 ], [ 0, %6 ]
ret i32 %19
}