// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_parsezemodulezepackagezenamezx
static uint64_t mw_mirth_elab_parsezemodulezepackagezenamezx (struct mirth_mirth_zaMirth* in_zaMirth_1, uint64_t in_Token_2, struct mirth_mirth_zaMirth* *out_zaMirth_3, uint64_t *out_Name_5) {
	struct mirth_mirth_zaMirth* v6;
	struct std_maybe_Maybe_1 v7 = mw_mirth_token_Token_namezfdnamezy(in_zaMirth_1, in_Token_2, &v6);
	int64_t v8 = (v7).tag;
	decref(MK_std_maybe_Maybe_1(v7));
	INT v9 = WRAP_I63(0LL);
	INT v10 = v9;
	INT v11 = i64_to_int(v8);
	bool v12 = int_eq(v11, v10);
	bool v13 = !v12;
	struct mirth_mirth_zaMirth* branch_zaMirth_14;
	uint64_t branch_Token_15;
	if (v13) {
		branch_Token_15 = in_Token_2;
		branch_zaMirth_14 = v6;
	} else {
		STR* v16;
		STRLIT(v16, "Expected module name.", 21);
		mw_mirth_mirth_zaMirth_emitzefatalzeerrorzx(v6, in_Token_2, v16);
	}
	struct mirth_mirth_zaMirth* v19;
	struct std_maybe_Maybe_1 v20 = mw_mirth_token_Token_dnamezy(branch_zaMirth_14, branch_Token_15, &v19);
	struct mirth_mirth_zaMirth* branch_zaMirth_21;
	uint64_t branch_Token_22;
	VAL branch_zux1_23;
	switch ((v20).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v24 = mtp_std_maybe_Maybe_1_Some(v20);
			branch_zux1_23 = v24;
			branch_Token_22 = branch_Token_15;
			branch_zaMirth_21 = v19;
		} break;
		case std_maybe_Maybe_1_None: {
			STR* v25;
			STRLIT(v25, "Invalid module name: Module name must include package, for example \"package.module\"", 83);
			mw_mirth_mirth_zaMirth_emitzefatalzeerrorzx(v19, branch_Token_15, v25);
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	struct mirth_mirth_zaMirth* v29;
	mw_mirth_token_Token_argsze0(branch_zaMirth_21, branch_Token_22, &v29);
	incref(branch_zux1_23);
	struct std_maybe_Maybe_1 v30 = mw_mirth_name_DName_rootzy(V_mirth_name_DName(branch_zux1_23));
	struct mirth_mirth_zaMirth* branch_zaMirth_31;
	uint64_t branch_Token_32;
	VAL branch_zux1_33;
	VAL branch_zux2_34;
	switch ((v30).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v35 = mtp_std_maybe_Maybe_1_Some(v30);
			branch_zux2_34 = v35;
			branch_zux1_33 = branch_zux1_23;
			branch_Token_32 = branch_Token_22;
			branch_zaMirth_31 = v29;
		} break;
		case std_maybe_Maybe_1_None: {
			decref(branch_zux1_23);
			STR* v36;
			STRLIT(v36, "Invalid module name: Package name is missing.", 45);
			mw_mirth_mirth_zaMirth_emitzefatalzeerrorzx(v29, branch_Token_22, v36);
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	struct std_list_Nest_1* v41 = mw_mirth_name_DName_parts(V_mirth_name_DName(branch_zux1_33));
	struct std_maybe_Maybe_1 v42 = mw_std_list_Nest_1_singlezy(v41);
	struct mirth_mirth_zaMirth* branch_zaMirth_43;
	uint64_t branch_Token_44;
	VAL branch_zux1_45;
	VAL branch_zux2_46;
	switch ((v42).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v47 = mtp_std_maybe_Maybe_1_Some(v42);
			branch_zux2_46 = v47;
			branch_zux1_45 = branch_zux2_34;
			branch_Token_44 = branch_Token_32;
			branch_zaMirth_43 = branch_zaMirth_31;
		} break;
		case std_maybe_Maybe_1_None: {
			decref(branch_zux2_34);
			STR* v48;
			STRLIT(v48, "Expected module name. (3)", 25);
			mw_mirth_mirth_zaMirth_emitzefatalzeerrorzx(branch_zaMirth_31, branch_Token_32, v48);
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	struct mirth_mirth_zaMirth* v53;
	uint64_t v54 = mw_mirth_package_Package_FindzeOrzeNewzx(branch_zaMirth_43, V_mirth_name_Name(branch_zux1_45), &v53);
	*out_Name_5 = V_mirth_name_Name(branch_zux2_46);
	*out_zaMirth_3 = v53;
	return v54;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %r12
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
leaq -0x58(%rbp), %rdx
callq 0x24b09
movl %eax, %r14d
movq %rdx, %rax
andq %rbx, %rax
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x81058
decl (%rax)
jne 0x81058
movq %r14, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0x8726e(%rip), %rsi     # 0x1082c1
callq 0xce94
movq %r14, %rdi
callq 0xd86d
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0xd759
testb %al, %al
jne 0x81237
movq %r15, -0x70(%rbp)
movq -0x58(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %r12, %rsi
callq 0x2b16d
cmpl $0x1, %eax
jne 0x81274
movq %rdx, %rdi
callq 0xd491
movq %rax, %r15
movq %rdx, %r14
movq -0x50(%rbp), %rdi
leaq -0x48(%rbp), %rdx
movq %r12, -0x38(%rbp)
movq %r12, %rsi
callq 0x24a81
testb $0x1, %r14b
je 0x810ce
movq %r15, %rax
andq %rbx, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x810ce
incl (%rax)
movq %r13, -0x40(%rbp)
movq %rbx, -0x30(%rbp)
movq %r15, %rdi
callq 0x2b953
cmpl $0x1, %eax
jne 0x811a4
movq %rdx, %rdi
callq 0xd491
movq %rax, %r12
movq %rdx, %r14
movq -0x48(%rbp), %rbx
movq %r15, %rdi
callq 0x2a325
leaq -0x68(%rbp), %rsi
leaq -0x80(%rbp), %r15
movq %rax, %rdi
movq %r15, %rdx
callq 0xe953
movl (%r15), %edi
movq 0x8(%r15), %rsi
callq 0xeb14
testb %al, %al
je 0x812b7
leaq -0x68(%rbp), %r14
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x8d0c
movq %rdx, %rdi
callq 0xd491
movq %rax, %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x7b5ab
testl %eax, %eax
movq -0x70(%rbp), %r15
je 0x81170
cmpl $0x1, %eax
jne 0x81220
movq %rdx, %rdi
callq 0xd491
movq -0x68(%rbp), %rcx
jmp 0x8118a
movq -0x68(%rbp), %rdi
leaq -0x80(%rbp), %r14
xorl %esi, %esi
xorl %edx, %edx
movq %r12, %rcx
movq %r14, %r8
callq 0x7b9a3
movq (%r14), %rcx
movq -0x40(%rbp), %r12
movq %r13, (%r15)
movq %rcx, (%r12)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0x81220
testb $0x1, %r14b
je 0x811db
movq %r15, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x811db
decl (%rax)
jne 0x811db
movq %r15, %rdi
movq %r14, %rsi
callq 0xce94
movq 0x108c566(%rip), %rdx   # 0x110d748
testq %rdx, %rdx
jne 0x81200
leaq 0x5bda8(%rip), %rdi     # 0xdcf96
pushq $0x2d
popq %rsi
callq 0x8a21
movq %rax, %rdx
movq %rax, 0x108c548(%rip)   # 0x110d748
andq %rdx, -0x30(%rbp)
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x81217
movq -0x30(%rbp), %rax
incl (%rax)
movq -0x48(%rbp), %rdi
jmp 0x8135e
leaq 0x535e6(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6
movq 0x108c4fa(%rip), %rdx   # 0x110d738
testq %rdx, %rdx
jne 0x8125c
leaq 0x5bce2(%rip), %rdi     # 0xdcf2c
pushq $0x15
popq %rsi
callq 0x8a21
movq %rax, %rdx
movq %rax, 0x108c4dc(%rip)   # 0x110d738
andq %rdx, %rbx
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x8126e
incl (%rbx)
movq -0x58(%rbp), %rdi
jmp 0x812af
movq 0x108c4c5(%rip), %rdx   # 0x110d740
testq %rdx, %rdx
jne 0x81299
leaq 0x5bcbb(%rip), %rdi     # 0xdcf42
pushq $0x53
popq %rsi
callq 0x8a21
movq %rax, %rdx
movq %rax, 0x108c4a7(%rip)   # 0x110d740
andq %rdx, %rbx
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x812ab
incl (%rbx)
movq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x246fe
movq -0x60(%rbp), %rsi
testb $0x1, %sil
je 0x812ec
movq -0x68(%rbp), %rdi
movq %rdi, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x812ec
decl (%rax)
jne 0x812ec
callq 0xce94
testb $0x1, %r14b
je 0x8131f
movq %r12, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %r12b
setne %dl
orb %cl, %dl
jne 0x8131f
decl (%rax)
jne 0x8131f
movq %r12, %rdi
movq %r14, %rsi
callq 0xce94
movq 0x108c42a(%rip), %rdx   # 0x110d750
testq %rdx, %rdx
jne 0x81344
leaq 0x5bc92(%rip), %rdi     # 0xdcfc4
pushq $0x19
popq %rsi
callq 0x8a21
movq %rax, %rdx
movq %rax, 0x108c40c(%rip)   # 0x110d750
andq %rdx, -0x30(%rbp)
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x8135b
movq -0x30(%rbp), %rax
incl (%rax)
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
callq 0x246fe