// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_resolvezedefzenamespace
static struct std_maybe_Maybe_1 mw_mirth_elab_resolvezedefzenamespace (struct mirth_mirth_zaMirth* in_zaMirth_1, uint64_t in_Token_2, struct std_either_Either_2 in_Either_3, bool in_Bool_4, struct mirth_mirth_zaMirth* *out_zaMirth_5) {
	STR* v7;
	STRLIT(v7, "namespace", 9);
	bool v8 = false;
	struct mirth_mirth_zaMirth* v9;
	struct mirth_elab_zaResolveDef* v10;
	mw_mirth_elab_zaResolveDef_Beginzx(v7, in_Token_2, in_Either_3, in_Bool_4, v8, in_zaMirth_1, &v9, &v10);
	struct std_list_List_1 v11 = v10->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 = v9;
	struct mirth_elab_zaResolveDef* r16 = v10;
	struct std_list_List_1 v17 = v12;
	struct std_list_List_1 v18 = v13;
	struct std_list_List_1 v19 = v11;
	bool v20 = v14;
	bool v21 = v14;
	while (v21) {
		struct mirth_mirth_zaMirth* r22 = r15;
		struct mirth_elab_zaResolveDef* r23 = r16;
		struct std_list_List_1 v24 = v17;
		struct std_list_List_1 v25 = v18;
		struct std_list_List_1 v26 = v19;
		bool v27 = v20;
		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 ((v26).tag) {
			case std_list_List_1_Cons: {
				struct std_list_List_1 v34;
				VAL v35 = mtp_std_list_List_1_Cons(v26, &v34);
				incref(v35);
				struct mirth_mirth_zaMirth* v36;
				struct std_maybe_Maybe_1 v37 = mw_mirth_def_Def_aszedefzenamespacezy(r22, V_mirth_def_Def(v35), &v36);
				int64_t v38 = (v37).tag;
				decref(MK_std_maybe_Maybe_1(v37));
				INT v39 = WRAP_I63(0LL);
				INT v40 = v39;
				INT v41 = i64_to_int(v38);
				bool v42 = int_eq(v41, v40);
				bool v43 = !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(v35);
					branch_Either_46 = v47;
					branch_zux1_45 = MK_mirth_elab_zaResolveDef(r23);
					branch_zaMirth_44 = v36;
				} else {
					struct mirth_elab_RejectedDef v48 = mtw_mirth_elab_RejectedDef_WrongSort(V_mirth_def_Def(v35));
					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(r23);
					branch_zaMirth_44 = v36;
				}
				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, v24);
						branch_List_53 = v25;
						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, v25);
						branch_List_53 = v57;
						branch_List_52 = v24;
						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_33 = v58;
				branch_List_32 = v34;
				branch_List_31 = branch_List_53;
				branch_List_30 = branch_List_52;
				branch_zux1_29 = branch_zux1_51;
				branch_zaMirth_28 = 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_33 = v60;
				branch_List_32 = v59;
				branch_List_31 = v25;
				branch_List_30 = v24;
				branch_zux1_29 = MK_mirth_elab_zaResolveDef(r23);
				branch_zaMirth_28 = r22;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v21 = branch_Bool_33;
		v20 = branch_Bool_33;
		v19 = branch_List_32;
		v18 = branch_List_31;
		v17 = branch_List_30;
		r16 = V_mirth_elab_zaResolveDef(branch_zux1_29);
		r15 = branch_zaMirth_28;
	}
	decref(MK_std_list_List_1(v19));
	struct std_list_List_1 v61 = mw_std_list_List_1_reverse(v17);
	struct std_list_List_1 v62 = mw_std_list_List_1_reverse(v18);
	struct std_list_List_1 v63 = r16->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 = r16->mrejected;
	decref(MK_std_list_List_1(v65));
	r16->mrejected = v64;
	struct std_list_List_1 v66 = r16->mcandidates;
	decref(MK_std_list_List_1(v66));
	r16->mcandidates = v62;
	struct mirth_mirth_zaMirth* v67;
	struct mirth_elab_zaResolveDef* v68;
	mw_mirth_elab_zaResolveDef_filterzequalifiers(r15, r16, &v67, &v68);
	struct std_list_List_1 v69 = { .tag=std_list_List_1_Nil };
	struct mirth_mirth_zaMirth* v70;
	struct mirth_elab_zaResolveDef* v71;
	mw_mirth_elab_zaResolveDef_filterzeroots(v67, v68, v69, &v70, &v71);
	struct mirth_mirth_zaMirth* v72;
	struct std_maybe_Maybe_1 v73 = mw_mirth_elab_zaResolveDef_endzx(v70, v71, &v72);
	struct mirth_mirth_zaMirth* v74;
	struct std_maybe_Maybe_1 v75 = mw_std_maybe_Maybe_1_bind_1_sp16(v72, v73, &v74);
	*out_zaMirth_5 = v74;
	return v75;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r9, -0x68(%rbp)
movl %r8d, %r13d
movq %rcx, %r14
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r10
cmpq $0x0, 0x10f086c(%rip)   # 0x1119408
jne 0x28bcf
movl $0x9, %edi
movq %r10, %rbx
callq 0xf9f7
movq %rbx, %r10
movq $0x9, 0x10(%rax)
movabsq $0x63617073656d616e, %rcx # imm = 0x63617073656D616E
movq %rcx, 0x18(%rax)
movb $0x65, 0x20(%rax)
movq %rax, 0x10f0839(%rip)   # 0x1119408
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
movq 0x10f0828(%rip), %rdi   # 0x1119408
movq %rdi, %rax
andq %rcx, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x28bf6
incl (%rax)
subq $0x8, %rsp
leaq -0xa8(%rbp), %rbx
leaq -0x80(%rbp), %rax
movzbl %r13b, %r8d
movq $0x0, -0x48(%rbp)
movq %r12, %rsi
movl %r15d, %edx
movq %r14, %rcx
xorl %r9d, %r9d
pushq %rbx
pushq %rax
pushq %r10
callq 0x28f93
addq $0x20, %rsp
movq (%rbx), %rax
movl 0x20(%rax), %edi
movq %rax, -0x38(%rbp)
movq 0x28(%rax), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %r12   # imm = 0xFFFFFFFFFFFC
andq %r12, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x28c58
incl (%rcx)
movq -0x80(%rbp), %r15
movq $0x0, -0x40(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x0, -0x2c(%rbp)
testl %edi, %edi
je 0x28d30
cmpl $0x1, %edi
jne 0x28f63
movq %rax, %rdi
leaq -0x78(%rbp), %rsi
callq 0xd450
movq %rax, %r14
movq %rdx, %r13
movq %rax, %rsi
testb $0x1, %r13b
je 0x28cb5
movq %r14, %rax
andq %r12, %rax
sete %cl
testb $0x3, %sil
setne %dl
orb %cl, %dl
jne 0x28cb5
incl (%rax)
movq %rsi, -0x58(%rbp)
movq %r14, %rbx
shrq $0x30, %rbx
andq %r12, %r14
movq %r15, %rdi
movl %ebx, %esi
movq %r14, %rdx
leaq -0x60(%rbp), %rcx
callq 0x292fd
movq %r12, %rcx
movl %eax, %r12d
movq %rdx, %rax
andq %rcx, %rax
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x28d09
decl (%rax)
jne 0x28d09
movq %r12, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0xec5bd(%rip), %rsi     # 0x1152c1
callq 0xd4e3
leaq 0x1(,%r12,2), %rdi
movl $0x1, %esi
callq 0xec04
movl %eax, %r12d
testl %eax, %eax
je 0x28d39
movq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x20c67
jmp 0x28d52
xorl %ecx, %ecx
xorl %eax, %eax
jmp 0x28dba
movl %ebx, %edi
movq %r14, %rsi
callq 0x29392
movq %rax, %rdi
leaq 0xed264(%rip), %rsi     # 0x115fb1
callq 0x20c09
movq %rdx, %rdi
movq -0x60(%rbp), %r15
testl %r12d, %r12d
je 0x28d82
callq 0x2100c
movq %rax, %rdi
movq %rdx, %rsi
movl -0x2c(%rbp), %edx
movq -0x50(%rbp), %rcx
callq 0xd592
movq %rdx, -0x50(%rbp)
movl $0x1, -0x2c(%rbp)
jmp 0x28da7
callq 0x20fc5
movq %rax, %rdi
movq %rdx, %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0xd592
movq %rdx, -0x40(%rbp)
movl $0x1, %eax
movq %rax, -0x48(%rbp)
movabsq $0xfffffffffffc, %r12   # imm = 0xFFFFFFFFFFFC
movl -0x78(%rbp), %edi
movq -0x70(%rbp), %rax
movb $0x1, %cl
testb %cl, %cl
jne 0x28c73
movq %r15, -0x58(%rbp)
movq %rax, %rcx
andq %r12, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x28df1
decl (%rcx)
jne 0x28df1
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xec48d(%rip), %rsi     # 0x115279
callq 0xd4e3
xorl %edi, %edi
xorl %esi, %esi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0xd37c
movl %eax, %r15d
movq %rdx, %r12
xorl %edi, %edi
xorl %esi, %esi
movl -0x2c(%rbp), %edx
movq -0x50(%rbp), %rcx
callq 0xd37c
movl %eax, %ebx
movq %rdx, %r14
movq -0x38(%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 0x28e4a
incl (%rax)
movl %r15d, %edi
movq %r12, %rsi
callq 0x293eb
movl %eax, %r15d
movq %rdx, %r13
movq -0x38(%rbp), %rdi
movq 0x38(%rdi), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %r12   # imm = 0xFFFFFFFFFFFC
andq %r12, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
movq %rdi, %rsi
jne 0x28ea2
movl 0x30(%rsi), %edi
decl (%rcx)
jne 0x28ea2
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xec3e0(%rip), %rsi     # 0x115279
callq 0xd4e3
movq -0x38(%rbp), %rsi
movl %r15d, 0x30(%rsi)
movq %r13, 0x38(%rsi)
movq 0x28(%rsi), %rax
andq %rax, %r12
sete %cl
testb $0x3, %al
setne %dl
orb %cl, %dl
jne 0x28edd
movl 0x20(%rsi), %edi
decl (%r12)
jne 0x28edd
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xec3a5(%rip), %rsi     # 0x115279
callq 0xd4e3
movq -0x38(%rbp), %rsi
movl %ebx, 0x20(%rsi)
movq %r14, 0x28(%rsi)
leaq -0x78(%rbp), %rbx
leaq -0x60(%rbp), %r14
movq -0x58(%rbp), %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x29427
movq (%rbx), %rdi
movq (%r14), %rsi
leaq -0xa0(%rbp), %rbx
leaq -0x98(%rbp), %r14
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
movq %r14, %r9
callq 0x29858
movq (%rbx), %rdi
movq (%r14), %rsi
leaq -0x90(%rbp), %rbx
movq %rbx, %rdx
callq 0x2aec1
movq (%rbx), %rdi
leaq -0x88(%rbp), %rbx
movl %eax, %esi
movq %rbx, %rcx
callq 0x2d61f
movq (%rbx), %rcx
movq -0x68(%rbp), %rsi
movq %rcx, (%rsi)
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 0xbb7d1(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0xbb7d6(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5