// File: /workspace/github_c_makefile_star2_O3/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_zaResolveDef_filterzequalifiers
static void mw_mirth_elab_zaResolveDef_filterzequalifiers (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_elab_zaResolveDef* in_zaResolveDef_2, struct mirth_mirth_zaMirth* *out_zaMirth_3, struct mirth_elab_zaResolveDef* *out_zaResolveDef_4) {
	uint64_t v5 = in_zaResolveDef_2->mtoken;
	struct mirth_mirth_zaMirth* v6;
	struct std_maybe_Maybe_1 v7 = mw_mirth_token_Token_dnamezy(in_zaMirth_1, v5, &v6);
	struct mirth_mirth_zaMirth* branch_zaMirth_8;
	struct mirth_elab_zaResolveDef* branch_zaResolveDef_9;
	switch ((v7).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v10 = mtp_std_maybe_Maybe_1_Some(v7);
			struct std_list_List_1 v11 = in_zaResolveDef_2->mcandidates;
			incref(MK_std_list_List_1(v11));
			struct std_list_List_1 v12 = { .tag=std_list_List_1_Nil };
			struct std_list_List_1 v13 = { .tag=std_list_List_1_Nil };
			bool v14 = true;
			struct mirth_mirth_zaMirth* r15 = v6;
			struct mirth_elab_zaResolveDef* r16 = in_zaResolveDef_2;
			VAL v17 = v10;
			struct std_list_List_1 v18 = v12;
			struct std_list_List_1 v19 = v13;
			struct std_list_List_1 v20 = v11;
			bool v21 = v14;
			bool v22 = v14;
			while (v22) {
				struct mirth_mirth_zaMirth* r23 = r15;
				struct mirth_elab_zaResolveDef* r24 = r16;
				VAL v25 = v17;
				struct std_list_List_1 v26 = v18;
				struct std_list_List_1 v27 = v19;
				struct std_list_List_1 v28 = v20;
				bool v29 = v21;
				struct mirth_name_DName* branch_DName_30;
				struct mirth_mirth_zaMirth* branch_zaMirth_31;
				struct mirth_elab_zaResolveDef* branch_zaResolveDef_32;
				struct std_list_List_1 branch_List_33;
				struct std_list_List_1 branch_List_34;
				struct std_list_List_1 branch_List_35;
				bool branch_Bool_36;
				switch ((v28).tag) {
					case std_list_List_1_Cons: {
						struct std_list_List_1 v37;
						VAL v38 = mtp_std_list_List_1_Cons(v28, &v37);
						incref(v25);
						incref(v38);
						struct mirth_mirth_zaMirth* v39;
						struct mirth_name_QName* v40 = mw_mirth_def_Def_qnamezehard(r23, V_mirth_def_Def(v38), &v39);
						struct mirth_mirth_zaMirth* v41;
						struct mirth_elab_zaResolveDef* v42;
						struct std_list_List_1 v43 = mw_mirth_name_QName_climbzeupzednamezy(v39, r24, V_mirth_name_DName(v25), v40, &v41, &v42);
						bool v44 = mw_std_list_List_1_emptyzy(v43);
						bool v45 = !v44;
						struct mirth_name_DName* branch_DName_46;
						struct mirth_mirth_zaMirth* branch_zaMirth_47;
						struct mirth_elab_zaResolveDef* branch_zaResolveDef_48;
						struct std_either_Either_2 branch_Either_49;
						if (v45) {
							struct std_either_Either_2 v50 = mtw_std_either_Either_2_Right(v38);
							branch_Either_49 = v50;
							branch_zaResolveDef_48 = v42;
							branch_zaMirth_47 = v41;
							branch_DName_46 = V_mirth_name_DName(v25);
						} else {
							struct mirth_elab_RejectedDef v51 = mtw_mirth_elab_RejectedDef_WrongQualifier(V_mirth_def_Def(v38));
							struct std_either_Either_2 v52 = mtw_std_either_Either_2_Left(MK_mirth_elab_RejectedDef(v51));
							branch_Either_49 = v52;
							branch_zaResolveDef_48 = v42;
							branch_zaMirth_47 = v41;
							branch_DName_46 = V_mirth_name_DName(v25);
						}
						struct mirth_name_DName* branch_DName_53;
						struct mirth_mirth_zaMirth* branch_zaMirth_54;
						struct mirth_elab_zaResolveDef* branch_zaResolveDef_55;
						struct std_list_List_1 branch_List_56;
						struct std_list_List_1 branch_List_57;
						switch ((branch_Either_49).tag) {
							case std_either_Either_2_Left: {
								VAL v58 = mtp_std_either_Either_2_Left(branch_Either_49);
								struct std_list_List_1 v59 = mw_std_list_List_1_cons(v58, v26);
								branch_List_57 = v27;
								branch_List_56 = v59;
								branch_zaResolveDef_55 = branch_zaResolveDef_48;
								branch_zaMirth_54 = branch_zaMirth_47;
								branch_DName_53 = branch_DName_46;
							} break;
							case std_either_Either_2_Right: {
								VAL v60 = mtp_std_either_Either_2_Right(branch_Either_49);
								struct std_list_List_1 v61 = mw_std_list_List_1_cons(v60, v27);
								branch_List_57 = v61;
								branch_List_56 = v26;
								branch_zaResolveDef_55 = branch_zaResolveDef_48;
								branch_zaMirth_54 = branch_zaMirth_47;
								branch_DName_53 = branch_DName_46;
							} break;
							default: {
								do_panic(str_make("unexpected fallthrough in match\n", 32));
							}
						}
						bool v62 = true;
						branch_Bool_36 = v62;
						branch_List_35 = v37;
						branch_List_34 = branch_List_57;
						branch_List_33 = branch_List_56;
						branch_zaResolveDef_32 = branch_zaResolveDef_55;
						branch_zaMirth_31 = branch_zaMirth_54;
						branch_DName_30 = branch_DName_53;
					} break;
					case std_list_List_1_Nil: {
						struct std_list_List_1 v63 = { .tag=std_list_List_1_Nil };
						bool v64 = false;
						branch_Bool_36 = v64;
						branch_List_35 = v63;
						branch_List_34 = v27;
						branch_List_33 = v26;
						branch_zaResolveDef_32 = r24;
						branch_zaMirth_31 = r23;
						branch_DName_30 = V_mirth_name_DName(v25);
					} break;
					default: {
						do_panic(str_make("unexpected fallthrough in match\n", 32));
					}
				}
				v22 = branch_Bool_36;
				v21 = branch_Bool_36;
				v20 = branch_List_35;
				v19 = branch_List_34;
				v18 = branch_List_33;
				v17 = MK_mirth_name_DName(branch_DName_30);
				r16 = branch_zaResolveDef_32;
				r15 = branch_zaMirth_31;
			}
			decref(MK_std_list_List_1(v20));
			struct std_list_List_1 v65 = mw_std_list_List_1_reverse(v18);
			struct std_list_List_1 v66 = mw_std_list_List_1_reverse(v19);
			struct std_list_List_1 v67 = r16->mrejected;
			incref(MK_std_list_List_1(v67));
			struct std_list_List_1 v68 = mw_std_list_List_1_cat(v65, v67);
			struct std_list_List_1 v69 = r16->mrejected;
			decref(MK_std_list_List_1(v69));
			r16->mrejected = v68;
			struct std_list_List_1 v70 = r16->mcandidates;
			decref(MK_std_list_List_1(v70));
			r16->mcandidates = v66;
			decref(v17);
			branch_zaResolveDef_9 = r16;
			branch_zaMirth_8 = r15;
		} break;
		case std_maybe_Maybe_1_None: {
			branch_zaResolveDef_9 = in_zaResolveDef_2;
			branch_zaMirth_8 = v6;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_zaResolveDef_4 = branch_zaResolveDef_9;
	*out_zaMirth_3 = branch_zaMirth_8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, -0x88(%rbp)
movq %rdx, %rbx
movq %rsi, %r15
movq 0x8(%rsi), %rsi
leaq -0x80(%rbp), %rdx
callq 0x2da46
cmpl $0x1, %eax
jne 0x28fd3
movq %rbx, -0x60(%rbp)
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
movq %rdx, %rdi
callq 0xd745
movq %rax, -0x40(%rbp)
movl 0x20(%r15), %eax
movq 0x28(%r15), %rdi
movq %rdi, %rcx
andq %rbx, %rcx
sete %sil
testb $0x3, %dil
setne %r8b
orb %sil, %r8b
jne 0x28e38
incl (%rcx)
movq -0x80(%rbp), %r12
movq -0x40(%rbp), %rsi
movq %rsi, %rcx
andq %rbx, %rcx
movq %rcx, -0x68(%rbp)
sete %cl
testb $0x3, %sil
setne %sil
orb %cl, %sil
movb %sil, -0x29(%rbp)
testb $0x1, %dl
sete %bl
movq $0x0, -0x50(%rbp)
movl $0x0, -0x30(%rbp)
movq $0x0, -0x58(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x1, %eax
jne 0x28fdc
movq %r15, -0x48(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0xd0aa
movq %rax, %r13
movq %rdx, %r15
orb -0x29(%rbp), %bl
testb $0x1, %bl
jne 0x28ead
movq -0x68(%rbp), %rax
incl (%rax)
movq %r13, %r14
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %r14
testb $0x1, %r15b
je 0x28ed7
testq %r14, %r14
sete %al
testb $0x3, %r13b
setne %cl
orb %al, %cl
jne 0x28ed7
incl (%r14)
movq %r13, %rbx
shrq $0x30, %rbx
movq %r12, %rdi
movl %ebx, %esi
movq %r14, %rdx
leaq -0x90(%rbp), %rcx
callq 0x2dac3
movq -0x90(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rax, %rcx
leaq -0x78(%rbp), %r8
leaq -0x70(%rbp), %r9
callq 0x2dcd8
movl %eax, %edi
movq %rdx, %rsi
callq 0xf421
testb %al, %al
je 0x28f87
movl $0x1, %edi
movl $0x18, %esi
callq 0x50c0
testq %rax, %rax
je 0x29158
movl $0x1, (%rax)
movl %ebx, 0x8(%rax)
movq %r14, 0x10(%rax)
btsq $0x32, %rax
movq %rax, %rdi
leaq 0xe905e(%rip), %rsi     # 0x111fb1
callq 0x2069e
movq %rdx, %rdi
movq -0x78(%rbp), %r12
movq -0x70(%rbp), %r15
callq 0x20a5a
movq %rax, %rdi
movq %rdx, %rsi
movl -0x30(%rbp), %edx
movq -0x50(%rbp), %rcx
callq 0xd1ec
movq %rdx, -0x50(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0x28fbf
movq %r13, %rdi
movq %r15, %rsi
callq 0x206fc
movq %rdx, %rdi
movq -0x78(%rbp), %r12
movq -0x70(%rbp), %r15
callq 0x20aa1
movq %rax, %rdi
movq %rdx, %rsi
movl -0x34(%rbp), %edx
movq -0x58(%rbp), %rcx
callq 0xd1ec
movq %rdx, -0x58(%rbp)
movl $0x1, -0x34(%rbp)
movl -0xa0(%rbp), %eax
movq -0x98(%rbp), %rdi
xorl %ebx, %ebx
jmp 0x28e80
movq -0x80(%rbp), %r12
jmp 0x2910c
movq %r12, -0x48(%rbp)
testl %eax, %eax
jne 0x29128
xorl %edi, %edi
xorl %esi, %esi
movl -0x30(%rbp), %edx
movq -0x50(%rbp), %rcx
callq 0xd01b
movl %eax, %ebx
movq %rdx, %r13
xorl %edi, %edi
xorl %esi, %esi
movl -0x34(%rbp), %edx
movq -0x58(%rbp), %rcx
callq 0xd01b
movl %eax, %r12d
movq %rdx, %r14
movl 0x30(%r15), %edx
movq 0x38(%r15), %rcx
movq %rcx, %rax
movabsq $0xfffffffffffc, %rsi   # imm = 0xFFFFFFFFFFFC
andq %rsi, %rax
sete %sil
testb $0x3, %cl
setne %dil
orb %sil, %dil
jne 0x2903d
incl (%rax)
movl %ebx, %edi
movq %r13, %rsi
callq 0x28d8d
movl %eax, %ebx
movq %rdx, %r13
movq 0x38(%r15), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x29089
movl 0x30(%r15), %edi
decl (%rcx)
jne 0x29089
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xe81f5(%rip), %rsi     # 0x111279
callq 0xd13d
movl %ebx, 0x30(%r15)
movq %r13, 0x38(%r15)
movq 0x28(%r15), %rax
movabsq $0xfffffffffffc, %rsi   # imm = 0xFFFFFFFFFFFC
andq %rax, %rsi
sete %cl
testb $0x3, %al
setne %dl
orb %cl, %dl
jne 0x290c9
movl 0x20(%r15), %edi
decl (%rsi)
jne 0x290c9
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xe81b5(%rip), %rsi     # 0x111279
callq 0xd13d
movl %r12d, 0x20(%r15)
movq %r14, 0x28(%r15)
movq -0x68(%rbp), %rdx
testq %rdx, %rdx
sete %al
testb $0x3, -0x40(%rbp)
setne %cl
orb %al, %cl
jne 0x29104
decl (%rdx)
movq -0x60(%rbp), %rbx
movq -0x48(%rbp), %r12
jne 0x2910c
movq -0x40(%rbp), %rdi
leaq 0xe8d4c(%rip), %rsi     # 0x111e49
callq 0xd13d
jmp 0x2910c
movq -0x60(%rbp), %rbx
movq -0x48(%rbp), %r12
movq -0x88(%rbp), %rax
movq %r15, (%rax)
movq %r12, (%rbx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf5e4
movq $0x20, 0x10(%rax)
movups 0xb758c(%rip), %xmm0    # 0xe06cd
movups %xmm0, 0x18(%rax)
movups 0xb7591(%rip), %xmm0    # 0xe06dd
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x9302
leaq 0xbb143(%rip), %rsi     # 0xe42a2
movl $0x31, %edx
movl $0x2, %edi
callq 0x5060
callq 0x52b6
movl $0x1, %edi
callq 0x5130