// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_zaTypeElab_elabzetypezeatomzx
static struct mirth_type_Type mw_mirth_elab_zaTypeElab_elabzetypezeatomzx (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_elab_zaTypeElab* in_zaTypeElab_2, struct mirth_mirth_zaMirth* *out_zaMirth_3, struct mirth_elab_zaTypeElab* *out_zaTypeElab_4) {
	uint64_t v6 = in_zaTypeElab_2->mtoken;
	struct mirth_mirth_zaMirth* v7;
	struct mirth_elab_zaTypeElab* v8;
	struct mirth_type_StackTypePart v9 = mw_mirth_elab_zaTypeElab_elabzestackzetypezepartzx(in_zaMirth_1, in_zaTypeElab_2, &v7, &v8);
	struct mirth_mirth_zaMirth* branch_zaMirth_10;
	struct mirth_elab_zaTypeElab* branch_zaTypeElab_11;
	struct mirth_type_Type branch_Type_12;
	switch ((v9).tag) {
		case mirth_type_StackTypePart_Cons: {
			struct mirth_type_Type v13 = mtp_mirth_type_StackTypePart_Cons(v9);
			branch_Type_12 = v13;
			branch_zaTypeElab_11 = v8;
			branch_zaMirth_10 = v7;
		} break;
		case mirth_type_StackTypePart_ConsLabel: {
			uint64_t v14;
			struct mirth_type_Type v15 = mtp_mirth_type_StackTypePart_ConsLabel(v9, &v14);
			decref(MK_mirth_type_Type(v15));
			STR* v16;
			STRLIT(v16, "Expected type, not label.", 25);
			struct mirth_mirth_zaMirth* v17;
			mw_mirth_mirth_zaMirth_emitzeerrorzx(v7, v6, v16, &v17);
			struct mirth_type_Type v18 = { .tag=mirth_type_Type_Error };
			branch_Type_12 = v18;
			branch_zaTypeElab_11 = v8;
			branch_zaMirth_10 = v17;
		} break;
		case mirth_type_StackTypePart_With: {
			struct mirth_type_Type v19 = mtp_mirth_type_StackTypePart_With(v9);
			decref(MK_mirth_type_Type(v19));
			STR* v20;
			STRLIT(v20, "Expected type, not resource.", 28);
			struct mirth_mirth_zaMirth* v21;
			mw_mirth_mirth_zaMirth_emitzeerrorzx(v7, v6, v20, &v21);
			struct mirth_type_Type v22 = { .tag=mirth_type_Type_Error };
			branch_Type_12 = v22;
			branch_zaTypeElab_11 = v8;
			branch_zaMirth_10 = v21;
		} break;
		case mirth_type_StackTypePart_WithLabel: {
			uint64_t v23;
			struct mirth_type_Type v24 = mtp_mirth_type_StackTypePart_WithLabel(v9, &v23);
			decref(MK_mirth_type_Type(v24));
			STR* v25;
			STRLIT(v25, "Expected type, not labelled resource.", 37);
			struct mirth_mirth_zaMirth* v26;
			mw_mirth_mirth_zaMirth_emitzeerrorzx(v7, v6, v25, &v26);
			struct mirth_type_Type v27 = { .tag=mirth_type_Type_Error };
			branch_Type_12 = v27;
			branch_zaTypeElab_11 = v8;
			branch_zaMirth_10 = v26;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_zaTypeElab_4 = branch_zaTypeElab_11;
	*out_zaMirth_3 = branch_zaMirth_10;
	return branch_Type_12;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq 0x10(%rsi), %r15
leaq -0x38(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x3f5e3
movq %rdx, %rdi
movl %eax, %eax
leaq 0xa1222(%rip), %rcx     # 0xe2b98
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x3f453
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rcx
jmp 0x41bc8
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
callq 0x3f4e7
movq %rdx, %rcx
andq %r13, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x419d0
decl (%rcx)
jne 0x419d0
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xd4121(%rip), %rsi     # 0x115ae9
movq %rax, %rdi
callq 0xd4e3
cmpq $0x0, 0x10d7fa0(%rip)   # 0x1119978
jne 0x41a09
movl $0x1c, %edi
callq 0xf9f7
movq $0x1c, 0x10(%rax)
movups 0xa7b63(%rip), %xmm0    # 0xe9556
movups %xmm0, 0x18(%rax)
movups 0xa7b64(%rip), %xmm0    # 0xe9562
movups %xmm0, 0x24(%rax)
movq %rax, 0x10d7f6f(%rip)   # 0x1119978
movq 0x10d7f68(%rip), %r12   # 0x1119978
andq %r12, %r13
sete %al
testb $0x3, %r12b
setne %cl
orb %al, %cl
jne 0x41a25
incl (%r13)
movq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %r13
movq %r15, %rsi
movq %r13, %rdx
callq 0x1b861
movq (%r13), %rdi
leaq -0x48(%rbp), %r15
movq %rax, %rsi
movq %r12, %rdx
movl $0x2, %ecx
movq %r15, %r8
callq 0x1bf3a
movq (%r15), %rcx
xorl %eax, %eax
movq -0x30(%rbp), %rsi
jmp 0x41bc6
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
leaq -0x50(%rbp), %rsi
callq 0x3f527
movq %rdx, %rcx
andq %r13, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x41aa4
decl (%rcx)
jne 0x41aa4
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xd404d(%rip), %rsi     # 0x115ae9
movq %rax, %rdi
callq 0xd4e3
cmpq $0x0, 0x10d7ed4(%rip)   # 0x1119980
jne 0x41aeb
movl $0x25, %edi
callq 0xf9f7
movq $0x25, 0x10(%rax)
movabsq $0x2e656372756f7365, %rcx # imm = 0x2E656372756F7365
movq %rcx, 0x35(%rax)
movups 0xa7a9e(%rip), %xmm0    # 0xe9573
movups %xmm0, 0x18(%rax)
movups 0xa7aa3(%rip), %xmm0    # 0xe9583
movups %xmm0, 0x28(%rax)
movq %rax, 0x10d7e95(%rip)   # 0x1119980
movq 0x10d7e8e(%rip), %r12   # 0x1119980
jmp 0x41b7a
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
leaq -0x50(%rbp), %rsi
callq 0x3f493
movq %rdx, %rcx
andq %r13, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x41b3a
decl (%rcx)
jne 0x41b3a
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xd3fb7(%rip), %rsi     # 0x115ae9
movq %rax, %rdi
callq 0xd4e3
cmpq $0x0, 0x10d7e2e(%rip)   # 0x1119970
jne 0x41b73
movl $0x19, %edi
callq 0xf9f7
movq $0x19, 0x10(%rax)
movups 0xa79df(%rip), %xmm0    # 0xe953c
movups %xmm0, 0x18(%rax)
movups 0xa79dd(%rip), %xmm0    # 0xe9545
movups %xmm0, 0x21(%rax)
movq %rax, 0x10d7dfd(%rip)   # 0x1119970
movq 0x10d7df6(%rip), %r12   # 0x1119970
andq %r12, %r13
sete %al
testb $0x3, %r12b
setne %cl
orb %al, %cl
jne 0x41b8f
incl (%r13)
movq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %r13
movq %r15, %rsi
movq %r13, %rdx
callq 0x1b861
movq (%r13), %rdi
leaq -0x48(%rbp), %r15
movq %rax, %rsi
movq %r12, %rdx
movl $0x2, %ecx
movq %r15, %r8
callq 0x1bf3a
movq (%r15), %rcx
movq -0x30(%rbp), %rsi
xorl %eax, %eax
xorl %edx, %edx
movq %rsi, (%r14)
movq %rcx, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq