// File: /workspace/github_c_makefile_star2_O3/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 0x10b8c80(%rip), %rdi   # 0x1115d70
callq 0x13c85
movq %rax, %r13
movq %rax, %rdi
callq 0x1505d
testb %al, %al
je 0x5d11e
movq %r13, %rdi
callq 0x13d82
movq %rax, %r15
andq %rax, %r14
shrq $0x30, %r15
movq %r14, %r13
jmp 0x5d446
movq %r13, -0x58(%rbp)
leaq -0x60(%rbp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x4fa43
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 0x5d154
incl (%rcx)
andq %r14, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x5d175
decl (%rax)
jne 0x5d175
leaq 0xb4a09(%rip), %rsi     # 0x111b79
callq 0xd13d
movq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rcx
movl %r13d, %esi
movq %r12, %rdx
callq 0x37fe3
cmpl $0x7, %eax
je 0x5d1f8
cmpl $0x5, %eax
jne 0x5d25d
leaq -0x38(%rbp), %rsi
movq %rdx, %rdi
callq 0x38125
movq %rdx, %rcx
andq %r14, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x5d1d2
decl (%rcx)
jne 0x5d1d2
shlq $0x30, %rax
orq %rdx, %rax
movq %rax, %rdi
leaq 0xb49f4(%rip), %rsi     # 0x111bc1
callq 0xd13d
movl -0x38(%rbp), %edi
shlq $0x30, %rdi
orq -0x30(%rbp), %rdi
leaq 0xb4905(%rip), %rsi     # 0x111ae9
callq 0x2069e
movq %rdx, %r13
movq -0x40(%rbp), %r12
xorl %r15d, %r15d
jmp 0x5d418
leaq -0x38(%rbp), %rsi
movq %rdx, %rdi
callq 0x381ac
movq %rdx, %rcx
andq %r14, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x5d234
decl (%rcx)
jne 0x5d234
shlq $0x30, %rax
orq %rdx, %rax
movq %rax, %rdi
leaq 0xb4992(%rip), %rsi     # 0x111bc1
callq 0xd13d
movl -0x38(%rbp), %edi
shlq $0x30, %rdi
orq -0x30(%rbp), %rdi
leaq 0xb48a3(%rip), %rsi     # 0x111ae9
callq 0x206fc
movq %rdx, %r13
movq -0x40(%rbp), %r12
movl $0x1, %r15d
jmp 0x5d418
movq %rdx, %rcx
andq %r14, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x5d28d
decl (%rcx)
jne 0x5d28d
shlq $0x30, %rax
orq %rdx, %rax
movq %rax, %rdi
leaq 0xb4939(%rip), %rsi     # 0x111bc1
callq 0xd13d
movq 0x10b8aec(%rip), %r12   # 0x1115d80
testq %r12, %r12
jne 0x5d2b2
xorl %edi, %edi
callq 0xf5e4
movq %rax, %r12
movq $0x0, 0x10(%rax)
movq %rax, 0x10b8ace(%rip)   # 0x1115d80
movq %r12, %rax
andq %r14, %rax
sete %cl
testb $0x3, %r12b
setne %dl
orb %cl, %dl
jne 0x5d2c8
incl (%rax)
movq 0x10b8ab9(%rip), %rsi   # 0x1115d88
testq %rsi, %rsi
jne 0x5d314
movl $0x27, %edi
callq 0xf5e4
movq %rax, %rsi
movq $0x27, 0x10(%rax)
movabsq $0x20726f7463757274, %rax # imm = 0x20726F7463757274
movq %rax, 0x37(%rsi)
movups 0x893d7(%rip), %xmm0    # 0xe66d5
movups %xmm0, 0x18(%rsi)
movups 0x893dc(%rip), %xmm0    # 0xe66e5
movups %xmm0, 0x28(%rsi)
movq %rsi, 0x10b8a74(%rip)   # 0x1115d88
movq %rbx, -0x48(%rbp)
movq %rsi, %rax
andq %r14, %rax
sete %cl
testb $0x3, %sil
setne %dl
orb %cl, %dl
jne 0x5d32e
incl (%rax)
movq %r12, %rdi
callq 0xe069
movq %rax, %r12
movq -0x40(%rbp), %rdi
leaq -0x38(%rbp), %r13
movq %r15, %rsi
movq %r13, %rdx
callq 0x14eea
movq (%r13), %rdi
leaq -0x50(%rbp), %rbx
leaq -0x68(%rbp), %r13
movq %r12, %rsi
movq %rax, %rdx
movq %rbx, %rcx
movq %r13, %r8
callq 0x14a8c
movq (%r13), %r13
movq (%rbx), %r12
leaq 0x10b7869(%rip), %rdi   # 0x1114be0
movq %r15, %rsi
callq 0x13c85
movq %rax, %rdi
callq 0x13d82
leaq 0x10b797a(%rip), %rdi   # 0x1114d08
movq %rax, %rsi
callq 0x13c85
movq %rax, %rdi
callq 0x13d82
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 0x5d56a
movq (%rbx), %rbx
leaq 0x10b7819(%rip), %rdi   # 0x1114be0
movq %r15, %rsi
callq 0x13c85
movq %rax, %rdi
callq 0x13d82
leaq -0x50(%rbp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x207b0
leaq 0xb46fc(%rip), %rsi     # 0x111ae9
testb %al, %al
je 0x5d403
xorl %edi, %edi
callq 0x206fc
movq %rdx, %r13
movl $0x1, %r15d
jmp 0x5d410
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2069e
movq %rdx, %r13
movq -0x48(%rbp), %rbx
movq -0x50(%rbp), %r12
movq %r15, %rdi
shlq $0x30, %rdi
orq %r13, %rdi
leaq 0xb4af8(%rip), %rsi     # 0x111f21
andq %r13, %r14
sete %al
testb $0x3, %r13b
setne %cl
orb %al, %cl
jne 0x5d43d
incl (%r14)
movq -0x58(%rbp), %rdx
callq 0x14766
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