// File: /workspace/github_c_makefile_star2_O0/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_mirth_zaMirth_resolvezeowner
static struct mirth_table_StateOwner mw_mirth_mirth_zaMirth_resolvezeowner (struct mirth_mirth_zaMirth* in_zaMirth_1, struct std_maybe_Maybe_1 in_Maybe_2, struct mirth_mirth_zaMirth* *out_zaMirth_3) {
	struct mirth_mirth_zaMirth* branch_zaMirth_5;
	struct mirth_table_StateOwner branch_StateOwner_6;
	switch ((in_Maybe_2).tag) {
		case std_maybe_Maybe_1_None: {
			struct mirth_table_StateOwner v7 = { .tag=mirth_table_StateOwner_Default };
			branch_StateOwner_6 = v7;
			branch_zaMirth_5 = in_zaMirth_1;
		} break;
		case std_maybe_Maybe_1_Some: {
			VAL v8 = mtp_std_maybe_Maybe_1_Some(in_Maybe_2);
			struct mirth_elab_zaTypeElab* v9;
			mw_mirth_elab_zaTypeElab_Startzx(V_mirth_token_Token(v8), &v9);
			uint64_t v10 = v9->mtoken;
			struct mirth_mirth_zaMirth* v11;
			struct std_maybe_Maybe_1 v12 = mw_mirth_token_Token_sigzeresourcezeconzy(in_zaMirth_1, v10, &v11);
			struct mirth_mirth_zaMirth* branch_zaMirth_13;
			struct mirth_elab_zaTypeElab* branch_zaTypeElab_14;
			struct mirth_table_StateOwner branch_StateOwner_15;
			switch ((v12).tag) {
				case std_maybe_Maybe_1_Some: {
					VAL v16 = mtp_std_maybe_Maybe_1_Some(v12);
					struct mirth_mirth_zaMirth* v17;
					struct mirth_elab_zaTypeElab* v18;
					struct mirth_type_Type v19 = mw_mirth_elab_zaTypeElab_elabzeresourcezeconzx(v11, v9, V_std_either_Either_2(v16), &v17, &v18);
					incref(MK_mirth_type_Type(v19));
					struct mirth_mirth_zaMirth* v20;
					bool v21 = mw_mirth_type_Resource_canzeownzestatezy(v17, v19, &v20);
					struct mirth_mirth_zaMirth* branch_zaMirth_22;
					struct mirth_elab_zaTypeElab* branch_zaTypeElab_23;
					struct mirth_table_StateOwner branch_StateOwner_24;
					if (v21) {
						struct std_list_List_1 v25 = v18->mctx;
						incref(MK_std_list_List_1(v25));
						struct mirth_table_StateOwner v26 = mtw_mirth_table_StateOwner_Resource(v25, v19);
						branch_StateOwner_24 = v26;
						branch_zaTypeElab_23 = v18;
						branch_zaMirth_22 = v20;
					} else {
						uint64_t v27 = v18->mtoken;
						STR* v28;
						STRLIT(v28, "Resource cannot own state.", 26);
						struct mirth_mirth_zaMirth* v29;
						mw_mirth_mirth_zaMirth_emitzeerrorzx(v20, v27, v28, &v29);
						decref(MK_mirth_type_Type(v19));
						struct mirth_table_StateOwner v30 = { .tag=mirth_table_StateOwner_Error };
						branch_StateOwner_24 = v30;
						branch_zaTypeElab_23 = v18;
						branch_zaMirth_22 = v29;
					}
					branch_StateOwner_15 = branch_StateOwner_24;
					branch_zaTypeElab_14 = branch_zaTypeElab_23;
					branch_zaMirth_13 = branch_zaMirth_22;
				} break;
				case std_maybe_Maybe_1_None: {
					uint64_t v31 = v9->mtoken;
					STR* v32;
					STRLIT(v32, "Expected a resource name.", 25);
					struct mirth_mirth_zaMirth* v33;
					mw_mirth_mirth_zaMirth_emitzeerrorzx(v11, v31, v32, &v33);
					struct mirth_table_StateOwner v34 = { .tag=mirth_table_StateOwner_Error };
					branch_StateOwner_15 = v34;
					branch_zaTypeElab_14 = v9;
					branch_zaMirth_13 = v33;
				} break;
				default: {
					do_panic(str_make("unexpected fallthrough in match\n", 32));
				}
			}
			mw_mirth_elab_zaTypeElab_rdrop(branch_zaTypeElab_14);
			branch_StateOwner_6 = branch_StateOwner_15;
			branch_zaMirth_5 = branch_zaMirth_13;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_zaMirth_3 = branch_zaMirth_5;
	return branch_StateOwner_6;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movl %esi, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
movq %rdi, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x2d4(%rbp)
testl %eax, %eax
je 0x188c59
jmp 0x188c49
movl -0x2d4(%rbp), %eax
subl $0x1, %eax
je 0x188c8c
jmp 0x189489
movq 0x1e5f18(%rip), %rax    # 0x36eb78
movq %rax, -0x48(%rbp)
movq 0x1e5f15(%rip), %rax    # 0x36eb80
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x1894a2
movl -0x20(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x174a0
movq %rax, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xad400
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rdi
movq -0x68(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0xd1550
movl %eax, -0x80(%rbp)
movq %rdx, -0x78(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x2d8(%rbp)
testl %eax, %eax
je 0x1892c1
jmp 0x188ce4
movl -0x2d8(%rbp), %eax
subl $0x1, %eax
jne 0x189441
jmp 0x188cf5
movl -0x80(%rbp), %edi
movq -0x78(%rbp), %rsi
callq 0x174a0
movq %rax, -0xb0(%rbp)
movq %rdx, -0xa8(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x7bd50
movq -0x2e8(%rbp), %rdi
movq -0x2e0(%rbp), %rsi
movl %eax, -0xe0(%rbp)
movq %rdx, -0xd8(%rbp)
movl -0xe0(%rbp), %edx
movq -0xd8(%rbp), %rcx
leaq -0xb8(%rbp), %r8
leaq -0xc0(%rbp), %r9
callq 0xd15b0
movl %eax, -0xd0(%rbp)
movq %rdx, -0xc8(%rbp)
movl -0xd0(%rbp), %edi
movq -0xc8(%rbp), %rsi
callq 0x6e780
movq %rax, -0xf0(%rbp)
movq %rdx, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x188e55
movl -0xd0(%rbp), %edi
movq -0xc8(%rbp), %rsi
callq 0x6e780
movq %rax, -0x100(%rbp)
movq %rdx, -0xf8(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x100(%rbp), %rax
cmpq $0x0, %rax
je 0x188e55
movl -0xd0(%rbp), %edi
movq -0xc8(%rbp), %rsi
callq 0x6e780
movq %rax, -0x110(%rbp)
movq %rdx, -0x108(%rbp)
movq -0x110(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x188e55
movl -0xd0(%rbp), %edi
movq -0xc8(%rbp), %rsi
callq 0x6e780
movq %rax, -0x120(%rbp)
movq %rdx, -0x118(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x120(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x188e57
movq -0xb8(%rbp), %rdi
movl -0xd0(%rbp), %esi
movq -0xc8(%rbp), %rdx
leaq -0x128(%rbp), %rcx
callq 0x189500
andb $0x1, %al
movb %al, -0x129(%rbp)
testb $0x1, -0x129(%rbp)
je 0x188fe8
movq -0xc0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x160(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x158(%rbp)
movl -0x160(%rbp), %edi
movq -0x158(%rbp), %rsi
callq 0x12780
movq %rax, -0x170(%rbp)
movq %rdx, -0x168(%rbp)
movq -0x168(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x188f7d
movl -0x160(%rbp), %edi
movq -0x158(%rbp), %rsi
callq 0x12780
movq %rax, -0x180(%rbp)
movq %rdx, -0x178(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x180(%rbp), %rax
cmpq $0x0, %rax
je 0x188f7d
movl -0x160(%rbp), %edi
movq -0x158(%rbp), %rsi
callq 0x12780
movq %rax, -0x190(%rbp)
movq %rdx, -0x188(%rbp)
movq -0x190(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x188f7d
movl -0x160(%rbp), %edi
movq -0x158(%rbp), %rsi
callq 0x12780
movq %rax, -0x1a0(%rbp)
movq %rdx, -0x198(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x1a0(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x188f7f
movl -0x160(%rbp), %edi
movq -0x158(%rbp), %rsi
movl -0xd0(%rbp), %edx
movq -0xc8(%rbp), %rcx
callq 0x189600
movl %eax, -0x1b0(%rbp)
movq %rdx, -0x1a8(%rbp)
movq -0x1b0(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x1a8(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
jmp 0x189284
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x1b8(%rbp)
cmpq $0x0, 0x120d246(%rip)   # 0x1396248
jne 0x18901c
leaq 0x1d206a(%rip), %rdi    # 0x35b075
movl $0x1a, %esi
callq 0xb6c0
movq %rax, 0x120d22c(%rip)   # 0x1396248
jmp 0x18901e
movq 0x120d223(%rip), %rax   # 0x1396248
movq %rax, -0x1d0(%rbp)
leaq 0x208125(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x1890f3
movq 0x120d1ee(%rip), %rax   # 0x1396248
movq %rax, -0x1e0(%rbp)
leaq 0x2080f0(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x1d8(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x1e0(%rbp), %rax
cmpq $0x0, %rax
je 0x1890f3
movq 0x120d1b7(%rip), %rax   # 0x1396248
movq %rax, -0x1f0(%rbp)
leaq 0x2080b9(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x1e8(%rbp)
movq -0x1f0(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x1890f3
movq 0x120d186(%rip), %rax   # 0x1396248
movq %rax, -0x200(%rbp)
leaq 0x208088(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x1f8(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x200(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x1890f5
movq 0x120d14c(%rip), %rax   # 0x1396248
movq %rax, -0x1c0(%rbp)
movq -0x128(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
movq -0x1c0(%rbp), %rdx
leaq -0x208(%rbp), %rcx
callq 0x98c50
movl -0xd0(%rbp), %edi
movq -0xc8(%rbp), %rsi
callq 0x6e780
movq %rax, -0x218(%rbp)
movq %rdx, -0x210(%rbp)
movq -0x210(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x189237
movl -0xd0(%rbp), %edi
movq -0xc8(%rbp), %rsi
callq 0x6e780
movq %rax, -0x228(%rbp)
movq %rdx, -0x220(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x228(%rbp), %rax
cmpq $0x0, %rax
je 0x189237
movl -0xd0(%rbp), %edi
movq -0xc8(%rbp), %rsi
callq 0x6e780
movq %rax, -0x238(%rbp)
movq %rdx, -0x230(%rbp)
movq -0x238(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x189237
movl -0xd0(%rbp), %edi
movq -0xc8(%rbp), %rsi
callq 0x6e780
movq %rax, -0x248(%rbp)
movq %rdx, -0x240(%rbp)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq -0x248(%rbp), %rcx
movl (%rcx), %eax
addl $-0x1, %eax
movl %eax, (%rcx)
cmpl $0x0, %eax
jne 0x189235
movl -0xd0(%rbp), %edi
movq -0xc8(%rbp), %rsi
callq 0x6e780
movq %rax, -0x258(%rbp)
movq %rdx, -0x250(%rbp)
movq -0x258(%rbp), %rdi
movq -0x250(%rbp), %rsi
callq 0x127c0
jmp 0x189237
jmp 0x189239
leaq -0x268(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5080
movq -0x268(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x260(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x208(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x18945a
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x270(%rbp)
cmpq $0x0, 0x120cf78(%rip)   # 0x1396250
jne 0x1892f2
leaq 0x1d1daf(%rip), %rdi    # 0x35b090
movl $0x19, %esi
callq 0xb6c0
movq %rax, 0x120cf5e(%rip)   # 0x1396250
jmp 0x1892f4
movq 0x120cf55(%rip), %rax   # 0x1396250
movq %rax, -0x288(%rbp)
leaq 0x207e4f(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x1893c9
movq 0x120cf20(%rip), %rax   # 0x1396250
movq %rax, -0x298(%rbp)
leaq 0x207e1a(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x290(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x298(%rbp), %rax
cmpq $0x0, %rax
je 0x1893c9
movq 0x120cee9(%rip), %rax   # 0x1396250
movq %rax, -0x2a8(%rbp)
leaq 0x207de3(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x2a0(%rbp)
movq -0x2a8(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x1893c9
movq 0x120ceb8(%rip), %rax   # 0x1396250
movq %rax, -0x2b8(%rbp)
leaq 0x207db2(%rip), %rax    # 0x391158
orq $0x1, %rax
movq %rax, -0x2b0(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x2b8(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x1893cb
movq 0x120ce7e(%rip), %rax   # 0x1396250
movq %rax, -0x278(%rbp)
movq -0x70(%rbp), %rdi
movq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
leaq -0x2c0(%rbp), %rcx
callq 0x98c50
leaq -0x2d0(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5080
movq -0x2d0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x2c8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x2c0(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x18945a
leaq 0x1caa39(%rip), %rdi    # 0x353e81
movl $0x20, %esi
callq 0xb6c0
movq %rax, %rdi
callq 0xc620
movq -0x90(%rbp), %rdi
callq 0xae360
movq -0xa0(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x1894a2
leaq 0x1ca9f1(%rip), %rdi    # 0x353e81
movl $0x20, %esi
callq 0xb6c0
movq %rax, %rdi
callq 0xc620
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rdx
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
nopl (%rax)