// File: /workspace/github_c_makefile_star2_O1/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 $0x68, %rsp
movq %rcx, -0x80(%rbp)
movq %rdx, %r13
movl %esi, %ebx
movq %rdi, %r12
movl $0x1, %r15d
movl $0x1, %edi
movl $0x28, %esi
callq 0x50c0
testq %rax, %rax
je 0x58206
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
movl $0x1, (%rax)
movl $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq %r15, 0x10(%rax)
movq %rax, -0x30(%rbp)
movq %r15, 0x8(%rax)
shlq $0x30, %rbx
orq %r13, %rbx
leaq 0xbdddb(%rip), %rsi     # 0x115bc0
orq %r15, %rsi
movq %rbx, %rdi
movq %rsi, -0x60(%rbp)
callq 0x20c67
movq %rdx, %r13
leaq 0xbe122(%rip), %rax     # 0x115f20
orq %r15, %rax
movq %rax, -0x88(%rbp)
leaq 0xbdcd9(%rip), %rax     # 0x115ae8
orq %r15, %rax
movq %rax, -0x58(%rbp)
leaq 0xbe8e3(%rip), %rax     # 0x116700
orq %r15, %rax
movq %rax, -0x78(%rbp)
leaq 0xbe4e5(%rip), %rax     # 0x116310
orq %r15, %rax
movq %rax, -0x40(%rbp)
movl $0x1, %r15d
movq %r13, %rax
andq %r14, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x57e4e
incl (%rax)
movl %r15d, %edi
movq %r13, %rsi
callq 0x3b176
testl %eax, %eax
je 0x57eed
cmpl $0x1, %eax
jne 0x581d6
movq %rdx, %rdi
callq 0xdaeb
movq %rax, %rbx
movq %r13, %rax
andq %r14, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x57ea3
decl (%rax)
jne 0x57ea3
shlq $0x30, %r15
orq %r13, %r15
movq %r15, %rdi
movq -0x88(%rbp), %rsi
callq 0xd4e3
movq %rbx, %rsi
shrq $0x30, %rsi
andq %r14, %rbx
movq %r12, %rdi
movq %rbx, %rdx
leaq -0x38(%rbp), %rcx
callq 0x3917b
cmpl $0x8, %eax
ja 0x581d6
movl %eax, %eax
leaq 0x8b03a(%rip), %rcx     # 0xe2f08
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r15d, %r15d
xorl %edi, %edi
movq -0x40(%rbp), %rsi
callq 0x20c09
movq %rdx, %r13
jmp 0x58013
xorl %eax, %eax
jmp 0x58179
movq 0x8(%rdx), %rbx
decl (%rdx)
jne 0x57f04
movq %rdx, %rdi
callq 0x5030
movq %rbx, %rdi
callq 0x3b262
btsq $0x32, %rax
jmp 0x57f47
movabsq $0x2000000000000, %rdi  # imm = 0x2000000000000
jmp 0x58004
movq 0x8(%rdx), %rbx
decl (%rdx)
jne 0x57f32
movq %rdx, %rdi
callq 0x5030
movq %rbx, %rdi
callq 0x3b20f
movabsq $0x3000000000000, %rcx  # imm = 0x3000000000000
orq %rcx, %rax
movq %rax, %rdi
jmp 0x58004
movq %rdx, %rdi
leaq -0x50(%rbp), %rsi
callq 0x39346
movl %eax, %r15d
movq %rdx, %r13
movq -0x38(%rbp), %r12
movq -0x48(%rbp), %rax
movq %rax, %rcx
andq %r14, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x57f94
movl -0x50(%rbp), %edi
decl (%rcx)
jne 0x57f94
shlq $0x30, %rdi
orq %rax, %rdi
movq -0x58(%rbp), %rsi
callq 0xd4e3
movq -0x30(%rbp), %rsi
movq %rsi, %rax
andq %r14, %rax
setne %dl
testb $0x3, %sil
sete %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x57fb1
incl (%rax)
movq 0x10(%rsi), %rbx
movq %rbx, %rdx
andq %r14, %rdx
sete %sil
testb $0x3, %bl
setne %dil
orb %sil, %dil
jne 0x57fcd
incl (%rdx)
testb %cl, %cl
je 0x57fe2
decl (%rax)
jne 0x57fe2
movq -0x30(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0xd4e3
movl $0x3, %esi
movq %rbx, %rdi
callq 0xe8e2
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x5f97a
jmp 0x580c8
leaq 0x4(%r14), %rdi
movq -0x40(%rbp), %rsi
callq 0x20c09
movq %rdx, %r13
xorl %r15d, %r15d
movq -0x38(%rbp), %r12
jmp 0x58177
movq %rdx, %rdi
leaq -0x50(%rbp), %rsi
callq 0x392bf
movl %eax, %r15d
movq %rdx, %r13
movq -0x38(%rbp), %r12
movq -0x48(%rbp), %rax
movq %rax, %rcx
andq %r14, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x58061
movl -0x50(%rbp), %edi
decl (%rcx)
jne 0x58061
shlq $0x30, %rdi
orq %rax, %rdi
movq -0x58(%rbp), %rsi
callq 0xd4e3
movq -0x30(%rbp), %rsi
movq %rsi, %rax
andq %r14, %rax
setne %dl
testb $0x3, %sil
sete %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x5807e
incl (%rax)
movq 0x8(%rsi), %rbx
movq %rbx, %rdx
andq %r14, %rdx
sete %sil
testb $0x3, %bl
setne %dil
orb %sil, %dil
jne 0x5809a
incl (%rdx)
testb %cl, %cl
je 0x580af
decl (%rax)
jne 0x580af
movq -0x30(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0xd4e3
movl $0x3, %esi
movq %rbx, %rdi
callq 0xe8e2
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x5f890
movq %rax, -0x30(%rbp)
shlq $0x30, %r15
orq %r13, %r15
movq %r15, %rdi
movq -0x60(%rbp), %rsi
callq 0x20c67
movq %rdx, %r13
jmp 0x58171
movq %rdx, %rdi
leaq -0x50(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x393cd
jmp 0x58109
movq %rdx, %rdi
leaq -0x50(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x39471
movl %eax, %r15d
movq %rdx, %r12
movq -0x48(%rbp), %rax
movq %rax, %rcx
andq %r14, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x5813e
movl -0x50(%rbp), %edi
decl (%rcx)
jne 0x5813e
shlq $0x30, %rdi
orq %rax, %rdi
movq -0x58(%rbp), %rsi
callq 0xd4e3
movq -0x38(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0x68(%rbp), %rcx
callq 0x5f448
movq %rax, -0x30(%rbp)
shlq $0x30, %r15
orq %r12, %r15
movq %r15, %rdi
movq -0x60(%rbp), %rsi
callq 0x20c67
movq %rdx, %r13
movq -0x68(%rbp), %r12
movl $0x1, %r15d
movb $0x1, %al
testb %al, %al
jne 0x57e38
movl %r15d, %edi
movq %r13, %rsi
callq 0x3b2b5
movl %eax, %edi
movq %rdx, %rsi
callq 0x3502e
testb $0x1, %dl
je 0x581bc
andq %rax, %r14
sete %cl
testb $0x3, %al
setne %sil
orb %cl, %sil
jne 0x581bc
decl (%r14)
jne 0x581bc
movq %rax, %rdi
movq %rdx, %rsi
callq 0xd4e3
movq -0x80(%rbp), %rax
movq %r12, (%rax)
movq -0x30(%rbp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf9f7
movq $0x20, 0x10(%rax)
movups 0x8c55e(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0x8c563(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5
leaq 0x92753(%rip), %rsi     # 0xea960
movl $0x31, %edx
movl $0x2, %edi
callq 0x5060
callq 0x52be
movl $0x1, %edi
callq 0x5130