// File: /workspace/github_c_makefile_star2_O3/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, %rbx
movq %rcx, %r12
movq %rdx, %r14
movl %esi, %r13d
leaq -0x40(%rbp), %rdx
movq %rcx, %rsi
callq 0x2d45d
testl %eax, %eax
je 0x3785c
cmpl $0x1, %eax
jne 0x379cf
movq %rdx, %rdi
callq 0xd745
movq -0x40(%rbp), %rdi
movabsq $0xfffffffffffc, %r8    # imm = 0xFFFFFFFFFFFC
andq %rax, %r8
movq %rax, %rcx
shrq $0x30, %rcx
leaq -0x30(%rbp), %r15
movl %r13d, %esi
movq %r14, %rdx
movq %r15, %r9
callq 0x35be8
movq %rdx, %r14
movq (%r15), %r13
jmp 0x379ba
movq %rbx, -0x38(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
movq %r13, %r15
shlq $0x30, %r15
orq %r14, %r15
movq %r14, %rcx
andq %rax, %rcx
setne %al
testb $0x3, %r14b
sete %bl
andb %al, %bl
cmpb $0x1, %bl
movq %r13, %rax
movq %r13, -0x50(%rbp)
movq %rcx, -0x48(%rbp)
jne 0x378bc
incl (%rcx)
movq -0x40(%rbp), %r13
cmpl $0x3, %eax
je 0x378c5
decl (%rcx)
jne 0x378f4
movq %r15, %rdi
leaq 0xda23a(%rip), %rsi     # 0x111ae9
movq %rcx, %rbx
callq 0xd13d
movq %rbx, %rcx
jmp 0x378f4
movq -0x40(%rbp), %r13
cmpl $0x3, %eax
jne 0x37915
movq 0x8(%r14), %rdx
decl (%r14)
jne 0x378e2
movq %r14, %rdi
movq %rdx, -0x58(%rbp)
callq 0x5030
movq -0x58(%rbp), %rdx
movq -0x48(%rbp), %rcx
movl $0x3, %eax
cmpq %r12, %rdx
je 0x379b6
testb %bl, %bl
je 0x37915
incl (%rcx)
leaq -0x30(%rbp), %r8
movq %r13, %rdi
movq %r12, %rsi
movq -0x50(%rbp), %r13
movl %r13d, %edx
movq %r14, %rcx
callq 0x3a406
testb %al, %al
jne 0x37932
jmp 0x37966
leaq -0x30(%rbp), %r8
movq %r13, %rdi
movq %r12, %rsi
movq -0x50(%rbp), %r13
movl %r13d, %edx
movq %r14, %rcx
callq 0x3a406
testb %al, %al
je 0x37962
movq %r12, %rdi
callq 0x2d804
movq %rdx, %r8
movq -0x30(%rbp), %rdi
leaq -0x60(%rbp), %r15
movl %r13d, %esi
movq %r14, %rdx
movl $0x3, %ecx
movq %r15, %r9
callq 0x3a69d
movq (%r15), %r13
xorl %eax, %eax
xorl %r14d, %r14d
jmp 0x379b6
testb %bl, %bl
je 0x3796c
movq -0x48(%rbp), %rax
incl (%rax)
movq %r15, %rdi
leaq 0xda173(%rip), %rsi     # 0x111ae9
callq 0x9353
movq %rdx, %r15
movq %r13, %rbx
movq -0x30(%rbp), %r13
leaq 0x10dda9c(%rip), %rdi   # 0x1115428
movq %r12, %rsi
callq 0x13c85
movabsq $0xfffffffffffc, %rdi   # imm = 0xFFFFFFFFFFFC
addq $0x4, %rdi
orq %r15, %rdi
leaq 0xd9915(%rip), %rsi     # 0x1112c1
movq %rax, %rdx
callq 0x14766
movl %ebx, %eax
movq -0x38(%rbp), %rbx
movq %r13, (%rbx)
movq %r14, %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf5e4
movq $0x20, 0x10(%rax)
movups 0xa8ce5(%rip), %xmm0    # 0xe06cd
movups %xmm0, 0x18(%rax)
movups 0xa8cea(%rip), %xmm0    # 0xe06dd
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x9302