// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::emit_binary_op_cast(unsigned int, unsigned int, unsigned int, unsigned int, char const*, spirv_cross::SPIRType::BaseType, bool)
void CompilerGLSL::emit_binary_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1,
                                       const char *op, SPIRType::BaseType input_type, bool skip_cast_if_equal_type)
{
	string cast_op0, cast_op1;
	auto expected_type = binary_op_bitcast_helper(cast_op0, cast_op1, input_type, op0, op1, skip_cast_if_equal_type);
	auto &out_type = get<SPIRType>(result_type);

	// We might have casted away from the result type, so bitcast again.
	// For example, arithmetic right shift with uint inputs.
	// Special case boolean outputs since relational opcodes output booleans instead of int/uint.
	string expr;
	if (out_type.basetype != input_type && out_type.basetype != SPIRType::Boolean)
	{
		expected_type.basetype = input_type;
		expr = bitcast_glsl_op(out_type, expected_type);
		expr += '(';
		expr += join(cast_op0, " ", op, " ", cast_op1);
		expr += ')';
	}
	else
		expr += join(cast_op0, " ", op, " ", cast_op1);

	emit_op(result_type, result_id, expr, should_forward(op0) && should_forward(op1));
	inherit_expression_dependencies(result_id, op0);
	inherit_expression_dependencies(result_id, op1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movl %r8d, %ebx
movl %ecx, %r15d
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r14
movb 0x1a8(%rsp), %al
movq %r9, 0x8(%rsp)
leaq 0x80(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rcx)
leaq 0x60(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rcx)
movzbl %al, %eax
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0x1a0(%rsp), %r8
movq %r14, %rsi
movl %r15d, %r9d
pushq %rax
pushq %rbx
callq 0x2d1d8
popq %rax
popq %rcx
movq %r14, %rdi
movl %r12d, %esi
callq 0x90a4
leaq 0x40(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
movl 0xc(%rax), %ecx
movl 0x1a0(%rsp), %edx
cmpl %edx, %ecx
sete %sil
cmpl $0x2, %ecx
sete %cl
orb %sil, %cl
je 0x2f85e
leaq 0x60062(%rip), %rdx     # 0x8f886
leaq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x8(%rsp), %rcx
leaq 0x50(%rsp), %r9
movq %rdx, %r8
callq 0x437e6
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x64f0
leaq 0x10(%rsp), %rdi
callq 0x6548
jmp 0x2f90b
movl %r15d, 0x4(%rsp)
movl %ebp, %r15d
movq %rbx, %rbp
movl %r12d, %ebx
leaq 0x90(%rsp), %rcx
movl %edx, 0xc(%rcx)
movq (%r14), %r8
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq *0x168(%r8)
leaq 0x30(%rsp), %r13
leaq 0x10(%rsp), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x6320
movq %r12, %rdi
callq 0x6548
pushq $0x28
popq %rsi
movq %r13, %rdi
callq 0x6230
movl %ebx, %r12d
movq %rbp, %rbx
movl %r15d, %ebp
movl 0x4(%rsp), %r15d
leaq 0x5ffbd(%rip), %rdx     # 0x8f886
leaq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x8(%rsp), %rcx
leaq 0x50(%rsp), %r9
movq %rdx, %r8
callq 0x437e6
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x64f0
leaq 0x10(%rsp), %rdi
callq 0x6548
leaq 0x30(%rsp), %rdi
pushq $0x29
popq %rsi
callq 0x6230
movq %r14, %rdi
movl %r15d, %esi
callq 0x2f360
testb %al, %al
je 0x2f926
movq %r14, %rdi
movl %ebx, %esi
callq 0x2f360
jmp 0x2f928
xorl %eax, %eax
movzbl %al, %r8d
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
xorl %r9d, %r9d
callq 0x2f196
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x13128
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13128
leaq 0x30(%rsp), %rdi
callq 0x6548
leaq 0x90(%rsp), %rdi
callq 0x17a3e
leaq 0x50(%rsp), %rdi
callq 0x6548
leaq 0x70(%rsp), %rdi
callq 0x6548
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2f99b
jmp 0x2f9b8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x6548
jmp 0x2f9bb
jmp 0x2f9b8
jmp 0x2f9b8
movq %rax, %rbx
jmp 0x2f9c5
movq %rax, %rbx
jmp 0x2f9d2
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x6548
leaq 0x90(%rsp), %rdi
callq 0x17a3e
leaq 0x50(%rsp), %rdi
callq 0x6548
leaq 0x70(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0