// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonglfw/src/vulkan.c
// Function: CreateWindowSurface
static int CreateWindowSurface(lua_State *L)
    {
    VkResult ec;
    VkSurfaceKHR surface;
    win_t *win = checkwindow(L, 1);
    VkInstance instance = (VkInstance)checkhandle(L, 2);
    VkAllocationCallbacks* allocator = (VkAllocationCallbacks*)optlightuserdata(L, 3);

    CheckVulkanPfn(L, CreateWindowSurface);
    ec = glfw.CreateWindowSurface(instance, win->window, allocator, &surface);

    if(ec != VK_SUCCESS)
        return luaL_error(L, ResultString(ec));
    pushhandle(L, (uint64_t)surface);
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x1, %esi
callq 0x5560
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x53d0
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x5630
movq 0xb8a9(%rip), %rcx      # 0x1bfe8
movq 0x3c8(%rcx), %r8
testq %r8, %r8
je 0x1078c
movq 0x28(%r14), %rsi
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rdx
callq *%r8
cmpl $0xc46535ff, %eax       # imm = 0xC46535FF
jle 0x107bb
leal 0xc(%rax), %ecx
cmpl $0x11, %ecx
ja 0x10833
leaq 0x584d(%rip), %rax      # 0x15fc4
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x5b55(%rip), %rsi      # 0x162dc
jmp 0x10944
movl $0x3, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x5690
testl %eax, %eax
je 0x107eb
leaq 0x5a0d(%rip), %rsi      # 0x161b5
movq %rbx, %rdi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x55a0
cmpl $0xc4652a46, %eax       # imm = 0xC4652A46
jg 0x10812
cmpl $0xc4642878, %eax       # imm = 0xC4642878
je 0x10869
cmpl $0xc4650720, %eax       # imm = 0xC4650720
je 0x10851
cmpl $0xc4650b07, %eax       # imm = 0xC4650B07
jne 0x10881
leaq 0x5b68(%rip), %rsi      # 0x1634e
jmp 0x10944
leaq 0x5989(%rip), %rsi      # 0x1617b
movq %rbx, %rdi
movl $0x3, %edx
movl $0x2, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x55a0
cmpl $0xc4652a47, %eax       # imm = 0xC4652A47
je 0x10875
cmpl $0xc4653214, %eax       # imm = 0xC4653214
je 0x1085d
cmpl $0xc46535ff, %eax       # imm = 0xC46535FF
jne 0x10881
leaq 0x5acf(%rip), %rsi      # 0x162fd
jmp 0x10944
cmpl $0xc4653600, %eax       # imm = 0xC4653600
je 0x10910
cmpl $0x3b9acdeb, %eax       # imm = 0x3B9ACDEB
jne 0x10881
leaq 0x5aca(%rip), %rsi      # 0x16316
jmp 0x10944
leaq 0x5b0c(%rip), %rsi      # 0x16364
jmp 0x10944
leaq 0x5ac1(%rip), %rsi      # 0x16325
jmp 0x10944
leaq 0x5b06(%rip), %rsi      # 0x16376
jmp 0x10944
leaq 0x5ab9(%rip), %rsi      # 0x16335
jmp 0x10944
leaq 0x5b01(%rip), %rsi      # 0x16389
jmp 0x10944
leaq 0x595f(%rip), %rsi      # 0x161f3
jmp 0x10944
leaq 0x5bc0(%rip), %rsi      # 0x16460
jmp 0x10944
leaq 0x595e(%rip), %rsi      # 0x1620a
jmp 0x10944
leaq 0x59d6(%rip), %rsi      # 0x1628e
jmp 0x10944
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5310
movl $0x1, %eax
jmp 0x1094e
leaq 0x595a(%rip), %rsi      # 0x16232
jmp 0x10944
leaq 0x59d5(%rip), %rsi      # 0x162b6
jmp 0x10944
leaq 0x58ff(%rip), %rsi      # 0x161e9
jmp 0x10944
leaq 0x59af(%rip), %rsi      # 0x162a2
jmp 0x10944
leaq 0x5958(%rip), %rsi      # 0x16254
jmp 0x10944
leaq 0x59c2(%rip), %rsi      # 0x162c7
jmp 0x10944
leaq 0x58f1(%rip), %rsi      # 0x161ff
jmp 0x10944
leaq 0x59d5(%rip), %rsi      # 0x162ec
jmp 0x10944
leaq 0x5958(%rip), %rsi      # 0x16278
jmp 0x10944
leaq 0x58b6(%rip), %rsi      # 0x161df
jmp 0x10944
leaq 0x5934(%rip), %rsi      # 0x16266
jmp 0x10944
leaq 0x58e2(%rip), %rsi      # 0x1621d
jmp 0x10944
leaq 0x5904(%rip), %rsi      # 0x16248
movq %rbx, %rdi
xorl %eax, %eax
callq 0x55a0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq