// File: /workspace/github_c_makefile_star2_O3/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 0x5570
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x53e0
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
callq 0x5640
movq 0xb77d(%rip), %rcx      # 0x1bfe8
movq 0x3c8(%rcx), %r8
testq %r8, %r8
je 0x108b8
movq 0x28(%r14), %rsi
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rdx
callq *%r8
cmpl $0xc46535ff, %eax       # imm = 0xC46535FF
jle 0x108e7
leal 0xc(%rax), %ecx
cmpl $0x11, %ecx
ja 0x1095f
leaq 0x5721(%rip), %rax      # 0x15fc4
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x5a29(%rip), %rsi      # 0x162dc
jmp 0x10a70
movl $0x3, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x56a0
testl %eax, %eax
je 0x10917
leaq 0x58e1(%rip), %rsi      # 0x161b5
movq %rbx, %rdi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x55b0
cmpl $0xc4652a46, %eax       # imm = 0xC4652A46
jg 0x1093e
cmpl $0xc4642878, %eax       # imm = 0xC4642878
je 0x10995
cmpl $0xc4650720, %eax       # imm = 0xC4650720
je 0x1097d
cmpl $0xc4650b07, %eax       # imm = 0xC4650B07
jne 0x109ad
leaq 0x5a3c(%rip), %rsi      # 0x1634e
jmp 0x10a70
leaq 0x585d(%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 0x55b0
cmpl $0xc4652a47, %eax       # imm = 0xC4652A47
je 0x109a1
cmpl $0xc4653214, %eax       # imm = 0xC4653214
je 0x10989
cmpl $0xc46535ff, %eax       # imm = 0xC46535FF
jne 0x109ad
leaq 0x59a3(%rip), %rsi      # 0x162fd
jmp 0x10a70
cmpl $0xc4653600, %eax       # imm = 0xC4653600
je 0x10a3c
cmpl $0x3b9acdeb, %eax       # imm = 0x3B9ACDEB
jne 0x109ad
leaq 0x599e(%rip), %rsi      # 0x16316
jmp 0x10a70
leaq 0x59e0(%rip), %rsi      # 0x16364
jmp 0x10a70
leaq 0x5995(%rip), %rsi      # 0x16325
jmp 0x10a70
leaq 0x59da(%rip), %rsi      # 0x16376
jmp 0x10a70
leaq 0x598d(%rip), %rsi      # 0x16335
jmp 0x10a70
leaq 0x59d5(%rip), %rsi      # 0x16389
jmp 0x10a70
leaq 0x5833(%rip), %rsi      # 0x161f3
jmp 0x10a70
leaq 0x5a94(%rip), %rsi      # 0x16460
jmp 0x10a70
leaq 0x5832(%rip), %rsi      # 0x1620a
jmp 0x10a70
leaq 0x58aa(%rip), %rsi      # 0x1628e
jmp 0x10a70
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5310
movl $0x1, %eax
jmp 0x10a7a
leaq 0x582e(%rip), %rsi      # 0x16232
jmp 0x10a70
leaq 0x58a9(%rip), %rsi      # 0x162b6
jmp 0x10a70
leaq 0x57d3(%rip), %rsi      # 0x161e9
jmp 0x10a70
leaq 0x5883(%rip), %rsi      # 0x162a2
jmp 0x10a70
leaq 0x582c(%rip), %rsi      # 0x16254
jmp 0x10a70
leaq 0x5896(%rip), %rsi      # 0x162c7
jmp 0x10a70
leaq 0x57c5(%rip), %rsi      # 0x161ff
jmp 0x10a70
leaq 0x58a9(%rip), %rsi      # 0x162ec
jmp 0x10a70
leaq 0x582c(%rip), %rsi      # 0x16278
jmp 0x10a70
leaq 0x578a(%rip), %rsi      # 0x161df
jmp 0x10a70
leaq 0x5808(%rip), %rsi      # 0x16266
jmp 0x10a70
leaq 0x57b6(%rip), %rsi      # 0x1621d
jmp 0x10a70
leaq 0x57d8(%rip), %rsi      # 0x16248
movq %rbx, %rdi
xorl %eax, %eax
callq 0x55b0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq