// File: /workspace/github_c_makefile_star2_O3/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, %r12
movl %esi, %r13d
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
movq $0x0, -0x58(%rbp)
leaq -0x48(%rbp), %r14
leaq 0x8f733(%rip), %r15     # 0xdee24
movl $0x0, -0x2c(%rbp)
movl %r13d, %esi
movq %r12, %rdx
movq %r14, %rcx
callq 0x37fe3
movl %eax, %r13d
movq %rdx, %r12
leal -0x5(%r13), %eax
cmpl $0x3, %eax
ja 0x4f7ec
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq %r12, %rdi
leaq -0x40(%rbp), %rsi
callq 0x38125
jmp 0x4f752
movq %r12, %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x38233
jmp 0x4f752
movq %r12, %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x382d7
movl %eax, %r13d
movq %rdx, %r12
movq -0x38(%rbp), %rax
movq %rax, %rcx
andq %rbx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x4f78a
movl -0x40(%rbp), %edi
decl (%rcx)
jne 0x4f78a
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xc2364(%rip), %rsi     # 0x111ae9
callq 0xd13d
movq -0x48(%rbp), %rdi
jmp 0x4f6f8
movq %r12, %rdi
leaq -0x40(%rbp), %rsi
callq 0x381ac
movl %eax, %r13d
movq %rdx, %r12
movl -0x40(%rbp), %esi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rcx
callq 0x2cfb8
cmpl $0x1, %eax
jne 0x4f838
movq %rdx, %rdi
callq 0xd745
movq %rax, %rdi
movq %rdx, %rsi
movl -0x2c(%rbp), %edx
movq -0x58(%rbp), %rcx
callq 0xd1ec
movq %rdx, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movl $0x1, -0x2c(%rbp)
jmp 0x4f6f8
movq -0x48(%rbp), %r14
movq -0x60(%rbp), %r15
andq %r12, %rbx
sete %al
testb $0x3, %r12b
setne %cl
orb %al, %cl
jne 0x4f81f
decl (%rbx)
jne 0x4f81f
shlq $0x30, %r13
orq %r12, %r13
leaq 0xc23aa(%rip), %rsi     # 0x111bc1
movq %r13, %rdi
callq 0xd13d
movq %r14, (%r15)
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0x4f842
movq -0x50(%rbp), %r14
jmp 0x4f7f0
movl $0x20, %edi
callq 0xf5e4
movq $0x20, 0x10(%rax)
movups 0x90e72(%rip), %xmm0    # 0xe06cd
movups %xmm0, 0x18(%rax)
movups 0x90e77(%rip), %xmm0    # 0xe06dd
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x9302