// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_std_maybe_Maybe_1_filter_1_sp6
static struct mirth_type_Type mw_std_maybe_Maybe_1_filter_1_sp6 (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_Type in_Type_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_Type_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_Type_2));
			struct mirth_mirth_zaMirth* v11;
			bool v12 = mw_mirth_type_Type_haszemetazy(in_zaMirth_1, V_mirth_type_MetaVar(v10), in_Type_2, &v11);
			bool v13 = !v12;
			struct mirth_type_Type branch_Type_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_Type_14 = in_Type_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_Type_14 = in_Type_2;
			}
			branch_Maybe_9 = branch_Maybe_16;
			branch_zaMirth_8 = branch_zaMirth_15;
			branch_Type_7 = branch_Type_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_Type_7 = in_Type_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_Type_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 0x5a4e6
movq %r9, -0x30(%rbp)
cmpl $0x1, %ecx
jne 0x5a526
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
movq %r8, %rdi
callq 0xd491
movq %rbx, %rsi
movq %rax, %rbx
movq %rdx, %r12
testb $0x1, %r12b
je 0x5a47f
movq %rbx, %rax
andq %rsi, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0x5a47f
incl (%rax)
movq %r14, %rax
andq %rsi, %rax
sete %cl
testb $0x3, %r14b
setne %dl
orb %cl, %dl
jne 0x5a495
incl (%rax)
leaq -0x38(%rbp), %r8
movq %r13, %rdi
movq %rbx, %rsi
movl %r15d, %edx
movq %r14, %rcx
callq 0x3717f
testb %al, %al
je 0x5a4ea
testb $0x1, %r12b
je 0x5a4e0
movq %rbx, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0x5a4e0
decl (%rax)
jne 0x5a4e0
movq %rbx, %rdi
movq %r12, %rsi
callq 0xce94
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x5a4f8
xorl %edx, %edx
jmp 0x5a500
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 0x7a2e0(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6