// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_hlsl.cpp
// Function: spirv_cross::CompilerHLSL::remap_num_workgroups_builtin()
uint32_t CompilerHLSL::remap_num_workgroups_builtin()
{
	update_active_builtins();

	if (!active_input_builtins.get(BuiltInNumWorkgroups))
		return 0;

	// Create a new, fake UBO.
	uint32_t offset = ir.increase_bound_by(4);

	uint32_t uint_type_id = offset;
	uint32_t block_type_id = offset + 1;
	uint32_t block_pointer_type_id = offset + 2;
	uint32_t variable_id = offset + 3;

	SPIRType uint_type;
	uint_type.basetype = SPIRType::UInt;
	uint_type.width = 32;
	uint_type.vecsize = 3;
	uint_type.columns = 1;
	set<SPIRType>(uint_type_id, uint_type);

	SPIRType block_type;
	block_type.basetype = SPIRType::Struct;
	block_type.member_types.push_back(uint_type_id);
	set<SPIRType>(block_type_id, block_type);
	set_decoration(block_type_id, DecorationBlock);
	set_member_name(block_type_id, 0, "count");
	set_member_decoration(block_type_id, 0, DecorationOffset, 0);

	SPIRType block_pointer_type = block_type;
	block_pointer_type.pointer = true;
	block_pointer_type.storage = StorageClassUniform;
	block_pointer_type.parent_type = block_type_id;
	auto &ptr_type = set<SPIRType>(block_pointer_type_id, block_pointer_type);

	// Preserve self.
	ptr_type.self = block_type_id;

	set<SPIRVariable>(variable_id, block_pointer_type_id, StorageClassUniform);
	ir.meta[variable_id].decoration.alias = "SPIRV_Cross_NumWorkgroups";

	num_workgroups_builtin = variable_id;
	return variable_id;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, %rbx
callq 0x16086
xorl %r14d, %r14d
testb $0x1, 0x2d3(%rbx)
je 0x5d325
leaq 0x8(%rbx), %rdi
pushq $0x4
popq %rsi
callq 0x202bc
leaq 0x290(%rsp), %rcx
andl $0x0, -0xc8(%rcx)
leaq 0x8a2f7(%rip), %r15     # 0xe73f0
addq $0x10, %r15
movq %r15, -0xd0(%rcx)
andq $0x0, -0x88(%rcx)
movl %eax, %r14d
andl $0x0, -0x80(%rcx)
movl %eax, 0xc(%rsp)
andq $0x0, -0x78(%rcx)
leal 0x2(%r14), %ebp
movb $0x0, -0x70(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, -0xb0(%rcx)
movups %xmm0, -0xa0(%rcx)
andl $0x0, -0x90(%rcx)
movl $0x8, -0x6c(%rcx)
andq $0x0, -0x58(%rcx)
movups %xmm0, -0x68(%rcx)
andq $0x0, -0x38(%rcx)
movl %ebp, 0x8(%rsp)
movq %rcx, -0x30(%rcx)
movq $0x1, -0x28(%rcx)
movups %xmm0, -0x20(%rcx)
movl $0x3f800000, -0x10(%rcx) # imm = 0x3F800000
movups %xmm0, -0x8(%rcx)
movaps 0x39749(%rip), %xmm0    # 0x968c0
movups %xmm0, -0xc4(%rcx)
leaq 0x1c0(%rsp), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x63e9e
leaq 0x150(%rsp), %rdi
andl $0x0, -0x60(%rdi)
movq %r15, -0x68(%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, -0x58(%rdi)
movl $0x1, -0x50(%rdi)
andq $0x0, -0x20(%rdi)
andl $0x0, -0x18(%rdi)
andq $0x0, -0x10(%rdi)
movb $0x0, -0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, -0x48(%rdi)
movups %xmm0, -0x38(%rdi)
andl $0x0, -0x28(%rdi)
movl $0x8, -0x4(%rdi)
andq $0x0, 0x10(%rdi)
movups %xmm0, (%rdi)
andq $0x0, 0x30(%rdi)
leaq 0x1b8(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movl $0xc, -0x5c(%rdi)
leaq 0xc(%rsp), %rsi
callq 0x6c06
leal 0x1(%r14), %r15d
leaq 0xe8(%rsp), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x63e9e
pushq $0x2
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x1206e
leaq 0x332d5(%rip), %rsi     # 0x90521
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0x6100
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x11ed8
leaq 0x10(%rsp), %rdi
callq 0x6548
pushq $0x23
popq %rcx
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x11ece
leaq 0x10(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x1a29c
leaq 0x10(%rsp), %rdx
movb $0x1, 0x60(%rdx)
movl $0x2, 0x64(%rdx)
movl %r15d, 0x9c(%rdx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x63e9e
addl $0x3, %r14d
movl %r15d, 0x8(%rax)
leaq 0x4(%rsp), %rcx
movl $0x2, (%rcx)
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x63ec6
movl %r14d, %eax
imulq $0x148, %rax, %rdi      # imm = 0x148
addq 0x38(%rbx), %rdi
leaq 0x3c858(%rip), %rsi     # 0x99b4d
callq 0x64e0
movl %r14d, 0x7c8(%rbx)
leaq 0x10(%rsp), %rdi
callq 0x17a3e
leaq 0xe8(%rsp), %rdi
callq 0x17a3e
leaq 0x1c0(%rsp), %rdi
callq 0x17a3e
movl %r14d, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5d350
jmp 0x5d35f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x6548
jmp 0x5d362
jmp 0x5d35f
movq %rax, %rbx
jmp 0x5d36f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x17a3e
jmp 0x5d362
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x17a3e
leaq 0x1c0(%rsp), %rdi
callq 0x17a3e
movq %rbx, %rdi
callq 0x64b0