// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_zaResolveDef_filterzearity
static void mw_mirth_elab_zaResolveDef_filterzearity (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;
	INT v7 = mw_mirth_token_Token_numzeargs(in_zaMirth_1, v5, &v6);
	struct std_list_List_1 v8 = in_zaResolveDef_2->mcandidates;
	incref(MK_std_list_List_1(v8));
	struct std_list_List_1 v9 = { .tag=std_list_List_1_Nil };
	struct std_list_List_1 v10 = { .tag=std_list_List_1_Nil };
	bool v11 = true;
	struct mirth_mirth_zaMirth* r12 = v6;
	struct mirth_elab_zaResolveDef* r13 = in_zaResolveDef_2;
	INT v14 = v7;
	struct std_list_List_1 v15 = v9;
	struct std_list_List_1 v16 = v10;
	struct std_list_List_1 v17 = v8;
	bool v18 = v11;
	bool v19 = v11;
	while (v19) {
		struct mirth_mirth_zaMirth* r20 = r12;
		struct mirth_elab_zaResolveDef* r21 = r13;
		INT v22 = v14;
		struct std_list_List_1 v23 = v15;
		struct std_list_List_1 v24 = v16;
		struct std_list_List_1 v25 = v17;
		bool v26 = v18;
		INT branch_Nat_27;
		struct mirth_mirth_zaMirth* branch_zaMirth_28;
		VAL branch_zux1_29;
		struct std_list_List_1 branch_List_30;
		struct std_list_List_1 branch_List_31;
		struct std_list_List_1 branch_List_32;
		bool branch_Bool_33;
		switch ((v25).tag) {
			case std_list_List_1_Cons: {
				struct std_list_List_1 v34;
				VAL v35 = mtp_std_list_List_1_Cons(v25, &v34);
				incref(MKNAT(v22));
				incref(v35);
				struct mirth_mirth_zaMirth* v36;
				struct mirth_name_QName* v37 = mw_mirth_def_Def_qnamezehard(r20, V_mirth_def_Def(v35), &v36);
				INT v38 = v37->marity;
				incref(MKINT(v38));
				decref(MK_mirth_name_QName(v37));
				INT v39 = v22;
				bool v40 = mw_mirth_elab_arityzecompatiblezy(v39, v38);
				INT branch_Nat_41;
				struct mirth_mirth_zaMirth* branch_zaMirth_42;
				VAL branch_zux1_43;
				struct std_either_Either_2 branch_Either_44;
				if (v40) {
					struct std_either_Either_2 v45 = mtw_std_either_Either_2_Right(v35);
					branch_Either_44 = v45;
					branch_zux1_43 = MK_mirth_elab_zaResolveDef(r21);
					branch_zaMirth_42 = v36;
					branch_Nat_41 = v22;
				} else {
					struct mirth_elab_RejectedDef v46 = mtw_mirth_elab_RejectedDef_WrongArity(V_mirth_def_Def(v35));
					struct std_either_Either_2 v47 = mtw_std_either_Either_2_Left(MK_mirth_elab_RejectedDef(v46));
					branch_Either_44 = v47;
					branch_zux1_43 = MK_mirth_elab_zaResolveDef(r21);
					branch_zaMirth_42 = v36;
					branch_Nat_41 = v22;
				}
				INT branch_Nat_48;
				struct mirth_mirth_zaMirth* branch_zaMirth_49;
				VAL branch_zux1_50;
				struct std_list_List_1 branch_List_51;
				struct std_list_List_1 branch_List_52;
				switch ((branch_Either_44).tag) {
					case std_either_Either_2_Left: {
						VAL v53 = mtp_std_either_Either_2_Left(branch_Either_44);
						struct std_list_List_1 v54 = mw_std_list_List_1_cons(v53, v23);
						branch_List_52 = v24;
						branch_List_51 = v54;
						branch_zux1_50 = branch_zux1_43;
						branch_zaMirth_49 = branch_zaMirth_42;
						branch_Nat_48 = branch_Nat_41;
					} break;
					case std_either_Either_2_Right: {
						VAL v55 = mtp_std_either_Either_2_Right(branch_Either_44);
						struct std_list_List_1 v56 = mw_std_list_List_1_cons(v55, v24);
						branch_List_52 = v56;
						branch_List_51 = v23;
						branch_zux1_50 = branch_zux1_43;
						branch_zaMirth_49 = branch_zaMirth_42;
						branch_Nat_48 = branch_Nat_41;
					} break;
					default: {
						do_panic(str_make("unexpected fallthrough in match\n", 32));
					}
				}
				bool v57 = true;
				branch_Bool_33 = v57;
				branch_List_32 = v34;
				branch_List_31 = branch_List_52;
				branch_List_30 = branch_List_51;
				branch_zux1_29 = branch_zux1_50;
				branch_zaMirth_28 = branch_zaMirth_49;
				branch_Nat_27 = branch_Nat_48;
			} break;
			case std_list_List_1_Nil: {
				struct std_list_List_1 v58 = { .tag=std_list_List_1_Nil };
				bool v59 = false;
				branch_Bool_33 = v59;
				branch_List_32 = v58;
				branch_List_31 = v24;
				branch_List_30 = v23;
				branch_zux1_29 = MK_mirth_elab_zaResolveDef(r21);
				branch_zaMirth_28 = r20;
				branch_Nat_27 = v22;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v19 = branch_Bool_33;
		v18 = branch_Bool_33;
		v17 = branch_List_32;
		v16 = branch_List_31;
		v15 = branch_List_30;
		v14 = branch_Nat_27;
		r13 = V_mirth_elab_zaResolveDef(branch_zux1_29);
		r12 = branch_zaMirth_28;
	}
	decref(MK_std_list_List_1(v17));
	struct std_list_List_1 v60 = mw_std_list_List_1_reverse(v15);
	struct std_list_List_1 v61 = mw_std_list_List_1_reverse(v16);
	struct std_list_List_1 v62 = r13->mrejected;
	incref(MK_std_list_List_1(v62));
	struct std_list_List_1 v63 = mw_std_list_List_1_cat(v60, v62);
	struct std_list_List_1 v64 = r13->mrejected;
	decref(MK_std_list_List_1(v64));
	r13->mrejected = v63;
	struct std_list_List_1 v65 = r13->mcandidates;
	decref(MK_std_list_List_1(v65));
	r13->mcandidates = v61;
	decref(MKNAT(v14));
	*out_zaResolveDef_4 = r13;
	*out_zaMirth_3 = r12;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, -0x68(%rbp)
movq %rdx, -0x70(%rbp)
movq %rsi, %rbx
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
movq 0x8(%rsi), %rsi
leaq -0x90(%rbp), %rdx
callq 0x2801e
movq %rax, -0x60(%rbp)
movq %rax, -0x48(%rbp)
movl 0x20(%rbx), %edi
movq %rbx, -0x40(%rbp)
movq 0x28(%rbx), %rax
movq %rax, %rcx
andq %r14, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x42548
incl (%rcx)
movq -0x90(%rbp), %r13
movq -0x60(%rbp), %rdx
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rdx
movq %rdx, -0x78(%rbp)
setne %cl
testb $0x3, -0x48(%rbp)
sete %dl
andb %cl, %dl
movb %dl, -0x29(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x0, -0x30(%rbp)
movq $0x0, -0x58(%rbp)
movl $0x0, -0x34(%rbp)
movabsq $0xfffffffffffc, %r15   # imm = 0xFFFFFFFFFFFC
testl %edi, %edi
je 0x42688
cmpl $0x1, %edi
jne 0x428ae
movq %r13, %rbx
movq %rax, %rdi
leaq -0xa0(%rbp), %rsi
callq 0xd450
movq %rax, %r14
movq %rdx, %r13
cmpb $0x0, -0x29(%rbp)
je 0x425d0
movq -0x78(%rbp), %rax
incl (%rax)
movq %r14, %rsi
testb $0x1, %r13b
je 0x425f9
movq %r14, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %sil
setne %dl
orb %cl, %dl
jne 0x425f9
incl (%rax)
movq %rsi, -0x80(%rbp)
movq %r14, %r12
shrq $0x30, %r12
andq %r15, %r14
movq %rbx, %rdi
movl %r12d, %esi
movq %r14, %rdx
leaq -0x88(%rbp), %rcx
callq 0x2e781
movq 0x20(%rax), %rbx
movq %rbx, %rcx
andq %r15, %rcx
sete %dl
testb $0x3, %bl
setne %sil
orb %dl, %sil
jne 0x42637
incl (%rcx)
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x42668
decl (%rcx)
jne 0x42668
movq %rax, %rdi
leaq 0xd30de(%rip), %rsi     # 0x115741
callq 0xd4e3
movq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x3349b
movl %eax, %ebx
testb %al, %al
je 0x42691
movq -0x80(%rbp), %rdi
movq %r13, %rsi
callq 0x20c67
jmp 0x426b9
xorl %ecx, %ecx
xorl %eax, %eax
jmp 0x4271c
movl %r12d, %edi
movq %r14, %rsi
callq 0x334fa
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
leaq 0x4(%rcx), %rdi
orq %rax, %rdi
leaq 0xd38fd(%rip), %rsi     # 0x115fb1
callq 0x20c09
movq %rdx, %rdi
movq -0x88(%rbp), %r13
testb %bl, %bl
je 0x426eb
callq 0x2100c
movq %rax, %rdi
movq %rdx, %rsi
movl -0x34(%rbp), %edx
movq -0x58(%rbp), %rcx
callq 0xd592
movq %rdx, -0x58(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4270d
callq 0x20fc5
movq %rax, %rdi
movq %rdx, %rsi
movl -0x30(%rbp), %edx
movq -0x50(%rbp), %rcx
callq 0xd592
movq %rdx, -0x50(%rbp)
movl $0x1, -0x30(%rbp)
movl -0xa0(%rbp), %edi
movq -0x98(%rbp), %rax
movb $0x1, %cl
testb %cl, %cl
jne 0x4259b
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x42759
decl (%rcx)
jne 0x42759
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xd2b25(%rip), %rsi     # 0x115279
callq 0xd4e3
xorl %edi, %edi
xorl %esi, %esi
movl -0x30(%rbp), %edx
movq -0x50(%rbp), %rcx
callq 0xd37c
movl %eax, %ebx
movq %rdx, %r12
xorl %edi, %edi
xorl %esi, %esi
movl -0x34(%rbp), %edx
movq -0x58(%rbp), %rcx
callq 0xd37c
movl %eax, %r14d
movq %rdx, %r15
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 0x427b1
incl (%rax)
movl %ebx, %edi
movq %r12, %rsi
callq 0x293eb
movl %eax, %ebx
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 0x42807
movl 0x30(%rdx), %edi
decl (%rcx)
jne 0x42807
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xd2a7b(%rip), %rsi     # 0x115279
callq 0xd4e3
movq -0x40(%rbp), %rdx
movl %ebx, 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), %rdx
jne 0x42852
movl 0x20(%rdx), %edi
decl (%rcx)
jne 0x42852
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xd2a30(%rip), %rsi     # 0x115279
callq 0xd4e3
movq -0x40(%rbp), %rdx
movl %r14d, 0x20(%rdx)
movq %r15, 0x28(%rdx)
movq -0x60(%rbp), %rsi
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %rsi
sete %al
testb $0x3, -0x48(%rbp)
setne %cl
orb %al, %cl
jne 0x42891
decl (%rsi)
jne 0x42891
leaq 0xd288d(%rip), %rsi     # 0x115111
movq -0x48(%rbp), %rdi
callq 0xd4e3
movq -0x40(%rbp), %rdx
movq -0x68(%rbp), %rax
movq %rdx, (%rax)
movq -0x70(%rbp), %rax
movq %r13, (%rax)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf9f7
movq $0x20, 0x10(%rax)
movups 0xa1e86(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0xa1e8b(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5