// File: /workspace/github_c_makefile_star2_O3/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 $0x88, %rsp
movq %r9, -0x68(%rbp)
movq %r8, -0x70(%rbp)
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, -0x48(%rbp)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
movq %rdx, %rax
movq %rcx, -0x50(%rbp)
andq %rcx, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0x2dd24
incl (%rax)
movq %rbx, %rdi
callq 0x2e0f0
movl %eax, %edi
movq %rdx, %rsi
callq 0x2e149
movl %eax, %r12d
movq %rdx, %r13
movq %rbx, %rdi
callq 0x2cc3e
leaq -0x98(%rbp), %rsi
movq %rax, %rdi
callq 0x2ca91
movq %rdx, %rcx
movl %r12d, %edi
movq %r13, %rsi
movl %eax, %edx
callq 0x28d8d
movl %eax, %r12d
movq %rdx, %rbx
cmpb $0x1, 0x40(%r14)
movq %r14, -0x78(%rbp)
jne 0x2dde2
movq -0x90(%rbp), %rsi
testb $0x1, %sil
je 0x2ddaf
movq -0x98(%rbp), %rdi
movq %rdi, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x2ddaf
decl (%rax)
jne 0x2ddaf
callq 0xd13d
leaq -0x60(%rbp), %r13
movl %r12d, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2e1ae
movl %eax, %r12d
movl (%r13), %eax
cmpl $0x1, %eax
jne 0x2e045
movq %rdx, %rbx
movq -0x58(%rbp), %rdi
callq 0xd745
movq %rax, %rsi
jmp 0x2dde9
movq -0x98(%rbp), %rsi
leaq -0xb0(%rbp), %r14
movq -0x48(%rbp), %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2e209
movl %eax, %r13d
movq %rdx, %r15
xorl %edi, %edi
xorl %esi, %esi
movl %r12d, %edx
movq %rbx, %rcx
callq 0xd01b
movq %rdx, %rdi
movq (%r14), %r14
cmpl $0x1, %eax
jne 0x2e013
leaq -0x60(%rbp), %rsi
callq 0xd0aa
movq %rax, %rbx
movq %rdx, -0x80(%rbp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xd01b
movl %eax, %r12d
movq %rdx, %rcx
movq %rbx, %rdx
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rax, %rdx
movq %rdx, -0x88(%rbp)
sete %al
movq %rbx, -0x48(%rbp)
testb $0x3, %bl
setne %dl
orb %al, %dl
movb %dl, -0x29(%rbp)
testb $0x1, -0x80(%rbp)
sete %bl
cmpl $0x1, %r13d
jne 0x2dfec
movq %rcx, %r13
movq %r15, %rdi
leaq -0xa8(%rbp), %rsi
callq 0xd0aa
movq %rax, %r8
shrq $0x30, %r8
cmpw $0x4, %r8w
ja 0x2e0c0
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
leaq 0xb08c0(%rip), %rdx     # 0xde778
movslq (%rdx,%r8,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
xorl %ecx, %ecx
leaq -0x40(%rbp), %r15
jmp 0x2dfbe
movq 0x8(%rax), %r15
decl (%rax)
jne 0x2dedc
movq %rax, %rdi
callq 0x5030
leaq 0x10e6cdd(%rip), %rdi   # 0x1114bc0
movq %r15, %rsi
callq 0x13c85
movq %r14, %rdi
movq %rax, %rsi
leaq -0x40(%rbp), %r15
movq %r15, %rdx
callq 0x1a6db
movq -0x40(%rbp), %r14
movq %rax, %rdi
leaq 0xe3836(%rip), %rsi     # 0x111741
callq 0x9353
movq %rdx, %rdi
jmp 0x2df8c
movq 0x8(%rax), %r15
decl (%rax)
jne 0x2df25
movq %rax, %rdi
callq 0x5030
movq %r14, %rdi
movq %r15, %rsi
leaq -0x40(%rbp), %r15
movq %r15, %rdx
callq 0x14e04
jmp 0x2df76
movq %rax, %rdi
callq 0x19c36
movq %r14, %rdi
movl %eax, %esi
leaq -0x40(%rbp), %r15
movq %r15, %rcx
callq 0x19ff6
jmp 0x2df76
movq 0x8(%rax), %r15
decl (%rax)
jne 0x2df64
movq %rax, %rdi
callq 0x5030
movq %r14, %rdi
movq %r15, %rsi
leaq -0x40(%rbp), %r15
movq %r15, %rdx
callq 0x14dca
movq %rax, %rdi
leaq 0xe37c1(%rip), %rsi     # 0x111741
callq 0x9353
movq %rdx, %rdi
movq -0x40(%rbp), %r14
callq 0xd745
orb -0x29(%rbp), %bl
testb $0x1, %bl
jne 0x2dfa2
movq -0x88(%rbp), %rcx
incl (%rcx)
movq %r14, %rdi
movq -0x48(%rbp), %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x2e209
movl %eax, %r8d
movq %rdx, %rcx
movq -0x40(%rbp), %r14
movl %r12d, %edi
movq %r13, %rsi
movl %r8d, %edx
movq %r15, %r8
callq 0x2e5ba
movl -0xa8(%rbp), %r13d
movq -0xa0(%rbp), %r15
movl -0x40(%rbp), %r12d
movq -0x38(%rbp), %rcx
movb $0x1, %bl
jmp 0x2de76
testl %r13d, %r13d
jne 0x2e0c0
xorl %edi, %edi
xorl %esi, %esi
movl %r12d, %edx
callq 0xd01b
movl %eax, %r13d
movq %rdx, %r15
movl -0x60(%rbp), %eax
movq -0x58(%rbp), %rdi
jmp 0x2de1a
testl %eax, %eax
jne 0x2e0c0
movq -0x78(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rax, (%rcx)
movq -0x70(%rbp), %rax
movq %r14, (%rax)
movl %r13d, %eax
movq %r15, %rdx
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0x2e0c0
movq 0x8(%r14), %rbx
movq 0x10e73e4(%rip), %rdx   # 0x1115438
testq %rdx, %rdx
jne 0x2e09d
movl $0x34, %edi
callq 0xf5e4
movq %rax, %rdx
movq $0x34, 0x10(%rax)
movups 0xb61f8(%rip), %xmm0    # 0xe426d
movups %xmm0, 0x18(%rax)
movups 0xb61fd(%rip), %xmm0    # 0xe427d
movups %xmm0, 0x28(%rax)
movups 0xb6202(%rip), %xmm0    # 0xe428d
movups %xmm0, 0x38(%rax)
movl $0x3f656d61, 0x48(%rax) # imm = 0x3F656D61
movq %rax, 0x10e739b(%rip)   # 0x1115438
andq %rdx, -0x50(%rbp)
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x2e0b4
movq -0x50(%rbp), %rax
incl (%rax)
movq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x27183
movl $0x20, %edi
callq 0xf5e4
movq $0x20, 0x10(%rax)
movups 0xb25f4(%rip), %xmm0    # 0xe06cd
movups %xmm0, 0x18(%rax)
movups 0xb25f9(%rip), %xmm0    # 0xe06dd
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x9302