// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
movq %rcx, -0x50(%rbp)
movl %esi, %eax
movq %rdi, -0x30(%rbp)
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xbd500(%rip), %rsi     # 0x108bc1
movq %rax, %rdi
callq 0x1e454
movq %rdx, %rbx
pushq $0x1
popq %rax
leaq 0x4(%r14), %rcx
movq %rcx, -0x58(%rbp)
movl %eax, %r13d
movq %rbx, %r15
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %r15
setne %al
testb $0x3, %bl
sete %r12b
andb %al, %r12b
cmpb $0x1, %r12b
jne 0x4b700
incl (%r15)
movl %r13d, %edi
movq %rbx, %rsi
callq 0x36b56
cmpl $0x1, %eax
jne 0x4b8a5
movq %rdx, %rdi
callq 0xd491
movq %rax, %r14
testb %r12b, %r12b
je 0x4b73f
decl (%r15)
jne 0x4b73f
shlq $0x30, %r13
orq %rbx, %r13
movq %r13, %rdi
leaq 0xbd7e7(%rip), %rsi     # 0x108f21
callq 0xce94
movq %r14, %rsi
shrq $0x30, %rsi
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %r14
movq -0x30(%rbp), %rdi
movq %r14, %rdx
leaq -0x38(%rbp), %rcx
callq 0x34dd2
cmpl $0x8, %eax
ja 0x4b8e9
movl %eax, %eax
leaq 0x876cf(%rip), %rcx     # 0xd2e44
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r13d, %r13d
xorl %edi, %edi
leaq 0xbdb87(%rip), %rsi     # 0x109311
callq 0x1e400
movq %rdx, %rbx
jmp 0x4b7ef
movq %rdx, %rdi
callq 0x34e20
movq %rax, %rdi
callq 0x36c1f
btsq $0x32, %rax
jmp 0x4b7d4
movabsq $0x2000000000000, %rdi  # imm = 0x2000000000000
jmp 0x4b7dd
movq %rdx, %rdi
callq 0x34edb
movq %rax, %rdi
callq 0x36bd6
movabsq $0x3000000000000, %rcx  # imm = 0x3000000000000
orq %rcx, %rax
movq %rax, %rdi
jmp 0x4b7dd
movq -0x58(%rbp), %rdi
leaq 0xbdb2d(%rip), %rsi     # 0x109311
callq 0x1e400
movq %rdx, %rbx
xorl %r13d, %r13d
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x4b6da
movq %rdx, %rdi
leaq -0x48(%rbp), %rsi
callq 0x34f7f
jmp 0x4b83a
movq %rdx, %rdi
leaq -0x48(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x350d3
jmp 0x4b83a
movq %rdx, %rdi
leaq -0x48(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x3502f
jmp 0x4b83a
movq %rdx, %rdi
leaq -0x48(%rbp), %rsi
callq 0x34ef8
movl %eax, %r15d
movq %rdx, %r12
movq -0x40(%rbp), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x4b87c
movl -0x48(%rbp), %edi
decl (%rcx)
jne 0x4b87c
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xbd272(%rip), %rsi     # 0x108ae9
callq 0xce94
shlq $0x30, %r15
orq %r12, %r15
movq %r15, %rdi
leaq 0xbd334(%rip), %rsi     # 0x108bc1
callq 0x1e454
movq %rdx, %rbx
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
pushq $0x1
popq %rax
jmp 0x4b6d7
testl %eax, %eax
jne 0x4b8e9
movl %r13d, %edi
movq %rbx, %rsi
callq 0x36c68
movl %eax, %edi
movq %rdx, %rsi
callq 0x31344
movq -0x50(%rbp), %rcx
movq -0x30(%rbp), %rdx
movq %rdx, (%rcx)
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rax, %rdx
shrq $0x30, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x88f1d(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6