// File: /workspace/github_cpp_makefile_star2_O3/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 $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rdi
callq 0xb93c
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 0x2e2d6(%rip), %rcx     # 0xb7a6d
movq %rcx, 0x618(%r14)
movb %al, 0x602(%r14)
leaq 0x2dba3(%rip), %rax     # 0xb734f
movq %rax, 0x608(%r14)
leaq 0x3926c(%rip), %rax     # 0xc2a26
movq %rax, 0x610(%r14)
movq 0x5e8(%r14), %rdx
leaq 0x36b81(%rip), %rcx     # 0xc0350
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 0xa6c98
movq %r14, %rdi
callq 0x1a416
movq %r14, %rdi
callq 0x1a12a
movq %r14, %rdi
callq 0x1a1ec
movq %r14, %rdi
callq 0x89b3a
movq %r14, %rdi
callq 0x8704c
movq %r14, %rdi
callq 0x265fc
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x13d14
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x13e18
leaq 0x50(%rsp), %rdi
callq 0xd570
cmpl $0x0, 0x7c8(%r14)
je 0x898b6
leaq 0x7c8(%r14), %rsi
leaq 0x158(%r14), %rdi
leaq 0x10(%rsp), %rdx
movq %rdi, (%rdx)
callq 0x1f510
movq %r14, %rdi
callq 0x89b86
leaq 0x940(%r14), %rdi
movq 0x948(%r14), %rdx
leaq 0x2afdc(%rip), %rcx     # 0xb48af
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x63f0
movq %r14, %rdi
movl $0x3, %esi
callq 0x89d56
movl %eax, 0x930(%r14)
movq %r14, %rdi
movl $0x1, %esi
callq 0x89d56
movl %eax, 0x92c(%r14)
cmpl $0x0, 0x930(%r14)
jne 0x89917
movb $0x1, 0x937(%r14)
movq %r14, %rdi
callq 0x8c1c6
movq %r14, %rdi
callq 0x8c290
movq %r14, %rdi
callq 0x8c434
cmpb $0x1, 0x7de(%r14)
jne 0x89941
movq %r14, %rdi
callq 0x8c4ec
movq %rbx, 0x8(%rsp)
leaq 0x910(%r14), %rbp
leaq 0x18(%rsp), %r15
movl $0x4, %ebx
leaq 0x10(%rsp), %r12
decl %ebx
je 0x89a65
movq %r14, %rdi
callq 0x25a08
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 0x899a5
movq (%rdi), %rax
callq *0x8(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x78(%rax)
movq %r14, %rdi
callq 0x8c52a
movq %r14, %rdi
callq 0x8c9f6
movq %r14, %rdi
callq 0x8cc14
movl 0x108(%r14), %esi
movq %r14, %rdi
callq 0xb98a
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%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 0x26cf4
movq %r15, %rdi
callq 0xd570
cmpb $0x0, 0x1d0(%r14)
jne 0x8995c
movq 0x420(%r14), %rsi
addq $0x8, %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x6410
movq %rsp, %rdi
callq 0xb9be
movq %rbx, %rax
addq $0x88, %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 0x2a95e(%rip), %rsi     # 0xb43e0
leaq 0x2a988(%rip), %rdx     # 0xb4411
leaq 0x10(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x7231e(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x722f6(%rip), %rsi     # 0xfbdb0
movq 0x73517(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
jmp 0x89b26
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0x89b1f
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x89aef
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x89af9
jmp 0x89b29
movq %rax, %rbx
movq %r14, %rdi
callq 0x6200
jmp 0x89b29
jmp 0x89b26
jmp 0x89b26
movq %rax, %rbx
movl $0x178, %esi            # imm = 0x178
movq %r13, %rdi
callq 0x6260
jmp 0x89b29
movq %rax, %rbx
movq %r15, %rdi
callq 0xd570
jmp 0x89b29
movq %rax, %rbx
movq %rsp, %rdi
callq 0xb9be
movq %rbx, %rdi
callq 0x64a0
nop