// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_data_Tag_outputzetype
static struct std_either_Either_2 mw_mirth_data_Tag_outputzetype (struct mirth_mirth_zaMirth* in_zaMirth_1, uint64_t in_Tag_2, struct mirth_mirth_zaMirth* *out_zaMirth_3) {
	void* v5 = field_mut(&mfld_mirth_data_Tag_outputzetype, in_Tag_2);
	bool v6 = mut_is_set(v5);
	struct mirth_mirth_zaMirth* branch_zaMirth_7;
	struct std_either_Either_2 branch_Either_8;
	if (v6) {
		VAL v9 = mut_get(v5);
		branch_Either_8 = V_std_either_Either_2(v9);
		branch_zaMirth_7 = in_zaMirth_1;
	} else {
		struct mirth_mirth_zaMirth* v10;
		struct mirth_type_ArrowType* v11 = mw_mirth_data_Tag_type(in_zaMirth_1, in_Tag_2, &v10);
		struct mirth_type_StackType v12 = v11->mcod;
		incref(MK_mirth_type_StackType(v12));
		decref(MK_mirth_type_ArrowType(v11));
		struct mirth_mirth_zaMirth* v13;
		struct mirth_type_StackType v14 = mw_mirth_type_StackType_expand(v10, v12, &v13);
		uint64_t branch_Tag_15;
		uint64_t branch_Tag_16;
		struct mirth_mirth_zaMirth* branch_zaMirth_17;
		struct std_either_Either_2 branch_Either_18;
		switch ((v14).tag) {
			case mirth_type_StackType_Cons: {
				struct mirth_type_Type v19;
				struct mirth_type_StackType v20 = mtp_mirth_type_StackType_Cons(v14, &v19);
				decref(MK_mirth_type_StackType(v20));
				struct std_either_Either_2 v21 = mtw_std_either_Either_2_Left(MK_mirth_type_Type(v19));
				branch_Either_18 = v21;
				branch_zaMirth_17 = v13;
				branch_Tag_16 = in_Tag_2;
				branch_Tag_15 = in_Tag_2;
			} break;
			case mirth_type_StackType_With: {
				struct mirth_type_Type v22;
				struct mirth_type_StackType v23 = mtp_mirth_type_StackType_With(v14, &v22);
				decref(MK_mirth_type_StackType(v23));
				struct std_either_Either_2 v24 = mtw_std_either_Either_2_Right(MK_mirth_type_Type(v22));
				branch_Either_18 = v24;
				branch_zaMirth_17 = v13;
				branch_Tag_16 = in_Tag_2;
				branch_Tag_15 = in_Tag_2;
			} break;
			default: {
				decref(MK_mirth_type_StackType(v14));
				STR* v25;
				STRLIT(v25, "", 0);
				STR* v26;
				STRLIT(v26, "Unexpected output type for constructor ", 39);
				STR* v27;
				mw_std_str_zaStr_pushzestrzx(v26, v25, &v27);
				struct mirth_mirth_zaMirth* v28;
				STR* v29;
				mw_mirth_data_Tag_qnamezj(v13, v27, in_Tag_2, &v28, &v29);
				struct mirth_mirth_zaMirth* v30;
				uint64_t v31 = mw_mirth_data_Tag_data(v28, in_Tag_2, &v30);
				struct mirth_mirth_zaMirth* v32;
				struct std_maybe_Maybe_1 v33 = mw_mirth_data_Data_headzy(v30, v31, &v32);
				struct mirth_mirth_zaMirth* v34;
				mw_std_maybe_Maybe_1_ifzy_2_sp58(v32, v29, v33, &v34);
				struct mirth_type_Type v35 = { .tag=mirth_type_Type_Error };
				struct mirth_mirth_zaMirth* v36;
				uint64_t v37 = mw_mirth_data_Tag_data(v34, in_Tag_2, &v36);
				struct mirth_mirth_zaMirth* v38;
				bool v39 = mw_mirth_data_Data_iszeresourcezy(v36, v37, &v38);
				uint64_t branch_Tag_40;
				uint64_t branch_Tag_41;
				struct mirth_mirth_zaMirth* branch_zaMirth_42;
				struct std_either_Either_2 branch_Either_43;
				if (v39) {
					struct std_either_Either_2 v44 = mtw_std_either_Either_2_Right(MK_mirth_type_Type(v35));
					branch_Either_43 = v44;
					branch_zaMirth_42 = v38;
					branch_Tag_41 = in_Tag_2;
					branch_Tag_40 = in_Tag_2;
				} else {
					struct std_either_Either_2 v45 = mtw_std_either_Either_2_Left(MK_mirth_type_Type(v35));
					branch_Either_43 = v45;
					branch_zaMirth_42 = v38;
					branch_Tag_41 = in_Tag_2;
					branch_Tag_40 = in_Tag_2;
				}
				branch_Either_18 = branch_Either_43;
				branch_zaMirth_17 = branch_zaMirth_42;
				branch_Tag_16 = branch_Tag_41;
				branch_Tag_15 = branch_Tag_40;
			} break;
		}
		incref(MK_std_either_Either_2(branch_Either_18));
		mut_set(MK_std_either_Either_2(branch_Either_18), v5);
		branch_Either_8 = branch_Either_18;
		branch_zaMirth_7 = branch_zaMirth_17;
	}
	*out_zaMirth_3 = branch_zaMirth_7;
	return branch_Either_8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
leaq 0x10b4977(%rip), %rdi   # 0x110cd70
callq 0x12f88
movq %rax, %r13
movq %rax, %rdi
callq 0x142de
testb %al, %al
je 0x58427
movq %r13, %rdi
callq 0x1307d
movq %rax, %r15
andq %rax, %r14
shrq $0x30, %r15
movq %r14, %r13
jmp 0x58709
movq %r13, -0x50(%rbp)
leaq -0x60(%rbp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x4b310
movq %rax, %rdi
movl 0x18(%rax), %r13d
movq 0x20(%rax), %r12
movq %r12, %rcx
andq %r14, %rcx
sete %dl
testb $0x3, %r12b
setne %sil
orb %dl, %sil
jne 0x5845d
incl (%rcx)
andq %r14, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x5847e
decl (%rax)
jne 0x5847e
leaq 0xb0700(%rip), %rsi     # 0x108b79
callq 0xce94
movq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rcx
movl %r13d, %esi
movq %r12, %rdx
callq 0x34dd2
cmpl $0x7, %eax
je 0x58501
cmpl $0x5, %eax
jne 0x58564
leaq -0x38(%rbp), %rsi
movq %rdx, %rdi
callq 0x34ef8
movq %rdx, %rcx
andq %r14, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x584db
decl (%rcx)
jne 0x584db
shlq $0x30, %rax
orq %rdx, %rax
movq %rax, %rdi
leaq 0xb06eb(%rip), %rsi     # 0x108bc1
callq 0xce94
movl -0x38(%rbp), %edi
shlq $0x30, %rdi
orq -0x30(%rbp), %rdi
leaq 0xb05fc(%rip), %rsi     # 0x108ae9
callq 0x1e400
movq %rdx, %r13
movq -0x40(%rbp), %r12
xorl %r15d, %r15d
jmp 0x586db
leaq -0x38(%rbp), %rsi
movq %rdx, %rdi
callq 0x34f7f
movq %rdx, %rcx
andq %r14, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x5853d
decl (%rcx)
jne 0x5853d
shlq $0x30, %rax
orq %rdx, %rax
movq %rax, %rdi
leaq 0xb0689(%rip), %rsi     # 0x108bc1
callq 0xce94
movl -0x38(%rbp), %edi
shlq $0x30, %rdi
orq -0x30(%rbp), %rdi
leaq 0xb059a(%rip), %rsi     # 0x108ae9
callq 0x1e454
movq %rdx, %r13
movq -0x40(%rbp), %r12
pushq $0x1
popq %r15
jmp 0x586db
movq %rdx, %rcx
andq %r14, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x58594
decl (%rcx)
jne 0x58594
shlq $0x30, %rax
orq %rdx, %rax
movq %rax, %rdi
leaq 0xb0632(%rip), %rsi     # 0x108bc1
callq 0xce94
movq 0x10b47e5(%rip), %r12   # 0x110cd80
testq %r12, %r12
jne 0x585b8
leaq 0x8414e(%rip), %rdi     # 0xdc6f5
xorl %esi, %esi
callq 0x8a21
movq %rax, %r12
movq %rax, 0x10b47c8(%rip)   # 0x110cd80
movq %r12, %rax
andq %r14, %rax
sete %cl
testb $0x3, %r12b
setne %dl
orb %cl, %dl
jne 0x585ce
incl (%rax)
movq 0x10b47b3(%rip), %rsi   # 0x110cd88
testq %rsi, %rsi
jne 0x585f3
leaq 0x822c5(%rip), %rdi     # 0xda8a6
pushq $0x27
popq %rsi
callq 0x8a21
movq %rax, %rsi
movq %rax, 0x10b4795(%rip)   # 0x110cd88
movq %rbx, -0x48(%rbp)
movq %rsi, %rax
andq %r14, %rax
sete %cl
testb $0x3, %sil
setne %dl
orb %cl, %dl
jne 0x5860d
incl (%rax)
movq %r12, %rdi
callq 0xd8b0
movq %rax, %r12
movq -0x40(%rbp), %rdi
leaq -0x38(%rbp), %r13
movq %r15, %rsi
movq %r13, %rdx
callq 0x1415b
movq (%r13), %rdi
leaq -0x70(%rbp), %r13
leaq -0x68(%rbp), %rbx
movq %r12, %rsi
movq %rax, %rdx
movq %r13, %rcx
movq %rbx, %r8
callq 0x13bc8
movq (%rbx), %rbx
movq (%r13), %rdi
leaq -0x38(%rbp), %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x172b6
movq (%r12), %rdi
leaq -0x70(%rbp), %r12
movq %rax, %rsi
movq %r12, %rdx
callq 0x18fb4
movq %rdx, %rcx
movq (%r12), %rdi
leaq -0x68(%rbp), %r12
movq %rbx, %rsi
movl %eax, %edx
movq %r12, %r8
callq 0x58814
movq (%r12), %rdi
leaq -0x78(%rbp), %rbx
movq %r15, %rsi
movq %rbx, %rdx
callq 0x172b6
movq (%rbx), %rdi
leaq -0x58(%rbp), %rdx
movq %rax, %rsi
callq 0x1e4f2
leaq 0xb0437(%rip), %rsi     # 0x108ae9
testb %al, %al
je 0x586c6
xorl %edi, %edi
callq 0x1e454
movq %rdx, %r13
pushq $0x1
popq %r15
jmp 0x586d3
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x1e400
movq %rdx, %r13
movq -0x48(%rbp), %rbx
movq -0x58(%rbp), %r12
movq %r15, %rdi
shlq $0x30, %rdi
orq %r13, %rdi
leaq 0xb0835(%rip), %rsi     # 0x108f21
andq %r13, %r14
sete %al
testb $0x3, %r13b
setne %cl
orb %al, %cl
jne 0x58700
incl (%r14)
movq -0x50(%rbp), %rdx
callq 0x1393b
movq %r12, (%rbx)
movl %r15d, %eax
movq %r13, %rdx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq