// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_name_QName_climbzeupzednamezy
static struct std_list_List_1 mw_mirth_name_QName_climbzeupzednamezy (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_elab_zaResolveDef* in_zaResolveDef_2, struct mirth_name_DName* in_DName_3, struct mirth_name_QName* in_QName_4, struct mirth_mirth_zaMirth* *out_zaMirth_5, struct mirth_elab_zaResolveDef* *out_zaResolveDef_6) {
	incref(MK_mirth_name_DName(in_DName_3));
	struct std_maybe_Maybe_1 v8 = mw_mirth_name_DName_rootzy(in_DName_3);
	struct std_list_List_1 v9 = mw_std_maybe_Maybe_1_zgList(v8);
	struct std_list_Nest_1* v10 = mw_mirth_name_DName_parts(in_DName_3);
	VAL v11;
	struct std_list_List_1 v12 = mw_std_list_Nest_1_unsnoc(v10, &v11);
	struct std_list_List_1 v13 = mw_std_list_List_1_cat(v9, v12);
	bool v14 = in_zaResolveDef_2->mignorezelastzename;
	struct mirth_mirth_zaMirth* branch_zaMirth_15;
	struct mirth_elab_zaResolveDef* branch_zaResolveDef_16;
	struct std_list_List_1 branch_List_17;
	VAL branch_zux1_18;
	if (v14) {
		decref(v11);
		struct std_maybe_Maybe_1 v19;
		struct std_list_List_1 v20 = mw_std_list_List_1_unsnoc(v13, &v19);
		struct mirth_mirth_zaMirth* branch_zaMirth_21;
		struct mirth_elab_zaResolveDef* branch_zaResolveDef_22;
		VAL branch_zux1_23;
		switch ((v19).tag) {
			case std_maybe_Maybe_1_Some: {
				VAL v24 = mtp_std_maybe_Maybe_1_Some(v19);
				branch_zux1_23 = v24;
				branch_zaResolveDef_22 = in_zaResolveDef_2;
				branch_zaMirth_21 = in_zaMirth_1;
			} break;
			case std_maybe_Maybe_1_None: {
				uint64_t v25 = in_zaResolveDef_2->mtoken;
				STR* v26;
				STRLIT(v26, "Error, expected a namespace in QName.climb-up-dname?", 52);
				mw_mirth_mirth_zaMirth_emitzefatalzeerrorzx(in_zaMirth_1, v25, v26);
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		branch_zux1_18 = branch_zux1_23;
		branch_List_17 = v20;
		branch_zaResolveDef_16 = branch_zaResolveDef_22;
		branch_zaMirth_15 = branch_zaMirth_21;
	} else {
		branch_zux1_18 = v11;
		branch_List_17 = v13;
		branch_zaResolveDef_16 = in_zaResolveDef_2;
		branch_zaMirth_15 = in_zaMirth_1;
	}
	struct mirth_mirth_zaMirth* v29;
	struct std_list_List_1 v30 = mw_mirth_name_QName_climbzeupzenamezy(branch_zaMirth_15, V_mirth_name_Name(branch_zux1_18), in_QName_4, &v29);
	struct std_list_List_1 v31 = mw_std_list_List_1_reverse(branch_List_17);
	bool v32 = true;
	struct mirth_mirth_zaMirth* r33 = v29;
	struct mirth_elab_zaResolveDef* r34 = branch_zaResolveDef_16;
	struct std_list_List_1 v35 = v30;
	struct std_list_List_1 v36 = v31;
	bool v37 = v32;
	bool v38 = v32;
	while (v38) {
		struct mirth_mirth_zaMirth* r39 = r33;
		struct mirth_elab_zaResolveDef* r40 = r34;
		struct std_list_List_1 v41 = v35;
		struct std_list_List_1 v42 = v36;
		bool v43 = v37;
		struct mirth_mirth_zaMirth* branch_zaMirth_44;
		VAL branch_zux1_45;
		struct std_list_List_1 branch_List_46;
		struct std_list_List_1 branch_List_47;
		bool branch_Bool_48;
		switch ((v42).tag) {
			case std_list_List_1_Cons: {
				struct std_list_List_1 v49;
				VAL v50 = mtp_std_list_List_1_Cons(v42, &v49);
				struct std_list_List_1 v51 = { .tag=std_list_List_1_Nil };
				struct std_list_List_1 v52;
				mw_std_list_List_1_buildzx(v51, &v52);
				bool v53 = true;
				VAL v54 = v50;
				struct mirth_mirth_zaMirth* r55 = r39;
				struct mirth_elab_zaResolveDef* r56 = r40;
				struct std_list_List_1 r57 = v52;
				struct std_list_List_1 v58 = v41;
				bool v59 = v53;
				bool v60 = v53;
				while (v60) {
					VAL v61 = v54;
					struct mirth_mirth_zaMirth* r62 = r55;
					struct mirth_elab_zaResolveDef* r63 = r56;
					struct std_list_List_1 r64 = r57;
					struct std_list_List_1 v65 = v58;
					bool v66 = v59;
					uint64_t branch_Name_67;
					struct mirth_mirth_zaMirth* branch_zaMirth_68;
					VAL branch_zux1_69;
					struct std_list_List_1 branch_zaLister_70;
					struct std_list_List_1 branch_List_71;
					bool branch_Bool_72;
					switch ((v65).tag) {
						case std_list_List_1_Cons: {
							struct std_list_List_1 v73;
							VAL v74 = mtp_std_list_List_1_Cons(v65, &v73);
							struct mirth_mirth_zaMirth* v75;
							struct std_maybe_Maybe_1 v76 = mw_mirth_name_Namespace_qname(r62, V_mirth_name_Namespace(v74), &v75);
							uint64_t branch_Name_77;
							struct mirth_mirth_zaMirth* branch_zaMirth_78;
							struct std_list_List_1 branch_List_79;
							VAL branch_zux1_80;
							switch ((v76).tag) {
								case std_maybe_Maybe_1_Some: {
									VAL v81 = mtp_std_maybe_Maybe_1_Some(v76);
									incref(v61);
									struct mirth_mirth_zaMirth* v82;
									struct std_list_List_1 v83 = mw_mirth_name_QName_climbzeupzenamezy(v75, V_mirth_name_Name(v61), V_mirth_name_QName(v81), &v82);
									branch_zux1_80 = MK_mirth_elab_zaResolveDef(r63);
									branch_List_79 = v83;
									branch_zaMirth_78 = v82;
									branch_Name_77 = V_mirth_name_Name(v61);
								} break;
								case std_maybe_Maybe_1_None: {
									struct std_list_List_1 v84 = { .tag=std_list_List_1_Nil };
									branch_zux1_80 = MK_mirth_elab_zaResolveDef(r63);
									branch_List_79 = v84;
									branch_zaMirth_78 = v75;
									branch_Name_77 = V_mirth_name_Name(v61);
								} break;
								default: {
									do_panic(str_make("unexpected fallthrough in match\n", 32));
								}
							}
							struct std_list_List_1 v85;
							mw_std_list_List_1_for_1_sp71(r64, branch_List_79, &v85);
							bool v86 = true;
							branch_Bool_72 = v86;
							branch_List_71 = v73;
							branch_zaLister_70 = v85;
							branch_zux1_69 = branch_zux1_80;
							branch_zaMirth_68 = branch_zaMirth_78;
							branch_Name_67 = branch_Name_77;
						} break;
						case std_list_List_1_Nil: {
							struct std_list_List_1 v87 = { .tag=std_list_List_1_Nil };
							bool v88 = false;
							branch_Bool_72 = v88;
							branch_List_71 = v87;
							branch_zaLister_70 = r64;
							branch_zux1_69 = MK_mirth_elab_zaResolveDef(r63);
							branch_zaMirth_68 = r62;
							branch_Name_67 = V_mirth_name_Name(v61);
						} break;
						default: {
							do_panic(str_make("unexpected fallthrough in match\n", 32));
						}
					}
					v60 = branch_Bool_72;
					v59 = branch_Bool_72;
					v58 = branch_List_71;
					r57 = branch_zaLister_70;
					r56 = V_mirth_elab_zaResolveDef(branch_zux1_69);
					r55 = branch_zaMirth_68;
					v54 = MK_mirth_name_Name(branch_Name_67);
				}
				decref(MK_std_list_List_1(v58));
				struct std_list_List_1 v89 = mw_std_list_zaLister_1_donezx(r57);
				decref(v54);
				bool v90 = true;
				branch_Bool_48 = v90;
				branch_List_47 = v49;
				branch_List_46 = v89;
				branch_zux1_45 = MK_mirth_elab_zaResolveDef(r56);
				branch_zaMirth_44 = r55;
			} break;
			case std_list_List_1_Nil: {
				struct std_list_List_1 v91 = { .tag=std_list_List_1_Nil };
				bool v92 = false;
				branch_Bool_48 = v92;
				branch_List_47 = v91;
				branch_List_46 = v41;
				branch_zux1_45 = MK_mirth_elab_zaResolveDef(r40);
				branch_zaMirth_44 = r39;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v38 = branch_Bool_48;
		v37 = branch_Bool_48;
		v36 = branch_List_47;
		v35 = branch_List_46;
		r34 = V_mirth_elab_zaResolveDef(branch_zux1_45);
		r33 = branch_zaMirth_44;
	}
	decref(MK_std_list_List_1(v36));
	*out_zaResolveDef_6 = r34;
	*out_zaMirth_5 = r33;
	return v35;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, -0x88(%rbp)
movq %r8, -0x90(%rbp)
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, -0x50(%rbp)
movq %rdi, -0x38(%rbp)
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
movq %rdx, %rax
andq %r14, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x2b41c
incl (%rax)
movq %r15, %rdi
callq 0x2b953
movl %eax, %edi
movq %rdx, %rsi
callq 0x2b9ac
movl %eax, %r12d
movq %rdx, %r13
movq %r15, %rdi
callq 0x2a325
leaq -0xa0(%rbp), %rsi
movq %rax, %rdi
callq 0x2a166
movq %rdx, %rcx
movl %r12d, %edi
movq %r13, %rsi
movl %eax, %edx
callq 0x26383
movl %eax, %r15d
movq %rdx, %r13
movq -0x50(%rbp), %rax
cmpb $0x1, 0x40(%rax)
movq %r14, -0x68(%rbp)
jne 0x2b4d3
movq -0x98(%rbp), %rsi
testb $0x1, %sil
je 0x2b4a0
movq -0xa0(%rbp), %rdi
movq %rdi, %rax
andq %r14, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x2b4a0
decl (%rax)
jne 0x2b4a0
callq 0xce94
leaq -0x78(%rbp), %r12
movl %r15d, %edi
movq %r13, %rsi
movq %r12, %rdx
callq 0x2b9f8
movl %eax, %r15d
movl (%r12), %eax
cmpl $0x1, %eax
jne 0x2b7ad
movq %rdx, %r13
movq -0x70(%rbp), %rdi
callq 0xd491
movq %rax, %rsi
jmp 0x2b4da
movq -0xa0(%rbp), %rsi
movq -0x38(%rbp), %rdi
leaq -0xb8(%rbp), %r14
movq %rbx, %rdx
movq %r14, %rcx
callq 0x2ba46
movl %eax, %ebx
movq %rdx, %r12
movl %r15d, %edi
movq %r13, %rsi
callq 0xcd32
movq (%r14), %r15
leaq -0x78(%rbp), %rsi
leaq 0xdd1ea(%rip), %r13     # 0x1086f8
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
movb $0x1, %cl
movq %rdx, %rdi
testb $0x1, %cl
je 0x2b752
xorl %ecx, %ecx
movl $0x0, %edx
testl %eax, %eax
je 0x2b51a
movq %r15, -0x38(%rbp)
cmpl $0x1, %eax
jne 0x2b801
callq 0xce01
movq %rax, %r15
movq %rdx, %r14
xorl %edi, %edi
xorl %esi, %esi
callq 0xcd32
movl %eax, %esi
movq %r15, %rcx
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %rcx
movq %rcx, -0x40(%rbp)
sete %al
movq %r15, -0x48(%rbp)
testb $0x3, %r15b
setne %cl
orb %al, %cl
movb %cl, -0x29(%rbp)
movb $0x1, %al
movq %r14, %r15
movq %r12, %rdi
testb $0x1, %al
je 0x2b6be
xorl %eax, %eax
movl $0x0, %r12d
movq %r13, %r14
testl %ebx, %ebx
je 0x2b57d
movq %rdx, -0x80(%rbp)
cmpl $0x1, %ebx
jne 0x2b801
movl %esi, %r12d
leaq -0xb0(%rbp), %rsi
callq 0xce01
movq %rax, %rdi
shrq $0x30, %rax
cmpw $0x4, %ax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
leaq -0x60(%rbp), %r14
ja 0x2b801
andq %rcx, %rdi
leaq 0xa7199(%rip), %rdx     # 0xd2778
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
xorl %ecx, %ecx
jmp 0x2b691
callq 0x17c77
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x17f62
jmp 0x2b644
callq 0x17b2e
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x13f85
jmp 0x2b644
callq 0x17b4b
movq -0x38(%rbp), %rdi
movl %eax, %esi
movq %r14, %rcx
callq 0x17ecb
jmp 0x2b644
callq 0x17b11
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x13f30
movq %rax, %rdi
leaq 0xdd0f3(%rip), %rsi     # 0x108741
callq 0x8d0c
movq %rdx, %rdi
movq -0x60(%rbp), %rbx
callq 0xd491
testb $0x1, %r15b
sete %cl
orb -0x29(%rbp), %cl
testb $0x1, %cl
jne 0x2b674
movq -0x40(%rbp), %rcx
incl (%rcx)
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
movq %rax, %rdx
movq %r14, %rcx
callq 0x2ba46
movq %rdx, %rcx
movq -0x60(%rbp), %rdx
movq %rdx, -0x38(%rbp)
movl %r12d, %edi
movq -0x80(%rbp), %rsi
movl %eax, %edx
movq %r14, %r8
callq 0x2be0e
movl -0xb0(%rbp), %ebx
movq -0xa8(%rbp), %r12
movl -0x60(%rbp), %esi
movq -0x58(%rbp), %rdx
movq %r13, %r14
jmp 0x2b57b
movq %rdi, %rax
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
andq %r14, %rax
sete %cl
testb $0x3, %dil
setne %r8b
orb %cl, %r8b
jne 0x2b702
decl (%rax)
jne 0x2b702
shlq $0x30, %rbx
orq %rdi, %rbx
movq %rbx, %rdi
movl %esi, %ebx
leaq 0xdcb84(%rip), %rsi     # 0x108279
movq %rdx, %r12
callq 0xce94
movq %r12, %rdx
movl %ebx, %esi
movl %esi, %edi
movq %rdx, %rsi
callq 0xcd32
movl %eax, %ebx
movq %rdx, %r12
testb $0x1, %r15b
je 0x2b73e
cmpq $0x0, -0x40(%rbp)
sete %al
testb $0x3, -0x48(%rbp)
setne %cl
orb %al, %cl
jne 0x2b73e
movq -0x40(%rbp), %rax
decl (%rax)
jne 0x2b73e
movq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0xce94
movl -0x78(%rbp), %eax
movq -0x70(%rbp), %rdx
leaq -0x78(%rbp), %rsi
movq -0x38(%rbp), %r15
jmp 0x2b518
andq %rdi, %r14
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x2b77e
decl (%r14)
jne 0x2b77e
shlq $0x30, %rax
orq %rdi, %rax
movq %rax, %rdi
leaq 0xdcb00(%rip), %rsi     # 0x108279
callq 0xce94
movq -0x50(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rax, (%rcx)
movq -0x90(%rbp), %rax
movq %r15, (%rax)
movl %ebx, %eax
movq %r12, %rdx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0x2b801
movq -0x50(%rbp), %rax
movq 0x8(%rax), %r14
movq 0x10e0c78(%rip), %rdx   # 0x110c438
testq %rdx, %rdx
jne 0x2b7de
leaq 0xacc3e(%rip), %rdi     # 0xd840a
pushq $0x34
popq %rsi
callq 0x8a21
movq %rax, %rdx
movq %rax, 0x10e0c5a(%rip)   # 0x110c438
andq %rdx, -0x68(%rbp)
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x2b7f5
movq -0x68(%rbp), %rax
incl (%rax)
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x246fe
leaq 0xa9005(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6