// File: /workspace/github_cpp_makefile_star2_O1/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, 0xc(%rsp)
movq %r8, %rbx
movl %ecx, %ebp
movq %rsi, %r13
movq %rdi, %r15
movl %edx, %esi
callq 0xa426
movq %rax, 0x80(%rsp)
leaq 0xd0(%rsp), %rdi
movq $0x0, -0x8(%rdi)
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), %eax
movq 0x38(%r15), %r12
imulq $0x148, %rax, %r14      # imm = 0x148
movl %ebp, %esi
movq 0xd0(%r12,%r14), %rax
movq 0xd8(%r12,%r14), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
movabsq $0x4ec4ec4ec4ec4ec5, %rdx # imm = 0x4EC4EC4EC4EC4EC5
imulq %rcx, %rdx
movq %rsi, 0x50(%rsp)
cmpq %rsi, %rdx
jbe 0x67f03
imulq $0xd0, 0x50(%rsp), %rcx
leaq (%rax,%rcx), %rsi
addq $0x60, %rsi
movq (%rsi), %rax
leaq 0xc8(%rsp), %rcx
movq %rax, (%rcx)
cmpq %rcx, %rsi
je 0x67f03
addq $0x8, %rsi
callq 0x1dcd0
movq %rbx, 0x78(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0x8(%r13), %eax
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
testb $0xc, 0x60(%rcx,%rax)
je 0x67f77
movq (%r15), %rax
leaq 0x30(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movq %r15, %rsi
callq *0x140(%rax)
leaq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x6310
movq (%rbx), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x67f77
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0x8(%r13), %esi
movl 0x64(%r13), %ebx
movq %r15, %rdi
movl $0xa, %edx
callq 0x1299a
cmpl $0x9, %ebx
sete %cl
orb %cl, %al
cmpb $0x1, %al
jne 0x68055
movl 0x8(%r13), %esi
movq %r15, %rdi
movl %ebp, %edx
movl $0x23, %ecx
callq 0x14222
testb %al, %al
je 0x68055
leaq (%r12,%r14), %rax
addq $0xd0, %rax
movq (%rax), %rax
imulq $0xd0, 0x50(%rsp), %rcx
movl 0xb4(%rax,%rcx), %eax
subl 0xc(%rsp), %eax
testb $0x3, %al
jne 0x6818d
movl %eax, %ecx
shrl $0x4, %ecx
leaq 0x88(%rsp), %rdx
movl %ecx, (%rdx)
andl $0xc, %eax
leaq 0x963d3(%rip), %rcx     # 0xfe3e0
leaq (%rcx,%rax,2), %rcx
leaq 0x56935(%rip), %rsi     # 0xbe94d
leaq 0x53a06(%rip), %r8      # 0xbba25
leaq 0x10(%rsp), %rdi
callq 0x79487
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x6310
movq (%rbx), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x68055
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
leaq 0xd0(%rsp), %rbx
callq 0x2c69c
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 0x57a33(%rip), %rax     # 0xbfae9
movq %rax, (%rsp)
leaq 0x10(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x88(%rsp), %r8
leaq 0x30(%rsp), %r9
movq %r15, %rdi
movq 0x78(%rsp), %rcx
callq 0x79526
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x680ff
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x68120
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6813b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x68157
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x68173
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0xd5b0
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, %rbx
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5676f(%rip), %rsi     # 0xbe919
leaq 0x5679b(%rip), %rdx     # 0xbe94c
leaq 0x10(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0x94bc6(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x94b9e(%rip), %rsi     # 0xfcd80
movq 0x95def(%rip), %rdx     # 0xfdfd8
movq %rbx, %rdi
callq 0x6470
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x68213
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x68213
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x682ac
movq %rbx, %rdi
callq 0x6200
jmp 0x682ac
jmp 0x682a9
movq %rax, %r14
jmp 0x682e4
movq %rax, %r14
jmp 0x682c8
movq %rax, %r14
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x68264
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x68264
movq %rax, %r14
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6828a
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x6828a
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x682ac
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x682ac
jmp 0x682a9
movq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x682c8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x682e4
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xd0(%rsp), %rdi
callq 0xd5b0
movq %r14, %rdi
callq 0x64a0
nop