// File: /workspace/github_cpp_makefile_star2_O1/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 0x36738
addq $0x10, %rsp
movq %r14, %rdi
movl %r12d, %esi
callq 0xa426
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 0x3a4cd
leaq 0x7b435(%rip), %rdx     # 0xb58ae
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rcx
leaq 0x50(%rsp), %r9
movq %rdx, %r8
callq 0x545a8
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 0x3a586
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x3a586
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 0x3a51a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x28(%rsp), %rdi
movl $0x28, %esi
callq 0x6230
leaq 0x7b37e(%rip), %rdx     # 0xb58ae
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rcx
leaq 0x50(%rsp), %r9
movq %rdx, %r8
callq 0x545a8
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x3a577
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x28(%rsp), %rdi
movl $0x29, %esi
callq 0x6230
movq %r14, %rdi
movl %r15d, %esi
callq 0x39e96
testb %al, %al
je 0x3a5a1
movq %r14, %rdi
movl %ebx, %esi
callq 0x39e96
jmp 0x3a5a3
xorl %eax, %eax
movzbl %al, %r8d
leaq 0x28(%rsp), %rcx
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
xorl %r9d, %r9d
callq 0x39bea
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x164e0
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x164e0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3a5f1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xc2db8(%rip), %rax     # 0xfd3b0
addq $0x10, %rax
leaq 0x130(%rsp), %rbx
movq %rax, -0xa0(%rbx)
movq %rbx, %rdi
callq 0xdeb6
movq -0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x3a62c
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x3a671
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 0x3a68e
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3a6aa
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x3a6cc
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 0x3a700
jmp 0x3a720
jmp 0x3a71d
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a720
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x3a720
jmp 0x3a71d
jmp 0x3a71d
movq %rax, %rbx
jmp 0x3a73c
movq %rax, %rbx
jmp 0x3a749
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3a73c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x90(%rsp), %rdi
callq 0x1c438
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3a765
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x3a787
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop