// File: /workspace/github_cpp_makefile_star2_O3/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, 0x48(%rsp)
leaq 0x80(%rsp), %rdx
movq %rdx, -0x10(%rdx)
xorl %ecx, %ecx
movq %rcx, -0x8(%rdx)
movb %cl, (%rdx)
leaq 0x60(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq %rcx, -0x8(%rdx)
movb %cl, (%rdx)
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 0x35fe4
addq $0x10, %rsp
movq %r14, %rdi
movl %r12d, %esi
callq 0xa3ea
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq $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 0x39cc3
leaq 0x7ac3f(%rip), %rdx     # 0xb48ae
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rcx
leaq 0x50(%rsp), %r9
movq %rdx, %r8
callq 0x53dae
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x60b0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39d7c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x39d7c
leaq 0x90(%rsp), %rcx
movl %edx, 0xc(%rcx)
movq (%r14), %r8
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq *0x168(%r8)
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %r13
movq %r13, %rsi
callq 0x6310
movq (%r13), %rdi
leaq 0x18(%rsp), %r13
cmpq %r13, %rdi
je 0x39d10
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x28(%rsp), %rdi
movl $0x28, %esi
callq 0x6230
leaq 0x7ab88(%rip), %rdx     # 0xb48ae
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rcx
leaq 0x50(%rsp), %r9
movq %rdx, %r8
callq 0x53dae
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x39d6d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x28(%rsp), %rdi
movl $0x29, %esi
callq 0x6230
movq %r14, %rdi
movl %r15d, %esi
callq 0x39684
testb %al, %al
je 0x39d97
movq %r14, %rdi
movl %ebx, %esi
callq 0x39684
jmp 0x39d99
xorl %eax, %eax
movzbl %al, %r8d
leaq 0x28(%rsp), %rcx
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
xorl %r9d, %r9d
callq 0x3942c
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x1616c
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x1616c
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x39de7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xc25f2(%rip), %rax     # 0xfc3e0
addq $0x10, %rax
leaq 0x130(%rsp), %rbx
movq %rax, -0xa0(%rbx)
movq %rbx, %rdi
callq 0xde80
movq -0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x39e22
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x39e67
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
xorl %eax, %eax
movq %rax, 0xc8(%rsp)
movl %eax, 0xd0(%rsp)
movq %rax, 0xd8(%rsp)
movl %eax, 0xe0(%rsp)
movq %rax, 0xe8(%rsp)
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x39e84
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x39ea0
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x39ec2
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
jne 0x39ef6
jmp 0x39f16
jmp 0x39f13
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39f16
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x39f16
jmp 0x39f13
jmp 0x39f13
movq %rax, %rbx
jmp 0x39f32
movq %rax, %rbx
jmp 0x39f3f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x39f32
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x90(%rsp), %rdi
callq 0x1be02
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x39f5b
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x39f7d
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop