// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_hlsl.cpp
// Function: spirv_cross::CompilerHLSL::emit_struct_member(spirv_cross::SPIRType const&, unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)
void CompilerHLSL::emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index,
                                      const string &qualifier, uint32_t base_offset)
{
	auto &membertype = get<SPIRType>(member_type_id);

	Bitset memberflags;
	auto &memb = ir.meta[type.self].members;
	if (index < memb.size())
		memberflags = memb[index].decoration_flags;

	string qualifiers;
	bool is_block = ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock) ||
	                ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock);

	if (is_block)
		qualifiers = to_interpolation_qualifiers(memberflags);

	string packing_offset;
	bool is_push_constant = type.storage == StorageClassPushConstant;

	if ((has_decoration(type.self, DecorationCPacked) || is_push_constant) &&
	    has_member_decoration(type.self, index, DecorationOffset))
	{
		uint32_t offset = memb[index].offset - base_offset;
		if (offset & 3)
			SPIRV_CROSS_THROW("Cannot pack on tighter bounds than 4 bytes in HLSL.");

		static const char *packing_swizzle[] = { "", ".y", ".z", ".w" };
		packing_offset = join(" : packoffset(c", offset / 16, packing_swizzle[(offset & 15) >> 2], ")");
	}

	statement(layout_for_member(type, index), qualifiers, qualifier,
	          variable_decl(membertype, to_member_name(type, index)), packing_offset, ";");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %r9d, %ebx
movq %r8, 0x38(%rsp)
movl %ecx, %ebp
movq %rsi, %r13
movq %rdi, %r15
movl %edx, %esi
callq 0x90a4
movq %rax, 0x40(%rsp)
leaq 0xd0(%rsp), %rax
andq $0x0, -0x8(%rax)
leaq 0x100(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movl 0x8(%r13), %esi
movq 0x38(%r15), %r14
imulq $0x148, %rsi, %r12      # imm = 0x148
movl $0xd0, %ecx
movl %ebp, %r8d
movq 0xd0(%r14,%r12), %rdi
movq 0xd8(%r14,%r12), %rax
subq %rdi, %rax
cqto
idivq %rcx
movq %r14, %rcx
movq %r8, 0x10(%rsp)
cmpq %r8, %rax
jbe 0x541e4
imulq $0xd0, 0x10(%rsp), %rax
leaq (%rdi,%rax), %rsi
addq $0x60, %rsi
leaq 0xc8(%rsp), %rdi
callq 0x19146
movl 0x8(%r13), %esi
movq 0x38(%r15), %rcx
movl %ebx, 0xc(%rsp)
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
imulq $0x148, %rsi, %rax      # imm = 0x148
testb $0xc, 0x60(%rcx,%rax)
je 0x54244
movq (%r15), %rax
leaq 0x48(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movq %r15, %rsi
callq *0x140(%rax)
leaq 0x88(%rsp), %rdi
leaq 0x48(%rsp), %rbx
movq %rbx, %rsi
callq 0x6320
movq %rbx, %rdi
callq 0x6548
movl 0x8(%r13), %esi
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0x64(%r13), %ebx
pushq $0xa
popq %rdx
movq %r15, %rdi
callq 0x103d2
cmpl $0x9, %ebx
sete %cl
orb %cl, %al
cmpb $0x1, %al
jne 0x542ff
movl 0x8(%r13), %esi
pushq $0x23
popq %rcx
movq %r15, %rdi
movl %ebp, %edx
callq 0x117ba
testb %al, %al
je 0x542ff
movl $0xd0, %eax
addq %rax, %r14
addq %r12, %r14
movq (%r14), %rax
imulq $0xd0, 0x10(%rsp), %rcx
movl 0xb4(%rax,%rcx), %eax
subl 0xc(%rsp), %eax
testb $0x3, %al
jne 0x543d1
movl %eax, %ecx
shrl $0x4, %ecx
leaq 0x68(%rsp), %rdx
movl %ecx, (%rdx)
andl $0xc, %eax
leaq 0x94127(%rip), %rcx     # 0xe83f0
leaq (%rcx,%rax,2), %rcx
leaq 0x44611(%rip), %rsi     # 0x988e5
leaq 0x4171a(%rip), %r8      # 0x959f5
leaq 0x18(%rsp), %rdi
callq 0x614aa
leaq 0x48(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x6320
movq %rbx, %rdi
callq 0x6548
movq (%r15), %rax
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
callq *0x138(%rax)
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
callq 0x25cca
movq (%r15), %rax
leaq 0x68(%rsp), %rdi
leaq 0xa8(%rsp), %rcx
movq %r15, %rsi
movq 0x40(%rsp), %rdx
xorl %r8d, %r8d
callq *0xc8(%rax)
leaq 0x4572f(%rip), %rax     # 0x99a81
movq %rax, (%rsp)
leaq 0x18(%rsp), %rsi
leaq 0x88(%rsp), %rdx
leaq 0x68(%rsp), %r8
leaq 0x48(%rsp), %r9
movq %r15, %rdi
movq 0x38(%rsp), %rcx
callq 0x61526
leaq 0x68(%rsp), %rdi
callq 0x6548
leaq 0xa8(%rsp), %rdi
callq 0x6548
leaq 0x18(%rsp), %rdi
callq 0x6548
leaq 0x48(%rsp), %rdi
callq 0x6548
leaq 0x88(%rsp), %rdi
callq 0x6548
leaq 0xd0(%rsp), %rdi
callq 0xb51c
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %r14
leaq 0x444ce(%rip), %rsi     # 0x988b1
leaq 0x18(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0x929b5(%rip), %rsi     # 0xe6dc0
movq 0x93bce(%rip), %rdx     # 0xe7fe0
movq %r14, %rdi
callq 0x6490
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x6548
testb %bpl, %bpl
jne 0x54431
jmp 0x5447c
movq %rax, %rbx
movq %r14, %rdi
callq 0x6200
jmp 0x5447c
jmp 0x54479
movq %rax, %rbx
jmp 0x54493
movq %rax, %rbx
jmp 0x54486
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x6548
jmp 0x54459
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x6548
jmp 0x5446b
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x6548
jmp 0x5447c
jmp 0x54479
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x6548
leaq 0x88(%rsp), %rdi
callq 0x6548
leaq 0xd0(%rsp), %rdi
callq 0xb51c
movq %rbx, %rdi
callq 0x64b0