// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x5570
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x53e0
movq %rax, %r15
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x5640
movq 0xc02c(%rip), %rcx      # 0x1bfe8
movq 0x3c8(%rcx), %r8
testq %r8, %r8
je 0xfffc
movq 0x28(%r14), %rsi
movq %rsp, %rcx
movq %r15, %rdi
movq %rax, %rdx
callq *%r8
leal 0xc(%rax), %ecx
cmpl $0x11, %ecx
ja 0x10028
leaq 0x4fdd(%rip), %rax      # 0x14fc4
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x52e5(%rip), %rsi      # 0x152dc
jmp 0x101a6
pushq $0x3
popq %rdi
pushq $0x2
popq %rsi
xorl %edx, %edx
callq 0x56a0
testl %eax, %eax
je 0x10080
leaq 0x51a1(%rip), %rsi      # 0x151b5
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x55b0
cmpl $0xc4642878, %eax       # imm = 0xC4642878
je 0x1014e
cmpl $0xc4650720, %eax       # imm = 0xC4650720
je 0x100ec
cmpl $0xc4650b07, %eax       # imm = 0xC4650B07
je 0x1013c
cmpl $0xc4652a47, %eax       # imm = 0xC4652A47
je 0x10133
cmpl $0xc4653214, %eax       # imm = 0xC4653214
je 0x100bc
cmpl $0xc46535ff, %eax       # imm = 0xC46535FF
je 0x100e0
cmpl $0xc4653600, %eax       # imm = 0xC4653600
je 0x100d4
cmpl $0x3b9acdeb, %eax       # imm = 0x3B9ACDEB
jne 0x10104
leaq 0x529b(%rip), %rsi      # 0x15316
jmp 0x101a6
leaq 0x50f4(%rip), %rsi      # 0x1517b
pushq $0x3
popq %rdx
pushq $0x2
popq %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x55b0
leaq 0x5148(%rip), %rsi      # 0x151f3
jmp 0x101a6
leaq 0x53a9(%rip), %rsi      # 0x15460
jmp 0x101a6
leaq 0x5262(%rip), %rsi      # 0x15325
jmp 0x101a6
leaq 0x513b(%rip), %rsi      # 0x1520a
jmp 0x101a6
leaq 0x5211(%rip), %rsi      # 0x152ec
jmp 0x101a6
leaq 0x5216(%rip), %rsi      # 0x152fd
jmp 0x101a6
leaq 0x5271(%rip), %rsi      # 0x15364
jmp 0x101a6
leaq 0x518f(%rip), %rsi      # 0x1528e
jmp 0x101a6
leaq 0x527e(%rip), %rsi      # 0x15389
jmp 0x101a6
movq (%rsp), %rsi
movq %rbx, %rdi
callq 0x5310
jmp 0x101b2
leaq 0x510a(%rip), %rsi      # 0x15232
jmp 0x101a6
leaq 0x5185(%rip), %rsi      # 0x152b6
jmp 0x101a6
leaq 0x51fb(%rip), %rsi      # 0x15335
jmp 0x101a6
leaq 0x520b(%rip), %rsi      # 0x1534e
jmp 0x101a6
leaq 0x509d(%rip), %rsi      # 0x151e9
jmp 0x101a6
leaq 0x5221(%rip), %rsi      # 0x15376
jmp 0x101a6
leaq 0x5144(%rip), %rsi      # 0x152a2
jmp 0x101a6
leaq 0x50ed(%rip), %rsi      # 0x15254
jmp 0x101a6
leaq 0x5157(%rip), %rsi      # 0x152c7
jmp 0x101a6
leaq 0x5086(%rip), %rsi      # 0x151ff
jmp 0x101a6
leaq 0x50f6(%rip), %rsi      # 0x15278
jmp 0x101a6
leaq 0x5054(%rip), %rsi      # 0x151df
jmp 0x101a6
leaq 0x50d2(%rip), %rsi      # 0x15266
jmp 0x101a6
leaq 0x5080(%rip), %rsi      # 0x1521d
jmp 0x101a6
leaq 0x50a2(%rip), %rsi      # 0x15248
movq %rbx, %rdi
xorl %eax, %eax
callq 0x55b0
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop