// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/mi/flatten.c
// Function: comparecomplex
static Node *
comparecomplex(Flattenctx *s, Node *n, Op op)
{
	Type *ty;
	Node *l, *r, *e;

	/* special case: unions with nullary constructors can be compared easily. */
	ty = tybase(exprtype(n->expr.args[0]));
	if (ty->type == Tyunion && isenum(ty)) {
		l = mkexpr(n->loc, Outag, rval(s, n->expr.args[0]), NULL);
		r = mkexpr(n->loc, Outag, rval(s, n->expr.args[1]), NULL);
		l->expr.type = mktype(n->loc, Tyuint32);
		r->expr.type = mktype(n->loc, Tyuint32);
		if (op == Oeq)
			e = mkexpr(n->loc, Oueq, l, r, NULL);
		else if (op == One)
			e = mkexpr(n->loc, Oune, l, r, NULL);
		else
			fatal(n, "unsupported operator %s for enum union", opstr[op]);
		e->expr.type = mktype(n->loc, Tybool);
		return e;
	}
	fatal(n, "cannot compare values of type %s for equality\n",
	    tystr(exprtype(n->expr.args[0])));
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq (%rax), %rdi
callq 0x30340
movq %rax, %rdi
callq 0x36a30
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x18, (%rax)
jne 0x43eed
movq -0x20(%rbp), %rdi
callq 0x36ab0
cmpl $0x0, %eax
je 0x43eed
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq (%rax), %rsi
callq 0x41a40
movq %rax, %rdx
movq -0x48(%rbp), %rax
movq (%rax), %rdi
movl $0x43, %esi
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x2f400
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x41a40
movq %rax, %rdx
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl $0x43, %esi
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x2f400
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xd, %esi
callq 0x36c10
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0xd, %esi
callq 0x36c10
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
cmpl $0x17, -0x14(%rbp)
jne 0x43e77
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq (%rax), %rdi
movl $0x5a, %esi
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x2f400
movq %rax, -0x38(%rbp)
jmp 0x43ec7
cmpl $0x18, -0x14(%rbp)
jne 0x43ea3
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq (%rax), %rdi
movl $0x5b, %esi
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x2f400
movq %rax, -0x38(%rbp)
jmp 0x43ec5
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %ecx
leaq 0x3800d(%rip), %rax     # 0x7bec0
movq (%rax,%rcx,8), %rdx
leaq 0x11183(%rip), %rsi     # 0x55041
movb $0x0, %al
callq 0x1dfe0
jmp 0x43ec7
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x2, %esi
callq 0x36c10
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x38(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq (%rax), %rdi
callq 0x30340
movq %rax, %rdi
callq 0x38a10
movq -0x50(%rbp), %rdi
movq %rax, %rdx
leaq 0x1114d(%rip), %rsi     # 0x55068
movb $0x0, %al
callq 0x1dfe0
nopw %cs:(%rax,%rax)
nopl (%rax)