// File: rossy[P]crossc/SPIRV-Cross/spirv_msl.cpp
// Function: spirv_cross::CompilerMSL::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 CompilerMSL::emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index,
                                     const string &qualifier, uint32_t)
{
	auto &membertype = get<SPIRType>(member_type_id);

	// If this member requires padding to maintain alignment, emit a dummy padding member.
	MSLStructMemberKey key = get_struct_member_key(type.self, index);
	uint32_t pad_len = struct_member_padding[key];
	if (pad_len > 0)
		statement("char pad", to_string(index), "[", to_string(pad_len), "];");

	// If this member is packed, mark it as so.
	string pack_pfx = "";
	if (member_is_packed_type(type, index))
	{
		pack_pfx = "packed_";

		// If we're packing a matrix, output an appropriate typedef
		if (membertype.vecsize > 1 && membertype.columns > 1)
		{
			string base_type = membertype.width == 16 ? "half" : "float";
			string td_line = "typedef ";
			td_line += base_type + to_string(membertype.vecsize) + "x" + to_string(membertype.columns);
			td_line += " " + pack_pfx;
			td_line += base_type + to_string(membertype.columns) + "x" + to_string(membertype.vecsize);
			td_line += ";";
			add_typedef_line(td_line);
		}
	}

	statement(pack_pfx, type_to_glsl(membertype), " ", qualifier, to_member_name(type, index),
	          member_attribute_qualifier(type, index), type_to_array_glsl(membertype), ";");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
movl -0x14(%rbp), %esi
callq 0xea90
movq -0x2f0(%rbp), %rdi
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
movl -0x18(%rbp), %edx
callq 0xfaeb0
movq -0x2f0(%rbp), %rdi
movq %rax, -0x38(%rbp)
addq $0x848, %rdi            # imm = 0x848
leaq -0x38(%rbp), %rsi
callq 0x1140d0
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jbe 0x10702e
movl -0x18(%rbp), %esi
leaq -0x60(%rbp), %rdi
callq 0x45220
movl -0x3c(%rbp), %esi
leaq -0x80(%rbp), %rdi
callq 0x45220
jmp 0x106fb2
movq -0x2f0(%rbp), %rdi
leaq 0x463cc(%rip), %rsi     # 0x14d38c
leaq 0x463e1(%rip), %rcx     # 0x14d3a8
leaq 0x4007b(%rip), %r9      # 0x147049
leaq -0x60(%rbp), %rdx
leaq -0x80(%rbp), %r8
callq 0x1173e0
jmp 0x106fdd
leaq -0x80(%rbp), %rdi
callq 0x7708
leaq -0x60(%rbp), %rdi
callq 0x7708
jmp 0x10702e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x107020
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x7708
leaq -0x60(%rbp), %rdi
callq 0x7708
jmp 0x10773a
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x7650
movq -0x2f8(%rbp), %rdx
leaq 0x3784f(%rip), %rsi     # 0x13e89e
leaq -0xb0(%rbp), %rdi
callq 0x7520
jmp 0x10705d
leaq -0xb1(%rbp), %rdi
callq 0x73d0
movq -0x2f0(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x18(%rbp), %edx
callq 0x85e00
movb %al, -0x2f9(%rbp)
jmp 0x107084
movb -0x2f9(%rbp), %al
testb $0x1, %al
jne 0x107093
jmp 0x107599
leaq 0x462fb(%rip), %rsi     # 0x14d395
leaq -0xb0(%rbp), %rdi
callq 0x7510
jmp 0x1070a8
movq -0x30(%rbp), %rax
cmpl $0x1, 0x14(%rax)
jbe 0x107597
movq -0x30(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jbe 0x107597
movq -0x30(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x10, %eax
leaq 0x3acca(%rip), %rcx     # 0x141d9f
leaq 0x4600d(%rip), %rax     # 0x14d0e9
cmoveq %rcx, %rax
movq %rax, -0x310(%rbp)
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x7650
movq -0x310(%rbp), %rsi
movq -0x308(%rbp), %rdx
leaq -0xd8(%rbp), %rdi
callq 0x7520
jmp 0x107116
leaq -0xd9(%rbp), %rdi
callq 0x73d0
leaq -0x101(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x7650
movq -0x318(%rbp), %rdx
leaq 0x4625a(%rip), %rsi     # 0x14d39d
leaq -0x100(%rbp), %rdi
callq 0x7520
jmp 0x107151
leaq -0x101(%rbp), %rdi
callq 0x73d0
movq -0x30(%rbp), %rax
movl 0x14(%rax), %esi
leaq -0x188(%rbp), %rdi
callq 0x45220
jmp 0x107172
leaq -0x168(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0x188(%rbp), %rdx
callq 0x117530
jmp 0x10718e
leaq 0x3d0cc(%rip), %rdx     # 0x144261
leaq -0x148(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x11910
jmp 0x1071aa
movq -0x30(%rbp), %rax
movl 0x18(%rax), %esi
leaq -0x1a8(%rbp), %rdi
callq 0x45220
jmp 0x1071bf
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
leaq -0x1a8(%rbp), %rdx
callq 0x2f7f0
jmp 0x1071db
leaq -0x100(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x7470
jmp 0x1071f0
leaq -0x128(%rbp), %rdi
callq 0x7708
leaq -0x1a8(%rbp), %rdi
callq 0x7708
leaq -0x148(%rbp), %rdi
callq 0x7708
leaq -0x168(%rbp), %rdi
callq 0x7708
leaq -0x188(%rbp), %rdi
callq 0x7708
leaq 0x3766a(%rip), %rsi     # 0x13e89d
leaq -0x1c8(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0xdc760
jmp 0x107248
leaq -0x100(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x7470
jmp 0x10725d
leaq -0x1c8(%rbp), %rdi
callq 0x7708
movq -0x30(%rbp), %rax
movl 0x18(%rax), %esi
leaq -0x248(%rbp), %rdi
callq 0x45220
jmp 0x10727e
leaq -0x228(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0x248(%rbp), %rdx
callq 0x117530
jmp 0x10729a
leaq 0x3cfc0(%rip), %rdx     # 0x144261
leaq -0x208(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x11910
jmp 0x1072b6
movq -0x30(%rbp), %rax
movl 0x14(%rax), %esi
leaq -0x268(%rbp), %rdi
callq 0x45220
jmp 0x1072cb
leaq -0x1e8(%rbp), %rdi
leaq -0x208(%rbp), %rsi
leaq -0x268(%rbp), %rdx
callq 0x2f7f0
jmp 0x1072e7
leaq -0x100(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x7470
jmp 0x1072fc
leaq -0x1e8(%rbp), %rdi
callq 0x7708
leaq -0x268(%rbp), %rdi
callq 0x7708
leaq -0x208(%rbp), %rdi
callq 0x7708
leaq -0x228(%rbp), %rdi
callq 0x7708
leaq -0x248(%rbp), %rdi
callq 0x7708
leaq 0x41d67(%rip), %rsi     # 0x1490a6
leaq -0x100(%rbp), %rdi
callq 0x7340
jmp 0x10734d
movq -0x2f0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xfb160
jmp 0x107362
leaq -0x100(%rbp), %rdi
callq 0x7708
leaq -0xd8(%rbp), %rdi
callq 0x7708
jmp 0x107597
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xb1(%rbp), %rdi
callq 0x73d0
jmp 0x10773a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x10772e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xd9(%rbp), %rdi
callq 0x73d0
jmp 0x10772e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x101(%rbp), %rdi
callq 0x73d0
jmp 0x107586
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x10757a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1074a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x10749c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x107490
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x107484
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x7708
leaq -0x1a8(%rbp), %rdi
callq 0x7708
leaq -0x148(%rbp), %rdi
callq 0x7708
leaq -0x168(%rbp), %rdi
callq 0x7708
leaq -0x188(%rbp), %rdi
callq 0x7708
jmp 0x10757a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x7708
jmp 0x10757a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x10756e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x107562
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x107556
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x10754a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x7708
leaq -0x268(%rbp), %rdi
callq 0x7708
leaq -0x208(%rbp), %rdi
callq 0x7708
leaq -0x228(%rbp), %rdi
callq 0x7708
leaq -0x248(%rbp), %rdi
callq 0x7708
leaq -0x100(%rbp), %rdi
callq 0x7708
leaq -0xd8(%rbp), %rdi
callq 0x7708
jmp 0x10772e
jmp 0x107599
movq -0x2f0(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq (%rsi), %rax
movq 0x98(%rax), %rax
leaq -0x288(%rbp), %rdi
xorl %ecx, %ecx
callq *%rax
jmp 0x1075bb
movq -0x2f0(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x320(%rbp)
movq -0x10(%rbp), %rdx
movl -0x18(%rbp), %ecx
leaq -0x2a8(%rbp), %rdi
callq 0x62230
jmp 0x1075e2
movq -0x2f0(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x18(%rbp), %ecx
leaq -0x2c8(%rbp), %rdi
callq 0x107750
jmp 0x1075fe
movq -0x2f0(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0x2e8(%rbp), %rdi
callq 0x61340
jmp 0x107617
movq -0x320(%rbp), %r8
movq -0x2f0(%rbp), %rdi
leaq 0x41a7a(%rip), %rcx     # 0x1490a6
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0x2e8(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq -0x2c8(%rbp), %rcx
movq %rcx, (%rax)
leaq 0x3724e(%rip), %rcx     # 0x13e89d
leaq -0xb0(%rbp), %rsi
leaq -0x288(%rbp), %rdx
leaq -0x2a8(%rbp), %r9
callq 0x117580
jmp 0x10766b
leaq -0x2e8(%rbp), %rdi
callq 0x7708
leaq -0x2c8(%rbp), %rdi
callq 0x7708
leaq -0x2a8(%rbp), %rdi
callq 0x7708
leaq -0x288(%rbp), %rdi
callq 0x7708
leaq -0xb0(%rbp), %rdi
callq 0x7708
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x107722
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x107716
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x10770a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x7708
leaq -0x2c8(%rbp), %rdi
callq 0x7708
leaq -0x2a8(%rbp), %rdi
callq 0x7708
leaq -0x288(%rbp), %rdi
callq 0x7708
leaq -0xb0(%rbp), %rdi
callq 0x7708
movq -0x88(%rbp), %rdi
callq 0x7640
nopw %cs:(%rax,%rax)