// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rdx, %rbx
movq %rsi, %r12
movq 0x8(%rsi), %rsi
leaq -0x88(%rbp), %rdx
callq 0x2b16d
cmpl $0x1, %eax
jne 0x26613
movabsq $0xfffffffffffc, %r15   # imm = 0xFFFFFFFFFFFC
movq %rdx, %rdi
callq 0xd491
movq %r15, %r9
movq %rax, -0x58(%rbp)
movl 0x20(%r12), %edi
movq 0x28(%r12), %rcx
movq %rcx, %rax
andq %r15, %rax
sete %sil
testb $0x3, %cl
setne %r8b
orb %sil, %r8b
jne 0x2642a
incl (%rax)
movq %r14, -0x48(%rbp)
movq %rbx, -0x50(%rbp)
movq -0x88(%rbp), %r15
movq -0x58(%rbp), %rsi
movq %rsi, %rax
andq %r9, %rax
movq %rax, -0x70(%rbp)
sete %al
testb $0x3, %sil
setne %sil
orb %al, %sil
movb %sil, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
leaq 0xe29e1(%rip), %rbx     # 0x108e49
leaq -0xa8(%rbp), %rsi
movq $0x0, -0x60(%rbp)
xorl %r8d, %r8d
xorl %r13d, %r13d
movb $0x1, %r10b
movq %rdx, %r14
movq %rcx, %rax
testb $0x1, %r10b
je 0x2661f
xorl %r10d, %r10d
movl $0x0, %ecx
movq %rbx, %rdx
testl %edi, %edi
je 0x26480
movl %r8d, -0x34(%rbp)
movq %r13, -0x68(%rbp)
cmpl $0x1, %edi
jne 0x267a1
movq %rax, %rdi
callq 0xce01
movq %rax, %r13
testb $0x1, %r14b
sete %al
orb -0x40(%rbp), %al
testb $0x1, %al
jne 0x264cf
movq -0x70(%rbp), %rax
incl (%rax)
movq %r15, %rdi
movq %r13, %r14
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %r14
movq %rdx, -0x90(%rbp)
testb $0x1, %dl
je 0x26502
testq %r14, %r14
sete %al
testb $0x3, %r13b
setne %cl
orb %al, %cl
jne 0x26502
incl (%r14)
movq %r13, %r15
shrq $0x30, %r15
movl %r15d, %esi
movq %r14, %rdx
leaq -0x98(%rbp), %rcx
callq 0x2b1e9
movq -0x98(%rbp), %rdi
movq %r12, %rsi
movq -0x58(%rbp), %rdx
movq %rax, %rcx
leaq -0x80(%rbp), %r8
leaq -0x78(%rbp), %r9
callq 0x2b3cc
movl %eax, %edi
movq %rdx, %rsi
callq 0xeb14
testb %al, %al
je 0x265a8
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x50c0
testq %rax, %rax
je 0x267b8
movl $0x1, (%rax)
movl %r15d, 0x8(%rax)
movq %r14, 0x10(%rax)
btsq $0x32, %rax
movq %rax, %rdi
leaq 0xe2a39(%rip), %rsi     # 0x108fb1
callq 0x1e400
movq %rdx, %rdi
movq -0x80(%rbp), %r15
movq -0x78(%rbp), %r12
callq 0x1e79d
movq %rax, %rdi
movq %rdx, %rsi
movl -0x34(%rbp), %edx
movq -0x68(%rbp), %rcx
callq 0xcf39
movq %rdx, %r13
pushq $0x1
popq %r8
jmp 0x265ed
movq %r13, %rdi
movq -0x90(%rbp), %rsi
callq 0x1e454
movq %rdx, %rdi
movq -0x80(%rbp), %r15
movq -0x78(%rbp), %r12
callq 0x1e7e4
movq %rax, %rdi
movq %rdx, %rsi
movq -0x30(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0xcf39
movq %rdx, -0x60(%rbp)
pushq $0x1
popq %rax
movq %rax, -0x30(%rbp)
movq -0x68(%rbp), %r13
movl -0x34(%rbp), %r8d
movl -0xa8(%rbp), %edi
movq -0xa0(%rbp), %rcx
movq %rbx, %rdx
movabsq $0xfffffffffffc, %r9    # imm = 0xFFFFFFFFFFFC
leaq -0xa8(%rbp), %rsi
jmp 0x2647d
movq -0x88(%rbp), %r15
jmp 0x26789
movq %r15, -0x40(%rbp)
movq %rax, %rcx
andq %r9, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x26654
decl (%rcx)
jne 0x26654
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xe1c30(%rip), %rsi     # 0x108279
movl %r8d, %ebx
callq 0xce94
movl %ebx, %r8d
movl %r8d, %edi
movq %r13, %rsi
callq 0xcd32
movl %eax, %ebx
movq %rdx, %r13
movq -0x30(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xcd32
movl %eax, -0x30(%rbp)
movq %rdx, %r15
movl 0x30(%r12), %edx
movq 0x38(%r12), %rcx
movq %rcx, %rax
movabsq $0xfffffffffffc, %rsi   # imm = 0xFFFFFFFFFFFC
andq %rsi, %rax
sete %sil
testb $0x3, %cl
setne %dil
orb %sil, %dil
jne 0x266a3
incl (%rax)
movl %ebx, %edi
movq %r13, %rsi
callq 0x26383
movl %eax, %r13d
movq %rdx, %rbx
movq 0x38(%r12), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %r8    # imm = 0xFFFFFFFFFFFC
andq %r8, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x266fc
movl 0x30(%r12), %edi
decl (%rcx)
jne 0x266fc
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xe1b8c(%rip), %rsi     # 0x108279
callq 0xce94
movabsq $0xfffffffffffc, %r8    # imm = 0xFFFFFFFFFFFC
movl %r13d, 0x30(%r12)
movq %rbx, 0x38(%r12)
movq 0x28(%r12), %rax
andq %rax, %r8
sete %cl
testb $0x3, %al
setne %dl
orb %cl, %dl
jne 0x26737
movl 0x20(%r12), %edi
decl (%r8)
jne 0x26737
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xe1b47(%rip), %rsi     # 0x108279
callq 0xce94
movl -0x30(%rbp), %eax
movl %eax, 0x20(%r12)
movq %r15, 0x28(%r12)
testb $0x1, %r14b
jne 0x26758
movq -0x50(%rbp), %rbx
movq -0x48(%rbp), %r14
movq -0x40(%rbp), %r15
jmp 0x26789
movq -0x70(%rbp), %rdx
testq %rdx, %rdx
sete %al
testb $0x3, -0x58(%rbp)
setne %cl
orb %al, %cl
movq -0x40(%rbp), %r15
jne 0x26781
decl (%rdx)
jne 0x26781
movq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0xce94
movq -0x50(%rbp), %rbx
movq -0x48(%rbp), %r14
movq %r12, (%r14)
movq %r15, (%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xae065(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6
leaq 0xb1c80(%rip), %rsi     # 0xd843f
pushq $0x2
popq %rdi
pushq $0x31
popq %rdx
callq 0x5060
callq 0x52ae
pushq $0x1
popq %rdi
callq 0x5130