// File: /workspace/github_c_makefile_star2_O0/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
subq $0x120, %rsp            # imm = 0x120
movq 0x10(%rbp), %rax
movl %esi, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x30(%rbp)
movq %r8, -0x28(%rbp)
movq %rdi, -0x38(%rbp)
movq %r9, -0x40(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x114(%rbp)
testl %eax, %eax
je 0x286eed
jmp 0x286c48
movl -0x114(%rbp), %eax
subl $0x1, %eax
jne 0x286f30
jmp 0x286c59
movl -0x30(%rbp), %edi
movq -0x28(%rbp), %rsi
callq 0x174a0
movq %rax, -0x68(%rbp)
movq %rdx, -0x60(%rbp)
movq -0x60(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x286cb2
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x68(%rbp), %rax
cmpq $0x0, %rax
je 0x286cb2
movq -0x68(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x286cb2
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x68(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x286cb4
jmp 0x286cb6
movl -0x20(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x6e780
movq %rax, -0x78(%rbp)
movq %rdx, -0x70(%rbp)
movq -0x70(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x286d67
movl -0x20(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x6e780
movq %rax, -0x88(%rbp)
movq %rdx, -0x80(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x88(%rbp), %rax
cmpq $0x0, %rax
je 0x286d67
movl -0x20(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x6e780
movq %rax, -0x98(%rbp)
movq %rdx, -0x90(%rbp)
movq -0x98(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x286d67
movl -0x20(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x6e780
movq %rax, -0xa8(%rbp)
movq %rdx, -0xa0(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0xa8(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x286d69
movq -0x38(%rbp), %rdi
movq -0x68(%rbp), %rsi
movl -0x20(%rbp), %edx
movq -0x18(%rbp), %rcx
leaq -0xb0(%rbp), %r8
callq 0x288270
andb $0x1, %al
movb %al, -0xb1(%rbp)
movb -0xb1(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0xb2(%rbp)
testb $0x1, -0xb2(%rbp)
je 0x286e04
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xca10
movl %eax, -0xf0(%rbp)
movq %rdx, -0xe8(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc0(%rbp)
jmp 0x286eb4
jmp 0x286e06
movq -0x60(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x286e5f
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x68(%rbp), %rax
cmpq $0x0, %rax
je 0x286e5f
movq -0x68(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x286e5f
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq -0x68(%rbp), %rcx
movl (%rcx), %eax
addl $-0x1, %eax
movl %eax, (%rcx)
cmpl $0x0, %eax
jne 0x286e5d
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x127c0
jmp 0x286e5f
jmp 0x286e61
leaq -0x100(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5080
movq -0x100(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x286f49
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5080
movq -0x110(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x286f49
leaq 0xccf4a(%rip), %rdi     # 0x353e81
movl $0x20, %esi
callq 0xb6c0
movq %rax, %rdi
callq 0xc620
movq 0x10(%rbp), %rax
movups -0x58(%rbp), %xmm0
movups %xmm0, (%rax)
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rdx
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nop