// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_StackType_topzeresourcezetycons
static struct std_list_List_1 mw_mirth_type_StackType_topzeresourcezetycons (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_StackType in_StackType_2, struct mirth_mirth_zaMirth* *out_zaMirth_3) {
	struct std_list_List_1 v5 = { .tag=std_list_List_1_Nil };
	bool v6 = true;
	struct std_list_List_1 v7 = v5;
	struct mirth_mirth_zaMirth* r8 = in_zaMirth_1;
	struct mirth_type_StackType v9 = in_StackType_2;
	bool v10 = v6;
	bool v11 = v6;
	while (v11) {
		struct std_list_List_1 v12 = v7;
		struct mirth_mirth_zaMirth* r13 = r8;
		struct mirth_type_StackType v14 = v9;
		bool v15 = v10;
		struct mirth_mirth_zaMirth* v16;
		struct mirth_type_StackType v17 = mw_mirth_type_StackType_expand(r13, v14, &v16);
		struct mirth_type_StackType branch_StackType_18;
		struct mirth_mirth_zaMirth* branch_zaMirth_19;
		struct std_list_List_1 branch_List_20;
		bool branch_Bool_21;
		switch ((v17).tag) {
			case mirth_type_StackType_With: {
				struct mirth_type_Type v22;
				struct mirth_type_StackType v23 = mtp_mirth_type_StackType_With(v17, &v22);
				struct mirth_type_Type v24 = mw_mirth_type_Resource_zgType(v22);
				struct mirth_mirth_zaMirth* v25;
				struct std_maybe_Maybe_1 v26 = mw_mirth_type_Type_tyconzy(v16, v24, &v25);
				struct std_list_List_1 branch_List_27;
				bool branch_Bool_28;
				switch ((v26).tag) {
					case std_maybe_Maybe_1_Some: {
						VAL v29 = mtp_std_maybe_Maybe_1_Some(v26);
						struct std_list_List_1 v30 = mw_std_list_List_1_cons(v29, v12);
						bool v31 = true;
						branch_Bool_28 = v31;
						branch_List_27 = v30;
					} break;
					case std_maybe_Maybe_1_None: {
						bool v32 = false;
						branch_Bool_28 = v32;
						branch_List_27 = v12;
					} break;
					default: {
						do_panic(str_make("unexpected fallthrough in match\n", 32));
					}
				}
				branch_Bool_21 = branch_Bool_28;
				branch_List_20 = branch_List_27;
				branch_zaMirth_19 = v25;
				branch_StackType_18 = v23;
			} break;
			case mirth_type_StackType_Cons: {
				struct mirth_type_Type v33;
				struct mirth_type_StackType v34 = mtp_mirth_type_StackType_Cons(v17, &v33);
				decref(MK_mirth_type_Type(v33));
				bool v35 = true;
				branch_Bool_21 = v35;
				branch_List_20 = v12;
				branch_zaMirth_19 = v16;
				branch_StackType_18 = v34;
			} break;
			case mirth_type_StackType_WithLabel: {
				struct mirth_type_Type v36;
				uint64_t v37;
				struct mirth_type_StackType v38 = mtp_mirth_type_StackType_WithLabel(v17, &v36, &v37);
				decref(MK_mirth_type_Type(v36));
				bool v39 = true;
				branch_Bool_21 = v39;
				branch_List_20 = v12;
				branch_zaMirth_19 = v16;
				branch_StackType_18 = v38;
			} break;
			case mirth_type_StackType_ConsLabel: {
				struct mirth_type_Type v40;
				uint64_t v41;
				struct mirth_type_StackType v42 = mtp_mirth_type_StackType_ConsLabel(v17, &v40, &v41);
				decref(MK_mirth_type_Type(v40));
				bool v43 = true;
				branch_Bool_21 = v43;
				branch_List_20 = v12;
				branch_zaMirth_19 = v16;
				branch_StackType_18 = v42;
			} break;
			default: {
				bool v44 = false;
				branch_Bool_21 = v44;
				branch_List_20 = v12;
				branch_zaMirth_19 = v16;
				branch_StackType_18 = v17;
			} break;
		}
		v11 = branch_Bool_21;
		v10 = branch_Bool_21;
		v9 = branch_StackType_18;
		r8 = branch_zaMirth_19;
		v7 = branch_List_20;
	}
	decref(MK_mirth_type_StackType(v9));
	*out_zaMirth_3 = r8;
	return v7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, -0x60(%rbp)
movq %rdx, %r13
movl %esi, %r15d
movq %rdi, %r14
movabsq $0xfffffffffffc, %r12   # imm = 0xFFFFFFFFFFFC
movq $0x0, -0x50(%rbp)
leaq 0x91ffb(%rip), %rbx     # 0xe2e10
movl $0x0, -0x2c(%rbp)
movq %r14, %rdi
movl %r15d, %esi
movq %r13, %rdx
leaq -0x48(%rbp), %rcx
callq 0x3917b
movl %eax, %r15d
movq %rdx, %r13
leal -0x5(%r15), %eax
cmpl $0x3, %eax
ja 0x50f1d
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movq %r13, %rdi
leaq -0x40(%rbp), %rsi
callq 0x392bf
jmp 0x50edd
movq %r13, %rdi
leaq -0x40(%rbp), %rsi
callq 0x39346
movl %eax, %r15d
movq %rdx, %r13
movl -0x40(%rbp), %esi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rdi
leaq -0x58(%rbp), %rcx
callq 0x2dc76
testl %eax, %eax
je 0x50f25
cmpl $0x1, %eax
jne 0x50f7d
movq %rdx, %rdi
callq 0xdaeb
movq %rax, %rdi
movq %rdx, %rsi
movl -0x2c(%rbp), %edx
movq -0x50(%rbp), %rcx
callq 0xd592
movq %rdx, -0x50(%rbp)
movl $0x1, -0x2c(%rbp)
movb $0x1, %al
jmp 0x50f27
movq %r13, %rdi
leaq -0x40(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x39471
jmp 0x50edd
movq %r13, %rdi
leaq -0x40(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x393cd
movl %eax, %r15d
movq %rdx, %r13
movq -0x38(%rbp), %rax
movq %rax, %rcx
andq %r12, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x50f15
movl -0x40(%rbp), %edi
decl (%rcx)
jne 0x50f15
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xc4bd9(%rip), %rsi     # 0x115ae9
callq 0xd4e3
movq -0x48(%rbp), %r14
movb $0x1, %al
jmp 0x50f2b
movq -0x48(%rbp), %r14
xorl %eax, %eax
jmp 0x50f2b
xorl %eax, %eax
movq -0x58(%rbp), %r14
testb %al, %al
jne 0x50e1c
andq %r13, %r12
sete %al
testb $0x3, %r13b
setne %cl
orb %al, %cl
jne 0x50f60
decl (%r12)
jne 0x50f60
shlq $0x30, %r15
orq %r13, %r15
leaq 0xc4c69(%rip), %rsi     # 0x115bc1
movq %r15, %rdi
callq 0xd4e3
movq -0x60(%rbp), %rax
movq %r14, (%rax)
movl -0x2c(%rbp), %eax
movq -0x50(%rbp), %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf9f7
movq $0x20, 0x10(%rax)
movups 0x937b7(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0x937bc(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5