// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_StackType_base
static struct mirth_type_StackTypeBase mw_mirth_type_StackType_base (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_StackType in_StackType_2, struct mirth_mirth_zaMirth* *out_zaMirth_3) {
	struct std_either_Either_2 v5 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(in_StackType_2));
	bool v6 = true;
	struct mirth_mirth_zaMirth* r7 = in_zaMirth_1;
	struct std_either_Either_2 v8 = v5;
	bool v9 = v6;
	bool v10 = v6;
	while (v10) {
		struct mirth_mirth_zaMirth* r11 = r7;
		struct std_either_Either_2 v12 = v8;
		bool v13 = v9;
		incref(MK_std_either_Either_2(v12));
		struct std_maybe_Maybe_1 v14 = mw_std_either_Either_2_rightzy(v12);
		struct mirth_mirth_zaMirth* branch_zaMirth_15;
		struct std_either_Either_2 branch_Either_16;
		bool branch_Bool_17;
		switch ((v14).tag) {
			case std_maybe_Maybe_1_Some: {
				VAL v18 = mtp_std_maybe_Maybe_1_Some(v14);
				decref(MK_std_either_Either_2(v12));
				struct mirth_mirth_zaMirth* v19;
				struct mirth_type_StackType v20 = mw_mirth_type_StackType_expand(r11, V_mirth_type_StackType(v18), &v19);
				struct mirth_mirth_zaMirth* branch_zaMirth_21;
				struct std_either_Either_2 branch_Either_22;
				switch ((v20).tag) {
					case mirth_type_StackType_Error: {
						struct mirth_type_StackTypeBase v23 = { .tag=mirth_type_StackTypeBase_Error };
						struct std_either_Either_2 v24 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v23));
						branch_Either_22 = v24;
						branch_zaMirth_21 = v19;
					} break;
					case mirth_type_StackType_Ignore: {
						struct mirth_type_StackTypeBase v25 = { .tag=mirth_type_StackTypeBase_Ignore };
						struct std_either_Either_2 v26 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v25));
						branch_Either_22 = v26;
						branch_zaMirth_21 = v19;
					} break;
					case mirth_type_StackType_Var: {
						uint64_t v27 = mtp_mirth_type_StackType_Var(v20);
						struct mirth_type_StackTypeBase v28 = mtw_mirth_type_StackTypeBase_Var(v27);
						struct std_either_Either_2 v29 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v28));
						branch_Either_22 = v29;
						branch_zaMirth_21 = v19;
					} break;
					case mirth_type_StackType_Meta: {
						uint64_t v30 = mtp_mirth_type_StackType_Meta(v20);
						struct mirth_type_StackTypeBase v31 = mtw_mirth_type_StackTypeBase_Meta(v30);
						struct std_either_Either_2 v32 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v31));
						branch_Either_22 = v32;
						branch_zaMirth_21 = v19;
					} break;
					case mirth_type_StackType_Unit: {
						struct mirth_type_StackTypeBase v33 = { .tag=mirth_type_StackTypeBase_Unit };
						struct std_either_Either_2 v34 = mtw_std_either_Either_2_Left(MK_mirth_type_StackTypeBase(v33));
						branch_Either_22 = v34;
						branch_zaMirth_21 = v19;
					} break;
					case mirth_type_StackType_Cons: {
						struct mirth_type_Type v35;
						struct mirth_type_StackType v36 = mtp_mirth_type_StackType_Cons(v20, &v35);
						decref(MK_mirth_type_Type(v35));
						struct std_either_Either_2 v37 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v36));
						branch_Either_22 = v37;
						branch_zaMirth_21 = v19;
					} break;
					case mirth_type_StackType_With: {
						struct mirth_type_Type v38;
						struct mirth_type_StackType v39 = mtp_mirth_type_StackType_With(v20, &v38);
						decref(MK_mirth_type_Type(v38));
						struct std_either_Either_2 v40 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v39));
						branch_Either_22 = v40;
						branch_zaMirth_21 = v19;
					} break;
					case mirth_type_StackType_ConsLabel: {
						struct mirth_type_Type v41;
						uint64_t v42;
						struct mirth_type_StackType v43 = mtp_mirth_type_StackType_ConsLabel(v20, &v41, &v42);
						decref(MK_mirth_type_Type(v41));
						struct std_either_Either_2 v44 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v43));
						branch_Either_22 = v44;
						branch_zaMirth_21 = v19;
					} break;
					case mirth_type_StackType_WithLabel: {
						struct mirth_type_Type v45;
						uint64_t v46;
						struct mirth_type_StackType v47 = mtp_mirth_type_StackType_WithLabel(v20, &v45, &v46);
						decref(MK_mirth_type_Type(v45));
						struct std_either_Either_2 v48 = mtw_std_either_Either_2_Right(MK_mirth_type_StackType(v47));
						branch_Either_22 = v48;
						branch_zaMirth_21 = v19;
					} break;
					default: {
						do_panic(str_make("unexpected fallthrough in match\n", 32));
					}
				}
				bool v49 = true;
				branch_Bool_17 = v49;
				branch_Either_16 = branch_Either_22;
				branch_zaMirth_15 = branch_zaMirth_21;
			} break;
			case std_maybe_Maybe_1_None: {
				bool v50 = false;
				branch_Bool_17 = v50;
				branch_Either_16 = v12;
				branch_zaMirth_15 = r11;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v10 = branch_Bool_17;
		v9 = branch_Bool_17;
		v8 = branch_Either_16;
		r7 = branch_zaMirth_15;
	}
	struct std_maybe_Maybe_1 v51 = mw_std_either_Either_2_leftzy(v8);
	VAL v52 = mw_std_maybe_Maybe_1_unwrap_1_sp3(v51);
	*out_zaMirth_3 = r7;
	return V_mirth_type_StackTypeBase(v52);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, -0x48(%rbp)
movl %esi, %eax
movq %rdi, %r12
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xc4693(%rip), %rsi     # 0x115bc1
movq %rax, %rdi
callq 0x20c67
movq %rdx, %r15
movl $0x1, %r13d
movq %r15, %rax
andq %rbx, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x51555
incl (%rax)
movl %r13d, %edi
movq %r15, %rsi
callq 0x3b176
testl %eax, %eax
je 0x515f7
cmpl $0x1, %eax
jne 0x5174a
movq %rdx, %rdi
callq 0xdaeb
movq %rax, %r14
movq %r15, %rax
andq %rbx, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x515aa
decl (%rax)
jne 0x515aa
shlq $0x30, %r13
orq %r15, %r13
movq %r13, %rdi
leaq 0xc497c(%rip), %rsi     # 0x115f21
callq 0xd4e3
movq %r14, %rsi
shrq $0x30, %rsi
andq %rbx, %r14
movq %r12, %rdi
movq %r14, %rdx
leaq -0x30(%rbp), %rcx
callq 0x3917b
cmpl $0x8, %eax
ja 0x5174a
movl %eax, %eax
leaq 0x9185b(%rip), %rcx     # 0xe2e30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r13d, %r13d
xorl %edi, %edi
leaq 0xc4d27(%rip), %rsi     # 0x116311
callq 0x20c09
movq %rdx, %r15
jmp 0x51677
xorl %eax, %eax
jmp 0x5170d
movq 0x8(%rdx), %r14
decl (%rdx)
jne 0x5160e
movq %rdx, %rdi
callq 0x5030
movq %r14, %rdi
callq 0x3b262
btsq $0x32, %rax
jmp 0x5164e
movabsq $0x2000000000000, %rdi  # imm = 0x2000000000000
jmp 0x51665
movq 0x8(%rdx), %r14
decl (%rdx)
jne 0x51639
movq %rdx, %rdi
callq 0x5030
movq %r14, %rdi
callq 0x3b20f
movabsq $0x3000000000000, %rcx  # imm = 0x3000000000000
orq %rcx, %rax
movq %rax, %rdi
jmp 0x51665
movq %rdx, %rdi
leaq -0x40(%rbp), %rsi
callq 0x39346
jmp 0x516b0
leaq 0x4(%rbx), %rdi
leaq 0xc4ca5(%rip), %rsi     # 0x116311
callq 0x20c09
movq %rdx, %r15
xorl %r13d, %r13d
movq -0x30(%rbp), %r12
jmp 0x5170b
movq %rdx, %rdi
leaq -0x40(%rbp), %rsi
callq 0x392bf
jmp 0x516b0
movq %rdx, %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x393cd
jmp 0x516b0
movq %rdx, %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x39471
movl %eax, %r15d
movq %rdx, %r14
movq -0x38(%rbp), %rax
movq %rax, %rcx
andq %rbx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x516e8
movl -0x40(%rbp), %edi
decl (%rcx)
jne 0x516e8
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xc4406(%rip), %rsi     # 0x115ae9
callq 0xd4e3
shlq $0x30, %r15
orq %r14, %r15
movq %r15, %rdi
leaq 0xc44c8(%rip), %rsi     # 0x115bc1
callq 0x20c67
movq %rdx, %r15
movq -0x30(%rbp), %r12
movl $0x1, %r13d
movb $0x1, %al
testb %al, %al
jne 0x5153f
movl %r13d, %edi
movq %r15, %rsi
callq 0x3b2b5
movl %eax, %edi
movq %rdx, %rsi
callq 0x3502e
movq -0x48(%rbp), %rcx
movq %r12, (%rcx)
andq %rax, %rbx
shrq $0x30, %rax
movq %rbx, %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf9f7
movq $0x20, 0x10(%rax)
movups 0x92fea(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0x92fef(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5