// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_StackType_splitzeparts
static struct mirth_type_StackTypeBase mw_mirth_type_StackType_splitzeparts (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_StackType in_StackType_2, struct mirth_mirth_zaMirth* *out_zaMirth_3, struct std_list_List_1 *out_List_5) {
	struct std_list_List_1 v6 = { .tag=std_list_List_1_Nil };
	struct std_either_Either_2 v7 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(in_StackType_2));
	bool v8 = true;
	struct std_list_List_1 v9 = v6;
	struct mirth_mirth_zaMirth* r10 = in_zaMirth_1;
	struct std_either_Either_2 v11 = v7;
	bool v12 = v8;
	bool v13 = v8;
	while (v13) {
		struct std_list_List_1 v14 = v9;
		struct mirth_mirth_zaMirth* r15 = r10;
		struct std_either_Either_2 v16 = v11;
		bool v17 = v12;
		incref(MK_std_either_Either_2(v16));
		struct std_maybe_Maybe_1 v18 = mw_std_either_Either_2_rightzy(v16);
		struct std_list_List_1 branch_List_19;
		struct mirth_mirth_zaMirth* branch_zaMirth_20;
		struct std_either_Either_2 branch_Either_21;
		bool branch_Bool_22;
		switch ((v18).tag) {
			case std_maybe_Maybe_1_Some: {
				VAL v23 = mtp_std_maybe_Maybe_1_Some(v18);
				decref(MK_std_either_Either_2(v16));
				struct mirth_mirth_zaMirth* v24;
				struct mirth_type_StackType v25 = mw_mirth_type_StackType_expand(r15, V_mirth_type_StackType(v23), &v24);
				struct std_list_List_1 branch_List_26;
				struct mirth_mirth_zaMirth* branch_zaMirth_27;
				struct std_either_Either_2 branch_Either_28;
				switch ((v25).tag) {
					case mirth_type_StackType_Error: {
						struct mirth_type_StackTypeBase v29 = { .tag=mirth_type_StackTypeBase_Error };
						struct std_either_Either_2 v30 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v29));
						branch_Either_28 = v30;
						branch_zaMirth_27 = v24;
						branch_List_26 = v14;
					} break;
					case mirth_type_StackType_Ignore: {
						struct mirth_type_StackTypeBase v31 = { .tag=mirth_type_StackTypeBase_Ignore };
						struct std_either_Either_2 v32 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v31));
						branch_Either_28 = v32;
						branch_zaMirth_27 = v24;
						branch_List_26 = v14;
					} break;
					case mirth_type_StackType_Var: {
						uint64_t v33 = mtp_mirth_type_StackType_Var(v25);
						struct mirth_type_StackTypeBase v34 = mtw_mirth_type_StackTypeBase_Var(v33);
						struct std_either_Either_2 v35 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v34));
						branch_Either_28 = v35;
						branch_zaMirth_27 = v24;
						branch_List_26 = v14;
					} break;
					case mirth_type_StackType_Meta: {
						uint64_t v36 = mtp_mirth_type_StackType_Meta(v25);
						struct mirth_type_StackTypeBase v37 = mtw_mirth_type_StackTypeBase_Meta(v36);
						struct std_either_Either_2 v38 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v37));
						branch_Either_28 = v38;
						branch_zaMirth_27 = v24;
						branch_List_26 = v14;
					} break;
					case mirth_type_StackType_Unit: {
						struct mirth_type_StackTypeBase v39 = { .tag=mirth_type_StackTypeBase_Unit };
						struct std_either_Either_2 v40 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v39));
						branch_Either_28 = v40;
						branch_zaMirth_27 = v24;
						branch_List_26 = v14;
					} break;
					case mirth_type_StackType_Cons: {
						struct mirth_type_Type v41;
						struct mirth_type_StackType v42 = mtp_mirth_type_StackType_Cons(v25, &v41);
						struct mirth_type_StackTypePart v43 = mtw_mirth_type_StackTypePart_Cons(v41);
						struct std_list_List_1 v44 = mw_std_list_List_1_cons(MK_mirth_type_StackTypePart(v43), v14);
						struct std_either_Either_2 v45 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v42));
						branch_Either_28 = v45;
						branch_zaMirth_27 = v24;
						branch_List_26 = v44;
					} break;
					case mirth_type_StackType_With: {
						struct mirth_type_Type v46;
						struct mirth_type_StackType v47 = mtp_mirth_type_StackType_With(v25, &v46);
						struct mirth_type_StackTypePart v48 = mtw_mirth_type_StackTypePart_With(v46);
						struct std_list_List_1 v49 = mw_std_list_List_1_cons(MK_mirth_type_StackTypePart(v48), v14);
						struct std_either_Either_2 v50 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v47));
						branch_Either_28 = v50;
						branch_zaMirth_27 = v24;
						branch_List_26 = v49;
					} break;
					case mirth_type_StackType_ConsLabel: {
						struct mirth_type_Type v51;
						uint64_t v52;
						struct mirth_type_StackType v53 = mtp_mirth_type_StackType_ConsLabel(v25, &v51, &v52);
						struct mirth_type_StackTypePart v54 = mtw_mirth_type_StackTypePart_ConsLabel(v51, v52);
						struct std_list_List_1 v55 = mw_std_list_List_1_cons(MK_mirth_type_StackTypePart(v54), v14);
						struct std_either_Either_2 v56 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v53));
						branch_Either_28 = v56;
						branch_zaMirth_27 = v24;
						branch_List_26 = v55;
					} break;
					case mirth_type_StackType_WithLabel: {
						struct mirth_type_Type v57;
						uint64_t v58;
						struct mirth_type_StackType v59 = mtp_mirth_type_StackType_WithLabel(v25, &v57, &v58);
						struct mirth_type_StackTypePart v60 = mtw_mirth_type_StackTypePart_WithLabel(v57, v58);
						struct std_list_List_1 v61 = mw_std_list_List_1_cons(MK_mirth_type_StackTypePart(v60), v14);
						struct std_either_Either_2 v62 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v59));
						branch_Either_28 = v62;
						branch_zaMirth_27 = v24;
						branch_List_26 = v61;
					} break;
					default: {
						do_panic(str_make("unexpected fallthrough in match\n", 32));
					}
				}
				bool v63 = true;
				branch_Bool_22 = v63;
				branch_Either_21 = branch_Either_28;
				branch_zaMirth_20 = branch_zaMirth_27;
				branch_List_19 = branch_List_26;
			} break;
			case std_maybe_Maybe_1_None: {
				bool v64 = false;
				branch_Bool_22 = v64;
				branch_Either_21 = v16;
				branch_zaMirth_20 = r15;
				branch_List_19 = v14;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v13 = branch_Bool_22;
		v12 = branch_Bool_22;
		v11 = branch_Either_21;
		r10 = branch_zaMirth_20;
		v9 = branch_List_19;
	}
	struct std_maybe_Maybe_1 v65 = mw_std_either_Either_2_leftzy(v11);
	VAL v66 = mw_std_maybe_Maybe_1_unwrap_1_sp3(v65);
	*out_List_5 = v9;
	*out_zaMirth_3 = r10;
	return V_mirth_type_StackTypeBase(v66);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, -0x60(%rbp)
movq %rcx, -0x68(%rbp)
movl %esi, %eax
movq %rdi, %r13
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xd6622(%rip), %rsi     # 0x108bc1
movq %rax, %rdi
callq 0x1e454
movq %rdx, %rbx
movq $0x0, -0x30(%rbp)
pushq $0x1
popq %rax
movl %eax, %r12d
movq $0x0, -0x38(%rbp)
movq %rbx, %r14
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %r14
setne %al
testb $0x3, %bl
sete %r15b
andb %al, %r15b
cmpb $0x1, %r15b
jne 0x325e6
incl (%r14)
movl %r12d, %edi
movq %rbx, %rsi
callq 0x36b56
cmpl $0x1, %eax
jne 0x327ff
movq %rbx, -0x70(%rbp)
movq %r12, %rbx
movq %r13, %r12
movq %rdx, %rdi
callq 0xd491
movq %rax, %r13
testb %r15b, %r15b
je 0x32630
decl (%r14)
jne 0x32630
shlq $0x30, %rbx
orq -0x70(%rbp), %rbx
movq %rbx, %rdi
leaq 0xd68f6(%rip), %rsi     # 0x108f21
callq 0xce94
movq %r13, %rsi
shrq $0x30, %rsi
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %r13
movq %r12, %rdi
movq %r13, %rdx
leaq -0x40(%rbp), %rcx
callq 0x34dd2
cmpl $0x8, %eax
ja 0x32855
movl %eax, %eax
leaq 0xa01bb(%rip), %rcx     # 0xd2820
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r12d, %r12d
xorl %edi, %edi
leaq 0xd6c97(%rip), %rsi     # 0x109311
callq 0x1e400
movq %rdx, %rbx
movq -0x40(%rbp), %r13
jmp 0x325c0
movq %rdx, %rdi
callq 0x34e20
movq %rax, %rdi
callq 0x36c1f
btsq $0x32, %rax
jmp 0x326cb
movabsq $0x2000000000000, %rdi  # imm = 0x2000000000000
jmp 0x3270e
movq %rdx, %rdi
callq 0x34edb
movq %rax, %rdi
callq 0x36bd6
movabsq $0x3000000000000, %rcx  # imm = 0x3000000000000
orq %rcx, %rax
movq %rax, %rdi
jmp 0x3270e
movq %rdx, %rdi
leaq -0x50(%rbp), %rsi
callq 0x34f7f
movl %eax, %r14d
movq %rdx, %r15
movl -0x50(%rbp), %edi
movq -0x48(%rbp), %rsi
callq 0x3a9aa
movq %rdx, %rdi
movabsq $0x2000000000000, %rax  # imm = 0x2000000000000
jmp 0x327b8
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
leaq 0x4(%rax), %rdi
leaq 0xd6bfc(%rip), %rsi     # 0x109311
callq 0x1e400
movq %rdx, %rbx
xorl %r12d, %r12d
movq -0x40(%rbp), %r13
jmp 0x325c0
movq %rdx, %rdi
leaq -0x50(%rbp), %rsi
callq 0x34ef8
movl %eax, %r14d
movq %rdx, %r15
movl -0x50(%rbp), %edi
movq -0x48(%rbp), %rsi
callq 0x1decc
movq %rdx, %rdi
jmp 0x327bb
movq %rdx, %rdi
leaq -0x50(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x3502f
movl %eax, %r14d
movq %rdx, %r15
movq -0x58(%rbp), %rdx
movl -0x50(%rbp), %edi
movq -0x48(%rbp), %rsi
callq 0x3a9ff
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
leaq 0x4(%rax), %rdi
orq %rdx, %rdi
jmp 0x327bb
movq %rdx, %rdi
leaq -0x50(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x350d3
movl %eax, %r14d
movq %rdx, %r15
movq -0x58(%rbp), %rdx
movl -0x50(%rbp), %edi
movq -0x48(%rbp), %rsi
callq 0x3aa64
movq %rdx, %rdi
movabsq $0x3000000000000, %rax  # imm = 0x3000000000000
orq %rax, %rdi
leaq 0xd651f(%rip), %rsi     # 0x108ce1
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0xcf39
movq %rdx, -0x38(%rbp)
shlq $0x30, %r14
orq %r15, %r14
movq %r14, %rdi
leaq 0xd63dd(%rip), %rsi     # 0x108bc1
callq 0x1e454
movq %rdx, %rbx
movq -0x40(%rbp), %r13
pushq $0x1
popq %rax
movl %eax, %r12d
movq %rax, -0x30(%rbp)
jmp 0x325c0
testl %eax, %eax
jne 0x32855
movl %r12d, %edi
movq %rbx, %rsi
callq 0x36c68
movl %eax, %edi
movq %rdx, %rsi
callq 0x31344
movq -0x60(%rbp), %rcx
movq -0x30(%rbp), %rdx
movl %edx, (%rcx)
andl $0x0, 0x4(%rcx)
movq -0x38(%rbp), %rdx
movq %rdx, 0x8(%rcx)
movq -0x68(%rbp), %rcx
movq %r13, (%rcx)
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rax, %rdx
shrq $0x30, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa1fb1(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6