// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_msl.cpp
// Function: spirv_cross::CompilerMSL::MemberSorter::sort()
void CompilerMSL::MemberSorter::sort()
{
	// Create a temporary array of consecutive member indices and sort it based on how
	// the members should be reordered, based on builtin and sorting aspect meta info.
	size_t mbr_cnt = type.member_types.size();
	vector<uint32_t> mbr_idxs(mbr_cnt);
	iota(mbr_idxs.begin(), mbr_idxs.end(), 0); // Fill with consecutive indices
	std::sort(mbr_idxs.begin(), mbr_idxs.end(), *this); // Sort member indices based on sorting aspect

	// Move type and meta member info to the order defined by the sorted member indices.
	// This is done by creating temporary copies of both member types and meta, and then
	// copying back to the original content at the sorted indices.
	auto mbr_types_cpy = type.member_types;
	auto mbr_meta_cpy = meta.members;
	for (uint32_t mbr_idx = 0; mbr_idx < mbr_cnt; mbr_idx++)
	{
		type.member_types[mbr_idx] = mbr_types_cpy[mbr_idxs[mbr_idx]];
		meta.members[mbr_idx] = mbr_meta_cpy[mbr_idxs[mbr_idx]];
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x68(%rax), %r13
movq 0x70(%rax), %rbp
movq %rbp, %r14
subq %r13, %r14
sarq $0x2, %r14
leaq 0x38(%rsp), %r12
leaq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x1c7b6
movq (%r12), %r15
movq 0x8(%r12), %r12
cmpq %r12, %r15
je 0x8fe35
xorl %eax, %eax
movq %r15, %rcx
movl %eax, (%rcx)
incl %eax
addq $0x4, %rcx
cmpq %r12, %rcx
jne 0x8fdc0
movq 0x10(%rbx), %rax
movq %rax, 0x30(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, 0x20(%rsp)
cmpq %r12, %r15
je 0x8fe46
movq %r12, %rax
subq %r15, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xae095
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xae1c3
jmp 0x8fe46
movq 0x10(%rbx), %rax
movq %rax, 0x30(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, 0x20(%rsp)
movq (%rbx), %rsi
addq $0x68, %rsi
leaq 0x20(%rsp), %rdi
callq 0x1ef5c
movl $0xd0, %esi
addq 0x8(%rbx), %rsi
leaq 0x50(%rsp), %rdi
callq 0x1d7dc
cmpq %r13, %rbp
je 0x8ff38
movl $0x1, %ebp
xorl %eax, %eax
movq 0x38(%rsp), %rcx
movl (%rcx,%rax,4), %edx
movq 0x20(%rsp), %rsi
movl (%rsi,%rdx,4), %edx
movq (%rbx), %rsi
movq 0x68(%rsi), %rsi
movl %edx, (%rsi,%rax,4)
movl (%rcx,%rax,4), %ecx
imulq $0xd0, %rcx, %r15
addq 0x50(%rsp), %r15
movq 0x8(%rbx), %rcx
imulq $0xd0, %rax, %r12
addq 0xd0(%rcx), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x6170
leaq 0x20(%r12), %rdi
leaq 0x20(%r15), %rsi
callq 0x6170
leaq 0x40(%r12), %rdi
leaq 0x40(%r15), %rsi
callq 0x6170
movq 0x60(%r15), %rax
movq %rax, 0x60(%r12)
cmpq %r12, %r15
je 0x8fef8
leaq 0x68(%r12), %rdi
leaq 0x68(%r15), %rsi
callq 0x1dcd0
movups 0xa0(%r15), %xmm0
movups 0xb0(%r15), %xmm1
movups 0xbd(%r15), %xmm2
movups %xmm2, 0xbd(%r12)
movups %xmm1, 0xb0(%r12)
movups %xmm0, 0xa0(%r12)
movl %ebp, %eax
incl %ebp
cmpq %rax, %r14
ja 0x8fe7a
leaq 0x50(%rsp), %rdi
callq 0xe316
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x8ff59
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x8ff70
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8ff86
movq %rax, %rbx
jmp 0x8ff98
movq %rax, %rbx
jmp 0x8ffaf
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xe316
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x8ffaf
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x8ffc6
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0