// File: /workspace/github_cpp_makefile_star2_O3/stetre[P]moonvulkan/src/pipeline.c
// Function: GetPipelineExecutableInternalRepresentations
static int GetPipelineExecutableInternalRepresentations(lua_State *L)
    {
    ud_t *ud;
    int err;
    VkResult ec;
    uint32_t count, remaining, tot, i;
    VkPipelineExecutableInfoKHR* info=NULL;
    VkPipelineExecutableInternalRepresentationKHR* representations = NULL; //[N]
    VkPipeline pipeline = checkpipeline(L, 1, &ud);
    CheckDevicePfn(L, ud, GetPipelineExecutableInternalRepresentationsKHR);
#define CLEANUP do {                                                                    \
    zfreeVkPipelineExecutableInfoKHR(L, info, 1);                                       \
    zfreearrayVkPipelineExecutableInternalRepresentationKHR(L, representations, N, 1);  \
} while(0)
    info = zcheckVkPipelineExecutableInfoKHR(L, 2, &err);
    info->pipeline = pipeline;
    representations = znewchainarrayVkPipelineExecutableInternalRepresentationKHR(L, N, &err);
    if(err) { CLEANUP; lua_error(L); }
    ec = ud->ddt->GetPipelineExecutableInternalRepresentationsKHR(ud->device, info, &remaining, NULL);
    if(ec) { CLEANUP; CheckError(L, ec); }
    lua_newtable(L);
    if(remaining==0) { CLEANUP; return 1; }
    tot = 0;
    do {
        if(remaining > N)
            { count = N; remaining -= N; }
        else
            { count = remaining; remaining = 0; }
        ec = ud->ddt->GetPipelineExecutableInternalRepresentationsKHR(ud->device, info, &count, representations);
        if(ec && ec != VK_INCOMPLETE) { CLEANUP; CheckError(L, ec); }
        for(i = 0; i < count; i++)
            {
            zpushVkPipelineExecutableInternalRepresentationKHR(L, &representations[i]);
            lua_rawseti(L, -2, ++tot);
            }
        } while (remaining > 0);
    CLEANUP;
#undef CLEANUP
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x4382b(%rip), %rcx     # 0x8c923
leaq 0x10(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1a4e0
movq %rax, %r14
movq (%r15), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x668(%rax)
je 0x491ef
leaq 0x24(%rsp), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x1a2d0
movq %rax, %r15
movq %r14, 0x10(%rax)
movq %rbx, %rdi
movl $0x20, %esi
movq %r12, %rdx
callq 0x18d90
movq %rax, %r14
cmpl $0x0, (%r12)
je 0x4918b
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movl $0x228, %edx            # imm = 0x228
movq %rbx, %rdi
movq %r14, %rsi
movl $0x20, %ecx
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
callq 0x199a0
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
leaq 0x8(%rsp), %rdx
movq %r15, %rsi
xorl %ecx, %ecx
callq *0x668(%rax)
testl %eax, %eax
je 0x49213
movl %eax, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movl $0x228, %edx            # imm = 0x228
movq %rbx, %rdi
movq %r14, %rsi
movl $0x20, %ecx
movl $0x1, %r8d
callq 0x197d0
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x18980
movq %rbx, %rdi
callq 0x199a0
jmp 0x49200
leaq 0x56ae9(%rip), %rsi     # 0x9fcdf
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19ba0
movl %eax, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x187d0
movl 0x8(%rsp), %eax
testl %eax, %eax
je 0x492de
xorl %r13d, %r13d
movq %r15, 0x18(%rsp)
movl %eax, %ecx
subl $0x20, %ecx
movl $0x20, %edx
cmovael %edx, %eax
movl $0x0, %edx
cmovbl %edx, %ecx
movl %eax, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rax), %rax
movq %r15, %rsi
leaq 0xc(%rsp), %rdx
movq %r14, %rcx
callq *0x668(%rax)
testl %eax, %eax
je 0x4927d
movl %eax, %ebp
cmpl $0x5, %eax
jne 0x491ae
cmpl $0x0, 0xc(%rsp)
je 0x492d2
movl %r13d, %r12d
movl %r13d, %ebp
movq %r14, %r15
movq %r14, %r13
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r13, %rsi
callq 0x19550
leal (%r14,%rbp), %edx
incl %edx
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x19130
incq %r14
movl 0xc(%rsp), %eax
addq $0x228, %r13            # imm = 0x228
cmpq %rax, %r14
jb 0x49293
movl %r12d, %r13d
addl %r14d, %r13d
movq %r15, %r14
movq 0x18(%rsp), %r15
movl 0x8(%rsp), %eax
testl %eax, %eax
jne 0x49233
movl $0x1, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x19160
movl $0x228, %edx            # imm = 0x228
movq %rbx, %rdi
movq %r14, %rsi
movl $0x20, %ecx
movl $0x1, %r8d
callq 0x197d0
jmp 0x49202