// File: /workspace/github_c_makefile_star2_O1/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 $0x88, %rsp
movq %rcx, -0x78(%rbp)
movq %rdx, %rbx
movq %rsi, %r12
movq 0x8(%rsi), %rsi
leaq -0x60(%rbp), %rdx
callq 0x2e704
cmpl $0x1, %eax
jne 0x297dd
movq %rbx, -0x70(%rbp)
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
movq %rdx, %rdi
callq 0xdaeb
movq %rax, -0x40(%rbp)
movl 0x20(%r12), %edi
movq 0x28(%r12), %r9
movq %r9, %rcx
andq %rbx, %rcx
sete %sil
testb $0x3, %r9b
setne %r8b
orb %sil, %r8b
jne 0x29498
incl (%rcx)
movq -0x60(%rbp), %r15
movq %rax, -0x68(%rbp)
movq %rax, %rcx
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %rcx
movq %rcx, -0x80(%rbp)
sete %cl
testb $0x3, -0x40(%rbp)
setne %al
orb %cl, %al
movb %al, -0x29(%rbp)
testb $0x1, %dl
sete %bl
movq $0x0, -0x58(%rbp)
movl $0x0, -0x30(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x0, -0x34(%rbp)
testl %edi, %edi
je 0x295e6
cmpl $0x1, %edi
jne 0x29803
movq %r12, %r14
movq %r15, %r13
movq %r9, %rdi
leaq -0xa8(%rbp), %rsi
callq 0xd450
movq %rax, %r12
movq %rdx, %r15
orb -0x29(%rbp), %bl
testb $0x1, %bl
jne 0x29521
movq -0x80(%rbp), %rax
incl (%rax)
movq %r12, %rsi
testb $0x1, %r15b
je 0x2954a
movq %r12, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %sil
setne %dl
orb %cl, %dl
jne 0x2954a
incl (%rax)
movq %rsi, -0x48(%rbp)
movq %r12, %rbx
shrq $0x30, %rbx
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %r12
movq %r13, %rdi
movl %ebx, %esi
movq %r12, %rdx
leaq -0x98(%rbp), %rcx
callq 0x2e781
movq -0x98(%rbp), %rdi
movq %r14, %rsi
movq -0x40(%rbp), %rdx
movq %rax, %rcx
leaq -0x90(%rbp), %r8
leaq -0x88(%rbp), %r9
callq 0x2e996
movl %eax, %edi
movq %rdx, %rsi
callq 0xf834
movl %eax, %r13d
testb %al, %al
je 0x295ed
movl $0x1, %edi
movl $0x18, %esi
callq 0x50c0
testq %rax, %rax
je 0x29833
movl $0x1, (%rax)
movl %ebx, 0x8(%rax)
movq %r12, 0x10(%rax)
btsq $0x32, %rax
movq %rax, %rdi
leaq 0xec9d2(%rip), %rsi     # 0x115fb1
callq 0x20c09
jmp 0x295f9
xorl %ecx, %ecx
xorl %r9d, %r9d
jmp 0x29664
movq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x20c67
movq %rdx, %rdi
movq -0x90(%rbp), %r15
movq -0x88(%rbp), %r12
testb %r13b, %r13b
je 0x29633
callq 0x20fc5
movq %rax, %rdi
movq %rdx, %rsi
movl -0x30(%rbp), %edx
movq -0x58(%rbp), %rcx
callq 0xd592
movq %rdx, -0x58(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0x29655
callq 0x2100c
movq %rax, %rdi
movq %rdx, %rsi
movl -0x34(%rbp), %edx
movq -0x50(%rbp), %rcx
callq 0xd592
movq %rdx, -0x50(%rbp)
movl $0x1, -0x34(%rbp)
movl -0xa8(%rbp), %edi
movq -0xa0(%rbp), %r9
movb $0x1, %cl
xorl %ebx, %ebx
testb %cl, %cl
jne 0x294e7
movq %r12, %r13
movq %r15, -0x48(%rbp)
movq %r9, %rcx
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %rcx
sete %dl
testb $0x3, %r9b
setne %sil
orb %dl, %sil
jne 0x296ac
decl (%rcx)
jne 0x296ac
shlq $0x30, %rdi
orq %r9, %rdi
leaq 0xebbd2(%rip), %rsi     # 0x115279
callq 0xd4e3
xorl %edi, %edi
xorl %esi, %esi
movl -0x30(%rbp), %edx
movq -0x58(%rbp), %rcx
callq 0xd37c
movl %eax, %ebx
movq %rdx, %r12
xorl %edi, %edi
xorl %esi, %esi
movl -0x34(%rbp), %edx
movq -0x50(%rbp), %rcx
callq 0xd37c
movl %eax, %r14d
movq %rdx, %r15
movl 0x30(%r13), %edx
movq 0x38(%r13), %rcx
movq %rcx, %rax
movabsq $0xfffffffffffc, %rsi   # imm = 0xFFFFFFFFFFFC
andq %rsi, %rax
sete %sil
testb $0x3, %cl
setne %dil
orb %sil, %dil
jne 0x29701
incl (%rax)
movl %ebx, %edi
movq %r12, %rsi
callq 0x293eb
movl %eax, %ebx
movq %rdx, %r12
movq 0x38(%r13), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x2974d
movl 0x30(%r13), %edi
decl (%rcx)
jne 0x2974d
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xebb31(%rip), %rsi     # 0x115279
callq 0xd4e3
movl %ebx, 0x30(%r13)
movq %r12, 0x38(%r13)
movq 0x28(%r13), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
movq %r13, %r12
jne 0x29796
movl 0x20(%r12), %edi
decl (%rcx)
jne 0x29796
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xebae8(%rip), %rsi     # 0x115279
callq 0xd4e3
movl %r14d, 0x20(%r12)
movq %r15, 0x28(%r12)
movq -0x68(%rbp), %rdx
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %rdx
sete %al
testb $0x3, -0x40(%rbp)
setne %cl
orb %al, %cl
movq -0x70(%rbp), %rbx
jne 0x297e3
decl (%rdx)
movq -0x48(%rbp), %r13
jne 0x297e7
movq -0x40(%rbp), %rdi
leaq 0xec673(%rip), %rsi     # 0x115e49
callq 0xd4e3
jmp 0x297e7
movq -0x60(%rbp), %r13
jmp 0x297e7
movq -0x48(%rbp), %r13
movq -0x78(%rbp), %rax
movq %r12, (%rax)
movq %r13, (%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf9f7
movq $0x20, 0x10(%rax)
movups 0xbaf31(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0xbaf36(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5
leaq 0xbeb67(%rip), %rsi     # 0xe83a1
movl $0x31, %edx
movl $0x2, %edi
callq 0x5060
callq 0x52be
movl $0x1, %edi
callq 0x5130