// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movabsq $0xfffffffffffc, %r12   # imm = 0xFFFFFFFFFFFC
leaq -0x60(%rbp), %rdx
callq 0x27bd7
movl %eax, %r14d
movq %rdx, %rax
andq %r12, %rax
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x8aa36
decl (%rax)
jne 0x8aa36
movq %r14, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0x8a890(%rip), %rsi     # 0x1152c1
callq 0xd4e3
leaq 0x1(,%r14,2), %rdi
movl $0x1, %esi
callq 0xec04
testl %eax, %eax
je 0x8ac91
movq %r15, -0x68(%rbp)
movq -0x60(%rbp), %rdi
leaq -0x58(%rbp), %rdx
movq %rbx, %rsi
callq 0x2e704
cmpl $0x1, %eax
jne 0x8acf1
movq %rdx, %rdi
callq 0xdaeb
movq %rax, %r15
movq %rdx, %r14
movq -0x58(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %rbx, %rsi
callq 0x27b3d
testb $0x1, %r14b
je 0x8aaa7
movq %r15, %rax
andq %r12, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x8aaa7
incl (%rax)
movq %r13, -0x48(%rbp)
movq %r12, -0x30(%rbp)
movq %r15, %rdi
callq 0x2ee4d
cmpl $0x1, %eax
jne 0x8abbb
movq %rdx, %rdi
callq 0xdaeb
movq %rax, %r13
movq %rdx, %r14
movq -0x50(%rbp), %r12
movq %r15, %rdi
callq 0x2d8fc
leaq -0x40(%rbp), %rsi
leaq -0x78(%rbp), %r15
movq %rax, %rdi
movq %r15, %rdx
callq 0xf694
movl (%r15), %edi
movq 0x8(%r15), %rsi
callq 0xf834
movl %eax, %r15d
testb %al, %al
je 0x8ab12
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x95f6
movq %rdx, %rdi
jmp 0x8ab49
movq -0x38(%rbp), %rsi
testb $0x1, %sil
je 0x8ab47
movq -0x40(%rbp), %rdi
movq %rdi, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x8ab47
decl (%rax)
jne 0x8ab47
callq 0xd4e3
xorl %edi, %edi
testb %r15b, %r15b
je 0x8ad50
callq 0xdaeb
movq %rax, %rbx
leaq -0x40(%rbp), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x84d1d
testl %eax, %eax
movq -0x68(%rbp), %r15
je 0x8ab88
cmpl $0x1, %eax
jne 0x8ac61
movq %rdx, %rdi
callq 0xdaeb
movq -0x40(%rbp), %rcx
jmp 0x8aba2
movq -0x40(%rbp), %rdi
leaq -0x78(%rbp), %r14
xorl %esi, %esi
xorl %edx, %edx
movq %r13, %rcx
movq %r14, %r8
callq 0x85204
movq (%r14), %rcx
movq -0x48(%rbp), %rdx
movq %rbx, (%r15)
movq %rcx, (%rdx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0x8ac61
testb $0x1, %r14b
je 0x8abf6
movq %r15, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x8abf6
decl (%rax)
jne 0x8abf6
movq %r15, %rdi
movq %r14, %rsi
callq 0xd4e3
cmpq $0x0, 0x108fb42(%rip)   # 0x111a740
jne 0x8ac3a
movl $0x2d, %edi
callq 0xf9f7
movq $0x2d, 0x10(%rax)
movups 0x622a6(%rip), %xmm0    # 0xecebf
movups %xmm0, 0x18(%rax)
movups 0x622ab(%rip), %xmm0    # 0xececf
movups %xmm0, 0x28(%rax)
movups 0x622ad(%rip), %xmm0    # 0xecedc
movups %xmm0, 0x35(%rax)
movq %rax, 0x108fb06(%rip)   # 0x111a740
movq 0x108faff(%rip), %rdx   # 0x111a740
andq %rdx, -0x30(%rbp)
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x8ac58
movq -0x30(%rbp), %rax
incl (%rax)
movq -0x50(%rbp), %rdi
jmp 0x8addd
movl $0x20, %edi
callq 0xf9f7
movq $0x20, 0x10(%rax)
movups 0x59ad3(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0x59ad8(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5
cmpq $0x0, 0x108fa97(%rip)   # 0x111a730
jne 0x8accd
movl $0x15, %edi
callq 0xf9f7
movq $0x15, 0x10(%rax)
movabsq $0x2e656d616e20656c, %rcx # imm = 0x2E656D616E20656C
movq %rcx, 0x25(%rax)
movups 0x62193(%rip), %xmm0    # 0xece55
movups %xmm0, 0x18(%rax)
movq %rax, 0x108fa63(%rip)   # 0x111a730
movq 0x108fa5c(%rip), %rdx   # 0x111a730
andq %rdx, %r12
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x8ace8
incl (%r12)
movq -0x60(%rbp), %rdi
jmp 0x8addd
cmpq $0x0, 0x108fa3f(%rip)   # 0x111a738
jne 0x8ad2c
movl $0x53, %edi
callq 0xf9f7
movq %rax, %r14
movq $0x53, 0x10(%rax)
leaq 0x18(%rax), %rdi
leaq 0x62150(%rip), %rsi     # 0xece6b
movl $0x53, %edx
callq 0x50e0
movq %r14, 0x108fa0c(%rip)   # 0x111a738
movq 0x108fa05(%rip), %rdx   # 0x111a738
andq %rdx, %r12
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x8ad47
incl (%r12)
movq -0x58(%rbp), %rdi
jmp 0x8addd
testb $0x1, %r14b
je 0x8ad83
movq %r13, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x8ad83
decl (%rax)
jne 0x8ad83
movq %r13, %rdi
movq %r14, %rsi
callq 0xd4e3
cmpq $0x0, 0x108f9bd(%rip)   # 0x111a748
jne 0x8adbc
movl $0x19, %edi
callq 0xf9f7
movq $0x19, 0x10(%rax)
movups 0x62147(%rip), %xmm0    # 0xeceed
movups %xmm0, 0x18(%rax)
movups 0x62145(%rip), %xmm0    # 0xecef6
movups %xmm0, 0x21(%rax)
movq %rax, 0x108f98c(%rip)   # 0x111a748
movq 0x108f985(%rip), %rdx   # 0x111a748
andq %rdx, -0x30(%rbp)
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x8adda
movq -0x30(%rbp), %rax
incl (%rax)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2778c