// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::emit_binary_func_op_cast(unsigned int, unsigned int, unsigned int, unsigned int, char const*, spirv_cross::SPIRType::BaseType, bool)
void CompilerGLSL::emit_binary_func_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);

	// 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(op, "(", cast_op0, ", ", cast_op1, ")");
		expr += ')';
	}
	else
	{
		expr += join(op, "(", cast_op0, ", ", 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 $0x178, %rsp            # imm = 0x178
movl %r8d, %ebx
movl %ecx, %r15d
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r14
movb 0x1b8(%rsp), %al
movq %r9, 0x18(%rsp)
leaq 0x90(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rcx)
leaq 0x70(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rcx)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
movl %r8d, (%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
leaq 0x60(%rsp), %rcx
leaq 0x1b0(%rsp), %r8
movq %r14, %rsi
movl %r15d, %r9d
callq 0x2d1d8
movq %r14, %rdi
movl %r12d, %esi
callq 0x90a4
leaq 0x50(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
movl 0xc(%rax), %ecx
movl 0x1b0(%rsp), %edx
cmpl %edx, %ecx
sete %sil
cmpl $0x2, %ecx
sete %cl
orb %sil, %cl
je 0x2fce7
leaq 0x65d5a(%rip), %rax     # 0x959f5
movq %rax, (%rsp)
leaq 0x6df83(%rip), %rdx     # 0x9dc29
leaq 0x653de(%rip), %r8      # 0x9508b
leaq 0x20(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x80(%rsp), %rcx
leaq 0x60(%rsp), %r9
callq 0x43986
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x64f0
leaq 0x20(%rsp), %rdi
callq 0x6548
jmp 0x2fda4
movl %r15d, 0x14(%rsp)
movl %ebp, %r15d
movl %ebx, %ebp
movl %r12d, %ebx
leaq 0xa0(%rsp), %rcx
movl %edx, 0xc(%rcx)
movq (%r14), %r8
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq *0x168(%r8)
leaq 0x40(%rsp), %r13
leaq 0x20(%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
movl %ebp, %ebx
movl %r15d, %ebp
movl 0x14(%rsp), %r15d
leaq 0x65ca5(%rip), %rax     # 0x959f5
movq %rax, (%rsp)
leaq 0x6dece(%rip), %rdx     # 0x9dc29
leaq 0x65329(%rip), %r8      # 0x9508b
leaq 0x20(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x80(%rsp), %rcx
leaq 0x60(%rsp), %r9
callq 0x43986
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x64f0
leaq 0x20(%rsp), %rdi
callq 0x6548
leaq 0x40(%rsp), %rdi
pushq $0x29
popq %rsi
callq 0x6230
movq %r14, %rdi
movl %r15d, %esi
callq 0x2f360
testb %al, %al
je 0x2fdbf
movq %r14, %rdi
movl %ebx, %esi
callq 0x2f360
jmp 0x2fdc1
xorl %eax, %eax
movzbl %al, %r8d
leaq 0x40(%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 0x40(%rsp), %rdi
callq 0x6548
leaq 0xa0(%rsp), %rdi
callq 0x17a3e
leaq 0x60(%rsp), %rdi
callq 0x6548
leaq 0x80(%rsp), %rdi
callq 0x6548
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2fe37
jmp 0x2fe54
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x6548
jmp 0x2fe57
jmp 0x2fe54
jmp 0x2fe54
movq %rax, %rbx
jmp 0x2fe61
movq %rax, %rbx
jmp 0x2fe6e
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6548
leaq 0xa0(%rsp), %rdi
callq 0x17a3e
leaq 0x60(%rsp), %rdi
callq 0x6548
leaq 0x80(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0
nop