// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_std_maybe_Maybe_1_filter_1_sp4
static struct mirth_type_Type mw_std_maybe_Maybe_1_filter_1_sp4 (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_Type in_Resource_2, struct std_maybe_Maybe_1 in_Maybe_3, struct mirth_mirth_zaMirth* *out_zaMirth_5, struct std_maybe_Maybe_1 *out_Maybe_6) {
	struct mirth_type_Type branch_Resource_7;
	struct mirth_mirth_zaMirth* branch_zaMirth_8;
	struct std_maybe_Maybe_1 branch_Maybe_9;
	switch ((in_Maybe_3).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v10 = mtp_std_maybe_Maybe_1_Some(in_Maybe_3);
			incref(v10);
			incref(MK_mirth_type_Type(in_Resource_2));
			struct mirth_mirth_zaMirth* v11;
			bool v12 = mw_mirth_type_Resource_haszevarzy(in_zaMirth_1, V_mirth_var_Var(v10), in_Resource_2, &v11);
			bool v13 = !v12;
			struct mirth_type_Type branch_Resource_14;
			struct mirth_mirth_zaMirth* branch_zaMirth_15;
			struct std_maybe_Maybe_1 branch_Maybe_16;
			if (v13) {
				struct std_maybe_Maybe_1 v17 = mtw_std_maybe_Maybe_1_Some(v10);
				branch_Maybe_16 = v17;
				branch_zaMirth_15 = v11;
				branch_Resource_14 = in_Resource_2;
			} else {
				decref(v10);
				struct std_maybe_Maybe_1 v18 = { .tag=std_maybe_Maybe_1_None };
				branch_Maybe_16 = v18;
				branch_zaMirth_15 = v11;
				branch_Resource_14 = in_Resource_2;
			}
			branch_Maybe_9 = branch_Maybe_16;
			branch_zaMirth_8 = branch_zaMirth_15;
			branch_Resource_7 = branch_Resource_14;
		} break;
		case std_maybe_Maybe_1_None: {
			struct std_maybe_Maybe_1 v19 = { .tag=std_maybe_Maybe_1_None };
			branch_Maybe_9 = v19;
			branch_zaMirth_8 = in_zaMirth_1;
			branch_Resource_7 = in_Resource_2;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_Maybe_6 = branch_Maybe_9;
	*out_zaMirth_5 = branch_zaMirth_8;
	return branch_Resource_7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r13
testl %ecx, %ecx
je 0xa31ac
movq %r9, -0x30(%rbp)
cmpl $0x1, %ecx
jne 0xa31ec
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
movq %r8, %rdi
callq 0xd491
movq %rbx, %rsi
movq %rax, %rbx
movq %rdx, %r12
testb $0x1, %r12b
je 0xa3145
movq %rbx, %rax
andq %rsi, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0xa3145
incl (%rax)
movq %r14, %rax
andq %rsi, %rax
sete %cl
testb $0x3, %r14b
setne %dl
orb %cl, %dl
jne 0xa315b
incl (%rax)
leaq -0x38(%rbp), %r8
movq %r13, %rdi
movq %rbx, %rsi
movl %r15d, %edx
movq %r14, %rcx
callq 0xa37b1
testb %al, %al
je 0xa31b0
testb $0x1, %r12b
je 0xa31a6
movq %rbx, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0xa31a6
decl (%rax)
jne 0xa31a6
movq %rbx, %rdi
movq %r12, %rsi
callq 0xce94
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0xa31be
xorl %edx, %edx
jmp 0xa31c6
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8d0c
pushq $0x1
popq %rcx
movq -0x38(%rbp), %r13
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
andl $0x0, 0x4(%rax)
movq %rdx, 0x8(%rax)
movq %r13, (%r9)
movl %r15d, %eax
movq %r14, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3161a(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6