// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_StackType_countzeparts
static struct mirth_type_StackTypeCounts* mw_mirth_type_StackType_countzeparts (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_StackType in_StackType_2, struct mirth_mirth_zaMirth* *out_zaMirth_3) {
	struct mirth_type_StackTypeCounts* v5 = mw_mirth_type_StackTypeCounts_Nil();
	struct std_either_Either_2 v6 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(in_StackType_2));
	bool v7 = true;
	struct mirth_type_StackTypeCounts* v8 = v5;
	struct mirth_mirth_zaMirth* r9 = in_zaMirth_1;
	struct std_either_Either_2 v10 = v6;
	bool v11 = v7;
	bool v12 = v7;
	while (v12) {
		struct mirth_type_StackTypeCounts* v13 = v8;
		struct mirth_mirth_zaMirth* r14 = r9;
		struct std_either_Either_2 v15 = v10;
		bool v16 = v11;
		incref(MK_std_either_Either_2(v15));
		struct std_maybe_Maybe_1 v17 = mw_std_either_Either_2_rightzy(v15);
		struct mirth_type_StackTypeCounts* branch_StackTypeCounts_18;
		struct mirth_mirth_zaMirth* branch_zaMirth_19;
		struct std_either_Either_2 branch_Either_20;
		bool branch_Bool_21;
		switch ((v17).tag) {
			case std_maybe_Maybe_1_Some: {
				VAL v22 = mtp_std_maybe_Maybe_1_Some(v17);
				decref(MK_std_either_Either_2(v15));
				struct mirth_mirth_zaMirth* v23;
				struct mirth_type_StackType v24 = mw_mirth_type_StackType_expand(r14, V_mirth_type_StackType(v22), &v23);
				struct mirth_type_StackTypeCounts* branch_StackTypeCounts_25;
				struct mirth_mirth_zaMirth* branch_zaMirth_26;
				struct std_either_Either_2 branch_Either_27;
				switch ((v24).tag) {
					case mirth_type_StackType_Error: {
						struct mirth_type_StackTypeBase v28 = { .tag=mirth_type_StackTypeBase_Error };
						struct std_either_Either_2 v29 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v28));
						branch_Either_27 = v29;
						branch_zaMirth_26 = v23;
						branch_StackTypeCounts_25 = v13;
					} break;
					case mirth_type_StackType_Ignore: {
						struct mirth_type_StackTypeBase v30 = { .tag=mirth_type_StackTypeBase_Ignore };
						struct std_either_Either_2 v31 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v30));
						branch_Either_27 = v31;
						branch_zaMirth_26 = v23;
						branch_StackTypeCounts_25 = v13;
					} break;
					case mirth_type_StackType_Var: {
						uint64_t v32 = mtp_mirth_type_StackType_Var(v24);
						struct mirth_type_StackTypeBase v33 = mtw_mirth_type_StackTypeBase_Var(v32);
						struct std_either_Either_2 v34 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v33));
						branch_Either_27 = v34;
						branch_zaMirth_26 = v23;
						branch_StackTypeCounts_25 = v13;
					} break;
					case mirth_type_StackType_Meta: {
						uint64_t v35 = mtp_mirth_type_StackType_Meta(v24);
						struct mirth_type_StackTypeBase v36 = mtw_mirth_type_StackTypeBase_Meta(v35);
						struct std_either_Either_2 v37 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v36));
						branch_Either_27 = v37;
						branch_zaMirth_26 = v23;
						branch_StackTypeCounts_25 = v13;
					} break;
					case mirth_type_StackType_Unit: {
						struct mirth_type_StackTypeBase v38 = { .tag=mirth_type_StackTypeBase_Unit };
						struct std_either_Either_2 v39 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v38));
						branch_Either_27 = v39;
						branch_zaMirth_26 = v23;
						branch_StackTypeCounts_25 = v13;
					} break;
					case mirth_type_StackType_Cons: {
						struct mirth_type_Type v40;
						struct mirth_type_StackType v41 = mtp_mirth_type_StackType_Cons(v24, &v40);
						struct mirth_mirth_zaMirth* v42;
						struct mirth_type_StackTypeCounts* v43 = mw_mirth_type_StackTypeCounts_addzevaluezx(v23, v40, v13, &v42);
						struct std_either_Either_2 v44 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v41));
						branch_Either_27 = v44;
						branch_zaMirth_26 = v42;
						branch_StackTypeCounts_25 = v43;
					} break;
					case mirth_type_StackType_With: {
						struct mirth_type_Type v45;
						struct mirth_type_StackType v46 = mtp_mirth_type_StackType_With(v24, &v45);
						struct mirth_mirth_zaMirth* v47;
						struct mirth_type_StackTypeCounts* v48 = mw_mirth_type_StackTypeCounts_addzeresourcezx(v23, v45, v13, &v47);
						struct std_either_Either_2 v49 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v46));
						branch_Either_27 = v49;
						branch_zaMirth_26 = v47;
						branch_StackTypeCounts_25 = v48;
					} break;
					case mirth_type_StackType_ConsLabel: {
						struct mirth_type_Type v50;
						uint64_t v51;
						struct mirth_type_StackType v52 = mtp_mirth_type_StackType_ConsLabel(v24, &v50, &v51);
						decref(MK_mirth_type_Type(v50));
						struct mirth_mirth_zaMirth* v53;
						struct mirth_type_StackTypeCounts* v54 = mw_mirth_type_StackTypeCounts_addzelabelzx(v23, v51, v13, &v53);
						struct std_either_Either_2 v55 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v52));
						branch_Either_27 = v55;
						branch_zaMirth_26 = v53;
						branch_StackTypeCounts_25 = v54;
					} break;
					case mirth_type_StackType_WithLabel: {
						struct mirth_type_Type v56;
						uint64_t v57;
						struct mirth_type_StackType v58 = mtp_mirth_type_StackType_WithLabel(v24, &v56, &v57);
						decref(MK_mirth_type_Type(v56));
						struct mirth_mirth_zaMirth* v59;
						struct mirth_type_StackTypeCounts* v60 = mw_mirth_type_StackTypeCounts_addzelabelzx(v23, v57, v13, &v59);
						struct std_either_Either_2 v61 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v58));
						branch_Either_27 = v61;
						branch_zaMirth_26 = v59;
						branch_StackTypeCounts_25 = v60;
					} break;
					default: {
						do_panic(str_make("unexpected fallthrough in match\n", 32));
					}
				}
				bool v62 = true;
				branch_Bool_21 = v62;
				branch_Either_20 = branch_Either_27;
				branch_zaMirth_19 = branch_zaMirth_26;
				branch_StackTypeCounts_18 = branch_StackTypeCounts_25;
			} break;
			case std_maybe_Maybe_1_None: {
				bool v63 = false;
				branch_Bool_21 = v63;
				branch_Either_20 = v15;
				branch_zaMirth_19 = r14;
				branch_StackTypeCounts_18 = v13;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v12 = branch_Bool_21;
		v11 = branch_Bool_21;
		v10 = branch_Either_20;
		r9 = branch_zaMirth_19;
		v8 = branch_StackTypeCounts_18;
	}
	struct std_maybe_Maybe_1 v64 = mw_std_either_Either_2_leftzy(v10);
	VAL v65 = mw_std_maybe_Maybe_1_unwrap_1_sp3(v64);
	decref(v65);
	*out_zaMirth_3 = r9;
	return v8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, -0x90(%rbp)
movq %rdx, %r13
movl %esi, %ebx
movq %rdi, -0x30(%rbp)
pushq $0x1
popq %r15
pushq $0x28
popq %rsi
movq %r15, %rdi
callq 0x50c0
testq %rax, %rax
je 0x521df
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
movq %rcx, -0x80(%rbp)
movl $0x1, (%rax)
movq %r15, 0x10(%rax)
movq %rax, -0x38(%rbp)
movq %r15, 0x8(%rax)
shlq $0x30, %rbx
orq %r13, %rbx
leaq 0xb6e36(%rip), %rsi     # 0x108bc0
orq %r15, %rsi
movq %rbx, %rdi
movq %rsi, -0x68(%rbp)
callq 0x1e454
movq %rdx, %r12
leaq 0xb717d(%rip), %rax     # 0x108f20
orq %r15, %rax
movq %rax, -0x98(%rbp)
leaq 0xb6d34(%rip), %rax     # 0x108ae8
orq %r15, %rax
movq %rax, -0x60(%rbp)
leaq 0xb793e(%rip), %rax     # 0x109700
orq %r15, %rax
movq %rax, -0x88(%rbp)
leaq 0xb753d(%rip), %rax     # 0x109310
orq %r15, %rax
movq %rax, -0x48(%rbp)
pushq $0x1
popq %rax
movl %eax, %r15d
movq %r12, %r13
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %r13
setne %al
testb $0x3, %r12b
sete %r14b
andb %al, %r14b
cmpb $0x1, %r14b
jne 0x51e08
incl (%r13)
movl %r15d, %edi
movq %r12, %rsi
callq 0x36b56
cmpl $0x1, %eax
jne 0x52164
movq %rdx, %rdi
callq 0xd491
movq %rax, %rbx
testb %r14b, %r14b
je 0x51e48
decl (%r13)
jne 0x51e48
shlq $0x30, %r15
orq %r12, %r15
movq %r15, %rdi
movq -0x98(%rbp), %rsi
callq 0xce94
movq %rbx, %rsi
shrq $0x30, %rsi
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %rbx
movq -0x30(%rbp), %rdi
movq %rbx, %rdx
leaq -0x40(%rbp), %rcx
callq 0x34dd2
cmpl $0x8, %eax
ja 0x521c8
movl %eax, %eax
leaq 0x8109e(%rip), %rcx     # 0xd2f1c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r15d, %r15d
xorl %edi, %edi
movq -0x48(%rbp), %rsi
callq 0x1e400
movq %rdx, %r12
jmp 0x51efc
movq %rdx, %rdi
callq 0x34e20
movq %rax, %rdi
callq 0x36c1f
btsq $0x32, %rax
jmp 0x51eda
movabsq $0x2000000000000, %rdi  # imm = 0x2000000000000
jmp 0x51eed
movq %rdx, %rdi
callq 0x34edb
movq %rax, %rdi
callq 0x36bd6
movabsq $0x3000000000000, %rcx  # imm = 0x3000000000000
orq %rcx, %rax
movq %rax, %rdi
jmp 0x51eed
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
leaq 0x4(%rax), %rdi
movq -0x48(%rbp), %rsi
callq 0x1e400
movq %rdx, %r12
xorl %r15d, %r15d
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x51de0
movq %rdx, %rdi
leaq -0x58(%rbp), %rsi
callq 0x34f7f
movl %eax, %r15d
movq %rdx, %r13
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x51f5c
movl -0x58(%rbp), %edi
decl (%rcx)
jne 0x51f5c
shlq $0x30, %rdi
orq %rax, %rdi
movq -0x60(%rbp), %rsi
callq 0xce94
movq -0x38(%rbp), %r14
movq %r14, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
setne %dl
testb $0x3, %r14b
sete %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x51f83
incl (%rax)
movq 0x10(%r14), %rbx
movq %rbx, %rdx
movabsq $0xfffffffffffc, %rsi   # imm = 0xFFFFFFFFFFFC
andq %rsi, %rdx
sete %sil
testb $0x3, %bl
setne %dil
orb %sil, %dil
jne 0x51fa9
incl (%rdx)
testb %cl, %cl
je 0x51fc0
decl (%rax)
jne 0x51fc0
movq %r14, %rdi
movq -0x88(%rbp), %rsi
callq 0xce94
movq %rbx, %rdi
pushq $0x3
popq %rsi
callq 0xdd03
movq %r14, %rdi
movq %rax, %rsi
callq 0x59314
jmp 0x52145
movq %rdx, %rdi
leaq -0x58(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x350d3
jmp 0x51ffd
movq %rdx, %rdi
leaq -0x58(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x3502f
movl %eax, %r15d
movq %rdx, %r12
movq -0x50(%rbp), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x5203c
movl -0x58(%rbp), %edi
decl (%rcx)
jne 0x5203c
shlq $0x30, %rdi
orq %rax, %rdi
movq -0x60(%rbp), %rsi
callq 0xce94
movq -0x40(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0x58de6
movq %rax, -0x38(%rbp)
shlq $0x30, %r15
orq %r12, %r15
movq %r15, %rdi
movq -0x68(%rbp), %rsi
callq 0x1e454
movq %rdx, %r12
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x51dda
movq %rdx, %rdi
leaq -0x58(%rbp), %rsi
callq 0x34ef8
movl %eax, %r15d
movq %rdx, %r13
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x520cb
movl -0x58(%rbp), %edi
decl (%rcx)
jne 0x520cb
shlq $0x30, %rdi
orq %rax, %rdi
movq -0x60(%rbp), %rsi
callq 0xce94
movq -0x38(%rbp), %r14
movq %r14, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
setne %dl
testb $0x3, %r14b
sete %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x520f2
incl (%rax)
movq 0x8(%r14), %rbx
movq %rbx, %rdx
movabsq $0xfffffffffffc, %rsi   # imm = 0xFFFFFFFFFFFC
andq %rsi, %rdx
sete %sil
testb $0x3, %bl
setne %dil
orb %sil, %dil
jne 0x52118
incl (%rdx)
testb %cl, %cl
je 0x5212f
decl (%rax)
jne 0x5212f
movq %r14, %rdi
movq -0x88(%rbp), %rsi
callq 0xce94
movq %rbx, %rdi
pushq $0x3
popq %rsi
callq 0xdd03
movq %r14, %rdi
movq %rax, %rsi
callq 0x59234
movq %rax, -0x38(%rbp)
shlq $0x30, %r15
orq %r13, %r15
movq %r15, %rdi
movq -0x68(%rbp), %rsi
callq 0x1e454
movq %rdx, %r12
jmp 0x51dda
testl %eax, %eax
jne 0x521c8
movl %r15d, %edi
movq %r12, %rsi
callq 0x36c68
movl %eax, %edi
movq %rdx, %rsi
callq 0x31344
testb $0x1, %dl
je 0x521a7
andq %rax, -0x80(%rbp)
sete %cl
testb $0x3, %al
setne %sil
orb %cl, %sil
jne 0x521a7
movq -0x80(%rbp), %rcx
decl (%rcx)
jne 0x521a7
movq %rax, %rdi
movq %rdx, %rsi
callq 0xce94
movq -0x90(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8263e(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6
leaq 0x8881a(%rip), %rsi     # 0xdaa00
pushq $0x2
popq %rdi
pushq $0x31
popq %rdx
callq 0x5060
callq 0x52ae
pushq $0x1
popq %rdi
callq 0x5130