// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_msl.cpp
// Function: spirv_cross::CompilerMSL::compile[abi:cxx11]()
string CompilerMSL::compile()
{
	// Force a classic "C" locale, reverts when function returns
	ClassicLocale classic_locale;

	// Do not deal with GLES-isms like precision, older extensions and such.
	options.vulkan_semantics = true;
	options.es = false;
	options.version = 450;
	backend.float_literal_suffix = false;
	backend.half_literal_suffix = "h";
	backend.uint32_t_literal_suffix = true;
	backend.basic_int_type = "int";
	backend.basic_uint_type = "uint";
	backend.discard_literal = "discard_fragment()";
	backend.swizzle_is_function = false;
	backend.shared_is_implied = false;
	backend.use_initializer_list = true;
	backend.use_typed_initializer_list = true;
	backend.native_row_major_matrix = false;
	backend.flexible_member_array_supported = false;
	backend.can_declare_arrays_inline = false;
	backend.can_return_array = false;
	backend.boolean_mix_support = false;
	backend.allow_truncated_access_chain = true;
	backend.array_is_value_type = false;

	is_rasterization_disabled = msl_options.disable_rasterization;

	replace_illegal_names();

	struct_member_padding.clear();

	build_function_control_flow_graphs_and_analyze();
	update_active_builtins();
	analyze_image_and_sampler_usage();
	analyze_sampled_image_usage();
	build_implicit_builtins();

	fixup_image_load_store_access();

	set_enabled_interface_variables(get_active_interface_variables());
	if (aux_buffer_id)
		active_interface_variables.insert(aux_buffer_id);

	// Preprocess OpCodes to extract the need to output additional header content
	preprocess_op_codes();

	// Create structs to hold input, output and uniform variables.
	// Do output first to ensure out. is declared at top of entry function.
	qual_pos_var_name = "";
	stage_out_var_id = add_interface_block(StorageClassOutput);
	stage_in_var_id = add_interface_block(StorageClassInput);

	// Metal vertex functions that define no output must disable rasterization and return void.
	if (!stage_out_var_id)
		is_rasterization_disabled = true;

	// Convert the use of global variables to recursively-passed function parameters
	localize_global_variables();
	extract_global_variables_from_functions();

	// Mark any non-stage-in structs to be tightly packed.
	mark_packable_structs();

	// Metal does not allow dynamic array lengths.
	// Resolve any specialization constants that are used for array lengths.
	if (msl_options.resolve_specialized_array_lengths)
		resolve_specialized_array_lengths();

	uint32_t pass_count = 0;
	do
	{
		if (pass_count >= 3)
			SPIRV_CROSS_THROW("Over 3 compilation loops detected. Must be a bug!");

		reset();

		next_metal_resource_index = MSLResourceBinding(); // Start bindings at zero

		// Move constructor for this type is broken on GCC 4.9 ...
		buffer = unique_ptr<ostringstream>(new ostringstream());

		emit_header();
		emit_specialization_constants();
		emit_resources();
		emit_custom_functions();
		emit_function(get<SPIRFunction>(ir.default_entry_point), Bitset());

		pass_count++;
	} while (force_recompile);

	return buffer->str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb97c
movb $0x1, %al
movb %al, 0x43e(%r14)
xorl %ecx, %ecx
movb %cl, 0x43c(%r14)
movl $0x1c2, 0x438(%r14) # imm = 0x1C2
leaq 0x5e0(%r14), %rdi
movb %cl, 0x600(%r14)
leaq 0x2e69e(%rip), %rcx     # 0xb8a7d
movq %rcx, 0x618(%r14)
movb %al, 0x602(%r14)
leaq 0x2df6b(%rip), %rax     # 0xb835f
movq %rax, 0x608(%r14)
leaq 0x39654(%rip), %rax     # 0xc3a56
movq %rax, 0x610(%r14)
movq 0x5e8(%r14), %rdx
leaq 0x36f69(%rip), %rcx     # 0xc1380
movl $0x12, %r8d
xorl %esi, %esi
callq 0x63f0
xorl %eax, %eax
movw %ax, 0x620(%r14)
movw $0x101, 0x624(%r14)     # imm = 0x101
movb %al, 0x622(%r14)
movw %ax, 0x627(%r14)
movw $0x100, 0x62e(%r14)     # imm = 0x100
movb %al, 0x62a(%r14)
movb %al, 0x632(%r14)
movb 0x7dd(%r14), %al
movb %al, 0x937(%r14)
movq (%r14), %rax
movq %r14, %rdi
callq *0x170(%rax)
leaq 0x848(%r14), %rdi
callq 0xa7ba4
movq %r14, %rdi
callq 0x1aa86
movq %r14, %rdi
callq 0x1a798
movq %r14, %rdi
callq 0x1a85c
movq %r14, %rdi
callq 0x8a78e
movq %r14, %rdi
callq 0x87c28
movq %r14, %rdi
callq 0x26cb8
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x13e26
leaq 0x60(%rsp), %rsi
movq %r14, %rdi
callq 0x13f40
leaq 0x60(%rsp), %rdi
callq 0xd5b0
cmpl $0x0, 0x7c8(%r14)
je 0x8a4fe
leaq 0x7c8(%r14), %rsi
leaq 0x158(%r14), %rdi
leaq 0x10(%rsp), %rdx
movq %rdi, (%rdx)
callq 0x1fc02
movq %r14, %rdi
callq 0x8a7da
leaq 0x940(%r14), %rdi
movq 0x948(%r14), %rdx
leaq 0x2b394(%rip), %rcx     # 0xb58af
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x63f0
movq %r14, %rdi
movl $0x3, %esi
callq 0x8a9aa
movl %eax, 0x930(%r14)
movq %r14, %rdi
movl $0x1, %esi
callq 0x8a9aa
movl %eax, 0x92c(%r14)
cmpl $0x0, 0x930(%r14)
jne 0x8a55f
movb $0x1, 0x937(%r14)
movq %r14, %rdi
callq 0x8ce2c
movq %r14, %rdi
callq 0x8ceea
movq %r14, %rdi
callq 0x8d08e
cmpb $0x1, 0x7de(%r14)
jne 0x8a589
movq %r14, %rdi
callq 0x8d146
movq %rbx, 0x58(%rsp)
leaq 0x910(%r14), %rbp
leaq 0x18(%rsp), %r15
movl $0x4, %ebx
leaq 0x10(%rsp), %r12
decl %ebx
je 0x8a6b4
movq %r14, %rdi
callq 0x260dc
xorps %xmm0, %xmm0
movups %xmm0, 0x9(%rbp)
movups %xmm0, (%rbp)
movl $0x178, %edi            # imm = 0x178
callq 0x6250
movq %rax, %r13
movq %rax, %rdi
callq 0x6370
movq 0x420(%r14), %rdi
movq %r13, 0x420(%r14)
testq %rdi, %rdi
je 0x8a5ed
movq (%rdi), %rax
callq *0x8(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x78(%rax)
movq %r14, %rdi
callq 0x8d184
movq %r14, %rdi
callq 0x8d644
movq %r14, %rdi
callq 0x8d82a
movl 0x108(%r14), %esi
movq %r14, %rdi
callq 0xb9ca
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
leaq 0x48(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq $0x1, 0x20(%rsp)
movups %xmm0, 0x10(%r15)
movl $0x3f800000, 0x38(%rsp) # imm = 0x3F800000
movups %xmm0, 0x28(%r15)
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x2736e
movq %r15, %rdi
callq 0xd5b0
cmpb $0x0, 0x1d0(%r14)
jne 0x8a5a4
movq 0x420(%r14), %rsi
addq $0x8, %rsi
movq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x6410
leaq 0x8(%rsp), %rdi
callq 0xb9fe
movq %rbx, %rax
addq $0x98, %rsp
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 0x2ad0f(%rip), %rsi     # 0xb53e0
leaq 0x2ad39(%rip), %rdx     # 0xb5411
leaq 0x10(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x7269f(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x72677(%rip), %rsi     # 0xfcd80
movq 0x738c8(%rip), %rdx     # 0xfdfd8
movq %r14, %rdi
callq 0x6470
jmp 0x8a778
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x8a771
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x8a746
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x8a746
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x8a77b
movq %r14, %rdi
callq 0x6200
jmp 0x8a77b
jmp 0x8a778
jmp 0x8a778
movq %rax, %rbx
movl $0x178, %esi            # imm = 0x178
movq %r13, %rdi
callq 0x6260
jmp 0x8a77b
movq %rax, %rbx
movq %r15, %rdi
callq 0xd5b0
jmp 0x8a77b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb9fe
movq %rbx, %rdi
callq 0x64a0
nop