// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_StackType_freshen
static struct std_list_List_1 mw_mirth_type_StackType_freshen (struct mirth_mirth_zaMirth* in_zaMirth_1, struct std_list_List_1 in_Subst_2, struct mirth_type_StackType in_StackType_3, struct mirth_mirth_zaMirth* *out_zaMirth_4, struct mirth_type_StackType *out_StackType_6) {
	struct mirth_mirth_zaMirth* v7;
	struct mirth_type_StackType v8 = mw_mirth_type_StackType_expand(in_zaMirth_1, in_StackType_3, &v7);
	struct std_list_List_1 branch_Subst_9;
	struct mirth_mirth_zaMirth* branch_zaMirth_10;
	struct mirth_type_StackType branch_StackType_11;
	switch ((v8).tag) {
		case mirth_type_StackType_Unit: {
			struct mirth_type_StackType v12 = { .tag=mirth_type_StackType_Unit };
			branch_StackType_11 = v12;
			branch_zaMirth_10 = v7;
			branch_Subst_9 = in_Subst_2;
		} break;
		case mirth_type_StackType_Cons: {
			struct mirth_type_Type v13;
			struct mirth_type_StackType v14 = mtp_mirth_type_StackType_Cons(v8, &v13);
			struct mirth_mirth_zaMirth* v15;
			struct mirth_type_StackType v16;
			struct std_list_List_1 v17 = mw_mirth_type_StackType_freshen(v7, in_Subst_2, v14, &v15, &v16);
			struct mirth_mirth_zaMirth* v18;
			struct mirth_type_Type v19;
			struct std_list_List_1 v20 = mw_mirth_type_Type_freshen(v15, v17, v13, &v18, &v19);
			struct mirth_type_StackType v21 = mtw_mirth_type_StackType_Cons(v16, v19);
			branch_StackType_11 = v21;
			branch_zaMirth_10 = v18;
			branch_Subst_9 = v20;
		} break;
		case mirth_type_StackType_With: {
			struct mirth_type_Type v22;
			struct mirth_type_StackType v23 = mtp_mirth_type_StackType_With(v8, &v22);
			struct mirth_mirth_zaMirth* v24;
			struct mirth_type_StackType v25;
			struct std_list_List_1 v26 = mw_mirth_type_StackType_freshen(v7, in_Subst_2, v23, &v24, &v25);
			struct mirth_mirth_zaMirth* v27;
			struct mirth_type_Type v28;
			struct std_list_List_1 v29 = mw_mirth_type_Resource_freshen(v24, v26, v22, &v27, &v28);
			struct mirth_type_StackType v30 = mtw_mirth_type_StackType_With(v25, v28);
			branch_StackType_11 = v30;
			branch_zaMirth_10 = v27;
			branch_Subst_9 = v29;
		} break;
		case mirth_type_StackType_ConsLabel: {
			struct mirth_type_Type v31;
			uint64_t v32;
			struct mirth_type_StackType v33 = mtp_mirth_type_StackType_ConsLabel(v8, &v31, &v32);
			struct mirth_mirth_zaMirth* v34;
			struct mirth_type_StackType v35;
			struct std_list_List_1 v36 = mw_mirth_type_StackType_freshen(v7, in_Subst_2, v33, &v34, &v35);
			struct mirth_mirth_zaMirth* v37;
			struct mirth_type_Type v38;
			struct std_list_List_1 v39 = mw_mirth_type_Type_freshen(v34, v36, v31, &v37, &v38);
			struct mirth_type_StackType v40 = mtw_mirth_type_StackType_ConsLabel(v35, v38, v32);
			branch_StackType_11 = v40;
			branch_zaMirth_10 = v37;
			branch_Subst_9 = v39;
		} break;
		case mirth_type_StackType_WithLabel: {
			struct mirth_type_Type v41;
			uint64_t v42;
			struct mirth_type_StackType v43 = mtp_mirth_type_StackType_WithLabel(v8, &v41, &v42);
			struct mirth_mirth_zaMirth* v44;
			struct mirth_type_StackType v45;
			struct std_list_List_1 v46 = mw_mirth_type_StackType_freshen(v7, in_Subst_2, v43, &v44, &v45);
			struct mirth_mirth_zaMirth* v47;
			struct mirth_type_Type v48;
			struct std_list_List_1 v49 = mw_mirth_type_Resource_freshen(v44, v46, v41, &v47, &v48);
			struct mirth_type_StackType v50 = mtw_mirth_type_StackType_WithLabel(v45, v48, v42);
			branch_StackType_11 = v50;
			branch_zaMirth_10 = v47;
			branch_Subst_9 = v49;
		} break;
		default: {
			struct mirth_type_Type v51 = mw_mirth_type_StackType_zgType(v8);
			struct mirth_mirth_zaMirth* v52;
			struct mirth_type_Type v53;
			struct std_list_List_1 v54 = mw_mirth_type_Type_freshen(v7, in_Subst_2, v51, &v52, &v53);
			struct mirth_type_StackType v55 = mw_mirth_type_Type_zgStackType(v53);
			branch_StackType_11 = v55;
			branch_zaMirth_10 = v52;
			branch_Subst_9 = v54;
		} break;
	}
	*out_StackType_6 = branch_StackType_11;
	*out_zaMirth_4 = branch_zaMirth_10;
	return branch_Subst_9;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %r13
movq %rdx, %r14
movl %esi, %r15d
movq 0x10(%rbp), %rbx
leaq -0x30(%rbp), %rax
movl %ecx, %esi
movq %r8, %rdx
movq %rax, %rcx
callq 0x3917b
leal -0x2(%rax), %ecx
cmpl $0x6, %ecx
ja 0x4b7ae
leaq 0x9758b(%rip), %rsi     # 0xe2d20
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
movl $0x2, %eax
movq -0x30(%rbp), %r12
xorl %edx, %edx
jmp 0x4ba30
movl %eax, %edi
movq %rdx, %rsi
callq 0x3cf9e
movq %rdx, %r8
movq -0x30(%rbp), %rdi
leaq -0x78(%rbp), %rbx
movq %rbx, (%rsp)
leaq -0x68(%rbp), %r12
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r12, %r9
callq 0x4b07d
movl %eax, %r15d
movq %rdx, %r14
movl (%rbx), %edi
movq 0x8(%rbx), %rsi
movq 0x10(%rbp), %rbx
callq 0x391d9
movq (%r12), %r12
jmp 0x4ba30
movq %r13, -0x38(%rbp)
leaq -0x78(%rbp), %r13
leaq -0x48(%rbp), %rax
movq %rdx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x393cd
movq %rdx, %r8
movq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rbx
movq %rbx, (%rsp)
leaq -0x40(%rbp), %r12
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r12, %r9
callq 0x4b757
movq (%r12), %rdi
movl (%r13), %ecx
movq 0x8(%r13), %r8
leaq -0x58(%rbp), %r13
movq %r13, (%rsp)
leaq -0x80(%rbp), %r12
movl %eax, %esi
movq %r12, %r9
callq 0x4b07d
movl %eax, %r15d
movq %rdx, %r14
leaq -0x48(%rbp), %rax
movq (%rax), %r8
movl (%rbx), %edi
movq 0x8(%rbx), %rsi
movq 0x10(%rbp), %rbx
movl (%r13), %edx
movq 0x8(%r13), %rcx
movq -0x38(%rbp), %r13
callq 0x3dc1a
movq (%r12), %r12
movl $0x6, %eax
jmp 0x4ba30
leaq -0x78(%rbp), %r12
movq %rdx, %rdi
movq %r12, %rsi
callq 0x392bf
movq %rdx, %r8
movq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rbx
movq %rbx, (%rsp)
movq %r13, -0x38(%rbp)
leaq -0x48(%rbp), %r13
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r13, %r9
callq 0x4b757
movq (%r13), %rdi
movl (%r12), %ecx
movq 0x8(%r12), %r8
leaq -0x58(%rbp), %r13
movq %r13, (%rsp)
leaq -0x40(%rbp), %r12
movl %eax, %esi
movq %r12, %r9
callq 0x4b07d
movl %eax, %r15d
movq %rdx, %r14
movl (%rbx), %edi
movq 0x8(%rbx), %rsi
movq 0x10(%rbp), %rbx
movl (%r13), %edx
movq 0x8(%r13), %rcx
movq -0x38(%rbp), %r13
callq 0x20b1a
movq (%r12), %r12
movl $0x5, %eax
jmp 0x4ba30
leaq -0x68(%rbp), %r12
movq %rdx, %rdi
movq %r12, %rsi
callq 0x39346
movq %rdx, %r8
movq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %rcx
movq %rcx, (%rsp)
movq %r13, %rbx
leaq -0x40(%rbp), %r13
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r13, %r9
callq 0x4b757
movq (%r13), %rdi
movl (%r12), %ecx
movq 0x8(%r12), %r8
leaq -0x78(%rbp), %r13
movq %r13, (%rsp)
leaq -0x48(%rbp), %r12
movl %eax, %esi
movq %r12, %r9
callq 0x4b07d
movl %eax, %r15d
movq %rdx, %r14
movl (%r13), %edx
movq 0x8(%r13), %rcx
movq %rbx, %r13
movq 0x10(%rbp), %rbx
movq (%r12), %r12
leaq -0x58(%rbp), %rax
movl (%rax), %edi
movq 0x8(%rax), %rsi
callq 0x21053
movl $0x7, %eax
jmp 0x4ba30
movq %r13, -0x38(%rbp)
leaq -0x68(%rbp), %r13
leaq -0x40(%rbp), %rax
movq %rdx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x39471
movq %rdx, %r8
movq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %rbx
movq %rbx, (%rsp)
leaq -0x80(%rbp), %r12
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r12, %r9
callq 0x4b757
movq (%r12), %rdi
movl (%r13), %ecx
movq 0x8(%r13), %r8
leaq -0x78(%rbp), %r13
movq %r13, (%rsp)
leaq -0x48(%rbp), %r12
movl %eax, %esi
movq %r12, %r9
callq 0x4b07d
movl %eax, %r15d
movq %rdx, %r14
movl (%r13), %edx
movq 0x8(%r13), %rcx
movq -0x38(%rbp), %r13
movq (%r12), %r12
leaq -0x40(%rbp), %rax
movq (%rax), %r8
movl (%rbx), %edi
movq 0x8(%rbx), %rsi
movq 0x10(%rbp), %rbx
callq 0x3e2fd
movl $0x8, %eax
movl %eax, (%rbx)
movl $0x0, 0x4(%rbx)
movq %rdx, 0x8(%rbx)
movq %r12, (%r13)
movl %r15d, %eax
movq %r14, %rdx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq