// File: /workspace/github_c_makefile_star2_O0/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_zaTypeElab_elabzeresourcezeargzx
static struct mirth_type_Type mw_mirth_elab_zaTypeElab_elabzeresourcezeargzx (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_Resource_12;
	switch ((v9).tag) {
		case mirth_type_StackTypePart_Cons: {
			struct mirth_type_Type v13 = mtp_mirth_type_StackTypePart_Cons(v9);
			decref(MK_mirth_type_Type(v13));
			STR* v14;
			STRLIT(v14, "Expected resource, not type.", 28);
			struct mirth_mirth_zaMirth* v15;
			mw_mirth_mirth_zaMirth_emitzeerrorzx(v7, v6, v14, &v15);
			struct mirth_type_Type v16 = { .tag=mirth_type_Type_Error };
			branch_Resource_12 = v16;
			branch_zaTypeElab_11 = v8;
			branch_zaMirth_10 = v15;
		} break;
		case mirth_type_StackTypePart_ConsLabel: {
			uint64_t v17;
			struct mirth_type_Type v18 = mtp_mirth_type_StackTypePart_ConsLabel(v9, &v17);
			decref(MK_mirth_type_Type(v18));
			STR* v19;
			STRLIT(v19, "Expected resource, not label.", 29);
			struct mirth_mirth_zaMirth* v20;
			mw_mirth_mirth_zaMirth_emitzeerrorzx(v7, v6, v19, &v20);
			struct mirth_type_Type v21 = { .tag=mirth_type_Type_Error };
			branch_Resource_12 = v21;
			branch_zaTypeElab_11 = v8;
			branch_zaMirth_10 = v20;
		} break;
		case mirth_type_StackTypePart_With: {
			struct mirth_type_Type v22 = mtp_mirth_type_StackTypePart_With(v9);
			branch_Resource_12 = v22;
			branch_zaTypeElab_11 = v8;
			branch_zaMirth_10 = v7;
		} 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 resource, not label.", 29);
			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_Resource_12 = v27;
			branch_zaTypeElab_11 = v8;
			branch_zaMirth_10 = v26;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	uint64_t v28 = branch_zaTypeElab_11->mtoken;
	struct mirth_mirth_zaMirth* v29;
	bool v30 = mw_mirth_token_Token_argzeendzy(branch_zaMirth_10, v28, &v29);
	struct mirth_mirth_zaMirth* branch_zaMirth_31;
	struct mirth_elab_zaTypeElab* branch_zaTypeElab_32;
	if (v30) {
		branch_zaTypeElab_32 = branch_zaTypeElab_11;
		branch_zaMirth_31 = v29;
	} else {
		uint64_t v33 = branch_zaTypeElab_11->mtoken;
		STR* v34;
		STRLIT(v34, "Unexpected token after resource.", 32);
		struct mirth_mirth_zaMirth* v35;
		mw_mirth_mirth_zaMirth_emitzeerrorzx(v29, v33, v34, &v35);
		branch_zaTypeElab_32 = branch_zaTypeElab_11;
		branch_zaMirth_31 = v35;
	}
	*out_zaTypeElab_4 = branch_zaTypeElab_32;
	*out_zaMirth_3 = branch_zaMirth_31;
	return branch_Resource_12;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %rcx
callq 0xcf620
movl %eax, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movl -0x58(%rbp), %eax
movq %rax, -0x350(%rbp)
subq $0x3, %rax
ja 0xd3082
movq -0x350(%rbp), %rax
leaq 0x27f60f(%rip), %rcx    # 0x351ea4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x58(%rbp), %edi
movq -0x50(%rbp), %rsi
callq 0xcf110
movl %eax, -0x78(%rbp)
movq %rdx, -0x70(%rbp)
movl -0x78(%rbp), %edi
movq -0x70(%rbp), %rsi
callq 0x6e780
movq %rax, -0x88(%rbp)
movq %rdx, -0x80(%rbp)
movq -0x80(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xd29a0
movl -0x78(%rbp), %edi
movq -0x70(%rbp), %rsi
callq 0x6e780
movq %rax, -0x98(%rbp)
movq %rdx, -0x90(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x98(%rbp), %rax
cmpq $0x0, %rax
je 0xd29a0
movl -0x78(%rbp), %edi
movq -0x70(%rbp), %rsi
callq 0x6e780
movq %rax, -0xa8(%rbp)
movq %rdx, -0xa0(%rbp)
movq -0xa8(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0xd29a0
movl -0x78(%rbp), %edi
movq -0x70(%rbp), %rsi
callq 0x6e780
movq %rax, -0xb8(%rbp)
movq %rdx, -0xb0(%rbp)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq -0xb8(%rbp), %rcx
movl (%rcx), %eax
addl $-0x1, %eax
movl %eax, (%rcx)
cmpl $0x0, %eax
jne 0xd299e
movl -0x78(%rbp), %edi
movq -0x70(%rbp), %rsi
callq 0x6e780
movq %rax, -0xc8(%rbp)
movq %rdx, -0xc0(%rbp)
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x127c0
jmp 0xd29a0
jmp 0xd29a2
jmp 0xd29a4
cmpq $0x0, 0x12c30dc(%rip)   # 0x1395a88
jne 0xd29c6
leaq 0x286445(%rip), %rdi    # 0x358dfa
movl $0x1c, %esi
callq 0xb6c0
movq %rax, 0x12c30c2(%rip)   # 0x1395a88
jmp 0xd29c8
movq 0x12c30b9(%rip), %rax   # 0x1395a88
movq %rax, -0xe0(%rbp)
leaq 0x2be77b(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xd2a9d
movq 0x12c3084(%rip), %rax   # 0x1395a88
movq %rax, -0xf0(%rbp)
leaq 0x2be746(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0xe8(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0xf0(%rbp), %rax
cmpq $0x0, %rax
je 0xd2a9d
movq 0x12c304d(%rip), %rax   # 0x1395a88
movq %rax, -0x100(%rbp)
leaq 0x2be70f(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0xf8(%rbp)
movq -0x100(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0xd2a9d
movq 0x12c301c(%rip), %rax   # 0x1395a88
movq %rax, -0x110(%rbp)
leaq 0x2be6de(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x108(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x110(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd2a9f
movq 0x12c2fe2(%rip), %rax   # 0x1395a88
movq %rax, -0xd0(%rbp)
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0xd0(%rbp), %rdx
leaq -0x118(%rbp), %rcx
callq 0x98c50
leaq -0x128(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5080
movq -0x128(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0xd309b
movl -0x58(%rbp), %edi
movq -0x50(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0xcf210
movl %eax, -0x140(%rbp)
movq %rdx, -0x138(%rbp)
movl -0x140(%rbp), %edi
movq -0x138(%rbp), %rsi
callq 0x6e780
movq %rax, -0x150(%rbp)
movq %rdx, -0x148(%rbp)
movq -0x148(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xd2c3c
movl -0x140(%rbp), %edi
movq -0x138(%rbp), %rsi
callq 0x6e780
movq %rax, -0x160(%rbp)
movq %rdx, -0x158(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x160(%rbp), %rax
cmpq $0x0, %rax
je 0xd2c3c
movl -0x140(%rbp), %edi
movq -0x138(%rbp), %rsi
callq 0x6e780
movq %rax, -0x170(%rbp)
movq %rdx, -0x168(%rbp)
movq -0x170(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0xd2c3c
movl -0x140(%rbp), %edi
movq -0x138(%rbp), %rsi
callq 0x6e780
movq %rax, -0x180(%rbp)
movq %rdx, -0x178(%rbp)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq -0x180(%rbp), %rcx
movl (%rcx), %eax
addl $-0x1, %eax
movl %eax, (%rcx)
cmpl $0x0, %eax
jne 0xd2c3a
movl -0x140(%rbp), %edi
movq -0x138(%rbp), %rsi
callq 0x6e780
movq %rax, -0x190(%rbp)
movq %rdx, -0x188(%rbp)
movq -0x190(%rbp), %rdi
movq -0x188(%rbp), %rsi
callq 0x127c0
jmp 0xd2c3c
jmp 0xd2c3e
jmp 0xd2c40
cmpq $0x0, 0x12c2e48(%rip)   # 0x1395a90
jne 0xd2c62
leaq 0x2861c6(%rip), %rdi    # 0x358e17
movl $0x1d, %esi
callq 0xb6c0
movq %rax, 0x12c2e2e(%rip)   # 0x1395a90
jmp 0xd2c64
movq 0x12c2e25(%rip), %rax   # 0x1395a90
movq %rax, -0x1a8(%rbp)
leaq 0x2be4df(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xd2d39
movq 0x12c2df0(%rip), %rax   # 0x1395a90
movq %rax, -0x1b8(%rbp)
leaq 0x2be4aa(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x1b0(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x1b8(%rbp), %rax
cmpq $0x0, %rax
je 0xd2d39
movq 0x12c2db9(%rip), %rax   # 0x1395a90
movq %rax, -0x1c8(%rbp)
leaq 0x2be473(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x1c0(%rbp)
movq -0x1c8(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0xd2d39
movq 0x12c2d88(%rip), %rax   # 0x1395a90
movq %rax, -0x1d8(%rbp)
leaq 0x2be442(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x1d0(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x1d8(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd2d3b
movq 0x12c2d4e(%rip), %rax   # 0x1395a90
movq %rax, -0x198(%rbp)
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x198(%rbp), %rdx
leaq -0x1e0(%rbp), %rcx
callq 0x98c50
leaq -0x1f0(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5080
movq -0x1f0(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x1e8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0xd309b
movl -0x58(%rbp), %edi
movq -0x50(%rbp), %rsi
callq 0xcf330
movl %eax, -0x200(%rbp)
movq %rdx, -0x1f8(%rbp)
movq -0x200(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0xd309b
movl -0x58(%rbp), %edi
movq -0x50(%rbp), %rsi
leaq -0x208(%rbp), %rdx
callq 0xcf430
movl %eax, -0x218(%rbp)
movq %rdx, -0x210(%rbp)
movl -0x218(%rbp), %edi
movq -0x210(%rbp), %rsi
callq 0x6e780
movq %rax, -0x228(%rbp)
movq %rdx, -0x220(%rbp)
movq -0x220(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xd2f1c
movl -0x218(%rbp), %edi
movq -0x210(%rbp), %rsi
callq 0x6e780
movq %rax, -0x238(%rbp)
movq %rdx, -0x230(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x238(%rbp), %rax
cmpq $0x0, %rax
je 0xd2f1c
movl -0x218(%rbp), %edi
movq -0x210(%rbp), %rsi
callq 0x6e780
movq %rax, -0x248(%rbp)
movq %rdx, -0x240(%rbp)
movq -0x248(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0xd2f1c
movl -0x218(%rbp), %edi
movq -0x210(%rbp), %rsi
callq 0x6e780
movq %rax, -0x258(%rbp)
movq %rdx, -0x250(%rbp)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq -0x258(%rbp), %rcx
movl (%rcx), %eax
addl $-0x1, %eax
movl %eax, (%rcx)
cmpl $0x0, %eax
jne 0xd2f1a
movl -0x218(%rbp), %edi
movq -0x210(%rbp), %rsi
callq 0x6e780
movq %rax, -0x268(%rbp)
movq %rdx, -0x260(%rbp)
movq -0x268(%rbp), %rdi
movq -0x260(%rbp), %rsi
callq 0x127c0
jmp 0xd2f1c
jmp 0xd2f1e
jmp 0xd2f20
cmpq $0x0, 0x12c2b70(%rip)   # 0x1395a98
jne 0xd2f42
leaq 0x285ee6(%rip), %rdi    # 0x358e17
movl $0x1d, %esi
callq 0xb6c0
movq %rax, 0x12c2b56(%rip)   # 0x1395a98
jmp 0xd2f44
movq 0x12c2b4d(%rip), %rax   # 0x1395a98
movq %rax, -0x280(%rbp)
leaq 0x2be1ff(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xd3019
movq 0x12c2b18(%rip), %rax   # 0x1395a98
movq %rax, -0x290(%rbp)
leaq 0x2be1ca(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x288(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x290(%rbp), %rax
cmpq $0x0, %rax
je 0xd3019
movq 0x12c2ae1(%rip), %rax   # 0x1395a98
movq %rax, -0x2a0(%rbp)
leaq 0x2be193(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x298(%rbp)
movq -0x2a0(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0xd3019
movq 0x12c2ab0(%rip), %rax   # 0x1395a98
movq %rax, -0x2b0(%rbp)
leaq 0x2be162(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x2a8(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x2b0(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd301b
movq 0x12c2a76(%rip), %rax   # 0x1395a98
movq %rax, -0x270(%rbp)
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x270(%rbp), %rdx
leaq -0x2b8(%rbp), %rcx
callq 0x98c50
leaq -0x2c8(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5080
movq -0x2c8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x2c0(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x2b8(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0xd309b
leaq 0x280df8(%rip), %rdi    # 0x353e81
movl $0x20, %esi
callq 0xb6c0
movq %rax, %rdi
callq 0xc620
movq -0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x2d0(%rbp)
movq -0x60(%rbp), %rdi
movq -0x2d0(%rbp), %rsi
leaq -0x2d8(%rbp), %rdx
callq 0x7b320
andb $0x1, %al
movb %al, -0x2d9(%rbp)
testb $0x1, -0x2d9(%rbp)
je 0xd30f0
movq -0x68(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq -0x2d8(%rbp), %rax
movq %rax, -0x2e8(%rbp)
jmp 0xd3242
movq -0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x2f8(%rbp)
cmpq $0x0, 0x12c2999(%rip)   # 0x1395aa0
jne 0xd3121
leaq 0x285d25(%rip), %rdi    # 0x358e35
movl $0x20, %esi
callq 0xb6c0
movq %rax, 0x12c297f(%rip)   # 0x1395aa0
jmp 0xd3123
movq 0x12c2976(%rip), %rax   # 0x1395aa0
movq %rax, -0x310(%rbp)
leaq 0x2be020(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x308(%rbp)
movq -0x308(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xd31f8
movq 0x12c2941(%rip), %rax   # 0x1395aa0
movq %rax, -0x320(%rbp)
leaq 0x2bdfeb(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x318(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x320(%rbp), %rax
cmpq $0x0, %rax
je 0xd31f8
movq 0x12c290a(%rip), %rax   # 0x1395aa0
movq %rax, -0x330(%rbp)
leaq 0x2bdfb4(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x328(%rbp)
movq -0x330(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0xd31f8
movq 0x12c28d9(%rip), %rax   # 0x1395aa0
movq %rax, -0x340(%rbp)
leaq 0x2bdf83(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x338(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x340(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd31fa
movq 0x12c289f(%rip), %rax   # 0x1395aa0
movq %rax, -0x300(%rbp)
movq -0x2d8(%rbp), %rdi
movq -0x2f8(%rbp), %rsi
movq -0x300(%rbp), %rdx
leaq -0x348(%rbp), %rcx
callq 0x98c50
movq -0x68(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq -0x348(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movq -0x2f0(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x2e8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rdx
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
nop