// File: /workspace/github_c_makefile_star2_O3/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_zaAB_elabzeatomzeresolvezedefzx
static void mw_mirth_elab_zaAB_elabzeatomzeresolvezedefzx (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_arrow_Arrow* in_zaAB_2, struct std_either_Either_2 in_Either_3, struct mirth_mirth_zaMirth* *out_zaMirth_4, struct mirth_arrow_Arrow* *out_zaAB_5) {
	struct mirth_arrow_Arrow* v6;
	struct mirth_type_StackType v7 = mw_mirth_elab_zaAB_abzetypezo(in_zaAB_2, &v6);
	struct mirth_mirth_zaMirth* v8;
	bool v9 = mw_mirth_type_StackType_topzetypeszearezefinezy(in_zaMirth_1, v7, &v8);
	bool v10 = !v9;
	struct mirth_arrow_Arrow* v11;
	uint64_t v12 = mw_mirth_elab_zaAB_abzetokenzo(v6, &v11);
	STR* v13;
	STRLIT(v13, "word", 4);
	bool v14 = false;
	struct mirth_mirth_zaMirth* v15;
	struct mirth_elab_zaResolveDef* v16;
	mw_mirth_elab_zaResolveDef_Beginzx(v13, v12, in_Either_3, v14, v10, v8, &v15, &v16);
	struct std_list_List_1 v17 = v16->mcandidates;
	incref(MK_std_list_List_1(v17));
	struct std_list_List_1 v18 = { .tag=std_list_List_1_Nil };
	struct std_list_List_1 v19 = { .tag=std_list_List_1_Nil };
	bool v20 = true;
	struct mirth_mirth_zaMirth* r21 = v15;
	struct mirth_elab_zaResolveDef* r22 = v16;
	struct std_list_List_1 v23 = v18;
	struct std_list_List_1 v24 = v19;
	struct std_list_List_1 v25 = v17;
	bool v26 = v20;
	bool v27 = v20;
	while (v27) {
		struct mirth_mirth_zaMirth* r28 = r21;
		struct mirth_elab_zaResolveDef* r29 = r22;
		struct std_list_List_1 v30 = v23;
		struct std_list_List_1 v31 = v24;
		struct std_list_List_1 v32 = v25;
		bool v33 = v26;
		struct mirth_mirth_zaMirth* branch_zaMirth_34;
		VAL branch_zux1_35;
		struct std_list_List_1 branch_List_36;
		struct std_list_List_1 branch_List_37;
		struct std_list_List_1 branch_List_38;
		bool branch_Bool_39;
		switch ((v32).tag) {
			case std_list_List_1_Cons: {
				struct std_list_List_1 v40;
				VAL v41 = mtp_std_list_List_1_Cons(v32, &v40);
				incref(v41);
				struct mirth_mirth_zaMirth* v42;
				bool v43 = mw_mirth_def_Def_callablezy(r28, V_mirth_def_Def(v41), &v42);
				struct mirth_mirth_zaMirth* branch_zaMirth_44;
				VAL branch_zux1_45;
				struct std_either_Either_2 branch_Either_46;
				if (v43) {
					struct std_either_Either_2 v47 = mtw_std_either_Either_2_Right(v41);
					branch_Either_46 = v47;
					branch_zux1_45 = MK_mirth_elab_zaResolveDef(r29);
					branch_zaMirth_44 = v42;
				} else {
					struct mirth_elab_RejectedDef v48 = mtw_mirth_elab_RejectedDef_WrongSort(V_mirth_def_Def(v41));
					struct std_either_Either_2 v49 = mtw_std_either_Either_2_Left(MK_mirth_elab_RejectedDef(v48));
					branch_Either_46 = v49;
					branch_zux1_45 = MK_mirth_elab_zaResolveDef(r29);
					branch_zaMirth_44 = v42;
				}
				struct mirth_mirth_zaMirth* branch_zaMirth_50;
				VAL branch_zux1_51;
				struct std_list_List_1 branch_List_52;
				struct std_list_List_1 branch_List_53;
				switch ((branch_Either_46).tag) {
					case std_either_Either_2_Left: {
						VAL v54 = mtp_std_either_Either_2_Left(branch_Either_46);
						struct std_list_List_1 v55 = mw_std_list_List_1_cons(v54, v30);
						branch_List_53 = v31;
						branch_List_52 = v55;
						branch_zux1_51 = branch_zux1_45;
						branch_zaMirth_50 = branch_zaMirth_44;
					} break;
					case std_either_Either_2_Right: {
						VAL v56 = mtp_std_either_Either_2_Right(branch_Either_46);
						struct std_list_List_1 v57 = mw_std_list_List_1_cons(v56, v31);
						branch_List_53 = v57;
						branch_List_52 = v30;
						branch_zux1_51 = branch_zux1_45;
						branch_zaMirth_50 = branch_zaMirth_44;
					} break;
					default: {
						do_panic(str_make("unexpected fallthrough in match\n", 32));
					}
				}
				bool v58 = true;
				branch_Bool_39 = v58;
				branch_List_38 = v40;
				branch_List_37 = branch_List_53;
				branch_List_36 = branch_List_52;
				branch_zux1_35 = branch_zux1_51;
				branch_zaMirth_34 = branch_zaMirth_50;
			} break;
			case std_list_List_1_Nil: {
				struct std_list_List_1 v59 = { .tag=std_list_List_1_Nil };
				bool v60 = false;
				branch_Bool_39 = v60;
				branch_List_38 = v59;
				branch_List_37 = v31;
				branch_List_36 = v30;
				branch_zux1_35 = MK_mirth_elab_zaResolveDef(r29);
				branch_zaMirth_34 = r28;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v27 = branch_Bool_39;
		v26 = branch_Bool_39;
		v25 = branch_List_38;
		v24 = branch_List_37;
		v23 = branch_List_36;
		r22 = V_mirth_elab_zaResolveDef(branch_zux1_35);
		r21 = branch_zaMirth_34;
	}
	decref(MK_std_list_List_1(v25));
	struct std_list_List_1 v61 = mw_std_list_List_1_reverse(v23);
	struct std_list_List_1 v62 = mw_std_list_List_1_reverse(v24);
	struct std_list_List_1 v63 = r22->mrejected;
	incref(MK_std_list_List_1(v63));
	struct std_list_List_1 v64 = mw_std_list_List_1_cat(v61, v63);
	struct std_list_List_1 v65 = r22->mrejected;
	decref(MK_std_list_List_1(v65));
	r22->mrejected = v64;
	struct std_list_List_1 v66 = r22->mcandidates;
	decref(MK_std_list_List_1(v66));
	r22->mcandidates = v62;
	struct mirth_mirth_zaMirth* v67;
	struct mirth_elab_zaResolveDef* v68;
	mw_mirth_elab_zaResolveDef_filterzearity(r21, r22, &v67, &v68);
	struct mirth_mirth_zaMirth* v69;
	struct mirth_elab_zaResolveDef* v70;
	mw_mirth_elab_zaResolveDef_filterzequalifiers(v67, v68, &v69, &v70);
	uint64_t v71 = v70->mtoken;
	struct mirth_mirth_zaMirth* v72;
	bool v73 = mw_mirth_token_Token_canzebezerelativezenamezeorzednamezy(v69, v71, &v72);
	struct mirth_arrow_Arrow* branch_zaAB_74;
	struct mirth_mirth_zaMirth* branch_zaMirth_75;
	struct mirth_elab_zaResolveDef* branch_zaResolveDef_76;
	if (v73) {
		struct mirth_arrow_Arrow* v77;
		struct mirth_type_StackType v78 = mw_mirth_elab_zaAB_abzetypezo(v11, &v77);
		struct mirth_mirth_zaMirth* v79;
		bool v80 = mw_mirth_type_StackType_topzetypeszearezefinezy(v72, v78, &v79);
		struct mirth_arrow_Arrow* branch_zaAB_81;
		struct mirth_mirth_zaMirth* branch_zaMirth_82;
		struct mirth_elab_zaResolveDef* branch_zaResolveDef_83;
		if (v80) {
			struct mirth_arrow_Arrow* v84;
			struct mirth_type_StackType v85 = mw_mirth_elab_zaAB_abzetypezo(v77, &v84);
			struct mirth_mirth_zaMirth* v86;
			struct std_list_List_1 v87 = mw_mirth_type_StackType_topzenamespaces(v79, v85, &v86);
			struct mirth_mirth_zaMirth* v88;
			struct mirth_elab_zaResolveDef* v89;
			mw_mirth_elab_zaResolveDef_filterzeroots(v86, v70, v87, &v88, &v89);
			branch_zaResolveDef_83 = v89;
			branch_zaMirth_82 = v88;
			branch_zaAB_81 = v84;
		} else {
			branch_zaResolveDef_83 = v70;
			branch_zaMirth_82 = v79;
			branch_zaAB_81 = v77;
		}
		branch_zaResolveDef_76 = branch_zaResolveDef_83;
		branch_zaMirth_75 = branch_zaMirth_82;
		branch_zaAB_74 = branch_zaAB_81;
	} else {
		struct std_list_List_1 v90 = { .tag=std_list_List_1_Nil };
		struct mirth_mirth_zaMirth* v91;
		struct mirth_elab_zaResolveDef* v92;
		mw_mirth_elab_zaResolveDef_filterzeroots(v72, v70, v90, &v91, &v92);
		branch_zaResolveDef_76 = v92;
		branch_zaMirth_75 = v91;
		branch_zaAB_74 = v11;
	}
	struct mirth_mirth_zaMirth* v93;
	struct std_maybe_Maybe_1 v94 = mw_mirth_elab_zaResolveDef_endzx(branch_zaMirth_75, branch_zaResolveDef_76, &v93);
	struct mirth_mirth_zaMirth* branch_zaMirth_95;
	struct mirth_arrow_Arrow* branch_zaAB_96;
	switch ((v94).tag) {
		case std_maybe_Maybe_1_None: {
			struct mirth_mirth_zaMirth* v97;
			struct mirth_arrow_Arrow* v98;
			mw_mirth_elab_zaAB_elabzeatomzefailedzx(v93, branch_zaAB_74, &v97, &v98);
			branch_zaAB_96 = v98;
			branch_zaMirth_95 = v97;
		} break;
		case std_maybe_Maybe_1_Some: {
			VAL v99 = mtp_std_maybe_Maybe_1_Some(v94);
			struct mirth_mirth_zaMirth* v100;
			struct mirth_arrow_Arrow* v101;
			mw_mirth_elab_zaAB_elabzeatomzedefzx(v93, branch_zaAB_74, V_mirth_def_Def(v99), &v100, &v101);
			branch_zaAB_96 = v101;
			branch_zaMirth_95 = v100;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_zaAB_5 = branch_zaAB_96;
	*out_zaMirth_4 = branch_zaMirth_95;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r9, -0x88(%rbp)
movq %r8, -0x90(%rbp)
movq %rcx, %r14
movl %edx, %r15d
movq %rdi, %rbx
leaq -0xe0(%rbp), %r12
movq %rsi, %rdi
movq %r12, %rsi
callq 0x43394
leaq -0xa8(%rbp), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq 0x4e71c
movl %eax, %ebx
movq (%r12), %rdi
leaq -0x80(%rbp), %rsi
callq 0x432bd
movq %rax, %r12
movq 0x10c3fc2(%rip), %rdi   # 0x1115a68
testq %rdi, %rdi
jne 0x51ace
movl $0x4, %edi
callq 0xf5e4
movq %rax, %rdi
movq $0x4, 0x10(%rax)
movl $0x64726f77, 0x18(%rax) # imm = 0x64726F77
movq %rax, 0x10c3f9a(%rip)   # 0x1115a68
xorb $0x1, %bl
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
movq %rdi, %rax
andq %rcx, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x51af1
incl (%rax)
subq $0x8, %rsp
leaq -0xd8(%rbp), %r13
leaq -0xa0(%rbp), %rax
movzbl %bl, %r9d
movq $0x0, -0x68(%rbp)
movq %r12, %rsi
movl %r15d, %edx
movq %r14, %rcx
xorl %r8d, %r8d
pushq %r13
pushq %rax
pushq -0xa8(%rbp)
callq 0x28951
addq $0x20, %rsp
movq (%r13), %rcx
movl 0x20(%rcx), %eax
movq %rcx, -0x40(%rbp)
movq 0x28(%rcx), %rdi
movq %rdi, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %dil
setne %sil
orb %dl, %sil
jne 0x51b5e
incl (%rcx)
movq -0xa0(%rbp), %r13
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x1, %eax
jne 0x51c62
leaq -0x50(%rbp), %rsi
callq 0xd0aa
movq %rax, %r15
movq %rdx, %r14
movq %rax, %rbx
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %rbx
testb $0x1, %r14b
je 0x51bbd
testq %rbx, %rbx
sete %al
testb $0x3, %r15b
setne %cl
orb %al, %cl
jne 0x51bbd
incl (%rbx)
movq %r15, %r12
shrq $0x30, %r12
movq %r13, %rdi
movl %r12d, %esi
movq %rbx, %rdx
leaq -0x70(%rbp), %rcx
callq 0x51fb8
testb %al, %al
je 0x51c10
movq %r15, %rdi
movq %r14, %rsi
callq 0x206fc
movq %rdx, %rdi
movq -0x70(%rbp), %r13
callq 0x20aa1
movq %rax, %rdi
movq %rdx, %rsi
movl -0x2c(%rbp), %edx
movq -0x60(%rbp), %rcx
callq 0xd1ec
movq %rdx, -0x60(%rbp)
movl $0x1, -0x2c(%rbp)
jmp 0x51c56
movl %r12d, %edi
movq %rbx, %rsi
callq 0x28d34
movq %rax, %rdi
leaq 0xc038c(%rip), %rsi     # 0x111fb1
callq 0x2069e
movq %rdx, %rdi
movq -0x70(%rbp), %r13
callq 0x20a5a
movq %rax, %rdi
movq %rdx, %rsi
movq -0x68(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0xd1ec
movq %rdx, -0x58(%rbp)
movl $0x1, %eax
movq %rax, -0x68(%rbp)
movl -0x50(%rbp), %eax
movq -0x48(%rbp), %rdi
jmp 0x51b7c
testl %eax, %eax
jne 0x51f88
xorl %edi, %edi
xorl %esi, %esi
movq -0x68(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0xd01b
movl %eax, %r15d
movq %rdx, %r12
xorl %edi, %edi
xorl %esi, %esi
movl -0x2c(%rbp), %edx
movq -0x60(%rbp), %rcx
callq 0xd01b
movl %eax, %ebx
movq %rdx, %r14
movq -0x40(%rbp), %rax
movl 0x30(%rax), %edx
movq 0x38(%rax), %rcx
movq %rcx, %rax
movabsq $0xfffffffffffc, %rsi   # imm = 0xFFFFFFFFFFFC
andq %rsi, %rax
sete %sil
testb $0x3, %cl
setne %dil
orb %sil, %dil
jne 0x51cc3
incl (%rax)
movl %r15d, %edi
movq %r12, %rsi
callq 0x28d8d
movl %eax, %r15d
movq %rdx, %r12
movq -0x40(%rbp), %rdi
movq 0x38(%rdi), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
movq %rdi, %rdx
jne 0x51d1b
movl 0x30(%rdx), %edi
decl (%rcx)
jne 0x51d1b
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xbf567(%rip), %rsi     # 0x111279
callq 0xd13d
movq -0x40(%rbp), %rdx
movl %r15d, 0x30(%rdx)
movq %r12, 0x38(%rdx)
movq 0x28(%rdx), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
movq -0x40(%rbp), %rsi
jne 0x51d67
movl 0x20(%rsi), %edi
decl (%rcx)
jne 0x51d67
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xbf51b(%rip), %rsi     # 0x111279
callq 0xd13d
movq -0x40(%rbp), %rsi
movl %ebx, 0x20(%rsi)
movq %r14, 0x28(%rsi)
leaq -0x70(%rbp), %rbx
leaq -0xd0(%rbp), %r14
movq %r13, %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x41145
movq (%rbx), %rdi
movq (%r14), %rsi
leaq -0xc8(%rbp), %rbx
leaq -0x78(%rbp), %r14
movq %rbx, %rdx
movq %r14, %rcx
callq 0x28dc9
movq (%r14), %r14
movq 0x8(%r14), %rsi
movq (%rbx), %rbx
leaq 0x10c3634(%rip), %rdi   # 0x11153e8
callq 0x13c85
movq %rax, %rdi
callq 0x13d82
movq %rax, %rcx
shrq $0x30, %rcx
movq %rax, %rdi
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rdi
cmpq $0x1c, %rcx
je 0x51e0c
cmpl $0x1b, %ecx
jne 0x51e9c
movq 0x8(%rdi), %r15
decl (%rdi)
jne 0x51df4
callq 0x5030
leaq -0x50(%rbp), %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2e901
movq (%r12), %rbx
jmp 0x51e19
callq 0x27ec7
movq %rax, %rdi
callq 0x2ea8e
testb %al, %al
je 0x51eb8
movq -0x80(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x43394
leaq -0x38(%rbp), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq 0x4e71c
testb %al, %al
je 0x51f77
movq -0x50(%rbp), %rdi
leaq -0x98(%rbp), %rbx
movq %rbx, %rsi
callq 0x43394
movq -0x38(%rbp), %rdi
leaq -0xc0(%rbp), %r14
movl %eax, %esi
movq %r14, %rcx
callq 0x4e7e6
movq %rdx, %rcx
movq (%r14), %rdi
movq -0x78(%rbp), %rsi
leaq -0xb8(%rbp), %r14
leaq -0xb0(%rbp), %r15
movl %eax, %edx
movq %r14, %r8
movq %r15, %r9
callq 0x2917d
movq (%r15), %rsi
movq (%r14), %rdi
movq (%rbx), %rbx
jmp 0x51ee0
testq %rdi, %rdi
je 0x51eb8
decl (%rdi)
jne 0x51eb8
andq $-0x4, %rax
leaq 0xc0029(%rip), %rsi     # 0x111ed9
movq %rax, %rdi
callq 0xd13d
leaq -0x50(%rbp), %r15
leaq -0x38(%rbp), %r12
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
movq %r12, %r9
callq 0x2917d
movq (%r12), %rsi
movq (%r15), %rdi
movq -0x80(%rbp), %rbx
leaq -0x38(%rbp), %rdx
callq 0x2a68a
cmpl $0x1, %eax
je 0x51f12
testl %eax, %eax
jne 0x51f88
movq -0x38(%rbp), %r15
leaq -0x50(%rbp), %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
callq 0x54044
movq (%r14), %rax
jmp 0x51f51
movq %rdx, %rdi
callq 0xd745
movq -0x38(%rbp), %rdi
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rax, %rcx
movq %rax, %rdx
shrq $0x30, %rdx
leaq -0x50(%rbp), %r14
leaq -0x98(%rbp), %r15
movq %rbx, %rsi
movq %r14, %r8
movq %r15, %r9
callq 0x52156
movq (%r15), %rax
movq (%r14), %r15
movq -0x88(%rbp), %rcx
movq %rax, (%rcx)
movq -0x90(%rbp), %rax
movq %r15, (%rax)
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x78(%rbp), %rsi
movq -0x38(%rbp), %rdi
movq -0x50(%rbp), %rbx
jmp 0x51ee0
movl $0x20, %edi
callq 0xf5e4
movq $0x20, 0x10(%rax)
movups 0x8e72c(%rip), %xmm0    # 0xe06cd
movups %xmm0, 0x18(%rax)
movups 0x8e731(%rip), %xmm0    # 0xe06dd
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x9302