// File: /workspace/github_c_makefile_star2_O3/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)
movl $0x1, %r15d
movl $0x1, %edi
movl $0x28, %esi
callq 0x50c0
testq %rax, %rax
je 0x56a0d
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 0xbb635(%rip), %rsi     # 0x111bc0
orq %r15, %rsi
movq %rbx, %rdi
movq %rsi, -0x68(%rbp)
callq 0x206fc
movq %rdx, %r12
leaq 0xbb97c(%rip), %rax     # 0x111f20
orq %r15, %rax
movq %rax, -0x98(%rbp)
leaq 0xbb533(%rip), %rax     # 0x111ae8
orq %r15, %rax
movq %rax, -0x60(%rbp)
leaq 0xbc13d(%rip), %rax     # 0x112700
orq %r15, %rax
movq %rax, -0x88(%rbp)
leaq 0xbbd3c(%rip), %rax     # 0x112310
orq %r15, %rax
movq %rax, -0x48(%rbp)
movl $0x1, %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 0x56609
incl (%r13)
movl %r15d, %edi
movq %r12, %rsi
callq 0x39e35
cmpl $0x1, %eax
jne 0x56979
movq %rdx, %rdi
callq 0xd745
movq %rax, %rbx
testb %r14b, %r14b
je 0x56649
decl (%r13)
jne 0x56649
shlq $0x30, %r15
orq %r12, %r15
movq %r15, %rdi
movq -0x98(%rbp), %rsi
callq 0xd13d
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 0x37fe3
cmpl $0x8, %eax
ja 0x569dd
movl %eax, %eax
leaq 0x8889d(%rip), %rcx     # 0xdef1c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r15d, %r15d
xorl %edi, %edi
movq -0x48(%rbp), %rsi
callq 0x2069e
movq %rdx, %r12
jmp 0x5670d
movq 0x8(%rdx), %rbx
decl (%rdx)
jne 0x566ab
movq %rdx, %rdi
callq 0x5030
movq %rbx, %rdi
callq 0x39f21
btsq $0x32, %rax
jmp 0x566eb
movabsq $0x2000000000000, %rdi  # imm = 0x2000000000000
jmp 0x566fe
movq 0x8(%rdx), %rbx
decl (%rdx)
jne 0x566d6
movq %rdx, %rdi
callq 0x5030
movq %rbx, %rdi
callq 0x39ece
movabsq $0x3000000000000, %rcx  # imm = 0x3000000000000
orq %rcx, %rax
movq %rax, %rdi
jmp 0x566fe
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
leaq 0x4(%rax), %rdi
movq -0x48(%rbp), %rsi
callq 0x2069e
movq %rdx, %r12
xorl %r15d, %r15d
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x565e1
movq %rdx, %rdi
leaq -0x58(%rbp), %rsi
callq 0x381ac
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 0x5676d
movl -0x58(%rbp), %edi
decl (%rcx)
jne 0x5676d
shlq $0x30, %rdi
orq %rax, %rdi
movq -0x60(%rbp), %rsi
callq 0xd13d
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 0x56794
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 0x567ba
incl (%rdx)
testb %cl, %cl
je 0x567d1
decl (%rax)
jne 0x567d1
movq %r14, %rdi
movq -0x88(%rbp), %rsi
callq 0xd13d
movl $0x3, %esi
movq %rbx, %rdi
callq 0xe50f
movq %r14, %rdi
movq %rax, %rsi
callq 0x5e0c8
jmp 0x5695a
movq %rdx, %rdi
leaq -0x58(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x382d7
jmp 0x56810
movq %rdx, %rdi
leaq -0x58(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x38233
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 0x5684f
movl -0x58(%rbp), %edi
decl (%rcx)
jne 0x5684f
shlq $0x30, %rdi
orq %rax, %rdi
movq -0x60(%rbp), %rsi
callq 0xd13d
movq -0x40(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0x5dc0a
movq %rax, -0x38(%rbp)
shlq $0x30, %r15
orq %r12, %r15
movq %r15, %rdi
movq -0x68(%rbp), %rsi
callq 0x206fc
movq %rdx, %r12
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x565db
movq %rdx, %rdi
leaq -0x58(%rbp), %rsi
callq 0x38125
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 0x568de
movl -0x58(%rbp), %edi
decl (%rcx)
jne 0x568de
shlq $0x30, %rdi
orq %rax, %rdi
movq -0x60(%rbp), %rsi
callq 0xd13d
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 0x56905
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 0x5692b
incl (%rdx)
testb %cl, %cl
je 0x56942
decl (%rax)
jne 0x56942
movq %r14, %rdi
movq -0x88(%rbp), %rsi
callq 0xd13d
movl $0x3, %esi
movq %rbx, %rdi
callq 0xe50f
movq %r14, %rdi
movq %rax, %rsi
callq 0x5dfde
movq %rax, -0x38(%rbp)
shlq $0x30, %r15
orq %r13, %r15
movq %r15, %rdi
movq -0x68(%rbp), %rsi
callq 0x206fc
movq %rdx, %r12
jmp 0x565db
testl %eax, %eax
jne 0x569dd
movl %r15d, %edi
movq %r12, %rsi
callq 0x39f74
movl %eax, %edi
movq %rdx, %rsi
callq 0x33ee8
testb $0x1, %dl
je 0x569bc
andq %rax, -0x80(%rbp)
sete %cl
testb $0x3, %al
setne %sil
orb %cl, %sil
jne 0x569bc
movq -0x80(%rbp), %rcx
decl (%rcx)
jne 0x569bc
movq %rax, %rdi
movq %rdx, %rsi
callq 0xd13d
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
movl $0x20, %edi
callq 0xf5e4
movq $0x20, 0x10(%rax)
movups 0x89cd7(%rip), %xmm0    # 0xe06cd
movups %xmm0, 0x18(%rax)
movups 0x89cdc(%rip), %xmm0    # 0xe06dd
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x9302
leaq 0x8fe1b(%rip), %rsi     # 0xe682f
movl $0x31, %edx
movl $0x2, %edi
callq 0x5060
callq 0x52b6
movl $0x1, %edi
callq 0x5130