// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_StackType_topzetypezy
static struct std_maybe_Maybe_1 mw_mirth_type_StackType_topzetypezy (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_StackType in_StackType_2, struct mirth_mirth_zaMirth* *out_zaMirth_3) {
	struct mirth_mirth_zaMirth* v5;
	struct mirth_type_StackType v6 = mw_mirth_type_StackType_expand(in_zaMirth_1, in_StackType_2, &v5);
	struct mirth_mirth_zaMirth* branch_zaMirth_7;
	struct std_maybe_Maybe_1 branch_Maybe_8;
	switch ((v6).tag) {
		case mirth_type_StackType_With: {
			struct mirth_type_Type v9;
			struct mirth_type_StackType v10 = mtp_mirth_type_StackType_With(v6, &v9);
			decref(MK_mirth_type_Type(v9));
			struct mirth_mirth_zaMirth* v11;
			struct std_maybe_Maybe_1 v12 = mw_mirth_type_StackType_topzetypezy(v5, v10, &v11);
			branch_Maybe_8 = v12;
			branch_zaMirth_7 = v11;
		} break;
		case mirth_type_StackType_Cons: {
			struct mirth_type_Type v13;
			struct mirth_type_StackType v14 = mtp_mirth_type_StackType_Cons(v6, &v13);
			decref(MK_mirth_type_StackType(v14));
			struct std_maybe_Maybe_1 v15 = mtw_std_maybe_Maybe_1_Some(MK_mirth_type_Type(v13));
			branch_Maybe_8 = v15;
			branch_zaMirth_7 = v5;
		} break;
		case mirth_type_StackType_ConsLabel: {
			struct mirth_type_Type v16;
			uint64_t v17;
			struct mirth_type_StackType v18 = mtp_mirth_type_StackType_ConsLabel(v6, &v16, &v17);
			decref(MK_mirth_type_Type(v16));
			struct mirth_mirth_zaMirth* v19;
			struct std_maybe_Maybe_1 v20 = mw_mirth_type_StackType_topzetypezy(v5, v18, &v19);
			branch_Maybe_8 = v20;
			branch_zaMirth_7 = v19;
		} break;
		case mirth_type_StackType_WithLabel: {
			struct mirth_type_Type v21;
			uint64_t v22;
			struct mirth_type_StackType v23 = mtp_mirth_type_StackType_WithLabel(v6, &v21, &v22);
			decref(MK_mirth_type_Type(v21));
			struct mirth_mirth_zaMirth* v24;
			struct std_maybe_Maybe_1 v25 = mw_mirth_type_StackType_topzetypezy(v5, v23, &v24);
			branch_Maybe_8 = v25;
			branch_zaMirth_7 = v24;
		} break;
		default: {
			decref(MK_mirth_type_StackType(v6));
			struct std_maybe_Maybe_1 v26 = { .tag=std_maybe_Maybe_1_None };
			branch_Maybe_8 = v26;
			branch_zaMirth_7 = v5;
		} break;
	}
	*out_zaMirth_3 = branch_zaMirth_7;
	return branch_Maybe_8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %rbx
leaq -0x28(%rbp), %rcx
callq 0x34dd2
leal -0x5(%rax), %ecx
cmpl $0x3, %ecx
ja 0x4b2c1
leaq 0x87cc5(%rip), %rax     # 0xd2e34
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq -0x38(%rbp), %rsi
movq %rdx, %rdi
callq 0x34ef8
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x4b1bb
decl (%rcx)
jne 0x4b1bb
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xbda0e(%rip), %rsi     # 0x108bc1
movq %rax, %rdi
callq 0xce94
movl -0x38(%rbp), %edi
shlq $0x30, %rdi
orq -0x30(%rbp), %rdi
leaq 0xbd91c(%rip), %rsi     # 0x108ae9
callq 0x8d0c
movq -0x28(%rbp), %rcx
pushq $0x1
popq %rax
jmp 0x4b300
leaq -0x38(%rbp), %r12
movq %rdx, %rdi
movq %r12, %rsi
callq 0x34f7f
movl %eax, %r14d
movq %rdx, %r15
movq 0x8(%r12), %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rax, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x4b22d
movl -0x38(%rbp), %edi
decl (%rcx)
jne 0x4b22d
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xbd8c1(%rip), %rsi     # 0x108ae9
callq 0xce94
movq -0x28(%rbp), %rdi
leaq -0x40(%rbp), %r12
jmp 0x4b2ad
leaq -0x38(%rbp), %r12
leaq -0x40(%rbp), %rax
movq %rdx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x350d3
jmp 0x4b265
leaq -0x38(%rbp), %r12
leaq -0x40(%rbp), %rax
movq %rdx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x3502f
movl %eax, %r14d
movq %rdx, %r15
movq 0x8(%r12), %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rax, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x4b2a5
movl -0x38(%rbp), %edi
decl (%rcx)
jne 0x4b2a5
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xbd849(%rip), %rsi     # 0x108ae9
callq 0xce94
movq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %r12
movl %r14d, %esi
movq %r15, %rdx
movq %r12, %rcx
callq 0x4b141
movq (%r12), %rcx
jmp 0x4b300
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %sil
testb $0x3, %dl
setne %dil
orb %sil, %dil
jne 0x4b2f8
decl (%rcx)
jne 0x4b2f8
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xbd8d1(%rip), %rsi     # 0x108bc1
movq %rax, %rdi
callq 0xce94
xorl %eax, %eax
movq -0x28(%rbp), %rcx
xorl %edx, %edx
movq %rcx, (%rbx)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq