// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_def_Def_resolve
static struct mirth_def_Def mw_mirth_def_Def_resolve (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_def_Def in_Def_2, struct mirth_mirth_zaMirth* *out_zaMirth_3) {
	bool v5 = true;
	struct mirth_mirth_zaMirth* r6 = in_zaMirth_1;
	struct mirth_def_Def v7 = in_Def_2;
	bool v8 = v5;
	bool v9 = v5;
	while (v9) {
		struct mirth_mirth_zaMirth* r10 = r6;
		struct mirth_def_Def v11 = v7;
		bool v12 = v8;
		incref(MK_mirth_def_Def(v11));
		struct std_maybe_Maybe_1 v13 = mw_mirth_def_Def_aliaszy(v11);
		struct mirth_mirth_zaMirth* branch_zaMirth_14;
		struct std_maybe_Maybe_1 branch_Maybe_15;
		switch ((v13).tag) {
			case std_maybe_Maybe_1_Some: {
				VAL v16 = mtp_std_maybe_Maybe_1_Some(v13);
				void* v17 = field_mut(&mfld_mirth_alias_Alias_zttarget, V_mirth_alias_Alias(v16));
				struct mirth_mirth_zaMirth* v18;
				struct std_maybe_Maybe_1 v19 = mw_mirth_mirth_Prop_1_tryzeforcezx(r10, v17, &v18);
				branch_Maybe_15 = v19;
				branch_zaMirth_14 = v18;
			} break;
			case std_maybe_Maybe_1_None: {
				struct std_maybe_Maybe_1 v20 = { .tag=std_maybe_Maybe_1_None };
				branch_Maybe_15 = v20;
				branch_zaMirth_14 = r10;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		VAL branch_zux1_21;
		bool branch_Bool_22;
		switch ((branch_Maybe_15).tag) {
			case std_maybe_Maybe_1_Some: {
				VAL v23 = mtp_std_maybe_Maybe_1_Some(branch_Maybe_15);
				decref(MK_mirth_def_Def(v11));
				bool v24 = true;
				branch_Bool_22 = v24;
				branch_zux1_21 = v23;
			} break;
			case std_maybe_Maybe_1_None: {
				bool v25 = false;
				branch_Bool_22 = v25;
				branch_zux1_21 = MK_mirth_def_Def(v11);
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v9 = branch_Bool_22;
		v8 = branch_Bool_22;
		v7 = V_mirth_def_Def(branch_zux1_21);
		r6 = branch_zaMirth_14;
	}
	*out_zaMirth_3 = r6;
	return v7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
movb $0x1, %r15b
testb $0x1, %r15b
je 0x2d131
movq %rdx, %r12
andq %rbx, %r12
setne %al
testb $0x3, %dl
sete %r13b
andb %al, %r13b
cmpb $0x1, %r13b
jne 0x2d09c
incl (%r12)
movq %rsi, %r14
shlq $0x30, %r14
orq %rdx, %r14
movl %esi, %edi
movq %rdx, %rsi
callq 0x2d164
cmpl $0x1, %eax
jne 0x2d108
movq %rdx, %rdi
callq 0xd491
leaq 0x10df354(%rip), %rdi   # 0x110c418
movq %rax, %rsi
callq 0x12f88
movq -0x30(%rbp), %rdi
movq %rax, %rsi
leaq -0x40(%rbp), %rdx
callq 0x1483b
movq -0x40(%rbp), %rcx
movq %rcx, -0x30(%rbp)
testl %eax, %eax
je 0x2d108
cmpl $0x1, %eax
jne 0x2d14d
movq %rdx, %rdi
callq 0xd491
movb $0x1, %r15b
testb %r13b, %r13b
je 0x2d103
decl (%r12)
je 0x2d11d
movq %rax, %r14
jmp 0x2d10b
xorl %r15d, %r15d
movq %r14, %rsi
shrq $0x30, %rsi
andq %rbx, %r14
movq %r14, %rdx
jmp 0x2d075
movq %r14, %rdi
leaq 0xdb662(%rip), %rsi     # 0x108789
movq %rax, %r14
callq 0xce94
jmp 0x2d10b
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
movl %esi, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa76b9(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6