// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_MetaVar_unifyzx
static struct mirth_type_Type mw_mirth_type_MetaVar_unifyzx (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_Type in_Type_2, uint64_t in_MetaVar_3, struct mirth_mirth_zaMirth* *out_zaMirth_4) {
	struct mirth_mirth_zaMirth* v6;
	struct std_maybe_Maybe_1 v7 = mw_mirth_type_MetaVar_typezy(in_zaMirth_1, in_MetaVar_3, &v6);
	struct mirth_mirth_zaMirth* branch_zaMirth_8;
	struct mirth_type_Type branch_Type_9;
	switch ((v7).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v10 = mtp_std_maybe_Maybe_1_Some(v7);
			struct mirth_mirth_zaMirth* v11;
			struct mirth_type_Type v12 = mw_mirth_type_Type_unifyzx(v6, in_Type_2, V_mirth_type_Type(v10), &v11);
			branch_Type_9 = v12;
			branch_zaMirth_8 = v11;
		} break;
		case std_maybe_Maybe_1_None: {
			incref(MK_mirth_type_Type(in_Type_2));
			struct mirth_mirth_zaMirth* v13;
			bool v14 = mw_mirth_type_Type_metazd(v6, in_MetaVar_3, in_Type_2, &v13);
			struct mirth_type_Type branch_Type_15;
			struct mirth_mirth_zaMirth* branch_zaMirth_16;
			if (v14) {
				branch_zaMirth_16 = v13;
				branch_Type_15 = in_Type_2;
			} else {
				incref(MK_mirth_type_Type(in_Type_2));
				struct mirth_mirth_zaMirth* v17;
				bool v18 = mw_mirth_type_Type_haszemetazy(v13, in_MetaVar_3, in_Type_2, &v17);
				struct mirth_mirth_zaMirth* branch_zaMirth_19;
				struct mirth_type_Type branch_Type_20;
				if (v18) {
					struct mirth_type_Type v21 = mtw_mirth_type_Type_Meta(in_MetaVar_3);
					struct mirth_mirth_zaMirth* v22;
					struct mirth_type_Type v23 = mw_mirth_type_Type_unifyzefailedzx(v17, in_Type_2, v21, &v22);
					branch_Type_20 = v23;
					branch_zaMirth_19 = v22;
				} else {
					incref(MK_mirth_type_Type(in_Type_2));
					struct std_maybe_Maybe_1 v24 = mtw_std_maybe_Maybe_1_Some(MK_mirth_type_Type(in_Type_2));
					struct mirth_mirth_zaMirth* v25;
					mw_mirth_type_MetaVar_typezyzx(v17, v24, in_MetaVar_3, &v25);
					branch_Type_20 = in_Type_2;
					branch_zaMirth_19 = v25;
				}
				branch_zaMirth_16 = branch_zaMirth_19;
				branch_Type_15 = branch_Type_20;
			}
			branch_Type_9 = branch_Type_15;
			branch_zaMirth_8 = branch_zaMirth_16;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_zaMirth_4 = branch_zaMirth_8;
	return branch_Type_9;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r12
movq %rcx, %rbx
movq %rdx, %r15
movl %esi, %r14d
leaq -0x50(%rbp), %rdx
movq %rcx, %rsi
callq 0x2aadc
testl %eax, %eax
je 0x3477e
cmpl $0x1, %eax
jne 0x348a3
movq %rdx, %rdi
callq 0xd491
movq -0x50(%rbp), %rdi
movabsq $0xfffffffffffc, %r8    # imm = 0xFFFFFFFFFFFC
andq %rax, %r8
movq %rax, %rcx
shrq $0x30, %rcx
leaq -0x48(%rbp), %rbx
movl %r14d, %esi
movq %r15, %rdx
movq %rbx, %r9
callq 0x32ede
movl %eax, %r14d
movq %rdx, %r15
movq (%rbx), %rbx
jmp 0x3488a
movq %rbx, -0x40(%rbp)
movq %r12, -0x38(%rbp)
movq %r14, %r13
shlq $0x30, %r13
orq %r15, %r13
leaq 0xd4352(%rip), %rsi     # 0x108ae9
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %r15, %rcx
setne %al
testb $0x3, %r15b
sete %r12b
andb %al, %r12b
cmpb $0x1, %r12b
movq %rcx, -0x30(%rbp)
jne 0x347da
incl (%rcx)
movq -0x50(%rbp), %rbx
cmpl $0x3, %r14d
je 0x347e4
decl (%rcx)
jne 0x34804
movq %r13, %rdi
callq 0xce94
movq -0x30(%rbp), %rcx
jmp 0x34804
movq -0x50(%rbp), %rbx
cmpl $0x3, %r14d
jne 0x34806
movq %r15, %rdi
callq 0x2aabf
cmpq -0x40(%rbp), %rax
jne 0x347fb
pushq $0x3
popq %r14
jmp 0x34886
testb %r12b, %r12b
movq -0x30(%rbp), %rcx
je 0x34806
incl (%rcx)
leaq -0x48(%rbp), %r8
movq %rbx, %rdi
movq -0x40(%rbp), %rbx
movq %rbx, %rsi
movl %r14d, %edx
movq %r15, %rcx
callq 0x3717f
testb %al, %al
je 0x34852
movq %rbx, %rdi
callq 0x2aeef
movq %rdx, %r8
movq -0x48(%rbp), %rdi
pushq $0x3
popq %rcx
leaq -0x58(%rbp), %rbx
movl %r14d, %esi
movq %r15, %rdx
movq %rbx, %r9
callq 0x3741a
movq (%rbx), %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x34886
testb %r12b, %r12b
je 0x3485d
movq -0x30(%rbp), %rax
incl (%rax)
movq %r13, %rdi
leaq 0xd4282(%rip), %rsi     # 0x108ae9
callq 0x8d0c
movq -0x48(%rbp), %rdi
leaq -0x58(%rbp), %rbx
movq %rdx, %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rcx
callq 0x2ab8f
movq (%rbx), %rbx
movq -0x38(%rbp), %r12
movq %rbx, (%r12)
movl %r14d, %eax
movq %r15, %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9ff63(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6