// File: /workspace/github_cpp_makefile_star2_O3/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, 0x78(%rsp)
movl %ecx, %ebp
movq %rsi, %r13
movq %rdi, %r15
movl %edx, %esi
callq 0xa3ea
movq %rax, 0x80(%rsp)
leaq 0xd0(%rsp), %rax
movq $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 %ebp, %edi
movq 0xd0(%r14,%r12), %rax
movq 0xd8(%r14,%r12), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
movabsq $0x4ec4ec4ec4ec4ec5, %rdx # imm = 0x4EC4EC4EC4EC4EC5
imulq %rcx, %rdx
cmpq %rdi, %rdx
movq %rdi, 0x70(%rsp)
jbe 0x6764a
imulq $0xd0, %rdi, %rcx
addq %rcx, %rax
addq $0x60, %rax
movq (%rax), %rcx
leaq 0xc8(%rsp), %rdx
movq %rcx, (%rdx)
movq %r14, %rcx
cmpq %rdx, %rax
je 0x6764d
addq $0x8, %rax
leaq 0xd0(%rsp), %rdi
movq %rax, %rsi
callq 0x1d5b4
movl 0x8(%r13), %esi
movq 0x38(%r15), %rcx
jmp 0x6764d
movq %r14, %rcx
movl %ebx, 0xc(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
imulq $0x148, %rsi, %rax      # imm = 0x148
testb $0xc, 0x60(%rcx,%rax)
je 0x676bc
movq (%r15), %rax
leaq 0x30(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movq %r15, %rsi
callq *0x140(%rax)
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x6310
movq (%rbx), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x676b8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x8(%r13), %esi
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0x64(%r13), %ebx
movq %r15, %rdi
movl $0xa, %edx
callq 0x12974
cmpl $0x9, %ebx
sete %cl
orb %cl, %al
cmpb $0x1, %al
jne 0x67796
movl 0x8(%r13), %esi
movq %r15, %rdi
movl %ebp, %edx
movl $0x23, %ecx
callq 0x1406a
testb %al, %al
je 0x67796
leaq (%r14,%r12), %rax
addq $0xd0, %rax
movq (%rax), %rax
imulq $0xd0, 0x70(%rsp), %rcx
movl 0xb4(%rax,%rcx), %eax
subl 0xc(%rsp), %eax
testb $0x3, %al
jne 0x678cb
movl %eax, %ecx
shrl $0x4, %ecx
leaq 0x88(%rsp), %rdx
movl %ecx, (%rdx)
andl $0xc, %eax
leaq 0x95c92(%rip), %rcx     # 0xfd3e0
leaq (%rcx,%rax,2), %rcx
leaq 0x561fc(%rip), %rsi     # 0xbd955
leaq 0x532b5(%rip), %r8      # 0xbaa15
leaq 0x10(%rsp), %rdi
callq 0x7897b
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x6310
movq (%rbx), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x67796
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
movq (%r15), %rax
leaq 0x10(%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 0x2c088
movq (%r15), %rax
leaq 0x88(%rsp), %rdi
leaq 0xa8(%rsp), %rcx
movq %r15, %rsi
movq 0x80(%rsp), %rdx
xorl %r8d, %r8d
callq *0xc8(%rax)
leaq 0x57302(%rip), %rax     # 0xbeaf1
movq %rax, (%rsp)
leaq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0x88(%rsp), %r8
leaq 0x30(%rsp), %r9
movq %r15, %rdi
movq 0x78(%rsp), %rcx
callq 0x78a1a
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x67838
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x67859
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x67874
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x67890
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x678ac
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xd0(%rsp), %rdi
callq 0xd570
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x56039(%rip), %rsi     # 0xbd921
leaq 0x56065(%rip), %rdx     # 0xbd954
leaq 0x10(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x944b8(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x94490(%rip), %rsi     # 0xfbdb0
movq 0x956b1(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x67949
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x67956
jmp 0x679e6
movq %rax, %rbx
movq %r14, %rdi
callq 0x6200
jmp 0x679e6
jmp 0x679e3
movq %rax, %rbx
jmp 0x67a1e
movq %rax, %rbx
jmp 0x67a02
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6799e
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x6799e
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x679c4
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x679c4
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x679e6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x679e6
jmp 0x679e3
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x67a02
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x67a1e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xd0(%rsp), %rdi
callq 0xd570
movq %rbx, %rdi
callq 0x64a0
nop