// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_zaAB_abzeslidezeresourcezetyconzetozetopzx
static bool mw_mirth_elab_zaAB_abzeslidezeresourcezetyconzetozetopzx (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_arrow_Arrow* in_zaAB_2, struct mirth_tycon_Tycon in_Tycon_3, struct mirth_mirth_zaMirth* *out_zaMirth_4, struct mirth_arrow_Arrow* *out_zaAB_5) {
	struct mirth_arrow_Arrow* v7;
	struct mirth_type_StackType v8 = mw_mirth_elab_zaAB_abzetypezo(in_zaAB_2, &v7);
	struct mirth_mirth_zaMirth* v9;
	struct std_maybe_Maybe_1 v10 = mw_mirth_type_StackType_topzeresourcezetyconzy(in_zaMirth_1, v8, &v9);
	struct mirth_arrow_Arrow* branch_zaAB_11;
	struct mirth_mirth_zaMirth* branch_zaMirth_12;
	bool branch_Bool_13;
	switch ((v10).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v14 = mtp_std_maybe_Maybe_1_Some(v10);
			incref(MK_mirth_tycon_Tycon(in_Tycon_3));
			struct mirth_mirth_zaMirth* v15;
			bool v16 = mw_mirth_tycon_Tycon_zd(v9, V_mirth_tycon_Tycon(v14), in_Tycon_3, &v15);
			struct mirth_arrow_Arrow* branch_zaAB_17;
			struct mirth_mirth_zaMirth* branch_zaMirth_18;
			bool branch_Bool_19;
			if (v16) {
				decref(MK_mirth_tycon_Tycon(in_Tycon_3));
				bool v20 = true;
				branch_Bool_19 = v20;
				branch_zaMirth_18 = v15;
				branch_zaAB_17 = v7;
			} else {
				struct mirth_arrow_Arrow* v21;
				struct mirth_type_StackType v22 = mw_mirth_elab_zaAB_abzetypezo(v7, &v21);
				struct mirth_mirth_zaMirth* v23;
				struct std_maybe_Maybe_1 v24 = mw_mirth_type_StackType_forcezewithzyzx(v15, v22, &v23);
				struct mirth_type_StackType v25 = mw_std_maybe_Maybe_1_ifzy_2_sp51(v24);
				struct mirth_mirth_zaMirth* v26;
				struct mirth_type_StackType v27 = mw_mirth_type_StackType_Freshzx(v23, &v26);
				struct mirth_type_ArrowType* v28 = mw_mirth_type_Tzezg(v25, v27);
				struct mirth_arrow_Arrow* v29;
				struct std_list_List_1 v30 = mw_mirth_elab_zaAB_abzectxzo(v21, &v29);
				struct mirth_arrow_Arrow* v31;
				uint64_t v32 = mw_mirth_elab_zaAB_abzetokenzo(v29, &v31);
				struct mirth_arrow_Arrow* v33;
				struct mirth_arrow_Home v34 = mw_mirth_elab_zaAB_abzehomezo(v31, &v33);
				struct mirth_type_StackType v35;
				struct mirth_type_StackType v36;
				mtp_mirth_type_ArrowType_ArrowType(v28, &v35, &v36);
				incref(MK_mirth_type_StackType(v35));
				struct std_list_List_1 v37 = { .tag=std_list_List_1_Nil };
				struct mirth_arrow_Arrow* v38 = mtw_mirth_arrow_Arrow_Arrow(v34, v32, v32, v30, v35, v35, v37);
				struct mirth_mirth_zaMirth* v39;
				struct mirth_arrow_Arrow* v40;
				bool v41 = mw_mirth_elab_zaAB_abzeslidezeresourcezetyconzetozetopzx(v26, v38, in_Tycon_3, &v39, &v40);
				struct mirth_mirth_zaMirth* v42;
				struct mirth_arrow_Arrow* v43;
				mw_mirth_elab_zaAB_abzeunifyzetypezx(v39, v40, v36, &v42, &v43);
				struct mirth_mirth_zaMirth* v44;
				uint64_t v45 = mw_mirth_arrow_Block_Newzx(v42, v43, &v44);
				struct std_list_List_1 v46 = { .tag=std_list_List_1_Nil };
				struct std_list_List_1 v47 = mw_std_list_List_1_cons(MK_mirth_arrow_Block(v45), v46);
				enum mirth_prim_Prim v48 = mirth_prim_Prim_RDip;
				struct mirth_mirth_zaMirth* v49;
				struct mirth_arrow_Arrow* v50;
				mw_mirth_elab_zaAB_abzeprimzx(v44, v33, v47, v48, &v49, &v50);
				struct mirth_mirth_zaMirth* branch_zaMirth_51;
				struct mirth_arrow_Arrow* branch_zaAB_52;
				bool branch_Bool_53;
				if (v41) {
					struct std_list_List_1 v54 = { .tag=std_list_List_1_Nil };
					enum mirth_prim_Prim v55 = mirth_prim_Prim_RSwap;
					struct mirth_mirth_zaMirth* v56;
					struct mirth_arrow_Arrow* v57;
					mw_mirth_elab_zaAB_abzeprimzx(v49, v50, v54, v55, &v56, &v57);
					bool v58 = true;
					branch_Bool_53 = v58;
					branch_zaAB_52 = v57;
					branch_zaMirth_51 = v56;
				} else {
					bool v59 = false;
					branch_Bool_53 = v59;
					branch_zaAB_52 = v50;
					branch_zaMirth_51 = v49;
				}
				branch_Bool_19 = branch_Bool_53;
				branch_zaMirth_18 = branch_zaMirth_51;
				branch_zaAB_17 = branch_zaAB_52;
			}
			branch_Bool_13 = branch_Bool_19;
			branch_zaMirth_12 = branch_zaMirth_18;
			branch_zaAB_11 = branch_zaAB_17;
		} break;
		case std_maybe_Maybe_1_None: {
			decref(MK_mirth_tycon_Tycon(in_Tycon_3));
			bool v60 = false;
			branch_Bool_13 = v60;
			branch_zaMirth_12 = v9;
			branch_zaAB_11 = v7;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_zaAB_5 = branch_zaAB_11;
	*out_zaMirth_4 = branch_zaMirth_12;
	return branch_Bool_13;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %r9, %r14
movq %r8, %r13
movq %rcx, %r12
movl %edx, %r15d
movq %rsi, %rax
movq %rdi, %rbx
leaq -0x40(%rbp), %rsi
movq %rax, %rdi
callq 0x3f687
leaq -0x70(%rbp), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq 0x518ac
testl %eax, %eax
je 0x50df6
movq %r15, -0x38(%rbp)
movq %r14, -0x30(%rbp)
cmpl $0x1, %eax
jne 0x5105b
movabsq $0xfffffffffffc, %r15   # imm = 0xFFFFFFFFFFFC
movq %rdx, %rdi
callq 0xd491
movq %r12, %rbx
andq %r15, %rbx
setne %cl
testb $0x3, %r12b
sete %r14b
andb %cl, %r14b
cmpb $0x1, %r14b
jne 0x50da1
incl (%rbx)
movq -0x70(%rbp), %rdi
movq %rax, %rsi
shrq $0x30, %rsi
andq %r15, %rax
leaq -0x68(%rbp), %r9
movq %rax, %rdx
movq -0x38(%rbp), %rcx
movq %r12, %r8
callq 0x17b8b
testb %al, %al
je 0x50e3b
testb %r14b, %r14b
je 0x50de6
decl (%rbx)
jne 0x50de6
movq -0x38(%rbp), %rdi
shlq $0x30, %rdi
orq %r12, %rdi
leaq 0xb7ba0(%rip), %rsi     # 0x108981
callq 0xce94
movq -0x68(%rbp), %rax
movb $0x1, %r15b
movq -0x40(%rbp), %rcx
jmp 0x5103b
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %r12, %rax
sete %cl
testb $0x3, %r12b
setne %dl
orb %cl, %dl
jne 0x50e2b
decl (%rax)
jne 0x50e2b
shlq $0x30, %r15
orq %r12, %r15
leaq 0xb7b5e(%rip), %rsi     # 0x108981
movq %r15, %rdi
callq 0xce94
movq -0x70(%rbp), %rax
movq -0x40(%rbp), %rcx
xorl %r15d, %r15d
jmp 0x5103f
movq %r13, -0x50(%rbp)
movq -0x40(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3f687
movq -0x68(%rbp), %rdi
leaq -0x110(%rbp), %rbx
movl %eax, %esi
movq %rbx, %rcx
callq 0x38e9f
movl %eax, %edi
movq %rdx, %rsi
callq 0x51072
movl %eax, %r13d
movq %rdx, %r14
movq (%rbx), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3a29b
pushq $0x4
popq %rdx
movl %r13d, %edi
movq %r14, %rsi
movq %rax, %rcx
callq 0x1e896
movq %rax, -0x80(%rbp)
leaq -0xa0(%rbp), %rax
movq (%rax), %rdi
leaq -0x108(%rbp), %rbx
movq %rbx, %rsi
callq 0x3f60a
movl %eax, -0x44(%rbp)
movq %rdx, -0x88(%rbp)
movq (%rbx), %rdi
leaq -0x100(%rbp), %rbx
movq %rbx, %rsi
callq 0x3f5b0
movq %rax, %r14
movq (%rbx), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3fa30
movl %eax, %r13d
movq %rdx, -0x78(%rbp)
leaq -0xf8(%rbp), %rbx
leaq -0xb0(%rbp), %rdx
movq -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x36e55
movq 0x8(%rbx), %rax
andq %rax, %r15
sete %cl
testb $0x3, %al
setne %al
orb %cl, %al
jne 0x50f16
incl (%r15)
xorps %xmm0, %xmm0
movaps %xmm0, -0x120(%rbp)
movups %xmm0, 0x20(%rsp)
movups -0xf8(%rbp), %xmm0
movups %xmm0, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %r13d, %edi
movq -0x78(%rbp), %rsi
movq %r14, %rdx
movq %r14, %rcx
movl -0x44(%rbp), %r8d
movq -0x88(%rbp), %r9
callq 0x3f209
movq -0x98(%rbp), %rdi
leaq -0xe8(%rbp), %rbx
leaq -0xe0(%rbp), %r14
movq %rax, %rsi
movq -0x38(%rbp), %rdx
movq %r12, %rcx
movq %rbx, %r8
movq %r14, %r9
callq 0x50d1a
movl %eax, %r15d
movq (%rbx), %rdi
movq (%r14), %rsi
movl -0xb0(%rbp), %edx
movq -0xa8(%rbp), %rcx
leaq -0xd8(%rbp), %rbx
leaq -0xd0(%rbp), %r14
movq %rbx, %r8
movq %r14, %r9
callq 0x3faad
movq (%rbx), %rdi
movq (%r14), %rsi
leaq -0xc8(%rbp), %rbx
movq %rbx, %rdx
callq 0x5114e
leaq 0xb86f1(%rip), %rsi     # 0x1096b8
movq %rax, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xcf39
movq %rdx, %rcx
movq (%rbx), %rdi
movq -0x90(%rbp), %rsi
leaq -0x58(%rbp), %rax
movq %rax, (%rsp)
pushq $0x1
popq %rdx
pushq $0x6
popq %r8
leaq -0x60(%rbp), %r9
callq 0x4d0c4
testb %r15b, %r15b
je 0x5102f
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0xb8(%rbp), %r14
movq %r14, (%rsp)
pushq $0x4
popq %r8
leaq -0xc0(%rbp), %rbx
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r9
callq 0x4d0c4
movq (%r14), %rcx
movq (%rbx), %rax
jmp 0x51037
movq -0x58(%rbp), %rcx
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %r13
movq -0x30(%rbp), %r14
movq %rcx, (%r14)
movq %rax, (%r13)
movl %r15d, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x837ab(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6