// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::ActiveBuiltinHandler::handle_builtin(spirv_cross::SPIRType const&, spv::BuiltIn, spirv_cross::Bitset const&)
void Compiler::ActiveBuiltinHandler::handle_builtin(const SPIRType &type, BuiltIn builtin,
                                                    const Bitset &decoration_flags)
{
	// If used, we will need to explicitly declare a new array size for these builtins.

	if (builtin == BuiltInClipDistance)
	{
		if (!type.array_size_literal[0])
			SPIRV_CROSS_THROW("Array size for ClipDistance must be a literal.");
		uint32_t array_size = type.array[0];
		if (array_size == 0)
			SPIRV_CROSS_THROW("Array size for ClipDistance must not be unsized.");
		compiler.clip_distance_count = array_size;
	}
	else if (builtin == BuiltInCullDistance)
	{
		if (!type.array_size_literal[0])
			SPIRV_CROSS_THROW("Array size for CullDistance must be a literal.");
		uint32_t array_size = type.array[0];
		if (array_size == 0)
			SPIRV_CROSS_THROW("Array size for CullDistance must not be unsized.");
		compiler.cull_distance_count = array_size;
	}
	else if (builtin == BuiltInPosition)
	{
		if (decoration_flags.get(DecorationInvariant))
			compiler.position_invariant = true;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
testl %edx, %edx
je 0x1a0aa
cmpl $0x4, %edx
je 0x1a087
cmpl $0x3, %edx
jne 0x1a0bb
movq 0x38(%rsi), %rax
testb $0x1, (%rax)
je 0x1a12f
movq 0x20(%rsi), %rax
movl (%rax), %eax
testl %eax, %eax
je 0x1a1fe
movq 0x8(%rdi), %rcx
movl %eax, 0x350(%rcx)
jmp 0x1a0bb
movq 0x38(%rsi), %rax
testb $0x1, (%rax)
je 0x1a0c6
movq 0x20(%rsi), %rax
movl (%rax), %eax
testl %eax, %eax
je 0x1a198
movq 0x8(%rdi), %rcx
movl %eax, 0x354(%rcx)
jmp 0x1a0bb
testb $0x4, 0x2(%rcx)
je 0x1a0bb
movq 0x8(%rdi), %rax
movb $0x1, 0x358(%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9c058(%rip), %rsi     # 0xb613b
leaq 0x9c07f(%rip), %rdx     # 0xb6169
leaq 0x8(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe2c8d(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe2c65(%rip), %rsi     # 0xfcd80
movq 0xe3eb6(%rip), %rdx     # 0xfdfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x1a262
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9bf8f(%rip), %rsi     # 0xb60db
leaq 0x9bfb6(%rip), %rdx     # 0xb6109
leaq 0x8(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe2c24(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe2bfc(%rip), %rsi     # 0xfcd80
movq 0xe3e4d(%rip), %rdx     # 0xfdfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x1a262
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9bfb5(%rip), %rsi     # 0xb616a
leaq 0x9bfde(%rip), %rdx     # 0xb619a
leaq 0x8(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe2bbb(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe2b93(%rip), %rsi     # 0xfcd80
movq 0xe3de4(%rip), %rdx     # 0xfdfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x1a262
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9beef(%rip), %rsi     # 0xb610a
leaq 0x9bf18(%rip), %rdx     # 0xb613a
leaq 0x8(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe2b55(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe2b2d(%rip), %rsi     # 0xfcd80
movq 0xe3d7e(%rip), %rdx     # 0xfdfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x1a26e
jmp 0x1a28a
jmp 0x1a26e
jmp 0x1a28a
jmp 0x1a26e
jmp 0x1a28a
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a290
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x1a290
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x1a29d
movq %rbx, %rdi
callq 0x6200
movq %r14, %rdi
callq 0x64a0
nop