// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_Type_freshen
static struct std_list_List_1 mw_mirth_type_Type_freshen (struct mirth_mirth_zaMirth* in_zaMirth_1, struct std_list_List_1 in_Subst_2, struct mirth_type_Type in_Type_3, struct mirth_mirth_zaMirth* *out_zaMirth_4, struct mirth_type_Type *out_Type_6) {
	struct mirth_mirth_zaMirth* branch_zaMirth_7;
	struct std_list_List_1 branch_Subst_8;
	struct mirth_type_Type branch_Type_9;
	switch ((in_Type_3).tag) {
		case mirth_type_Type_Error: {
			struct mirth_type_Type v10 = { .tag=mirth_type_Type_Error };
			branch_Type_9 = v10;
			branch_Subst_8 = in_Subst_2;
			branch_zaMirth_7 = in_zaMirth_1;
		} break;
		case mirth_type_Type_Ignore: {
			struct mirth_type_Type v11 = { .tag=mirth_type_Type_Ignore };
			branch_Type_9 = v11;
			branch_Subst_8 = in_Subst_2;
			branch_zaMirth_7 = in_zaMirth_1;
		} break;
		case mirth_type_Type_Prim: {
			enum mirth_type_PrimType v12 = mtp_mirth_type_Type_Prim(in_Type_3);
			struct mirth_type_Type v13 = mtw_mirth_type_Type_Prim(v12);
			branch_Type_9 = v13;
			branch_Subst_8 = in_Subst_2;
			branch_zaMirth_7 = in_zaMirth_1;
		} break;
		case mirth_type_Type_Hole: {
			uint64_t v14 = mtp_mirth_type_Type_Hole(in_Type_3);
			struct mirth_type_Type v15 = mtw_mirth_type_Type_Hole(v14);
			branch_Type_9 = v15;
			branch_Subst_8 = in_Subst_2;
			branch_zaMirth_7 = in_zaMirth_1;
		} break;
		case mirth_type_Type_Data: {
			uint64_t v16 = mtp_mirth_type_Type_Data(in_Type_3);
			struct mirth_type_Type v17 = mtw_mirth_type_Type_Data(v16);
			branch_Type_9 = v17;
			branch_Subst_8 = in_Subst_2;
			branch_zaMirth_7 = in_zaMirth_1;
		} break;
		case mirth_type_Type_DataPartial: {
			struct mirth_data_DataPartial* v18 = mtp_mirth_type_Type_DataPartial(in_Type_3);
			struct mirth_type_Type v19 = mtw_mirth_type_Type_DataPartial(v18);
			branch_Type_9 = v19;
			branch_Subst_8 = in_Subst_2;
			branch_zaMirth_7 = in_zaMirth_1;
		} break;
		case mirth_type_Type_Table: {
			uint64_t v20 = mtp_mirth_type_Type_Table(in_Type_3);
			struct mirth_type_Type v21 = mtw_mirth_type_Type_Table(v20);
			branch_Type_9 = v21;
			branch_Subst_8 = in_Subst_2;
			branch_zaMirth_7 = in_zaMirth_1;
		} break;
		case mirth_type_Type_Value: {
			struct mirth_type_Value v22 = mtp_mirth_type_Type_Value(in_Type_3);
			struct mirth_mirth_zaMirth* v23;
			struct mirth_type_Type v24 = mw_mirth_type_Value_type(in_zaMirth_1, v22, &v23);
			struct mirth_mirth_zaMirth* v25;
			struct mirth_type_Type v26;
			struct std_list_List_1 v27 = mw_mirth_type_Type_freshen(v23, in_Subst_2, v24, &v25, &v26);
			branch_Type_9 = v26;
			branch_Subst_8 = v27;
			branch_zaMirth_7 = v25;
		} break;
		case mirth_type_Type_Var: {
			uint64_t v28 = mtp_mirth_type_Type_Var(in_Type_3);
			struct mirth_mirth_zaMirth* v29;
			struct mirth_type_Type v30;
			struct std_list_List_1 v31 = mw_mirth_var_Var_freshen(in_zaMirth_1, in_Subst_2, v28, &v29, &v30);
			branch_Type_9 = v30;
			branch_Subst_8 = v31;
			branch_zaMirth_7 = v29;
		} break;
		case mirth_type_Type_Meta: {
			uint64_t v32 = mtp_mirth_type_Type_Meta(in_Type_3);
			struct mirth_mirth_zaMirth* v33;
			struct mirth_type_Type v34;
			struct std_list_List_1 v35 = mw_mirth_type_MetaVar_freshen(in_zaMirth_1, in_Subst_2, v32, &v33, &v34);
			branch_Type_9 = v34;
			branch_Subst_8 = v35;
			branch_zaMirth_7 = v33;
		} break;
		case mirth_type_Type_Stack: {
			struct mirth_type_StackType v36 = mtp_mirth_type_Type_Stack(in_Type_3);
			struct mirth_mirth_zaMirth* v37;
			struct mirth_type_StackType v38;
			struct std_list_List_1 v39 = mw_mirth_type_StackType_freshen(in_zaMirth_1, in_Subst_2, v36, &v37, &v38);
			struct mirth_type_Type v40 = mtw_mirth_type_Type_Stack(v38);
			branch_Type_9 = v40;
			branch_Subst_8 = v39;
			branch_zaMirth_7 = v37;
		} break;
		case mirth_type_Type_Arrow: {
			struct mirth_type_ArrowType* v41 = mtp_mirth_type_Type_Arrow(in_Type_3);
			struct mirth_mirth_zaMirth* v42;
			struct mirth_type_ArrowType* v43;
			struct std_list_List_1 v44 = mw_mirth_type_ArrowType_freshen(in_zaMirth_1, in_Subst_2, v41, &v42, &v43);
			struct mirth_type_Type v45 = mtw_mirth_type_Type_Arrow(v43);
			branch_Type_9 = v45;
			branch_Subst_8 = v44;
			branch_zaMirth_7 = v42;
		} break;
		case mirth_type_Type_App: {
			struct mirth_type_Type v46;
			struct mirth_type_Type v47 = mtp_mirth_type_Type_App(in_Type_3, &v46);
			struct mirth_mirth_zaMirth* v48;
			struct mirth_type_Type v49;
			struct mirth_type_Type v50;
			struct std_list_List_1 v51 = mw_mirth_type_Type_freshen2(in_zaMirth_1, in_Subst_2, v47, v46, &v48, &v49, &v50);
			struct mirth_type_Type v52 = mtw_mirth_type_Type_App(v49, v50);
			branch_Type_9 = v52;
			branch_Subst_8 = v51;
			branch_zaMirth_7 = v48;
		} break;
		case mirth_type_Type_Mut: {
			struct mirth_type_Type v53 = mtp_mirth_type_Type_Mut(in_Type_3);
			struct mirth_mirth_zaMirth* v54;
			struct mirth_type_Type v55;
			struct std_list_List_1 v56 = mw_mirth_type_Type_freshen(in_zaMirth_1, in_Subst_2, v53, &v54, &v55);
			struct mirth_type_Type v57 = mtw_mirth_type_Type_Mut(v55);
			branch_Type_9 = v57;
			branch_Subst_8 = v56;
			branch_zaMirth_7 = v54;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_Type_6 = branch_Type_9;
	*out_zaMirth_4 = branch_zaMirth_7;
	return branch_Subst_8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
cmpl $0xd, %ecx
ja 0x45d3b
movl %ecx, %ebx
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r12
movl %ecx, %eax
leaq 0x8d4f4(%rip), %rcx     # 0xd2cfc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r13d, %r13d
movl %ebx, %eax
jmp 0x45c0b
leaq -0x68(%rbp), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r9, -0x30(%rbp)
callq 0x2ad00
movq %rdx, %r8
movl (%rbx), %r13d
movq 0x8(%rbx), %rcx
movq %rcx, -0x38(%rbp)
leaq -0x48(%rbp), %rcx
movq %rcx, (%rsp)
leaq -0x80(%rbp), %rbx
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %rbx, %r9
callq 0x457da
movq (%rbx), %rdi
leaq -0x58(%rbp), %r12
movq %r12, (%rsp)
leaq -0x78(%rbp), %rbx
movl %eax, %esi
movl %r13d, %ecx
movq -0x38(%rbp), %r8
movq %rbx, %r9
callq 0x457da
movl %eax, %r15d
movq %rdx, %r14
movl (%r12), %edx
movq 0x8(%r12), %rcx
leaq -0x48(%rbp), %rax
movl (%rax), %edi
movq 0x8(%rax), %rsi
movq (%rbx), %r12
callq 0x1cff2
movq -0x30(%rbp), %r9
movq %rdx, %r13
pushq $0xb
jmp 0x45c0a
movq %r8, %rdi
movq %r9, %rbx
callq 0x2abd6
movq %rax, %rdi
callq 0x351c6
movq %rbx, %r9
movq %rax, %r13
pushq $0x4
jmp 0x45c0a
movq %r8, %rdi
movq %r9, %rbx
callq 0x2ad87
movq %rdx, %r8
leaq -0x48(%rbp), %r13
movq %r13, (%rsp)
leaq -0x58(%rbp), %r9
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r9, %r12
callq 0x457da
movl %eax, %r15d
movq %rdx, %r14
movl (%r13), %edi
movq 0x8(%r13), %rsi
callq 0x3a8f3
movq %rbx, %r9
movq %rdx, %r13
movq (%r12), %r12
pushq $0xc
jmp 0x45c0a
movq %r8, %rdi
movq %r9, %rbx
callq 0x2acc0
movq %rdx, %r8
leaq -0x48(%rbp), %r13
movq %r13, (%rsp)
leaq -0x58(%rbp), %r9
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r9, %r12
callq 0x45e10
movl %eax, %r15d
movq %rdx, %r14
movl (%r13), %edi
movq 0x8(%r13), %rsi
callq 0x3a0fa
movq %rbx, %r9
movq %rax, %r13
movq (%r12), %r12
pushq $0x9
jmp 0x45c0a
movq %r8, %rdi
movq %r9, %rbx
callq 0x2aa5d
movl %eax, %edi
callq 0x1c77d
movq %rbx, %r9
movq %rdx, %r13
pushq $0x2
jmp 0x45c0a
movq %r9, -0x30(%rbp)
movq %r8, %rdi
callq 0x2aabf
movq %rax, %rbx
leaq -0x58(%rbp), %rdx
movq %r12, %rdi
movq %rax, %rsi
callq 0x2aadc
cmpl $0x1, %eax
je 0x45c7e
testl %eax, %eax
jne 0x45d3b
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %r12
movq %rbx, %rsi
movq %r12, %rdx
callq 0x461bf
movq (%r12), %rdi
leaq -0x68(%rbp), %rbx
movl %eax, %esi
movq %rbx, %rcx
callq 0x3a324
movq %rax, %rdi
callq 0x2aeef
movq %rdx, %r13
movq (%rbx), %r12
pushq $0x3
popq %rbx
jmp 0x45d32
movq %r8, %rdi
movq %r9, %rbx
callq 0x2ac2d
movq %rax, %rdi
callq 0x1e4a9
movq %rbx, %r9
movq %rax, %r13
pushq $0x7
jmp 0x45c0a
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0x45c0b
movq %r9, -0x30(%rbp)
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
movq %r8, %rdi
callq 0x2abf3
movq %r14, %rdx
andq %rbx, %rdx
setne %cl
testb $0x3, %r14b
sete %r13b
andb %cl, %r13b
cmpb $0x1, %r13b
jne 0x45a51
incl (%rdx)
movq %rdx, -0x70(%rbp)
movq %rax, -0x38(%rbp)
movq %rax, %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x3e3b5
movl %eax, %ebx
movq %rdx, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x45aa2
decl (%rax)
jne 0x45aa2
movq %rbx, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0xc2824(%rip), %rsi     # 0x1082c1
callq 0xce94
movq %rbx, %rdi
callq 0xd86d
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0xd759
testb %al, %al
je 0x45c30
leaq -0x48(%rbp), %rbx
movq %r12, %rdi
movq -0x38(%rbp), %rsi
movq %rbx, %rdx
callq 0x32ea4
movq (%rbx), %rdi
leaq -0x48(%rbp), %rcx
movl %eax, %esi
callq 0x3a324
movq %rax, %rdi
callq 0x2aeef
movq %rdx, %r13
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %r13, %rdx
sete %al
testb $0x3, %r13b
setne %cl
orb %al, %cl
jne 0x45b06
incl (%rdx)
pushq $0x3
popq %rbx
movl %ebx, %edi
movq %r13, %rsi
movq -0x38(%rbp), %rdx
movl %r15d, %ecx
movq %r14, %r8
callq 0x3da19
movq %rax, %r14
movq -0x48(%rbp), %r12
pushq $0x1
popq %r15
jmp 0x45d32
movq %r8, %rdi
movq %r9, -0x30(%rbp)
callq 0x2adc7
leaq -0x58(%rbp), %rbx
movq %r12, %rdi
movl %eax, %esi
movq %rbx, %rcx
callq 0x36a03
movq %rdx, %r8
movq (%rbx), %rdi
leaq -0x48(%rbp), %r13
movq %r13, (%rsp)
leaq -0x68(%rbp), %r12
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r12, %r9
callq 0x457da
movq -0x30(%rbp), %r9
movl %eax, %r15d
movq %rdx, %r14
movl (%r13), %ebx
movl 0x4(%r13), %eax
movq 0x8(%r13), %r13
movq (%r12), %r12
jmp 0x45c0b
movq %r8, %rdi
movq %r9, %rbx
callq 0x2ac10
movq %rax, %rdi
callq 0x3a8aa
movq %rbx, %r9
movq %rax, %r13
pushq $0x6
jmp 0x45c0a
movq %r8, %rdi
movq %r9, %rbx
callq 0x2ac85
leaq -0x48(%rbp), %r8
leaq -0x58(%rbp), %r13
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rdx
movq %rax, %rcx
movq %r8, %r12
movq %r13, %r9
callq 0x460fd
movl %eax, %r15d
movq %rdx, %r14
movq (%r13), %rdi
callq 0x3233d
movq %rbx, %r9
movq %rdx, %r13
movq (%r12), %r12
pushq $0xa
jmp 0x45c0a
movq %r8, %rdi
movq %r9, %rbx
callq 0x2ac4a
movq %rax, %rdi
callq 0x3a85b
movq %rbx, %r9
movq %rdx, %r13
pushq $0x8
popq %rbx
movq 0x10(%rbp), %rcx
movl %ebx, (%rcx)
movl %eax, 0x4(%rcx)
movq %r13, 0x8(%rcx)
movq %r12, (%r9)
movl %r15d, %eax
movq %r14, %rdx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %r13b, %r13b
movq -0x38(%rbp), %rdi
je 0x45c3f
movq -0x70(%rbp), %rax
incl (%rax)
movl %r15d, %esi
movq %r14, %rdx
callq 0x3e3b5
movl %eax, %ebx
testl %eax, %eax
je 0x45d2f
cmpl $0x1, %ebx
jne 0x45d3b
movq %rdx, %rdi
callq 0xd491
movq %rax, %rbx
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
andq %rax, %r13
shrq $0x30, %rbx
jmp 0x45d32
movq %rdx, %rdi
callq 0xd491
movq -0x58(%rbp), %rdi
movq %rax, %rsi
shrq $0x30, %rsi
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
andq %r13, %rax
leaq -0x68(%rbp), %rcx
movq %rax, %rdx
callq 0x2ab4b
movq %rdx, %r12
movq %rax, -0x38(%rbp)
movq %rax, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0xc2e27(%rip), %rsi     # 0x108ae9
andq %rdx, %r13
sete %al
testb $0x3, %r12b
setne %cl
orb %al, %cl
jne 0x45cd7
incl (%r13)
callq 0x8d0c
movq -0x68(%rbp), %rdi
leaq -0x80(%rbp), %r13
movq %rdx, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x2ab8f
movq (%r13), %rdi
leaq -0x48(%rbp), %r13
movq %r13, (%rsp)
leaq -0x78(%rbp), %r9
movl %r15d, %esi
movq %r14, %rdx
movq -0x38(%rbp), %rcx
movq %r12, %r8
movq %r9, %r12
callq 0x457da
movl %eax, %r15d
movq %rdx, %r14
movl (%r13), %ebx
movl 0x4(%r13), %eax
movq 0x8(%r13), %r13
movq (%r12), %r12
jmp 0x45d32
xorl %r13d, %r13d
movq -0x30(%rbp), %r9
jmp 0x45c0b
leaq 0x8eacb(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6