// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
leaq 0x10bb44a(%rip), %rdi   # 0x1119d70
callq 0x13ff0
movq %rax, %r13
movq %rax, %rdi
callq 0x153b0
testb %al, %al
je 0x5e954
movq %r13, %rdi
callq 0x140f0
movq %rax, %r15
andq %rax, %r14
shrq $0x30, %r15
movq %r14, %r13
jmp 0x5ec80
movq %r13, -0x58(%rbp)
leaq -0x60(%rbp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x5117e
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 0x5e98a
incl (%rcx)
andq %r14, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x5e9ab
decl (%rax)
jne 0x5e9ab
leaq 0xb71d3(%rip), %rsi     # 0x115b79
callq 0xd4e3
movq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rcx
movl %r13d, %esi
movq %r12, %rdx
callq 0x3917b
cmpl $0x7, %eax
je 0x5ea2e
cmpl $0x5, %eax
jne 0x5ea93
leaq -0x38(%rbp), %rsi
movq %rdx, %rdi
callq 0x392bf
movq %rdx, %rcx
andq %r14, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x5ea08
decl (%rcx)
jne 0x5ea08
shlq $0x30, %rax
orq %rdx, %rax
movq %rax, %rdi
leaq 0xb71be(%rip), %rsi     # 0x115bc1
callq 0xd4e3
movl -0x38(%rbp), %edi
shlq $0x30, %rdi
orq -0x30(%rbp), %rdi
leaq 0xb70cf(%rip), %rsi     # 0x115ae9
callq 0x20c09
movq %rdx, %r13
movq -0x40(%rbp), %r12
xorl %r15d, %r15d
jmp 0x5ec52
leaq -0x38(%rbp), %rsi
movq %rdx, %rdi
callq 0x39346
movq %rdx, %rcx
andq %r14, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x5ea6a
decl (%rcx)
jne 0x5ea6a
shlq $0x30, %rax
orq %rdx, %rax
movq %rax, %rdi
leaq 0xb715c(%rip), %rsi     # 0x115bc1
callq 0xd4e3
movl -0x38(%rbp), %edi
shlq $0x30, %rdi
orq -0x30(%rbp), %rdi
leaq 0xb706d(%rip), %rsi     # 0x115ae9
callq 0x20c67
movq %rdx, %r13
movq -0x40(%rbp), %r12
movl $0x1, %r15d
jmp 0x5ec52
movq %rdx, %rcx
andq %r14, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x5eac3
decl (%rcx)
jne 0x5eac3
shlq $0x30, %rax
orq %rdx, %rax
movq %rax, %rdi
leaq 0xb7103(%rip), %rsi     # 0x115bc1
callq 0xd4e3
cmpq $0x0, 0x10bb2b5(%rip)   # 0x1119d80
jne 0x5eae3
xorl %edi, %edi
callq 0xf9f7
movq $0x0, 0x10(%rax)
movq %rax, 0x10bb29d(%rip)   # 0x1119d80
movq 0x10bb296(%rip), %r12   # 0x1119d80
movq %r12, %rax
andq %r14, %rax
sete %cl
testb $0x3, %r12b
setne %dl
orb %cl, %dl
jne 0x5eb00
incl (%rax)
cmpq $0x0, 0x10bb280(%rip)   # 0x1119d88
jne 0x5eb47
movl $0x27, %edi
callq 0xf9f7
movq $0x27, 0x10(%rax)
movabsq $0x20726f7463757274, %rcx # imm = 0x20726F7463757274
movq %rcx, 0x37(%rax)
movups 0x8bcd5(%rip), %xmm0    # 0xea806
movups %xmm0, 0x18(%rax)
movups 0x8bcda(%rip), %xmm0    # 0xea816
movups %xmm0, 0x28(%rax)
movq %rax, 0x10bb241(%rip)   # 0x1119d88
movq %rbx, -0x48(%rbp)
movq 0x10bb236(%rip), %rsi   # 0x1119d88
movq %rsi, %rax
andq %r14, %rax
sete %cl
testb $0x3, %sil
setne %dl
orb %cl, %dl
jne 0x5eb68
incl (%rax)
movq %r12, %rdi
callq 0xe43c
movq %rax, %r12
movq -0x40(%rbp), %rdi
leaq -0x38(%rbp), %r13
movq %r15, %rsi
movq %r13, %rdx
callq 0x1523d
movq (%r13), %rdi
leaq -0x50(%rbp), %rbx
leaq -0x68(%rbp), %r13
movq %r12, %rsi
movq %rax, %rdx
movq %rbx, %rcx
movq %r13, %r8
callq 0x14ddb
movq (%r13), %r13
movq (%rbx), %r12
leaq 0x10ba02f(%rip), %rdi   # 0x1118be0
movq %r15, %rsi
callq 0x13ff0
movq %rax, %rdi
callq 0x140f0
leaq 0x10ba140(%rip), %rdi   # 0x1118d08
movq %rax, %rsi
callq 0x13ff0
movq %rax, %rdi
callq 0x140f0
movq %rax, %rdx
shrq $0x30, %rdx
andq %r14, %rax
leaq -0x38(%rbp), %rbx
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rcx
movq %rbx, %r8
callq 0x5eda4
movq (%rbx), %rbx
leaq 0x10b9fdf(%rip), %rdi   # 0x1118be0
movq %r15, %rsi
callq 0x13ff0
movq %rax, %rdi
callq 0x140f0
leaq -0x50(%rbp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x20d1b
leaq 0xb6ec2(%rip), %rsi     # 0x115ae9
testb %al, %al
je 0x5ec3d
xorl %edi, %edi
callq 0x20c67
movq %rdx, %r13
movl $0x1, %r15d
jmp 0x5ec4a
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x20c09
movq %rdx, %r13
movq -0x48(%rbp), %rbx
movq -0x50(%rbp), %r12
movq %r15, %rdi
shlq $0x30, %rdi
orq %r13, %rdi
leaq 0xb72be(%rip), %rsi     # 0x115f21
andq %r13, %r14
sete %al
testb $0x3, %r13b
setne %cl
orb %al, %cl
jne 0x5ec77
incl (%r14)
movq -0x58(%rbp), %rdx
callq 0x14ab5
movq %r12, (%rbx)
movl %r15d, %eax
movq %r13, %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq