// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_Type_zgSortzy
static struct std_maybe_Maybe_1 mw_mirth_type_Type_zgSortzy (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_Type in_Type_2, struct mirth_mirth_zaMirth* *out_zaMirth_3) {
	struct mirth_mirth_zaMirth* branch_zaMirth_5;
	struct std_maybe_Maybe_1 branch_Maybe_6;
	switch ((in_Type_2).tag) {
		case mirth_type_Type_Meta: {
			uint64_t v7 = mtp_mirth_type_Type_Meta(in_Type_2);
			struct mirth_mirth_zaMirth* v8;
			struct std_maybe_Maybe_1 v9 = mw_mirth_type_MetaVar_typezy(in_zaMirth_1, v7, &v8);
			struct mirth_mirth_zaMirth* branch_zaMirth_10;
			struct std_maybe_Maybe_1 branch_Maybe_11;
			switch ((v9).tag) {
				case std_maybe_Maybe_1_None: {
					struct std_maybe_Maybe_1 v12 = { .tag=std_maybe_Maybe_1_None };
					branch_Maybe_11 = v12;
					branch_zaMirth_10 = v8;
				} break;
				case std_maybe_Maybe_1_Some: {
					VAL v13 = mtp_std_maybe_Maybe_1_Some(v9);
					struct mirth_mirth_zaMirth* v14;
					struct mirth_type_Type v15 = mw_mirth_type_Type_expand(v8, V_mirth_type_Type(v13), &v14);
					incref(MK_mirth_type_Type(v15));
					struct std_maybe_Maybe_1 v16 = mtw_std_maybe_Maybe_1_Some(MK_mirth_type_Type(v15));
					struct mirth_mirth_zaMirth* v17;
					mw_mirth_type_MetaVar_typezyzx(v14, v16, v7, &v17);
					struct mirth_mirth_zaMirth* v18;
					struct std_maybe_Maybe_1 v19 = mw_mirth_type_Type_zgSortzy(v17, v15, &v18);
					branch_Maybe_11 = v19;
					branch_zaMirth_10 = v18;
				} break;
				default: {
					do_panic(str_make("unexpected fallthrough in match\n", 32));
				}
			}
			branch_Maybe_6 = branch_Maybe_11;
			branch_zaMirth_5 = branch_zaMirth_10;
		} break;
		case mirth_type_Type_Prim: {
			enum mirth_type_PrimType v20 = mtp_mirth_type_Type_Prim(in_Type_2);
			struct mirth_mirth_zaMirth* v21;
			struct std_maybe_Maybe_1 v22 = mw_mirth_type_PrimType_zgSortzy(in_zaMirth_1, v20, &v21);
			branch_Maybe_6 = v22;
			branch_zaMirth_5 = v21;
		} break;
		default: {
			decref(MK_mirth_type_Type(in_Type_2));
			struct std_maybe_Maybe_1 v23 = { .tag=std_maybe_Maybe_1_None };
			branch_Maybe_6 = v23;
			branch_zaMirth_5 = in_zaMirth_1;
		} break;
	}
	*out_zaMirth_3 = branch_zaMirth_5;
	return branch_Maybe_6;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r12
movq %rdi, %r14
cmpl $0x2, %esi
je 0x42a85
cmpl $0x3, %esi
jne 0x42ab9
movq 0x8(%rdx), %r15
decl (%rdx)
jne 0x42a5d
movq %rdx, %rdi
callq 0x5030
leaq -0x30(%rbp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2e11b
cmpl $0x1, %eax
je 0x42afb
testl %eax, %eax
jne 0x42be3
xorl %eax, %eax
movq -0x30(%rbp), %r14
jmp 0x42af4
movl 0x4(%rdx), %ebx
decl (%rdx)
jne 0x42a94
movq %rdx, %rdi
callq 0x5030
cmpl $0x3, %ebx
je 0x42bba
cmpl $0x2, %ebx
je 0x42bac
cmpl $0x1, %ebx
jne 0x42af2
leaq 0xd39c6(%rip), %rsi     # 0x116478
xorl %edi, %edi
jmp 0x42bc6
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rax
sete %cl
testb $0x3, %dl
setne %dil
orb %cl, %dil
jne 0x42af2
decl (%rax)
jne 0x42af2
shlq $0x30, %rsi
orq %rdx, %rsi
leaq 0xd3002(%rip), %rax     # 0x115ae9
movq %rsi, %rdi
movq %rax, %rsi
callq 0xd4e3
xorl %eax, %eax
xorl %edx, %edx
jmp 0x42bd0
movq %r12, -0x40(%rbp)
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
movq %rdx, %rdi
callq 0xdaeb
movq -0x30(%rbp), %rdi
movq %rax, %rsi
shrq $0x30, %rsi
andq %r14, %rax
leaq -0x48(%rbp), %rcx
movq %rax, %rdx
callq 0x2e18a
movq %rdx, %r12
movq %rax, -0x38(%rbp)
movq %rax, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0xd2fa6(%rip), %rsi     # 0x115ae9
movq %rdx, %rax
andq %r14, %rax
sete %cl
testb $0x3, %r12b
setne %dl
orb %cl, %dl
jne 0x42b59
incl (%rax)
callq 0x95f6
movq %rdx, %r13
movq -0x48(%rbp), %rbx
leaq 0x10d68bc(%rip), %rdi   # 0x1119428
movq %r15, %rsi
callq 0x13ff0
addq $0x4, %r14
orq %r13, %r14
leaq 0xd273f(%rip), %rsi     # 0x1152c1
movq %r14, %rdi
movq %rax, %rdx
callq 0x14ab5
leaq -0x50(%rbp), %r14
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x42a2c
movq (%r14), %r14
movq -0x40(%rbp), %r12
jmp 0x42bd0
leaq 0xd38c5(%rip), %rsi     # 0x116478
movl $0x2, %edi
jmp 0x42bc6
leaq 0xd38b7(%rip), %rsi     # 0x116478
movl $0x1, %edi
callq 0x95f6
movl $0x1, %eax
movq %r14, (%r12)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf9f7
movq $0x20, 0x10(%rax)
movups 0xa1b51(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0xa1b56(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5