int WinMainCRTStartup(void) {
  void *vk = LoadLibraryA("vulkan-1.dll");
  if (!vk)
    do {
      MessageBoxA(0, "Vulkan drivers not installed.",
                  -1 ? "Failure" : "Success", 0);
      return -1;
    } while (0);
  void *(*vkGetInstanceProcAddr)(void *, const char *) =
      GetProcAddress(vk, "vkGetInstanceProcAddr");
  if (!vkGetInstanceProcAddr)
    do {
      MessageBoxA(0, "Vulkan is malfunctioning (vkGetInstanceProcAddr).",
                  -1 ? "Failure" : "Success", 0);
      return -1;
    } while (0);
  int (*vkCreateInstance)(int *, void *, void **) =
      vkGetInstanceProcAddr(0, "vkCreateInstance");
  if (!vkCreateInstance)
    do {
      MessageBoxA(0, "Vulkan is malfunctioning (vkCreateInstance)",
                  -1 ? "Failure" : "Success", 0);
      return -1;
    } while (0);
  void *instance = 0;
  int result = vkCreateInstance((int[16]){1}, 0, &instance);
  if (!instance || result != 0)
    do {
      MessageBoxA(0,
                  "Vulkan drivers installed and functioning "
                  "but are incompatible. An instance could not be created.",
                  -1 ? "Failure" : "Success", 0);
      return -1;
    } while (0);
  do {
    MessageBoxA(0, "Successfully created a Vulkan instance.",
                0 ? "Failure" : "Success", 0);
    return 0;
  } while (0);
}


x86 assembly (clang, -O0):
<WinMainCRTStartup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <LoadLibraryA@plt>
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1194 <WinMainCRTStartup+0x54>
jmp    116f <WinMainCRTStartup+0x2f>
xor    %ecx,%ecx
lea    0xe95(%rip),%rsi
lea    0xeac(%rip),%rdx
mov    %ecx,%edi
mov    $0x0,%al
call   1060 <MessageBoxA@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12c8 <WinMainCRTStartup+0x188>
mov    -0x10(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0x0,%al
call   1050 <GetProcAddress@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11e1 <WinMainCRTStartup+0xa1>
jmp    11bc <WinMainCRTStartup+0x7c>
xor    %ecx,%ecx
lea    0xe84(%rip),%rsi
lea    0xe5f(%rip),%rdx
mov    %ecx,%edi
mov    $0x0,%al
call   1060 <MessageBoxA@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12c8 <WinMainCRTStartup+0x188>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe8f(%rip),%rsi
call   *-0x18(%rbp)
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1228 <WinMainCRTStartup+0xe8>
jmp    1203 <WinMainCRTStartup+0xc3>
xor    %ecx,%ecx
lea    0xe80(%rip),%rsi
lea    0xe18(%rip),%rdx
mov    %ecx,%edi
mov    $0x0,%al
call   1060 <MessageBoxA@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12c8 <WinMainCRTStartup+0x188>
movq   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x6c(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
mov    -0x78(%rbp),%rax
movl   $0x1,-0x6c(%rbp)
lea    -0x6c(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%esi
lea    -0x28(%rbp),%rdx
call   *%rax
mov    %eax,-0x2c(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1279 <WinMainCRTStartup+0x139>
cmpl   $0x0,-0x2c(%rbp)
je     12a3 <WinMainCRTStartup+0x163>
jmp    127e <WinMainCRTStartup+0x13e>
xor    %ecx,%ecx
lea    0xe31(%rip),%rsi
lea    0xd9d(%rip),%rdx
mov    %ecx,%edi
mov    $0x0,%al
call   1060 <MessageBoxA@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12c8 <WinMainCRTStartup+0x188>
jmp    12a8 <WinMainCRTStartup+0x168>
xor    %ecx,%ecx
lea    0xe68(%rip),%rsi
lea    0xe89(%rip),%rdx
mov    %ecx,%edi
mov    $0x0,%al
call   1060 <MessageBoxA@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WinMainCRTStartup>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <LoadLibraryA@plt>
test   %eax,%eax
je     11d1 <WinMainCRTStartup+0xa1>
movslq %eax,%rdi
lea    0xede(%rip),%rsi
xor    %eax,%eax
call   1040 <GetProcAddress@plt>
test   %eax,%eax
je     11da <WinMainCRTStartup+0xaa>
cltq
lea    0xf12(%rip),%rsi
xor    %edi,%edi
call   *%rax
test   %rax,%rax
je     11e3 <WinMainCRTStartup+0xb3>
movq   $0x0,0x8(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x14(%rsp)
movups %xmm0,0x24(%rsp)
movups %xmm0,0x34(%rsp)
movups %xmm0,0x40(%rsp)
movl   $0x1,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rdx
xor    %esi,%esi
call   *%rax
cmpq   $0x0,0x8(%rsp)
je     11ec <WinMainCRTStartup+0xbc>
test   %eax,%eax
jne    11ec <WinMainCRTStartup+0xbc>
lea    0xf5e(%rip),%rsi
lea    0xf7f(%rip),%rdx
xor    %ebx,%ebx
xor    %edi,%edi
xor    %ecx,%ecx
xor    %eax,%eax
call   1050 <MessageBoxA@plt>
jmp    120a <WinMainCRTStartup+0xda>
lea    0xe35(%rip),%rsi
jmp    11f3 <WinMainCRTStartup+0xc3>
lea    0xe68(%rip),%rsi
jmp    11f3 <WinMainCRTStartup+0xc3>
lea    0xea2(%rip),%rsi
jmp    11f3 <WinMainCRTStartup+0xc3>
lea    0xec5(%rip),%rsi
lea    0xe31(%rip),%rdx
xor    %edi,%edi
xor    %ecx,%ecx
xor    %eax,%eax
call   1050 <MessageBoxA@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"vulkan-1.dll\00"
@.str.1 = [30 x i8] c"Vulkan drivers not installed.\00"
@.str.2 = [8 x i8] c"Failure\00"
@.str.3 = [22 x i8] c"vkGetInstanceProcAddr\00"
@.str.4 = [50 x i8] c"Vulkan is malfunctioning (vkGetInstanceProcAddr).\00"
@.str.5 = [17 x i8] c"vkCreateInstance\00"
@.str.6 = [44 x i8] c"Vulkan is malfunctioning (vkCreateInstance)\00"
@.str.7 = [97 x i8] c"Vulkan drivers installed and functioning but are incompatible. An instance could not be created.\00"
@.str.8 = [40 x i8] c"Successfully created a Vulkan instance.\00"
@.str.9 = [8 x i8] c"Success\00"
define i32 @WinMainCRTStartup() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8* (i8*, i8*)*
%4 = alloca i32 (i32*, i8*, i8**)*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [16 x i32]
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @LoadLibraryA to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %2
%11 = load i8*, i8** %2
%12 = icmp ne i8* %11, null
br i1 %12, label %17, label %13
13: ; preds = %0
br label %14
14: ; preds = %13
%15 = call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @MessageBoxA to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 0)
store i32 -1, i32* %1
br label %56
16: ; No predecessors!
br label %17
17: ; preds = %16, %0
%18 = load i8*, i8** %2
%19 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @GetProcAddress to i32 (i8*, i8*, ...)*)(i8* %18, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i8* (i8*, i8*)*
store i8* (i8*, i8*)* %21, i8* (i8*, i8*)** %3
%22 = load i8* (i8*, i8*)*, i8* (i8*, i8*)** %3
%23 = icmp ne i8* (i8*, i8*)* %22, null
br i1 %23, label %28, label %24
24: ; preds = %17
br label %25
25: ; preds = %24
%26 = call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @MessageBoxA to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 0)
store i32 -1, i32* %1
br label %56
27: ; No predecessors!
br label %28
28: ; preds = %27, %17
%29 = load i8* (i8*, i8*)*, i8* (i8*, i8*)** %3
%30 = call i8* %29(i8* null, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%31 = bitcast i8* %30 to i32 (i32*, i8*, i8**)*
store i32 (i32*, i8*, i8**)* %31, i32 (i32*, i8*, i8**)** %4
%32 = load i32 (i32*, i8*, i8**)*, i32 (i32*, i8*, i8**)** %4
%33 = icmp ne i32 (i32*, i8*, i8**)* %32, null
br i1 %33, label %38, label %34
34: ; preds = %28
br label %35
35: ; preds = %34
%36 = call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @MessageBoxA to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 0)
store i32 -1, i32* %1
br label %56
37: ; No predecessors!
br label %38
38: ; preds = %37, %28
store i8* null, i8** %5
%39 = load i32 (i32*, i8*, i8**)*, i32 (i32*, i8*, i8**)** %4
%40 = bitcast [16 x i32]* %7 to i8*
%41 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
store i32 1, i32* %41
%42 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%43 = call i32 %39(i32* %42, i8* null, i8** %5)
store i32 %43, i32* %6
%44 = load i8*, i8** %5
%45 = icmp ne i8* %44, null
br i1 %45, label %46, label %49
46: ; preds = %38
%47 = load i32, i32* %6
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %46, %38
br label %50
50: ; preds = %49
%51 = call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @MessageBoxA to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 0)
store i32 -1, i32* %1
br label %56
52: ; No predecessors!
br label %53
53: ; preds = %52, %46
br label %54
54: ; preds = %53
%55 = call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @MessageBoxA to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 0)
store i32 0, i32* %1
br label %56
56: ; preds = %14, %25, %35, %50, %54
%57 = load i32, i32* %1
ret i32 %57
}

LLVM IR (-O2):
@.str = [13 x i8] c"vulkan-1.dll\00"
@.str.1 = [30 x i8] c"Vulkan drivers not installed.\00"
@.str.2 = [8 x i8] c"Failure\00"
@.str.3 = [22 x i8] c"vkGetInstanceProcAddr\00"
@.str.4 = [50 x i8] c"Vulkan is malfunctioning (vkGetInstanceProcAddr).\00"
@.str.5 = [17 x i8] c"vkCreateInstance\00"
@.str.6 = [44 x i8] c"Vulkan is malfunctioning (vkCreateInstance)\00"
@.str.7 = [97 x i8] c"Vulkan drivers installed and functioning but are incompatible. An instance could not be created.\00"
@.str.8 = [40 x i8] c"Successfully created a Vulkan instance.\00"
@.str.9 = [8 x i8] c"Success\00"
define i32 @WinMainCRTStartup() {
%1 = alloca i8*
%2 = alloca [16 x i32]
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @LoadLibraryA to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @MessageBoxA to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %38
7: ; preds = %0
%8 = sext i32 %3 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @GetProcAddress to i32 (i8*, i8*, ...)*)(i8* %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @MessageBoxA to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %38
14: ; preds = %7
%15 = sext i32 %10 to i64
%16 = inttoptr i64 %15 to i8* (i8*, i8*)*
%17 = tail call i8* %16(i8* null, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = tail call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @MessageBoxA to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %38
21: ; preds = %14
%22 = bitcast i8* %17 to i32 (i32*, i8*, i8**)*
%23 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%24 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 1
%25 = bitcast i32* %24 to i8*
%26 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
store i32 1, i32* %26
%27 = call i32 %22(i32* %26, i8* null, i8** %1)
%28 = load i8*, i8** %1
%29 = icmp eq i8* %28, null
%30 = icmp ne i32 %27, 0
%31 = select i1 %29, i1 true, i1 %30
br i1 %31, label %32, label %34
32: ; preds = %21
%33 = call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @MessageBoxA to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %36
34: ; preds = %21
%35 = call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @MessageBoxA to i32 (i32, i8*, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 0)
br label %36
36: ; preds = %34, %32
%37 = phi i32 [ -1, %32 ], [ 0, %34 ]
br label %38
38: ; preds = %12, %36, %19, %5
%39 = phi i32 [ -1, %5 ], [ -1, %12 ], [ %37, %36 ], [ -1, %19 ]
ret i32 %39
}