// File: /workspace/github_c_makefile_star2_O1/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, -0x68(%rbp)
movq %r8, -0x70(%rbp)
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, -0x38(%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 0x2e9e2
incl (%rax)
movq %rbx, %rdi
callq 0x2ee4d
movl %eax, %edi
movq %rdx, %rsi
callq 0x2eea6
movl %eax, %r12d
movq %rdx, %r13
movq %rbx, %rdi
callq 0x2d8fc
leaq -0xa0(%rbp), %rsi
movq %rax, %rdi
callq 0x2d716
movq %rdx, %rcx
movl %r12d, %edi
movq %r13, %rsi
movl %eax, %edx
callq 0x293eb
movl %eax, %r12d
movq %rdx, %rbx
cmpb $0x1, 0x40(%r14)
movq %r14, -0x78(%rbp)
jne 0x2eaa0
movq -0x98(%rbp), %rsi
testb $0x1, %sil
je 0x2ea6d
movq -0xa0(%rbp), %rdi
movq %rdi, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x2ea6d
decl (%rax)
jne 0x2ea6d
callq 0xd4e3
leaq -0x60(%rbp), %r13
movl %r12d, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2ef0b
movl %eax, %r12d
movl (%r13), %eax
cmpl $0x1, %eax
jne 0x2eda0
movq %rdx, %rbx
movq -0x58(%rbp), %rdi
callq 0xdaeb
movq %rax, %rsi
jmp 0x2eaa7
movq -0xa0(%rbp), %rsi
leaq -0xb8(%rbp), %r14
movq -0x38(%rbp), %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2ef66
movl %eax, %r15d
movq %rdx, %r13
xorl %edi, %edi
xorl %esi, %esi
movl %r12d, %edx
movq %rbx, %rcx
callq 0xd37c
movq %rdx, %rdi
movq (%r14), %rcx
movq %rcx, -0x38(%rbp)
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
testl %eax, %eax
je 0x2ed3b
cmpl $0x1, %eax
jne 0x2ee1d
leaq -0x60(%rbp), %rsi
callq 0xd450
movq %rax, %r12
movq %rdx, -0x80(%rbp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xd37c
movl %eax, %r14d
movq %r12, %rax
andq %rbx, %rax
movq %rax, -0x88(%rbp)
sete %al
movq %r12, -0x90(%rbp)
testb $0x3, %r12b
setne %cl
orb %al, %cl
movb %cl, -0x29(%rbp)
testb $0x1, -0x80(%rbp)
sete %bl
testl %r15d, %r15d
je 0x2eba1
cmpl $0x1, %r15d
jne 0x2ee1d
movq %rdx, %r12
movq %r13, %rdi
leaq -0xb0(%rbp), %rsi
callq 0xd450
movq %rax, %rcx
shrq $0x30, %rcx
cmpw $0x4, %cx
ja 0x2ee1d
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rax
leaq 0xb3bdd(%rip), %rdx     # 0xe2764
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
movq -0x38(%rbp), %r13
jmpq *%rcx
xorl %eax, %eax
xorl %edx, %edx
leaq -0x48(%rbp), %r15
jmp 0x2ec67
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0x2ecd6
movq 0x8(%rax), %r15
decl (%rax)
jne 0x2ebbb
movq %rax, %rdi
callq 0x5030
leaq 0x10e9ffe(%rip), %rdi   # 0x1118bc0
movq %r15, %rsi
callq 0x13ff0
movq %r13, %rdi
movq %rax, %rsi
leaq -0x48(%rbp), %r15
movq %r15, %rdx
callq 0x1a972
movq -0x48(%rbp), %r13
movq %rax, %rdi
leaq 0xe6b57(%rip), %rsi     # 0x115741
callq 0x95f6
jmp 0x2ec65
movq 0x8(%rax), %r15
decl (%rax)
jne 0x2ec01
movq %rax, %rdi
callq 0x5030
movq %r13, %rdi
movq %r15, %rsi
leaq -0x48(%rbp), %r15
movq %r15, %rdx
callq 0x15157
jmp 0x2ec52
movq %rax, %rdi
callq 0x19ee8
movq %r13, %rdi
movl %eax, %esi
leaq -0x48(%rbp), %r15
movq %r15, %rcx
callq 0x1a2ad
jmp 0x2ec52
movq 0x8(%rax), %r15
decl (%rax)
jne 0x2ec40
movq %rax, %rdi
callq 0x5030
movq %r13, %rdi
movq %r15, %rsi
leaq -0x48(%rbp), %r15
movq %r15, %rdx
callq 0x1511d
movq %rax, %rdi
leaq 0xe6ae5(%rip), %rsi     # 0x115741
callq 0x95f6
movq -0x48(%rbp), %r13
movb $0x1, %al
testb %al, %al
je 0x2eca6
movq %rdx, %rdi
callq 0xdaeb
orb -0x29(%rbp), %bl
testb $0x1, %bl
jne 0x2ec84
movq -0x88(%rbp), %rcx
incl (%rcx)
movq %r13, %rdi
movq -0x90(%rbp), %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x2ef66
movq %rdx, %rcx
movq -0x48(%rbp), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x2ecae
movq %r13, -0x38(%rbp)
xorl %ecx, %ecx
xorl %eax, %eax
movl %r14d, %edi
movq %r12, %rsi
movl %eax, %edx
movq %r15, %r8
callq 0x2f38b
movl -0xb0(%rbp), %r15d
movq -0xa8(%rbp), %r13
movl -0x48(%rbp), %r14d
movq -0x40(%rbp), %rdx
movb $0x1, %al
movb $0x1, %bl
testb %al, %al
jne 0x2eb41
movq %rdx, %r12
movq %r13, %rax
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
andq %rbx, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x2ed1b
decl (%rax)
jne 0x2ed1b
shlq $0x30, %r15
orq %r13, %r15
movq %r15, %rdi
leaq 0xe6563(%rip), %rsi     # 0x115279
callq 0xd4e3
xorl %edi, %edi
xorl %esi, %esi
movl %r14d, %edx
movq %r12, %rcx
callq 0xd37c
movl %eax, %r15d
movq %rdx, %r13
movl -0x60(%rbp), %eax
movq -0x58(%rbp), %rdi
movb $0x1, %cl
jmp 0x2ed3f
xorl %ecx, %ecx
xorl %edi, %edi
testb %cl, %cl
jne 0x2eae6
andq %rdi, %rbx
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x2ed72
decl (%rbx)
jne 0x2ed72
shlq $0x30, %rax
orq %rdi, %rax
leaq 0xe650f(%rip), %rsi     # 0x115279
movq %rax, %rdi
callq 0xd4e3
movq -0x78(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rax, (%rcx)
movq -0x70(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, (%rax)
movl %r15d, %eax
movq %r13, %rdx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0x2ee1d
movq 0x8(%r14), %rbx
cmpq $0x0, 0x10ea688(%rip)   # 0x1119438
jne 0x2edf3
movl $0x34, %edi
callq 0xf9f7
movq $0x34, 0x10(%rax)
movups 0xb95a1(%rip), %xmm0    # 0xe836c
movups %xmm0, 0x18(%rax)
movups 0xb95a6(%rip), %xmm0    # 0xe837c
movups %xmm0, 0x28(%rax)
movups 0xb95ab(%rip), %xmm0    # 0xe838c
movups %xmm0, 0x38(%rax)
movl $0x3f656d61, 0x48(%rax) # imm = 0x3F656D61
movq %rax, 0x10ea645(%rip)   # 0x1119438
movq 0x10ea63e(%rip), %rdx   # 0x1119438
andq %rdx, -0x50(%rbp)
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x2ee11
movq -0x50(%rbp), %rax
incl (%rax)
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x2778c
movl $0x20, %edi
callq 0xf9f7
movq $0x20, 0x10(%rax)
movups 0xb5917(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0xb591c(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5