// File: /workspace/github_c_makefile_star2_O3/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 0x3e29c
movq %rdx, %rdi
movl %eax, %eax
leaq 0x9e5da(%rip), %rcx     # 0xdebac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x3e10c
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rcx
jmp 0x40827
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
callq 0x3e1a0
movq %rdx, %rcx
andq %r13, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x4062c
decl (%rcx)
jne 0x4062c
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xd14c5(%rip), %rsi     # 0x111ae9
movq %rax, %rdi
callq 0xd13d
movq 0x10d5345(%rip), %r12   # 0x1115978
testq %r12, %r12
jne 0x4066a
movl $0x1c, %edi
callq 0xf5e4
movq %rax, %r12
movq $0x1c, 0x10(%rax)
movups 0xa4dd1(%rip), %xmm0    # 0xe5425
movups %xmm0, 0x18(%rax)
movups 0xa4dd2(%rip), %xmm0    # 0xe5431
movups %xmm0, 0x24(%rax)
movq %rax, 0x10d530e(%rip)   # 0x1115978
andq %r12, %r13
sete %al
testb $0x3, %r12b
setne %cl
orb %al, %cl
jne 0x4067f
incl (%r13)
movq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %r13
movq %r15, %rsi
movq %r13, %rdx
callq 0x1b59d
movq (%r13), %rdi
leaq -0x48(%rbp), %r15
movq %rax, %rsi
movq %r12, %rdx
movl $0x2, %ecx
movq %r15, %r8
callq 0x1bc32
movq (%r15), %rcx
xorl %eax, %eax
movq -0x30(%rbp), %rsi
jmp 0x40825
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
leaq -0x50(%rbp), %rsi
callq 0x3e1e0
movq %rdx, %rcx
andq %r13, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x406fe
decl (%rcx)
jne 0x406fe
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xd13f3(%rip), %rsi     # 0x111ae9
movq %rax, %rdi
callq 0xd13d
movq 0x10d527b(%rip), %r12   # 0x1115980
testq %r12, %r12
jne 0x407d9
movl $0x25, %edi
callq 0xf5e4
movq %rax, %r12
movq $0x25, 0x10(%rax)
movabsq $0x2e656372756f7365, %rax # imm = 0x2E656372756F7365
movq %rax, 0x35(%r12)
movups 0xa4d09(%rip), %xmm0    # 0xe5442
movups %xmm0, 0x18(%r12)
movups 0xa4d0c(%rip), %xmm0    # 0xe5452
movups %xmm0, 0x28(%r12)
movq %r12, 0x10d522d(%rip)   # 0x1115980
jmp 0x407d9
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
leaq -0x50(%rbp), %rsi
callq 0x3e14c
movq %rdx, %rcx
andq %r13, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x4079b
decl (%rcx)
jne 0x4079b
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xd1356(%rip), %rsi     # 0x111ae9
movq %rax, %rdi
callq 0xd13d
movq 0x10d51ce(%rip), %r12   # 0x1115970
testq %r12, %r12
jne 0x407d9
movl $0x19, %edi
callq 0xf5e4
movq %rax, %r12
movq $0x19, 0x10(%rax)
movups 0xa4c48(%rip), %xmm0    # 0xe540b
movups %xmm0, 0x18(%rax)
movups 0xa4c46(%rip), %xmm0    # 0xe5414
movups %xmm0, 0x21(%rax)
movq %rax, 0x10d5197(%rip)   # 0x1115970
andq %r12, %r13
sete %al
testb $0x3, %r12b
setne %cl
orb %al, %cl
jne 0x407ee
incl (%r13)
movq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %r13
movq %r15, %rsi
movq %r13, %rdx
callq 0x1b59d
movq (%r13), %rdi
leaq -0x48(%rbp), %r15
movq %rax, %rsi
movq %r12, %rdx
movl $0x2, %ecx
movq %r15, %r8
callq 0x1bc32
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