// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_StackType_linearzebasezemetazy
static struct std_maybe_Maybe_1 mw_mirth_type_StackType_linearzebasezemetazy (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_StackType in_StackType_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_StackType_2).tag) {
		case mirth_type_StackType_Error: {
			struct std_maybe_Maybe_1 v7 = { .tag=std_maybe_Maybe_1_None };
			branch_Maybe_6 = v7;
			branch_zaMirth_5 = in_zaMirth_1;
		} break;
		case mirth_type_StackType_Ignore: {
			struct std_maybe_Maybe_1 v8 = { .tag=std_maybe_Maybe_1_None };
			branch_Maybe_6 = v8;
			branch_zaMirth_5 = in_zaMirth_1;
		} break;
		case mirth_type_StackType_Unit: {
			struct std_maybe_Maybe_1 v9 = { .tag=std_maybe_Maybe_1_None };
			branch_Maybe_6 = v9;
			branch_zaMirth_5 = in_zaMirth_1;
		} break;
		case mirth_type_StackType_Meta: {
			uint64_t v10 = mtp_mirth_type_StackType_Meta(in_StackType_2);
			struct mirth_mirth_zaMirth* v11;
			struct std_maybe_Maybe_1 v12 = mw_mirth_type_MetaVar_typezy(in_zaMirth_1, v10, &v11);
			struct mirth_mirth_zaMirth* branch_zaMirth_13;
			struct std_maybe_Maybe_1 branch_Maybe_14;
			switch ((v12).tag) {
				case std_maybe_Maybe_1_None: {
					struct std_maybe_Maybe_1 v15 = mtw_std_maybe_Maybe_1_Some(MK_mirth_type_MetaVar(v10));
					branch_Maybe_14 = v15;
					branch_zaMirth_13 = v11;
				} break;
				case std_maybe_Maybe_1_Some: {
					VAL v16 = mtp_std_maybe_Maybe_1_Some(v12);
					struct mirth_mirth_zaMirth* v17;
					struct mirth_type_Type v18 = mw_mirth_type_Type_expand(v11, V_mirth_type_Type(v16), &v17);
					incref(MK_mirth_type_Type(v18));
					struct std_maybe_Maybe_1 v19 = mtw_std_maybe_Maybe_1_Some(MK_mirth_type_Type(v18));
					struct mirth_mirth_zaMirth* v20;
					mw_mirth_type_MetaVar_typezyzx(v17, v19, v10, &v20);
					struct mirth_type_StackType v21 = mw_mirth_type_Type_zgStackType(v18);
					struct mirth_mirth_zaMirth* v22;
					struct std_maybe_Maybe_1 v23 = mw_mirth_type_StackType_linearzebasezemetazy(v20, v21, &v22);
					branch_Maybe_14 = v23;
					branch_zaMirth_13 = v22;
				} break;
				default: {
					do_panic(str_make("unexpected fallthrough in match\n", 32));
				}
			}
			branch_Maybe_6 = branch_Maybe_14;
			branch_zaMirth_5 = branch_zaMirth_13;
		} break;
		case mirth_type_StackType_Var: {
			uint64_t v24 = mtp_mirth_type_StackType_Var(in_StackType_2);
			struct std_maybe_Maybe_1 v25 = { .tag=std_maybe_Maybe_1_None };
			branch_Maybe_6 = v25;
			branch_zaMirth_5 = in_zaMirth_1;
		} break;
		case mirth_type_StackType_Cons: {
			struct mirth_type_Type v26;
			struct mirth_type_StackType v27 = mtp_mirth_type_StackType_Cons(in_StackType_2, &v26);
			struct mirth_mirth_zaMirth* v28;
			struct std_maybe_Maybe_1 v29 = mw_mirth_type_StackType_linearzebasezemetazy(in_zaMirth_1, v27, &v28);
			struct mirth_mirth_zaMirth* v30;
			struct std_maybe_Maybe_1 v31;
			struct mirth_type_Type v32 = mw_std_maybe_Maybe_1_filter_1_sp6(v28, v26, v29, &v30, &v31);
			decref(MK_mirth_type_Type(v32));
			branch_Maybe_6 = v31;
			branch_zaMirth_5 = v30;
		} break;
		case mirth_type_StackType_With: {
			struct mirth_type_Type v33;
			struct mirth_type_StackType v34 = mtp_mirth_type_StackType_With(in_StackType_2, &v33);
			struct mirth_mirth_zaMirth* v35;
			struct std_maybe_Maybe_1 v36 = mw_mirth_type_StackType_linearzebasezemetazy(in_zaMirth_1, v34, &v35);
			struct mirth_mirth_zaMirth* v37;
			struct std_maybe_Maybe_1 v38;
			struct mirth_type_Type v39 = mw_std_maybe_Maybe_1_filter_1_sp7(v35, v33, v36, &v37, &v38);
			decref(MK_mirth_type_Type(v39));
			branch_Maybe_6 = v38;
			branch_zaMirth_5 = v37;
		} break;
		case mirth_type_StackType_ConsLabel: {
			struct mirth_type_Type v40;
			uint64_t v41;
			struct mirth_type_StackType v42 = mtp_mirth_type_StackType_ConsLabel(in_StackType_2, &v40, &v41);
			struct mirth_mirth_zaMirth* v43;
			struct std_maybe_Maybe_1 v44 = mw_mirth_type_StackType_linearzebasezemetazy(in_zaMirth_1, v42, &v43);
			struct mirth_mirth_zaMirth* v45;
			struct std_maybe_Maybe_1 v46;
			struct mirth_type_Type v47 = mw_std_maybe_Maybe_1_filter_1_sp6(v43, v40, v44, &v45, &v46);
			decref(MK_mirth_type_Type(v47));
			branch_Maybe_6 = v46;
			branch_zaMirth_5 = v45;
		} break;
		case mirth_type_StackType_WithLabel: {
			struct mirth_type_Type v48;
			uint64_t v49;
			struct mirth_type_StackType v50 = mtp_mirth_type_StackType_WithLabel(in_StackType_2, &v48, &v49);
			struct mirth_mirth_zaMirth* v51;
			struct std_maybe_Maybe_1 v52 = mw_mirth_type_StackType_linearzebasezemetazy(in_zaMirth_1, v50, &v51);
			struct mirth_mirth_zaMirth* v53;
			struct std_maybe_Maybe_1 v54;
			struct mirth_type_Type v55 = mw_std_maybe_Maybe_1_filter_1_sp7(v51, v48, v52, &v53, &v54);
			decref(MK_mirth_type_Type(v55));
			branch_Maybe_6 = v54;
			branch_zaMirth_5 = v53;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*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 $0x48, %rsp
cmpl $0x8, %esi
ja 0x5a341
movq %rcx, %rbx
movq %rdi, %r14
movl %esi, %eax
leaq 0x79261(%rip), %rcx     # 0xd3300
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rdx, %rdi
callq 0x34edb
xorl %eax, %eax
xorl %edx, %edx
jmp 0x5a258
leaq -0x60(%rbp), %r15
movq %rdx, %rdi
movq %r15, %rsi
callq 0x34f7f
leaq -0x48(%rbp), %r12
movq %r14, %rdi
movl %eax, %esi
movq %r12, %rcx
callq 0x5a076
movq %rdx, %r8
movq (%r12), %rdi
movl (%r15), %esi
movq 0x8(%r15), %rdx
leaq -0x38(%rbp), %rcx
movq %rcx, (%rsp)
leaq -0x40(%rbp), %r9
movl %eax, %ecx
callq 0x5a53d
jmp 0x5a13d
leaq -0x60(%rbp), %r15
movq %rdx, %rdi
movq %r15, %rsi
callq 0x34ef8
leaq -0x48(%rbp), %r12
movq %r14, %rdi
movl %eax, %esi
movq %r12, %rcx
callq 0x5a076
movq %rdx, %r8
movq (%r12), %rdi
movl (%r15), %esi
movq 0x8(%r15), %rdx
leaq -0x38(%rbp), %rcx
movq %rcx, (%rsp)
leaq -0x40(%rbp), %r9
movl %eax, %ecx
callq 0x5a41a
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x5a174
decl (%rcx)
jne 0x5a174
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xae97d(%rip), %rsi     # 0x108ae9
movq %rax, %rdi
callq 0xce94
movl -0x38(%rbp), %eax
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %r14
jmp 0x5a258
leaq -0x60(%rbp), %r15
leaq -0x48(%rbp), %rax
movq %rdx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3502f
leaq -0x40(%rbp), %r12
movq %r14, %rdi
movl %eax, %esi
movq %r12, %rcx
callq 0x5a076
movq %rdx, %r8
movq (%r12), %rdi
movl (%r15), %esi
movq 0x8(%r15), %rdx
leaq -0x38(%rbp), %rcx
movq %rcx, (%rsp)
leaq -0x50(%rbp), %r9
movl %eax, %ecx
callq 0x5a41a
jmp 0x5a216
leaq -0x60(%rbp), %r15
leaq -0x48(%rbp), %rax
movq %rdx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x350d3
leaq -0x40(%rbp), %r12
movq %r14, %rdi
movl %eax, %esi
movq %r12, %rcx
callq 0x5a076
movq %rdx, %r8
movq (%r12), %rdi
movl (%r15), %esi
movq 0x8(%r15), %rdx
leaq -0x38(%rbp), %rcx
movq %rcx, (%rsp)
leaq -0x50(%rbp), %r9
movl %eax, %ecx
callq 0x5a53d
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x5a24d
decl (%rcx)
jne 0x5a24d
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xae8a4(%rip), %rsi     # 0x108ae9
movq %rax, %rdi
callq 0xce94
movl -0x38(%rbp), %eax
movq -0x30(%rbp), %rdx
movq -0x50(%rbp), %r14
movq %r14, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rdi
callq 0x34e20
movq %rax, %r15
leaq -0x60(%rbp), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x2aadc
cmpl $0x1, %eax
je 0x5a2a9
testl %eax, %eax
jne 0x5a341
leaq 0xaf618(%rip), %rsi     # 0x1098b0
movq %r15, %rdi
callq 0x8d0c
pushq $0x1
popq %rax
movq -0x60(%rbp), %r14
jmp 0x5a258
movq %rdx, %rdi
callq 0xd491
movq -0x60(%rbp), %rdi
movq %rax, %rsi
shrq $0x30, %rsi
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
andq %r13, %rax
leaq -0x38(%rbp), %rcx
movq %rax, %rdx
callq 0x2ab4b
movl %eax, %r12d
movq %rdx, %r14
movq %r12, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0xae7fd(%rip), %rsi     # 0x108ae9
andq %rdx, %r13
sete %al
testb $0x3, %r14b
setne %cl
orb %al, %cl
jne 0x5a301
incl (%r13)
callq 0x8d0c
movq -0x38(%rbp), %rdi
leaq -0x48(%rbp), %r13
movq %rdx, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x2ab8f
movl %r12d, %edi
movq %r14, %rsi
callq 0x34e3d
movq (%r13), %rdi
leaq -0x40(%rbp), %r14
movl %eax, %esi
movq %r14, %rcx
callq 0x5a076
movq (%r14), %r14
jmp 0x5a258
leaq 0x7a4c5(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6