// File: /workspace/github_c_makefile_star2_O1/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 0x4b6b6
movl %ecx, %ebx
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r12
movl %ecx, %eax
leaq 0x97c3d(%rip), %rcx     # 0xe2ce8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r13d, %r13d
movl %ebx, %eax
jmp 0x4b691
leaq -0x80(%rbp), %rbx
movq %r8, %rdi
movq %rbx, %rsi
movq %r9, -0x30(%rbp)
callq 0x2e294
movq %rdx, %r8
movl (%rbx), %r13d
movq 0x8(%rbx), %rcx
movq %rcx, -0x38(%rbp)
leaq -0x60(%rbp), %rcx
movq %rcx, (%rsp)
leaq -0x68(%rbp), %rbx
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %rbx, %r9
callq 0x4b07d
movq (%rbx), %rdi
leaq -0x50(%rbp), %r12
movq %r12, (%rsp)
leaq -0x88(%rbp), %rbx
movl %eax, %esi
movl %r13d, %ecx
movq -0x38(%rbp), %r8
movq %rbx, %r9
callq 0x4b07d
movl %eax, %r15d
movq %rdx, %r14
movl (%r12), %edx
movq 0x8(%r12), %rcx
leaq -0x60(%rbp), %rax
movl (%rax), %edi
movq 0x8(%rax), %rsi
movq (%rbx), %r12
callq 0x1f801
movq -0x30(%rbp), %r9
movq %rdx, %r13
movl $0xb, %ebx
jmp 0x4b50c
movq %r9, -0x30(%rbp)
movq 0x8(%r8), %rbx
decl (%r8)
jne 0x4b168
movq %r8, %rdi
callq 0x5030
movq %rbx, %rdi
callq 0x39570
movq %rax, %r13
movl $0x4, %ebx
jmp 0x4b68d
movq %r8, %rdi
movq %r9, %rbx
callq 0x2e31b
movq %rdx, %r8
leaq -0x60(%rbp), %r13
movq %r13, (%rsp)
leaq -0x50(%rbp), %r9
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r9, %r12
callq 0x4b07d
movl %eax, %r15d
movq %rdx, %r14
movl (%r13), %edi
movq 0x8(%r13), %rsi
callq 0x3f26f
movq %rbx, %r9
movq %rdx, %r13
movq (%r12), %r12
movl $0xc, %ebx
jmp 0x4b50c
movq %r8, %rdi
movq %r9, %rbx
callq 0x2e254
movq %rdx, %r8
leaq -0x60(%rbp), %r13
movq %r13, (%rsp)
leaq -0x50(%rbp), %r9
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r9, %r12
callq 0x4b757
movl %eax, %r15d
movq %rdx, %r14
movl (%r13), %edi
movq 0x8(%r13), %rsi
callq 0x3e9e0
movq %rbx, %r9
movq %rax, %r13
movq (%r12), %r12
movl $0x9, %ebx
jmp 0x4b50c
movq %r9, -0x30(%rbp)
movl 0x4(%r8), %ebx
decl (%r8)
jne 0x4b23a
movq %r8, %rdi
callq 0x5030
movl %ebx, %edi
callq 0x1ef8a
movq %rdx, %r13
movl $0x2, %ebx
jmp 0x4b68d
movq %r9, -0x30(%rbp)
movq 0x8(%r8), %rbx
decl (%r8)
jne 0x4b263
movq %r8, %rdi
callq 0x5030
leaq -0x50(%rbp), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2e11b
cmpl $0x1, %eax
je 0x4b511
testl %eax, %eax
jne 0x4b6b6
movq -0x50(%rbp), %r12
leaq 0x10ce612(%rip), %rdi   # 0x11198a0
movq %rbx, %rsi
callq 0x13ff0
movq %rax, %rdi
callq 0x140f0
movq %rax, %rbx
movq 0x10ce608(%rip), %r13   # 0x11198b0
incq %r13
movq %r13, 0x10ce5fe(%rip)   # 0x11198b0
leaq 0x10ce5e7(%rip), %rdi   # 0x11198a0
movq %r13, %rsi
callq 0x13ff0
andq $-0x4, %rbx
leaq 0xca81d(%rip), %rsi     # 0x115ae9
movq %rbx, %rdi
movq %rax, %rdx
callq 0x14ab5
movq %r13, %rdi
callq 0x2e4c2
movq %rdx, %r13
movl $0x3, %ebx
jmp 0x4b68d
movq %r9, -0x30(%rbp)
movq 0x8(%r8), %rbx
decl (%r8)
jne 0x4b301
movq %r8, %rdi
callq 0x5030
movq %rbx, %rdi
callq 0x20cc8
movq %rax, %r13
movl $0x7, %ebx
jmp 0x4b68d
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0x4b691
movq 0x8(%r8), %rax
movq %rax, -0x38(%rbp)
decl (%r8)
jne 0x4b33b
movq %r8, %rdi
movq %r9, %rbx
callq 0x5030
movq %rbx, %r9
movq %r9, -0x30(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
movq %r14, %rbx
andq %rax, %rbx
setne %al
testb $0x3, %r14b
sete %r13b
andb %al, %r13b
cmpb $0x1, %r13b
jne 0x4b365
incl (%rbx)
movq -0x38(%rbp), %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x433aa
movl %eax, %edi
movq %rdx, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x4b3b8
decl (%rax)
jne 0x4b3b8
movq %rdi, -0x40(%rbp)
movq -0x40(%rbp), %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0xc9f12(%rip), %rsi     # 0x1152c1
callq 0xd4e3
movq -0x40(%rbp), %rdi
leaq 0x1(,%rdi,2), %rdi
movl $0x1, %esi
callq 0xec04
testl %eax, %eax
je 0x4b5ea
testb %r13b, %r13b
je 0x4b3d9
incl (%rbx)
movq -0x38(%rbp), %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x433aa
movl %eax, %ebx
testl %eax, %eax
je 0x4b68a
cmpl $0x1, %ebx
jne 0x4b6b6
movq %rdx, %rdi
callq 0xdaeb
movq %rax, %rbx
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
andq %rax, %r13
shrq $0x30, %rbx
jmp 0x4b68d
movq %r8, %rdi
movq %r9, -0x30(%rbp)
callq 0x2e35b
leaq -0x50(%rbp), %rbx
movq %r12, %rdi
movl %eax, %esi
movq %rbx, %rcx
callq 0x3b039
movq %rdx, %r8
movq (%rbx), %rdi
leaq -0x60(%rbp), %r13
movq %r13, (%rsp)
leaq -0x80(%rbp), %r12
movl %r15d, %esi
movq %r14, %rdx
movl %eax, %ecx
movq %r12, %r9
callq 0x4b07d
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 0x4b691
movq %r9, -0x30(%rbp)
movq 0x8(%r8), %rbx
decl (%r8)
jne 0x4b48f
movq %r8, %rdi
callq 0x5030
movq %rbx, %rdi
callq 0x3f21c
movq %rax, %r13
movl $0x6, %ebx
jmp 0x4b68d
movq %r8, %rdi
movq %r9, %rbx
callq 0x2e219
leaq -0x60(%rbp), %r8
leaq -0x50(%rbp), %r13
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rdx
movq %rax, %rcx
movq %r8, %r12
movq %r13, %r9
callq 0x4ba56
movl %eax, %r15d
movq %rdx, %r14
movq (%r13), %rdi
callq 0x36174
movq %rbx, %r9
movq %rdx, %r13
movq (%r12), %r12
movl $0xa, %ebx
jmp 0x4b50c
movq %r8, %rdi
movq %r9, %rbx
callq 0x2e1de
movq %rax, %rdi
callq 0x3f1c1
movq %rbx, %r9
movq %rdx, %r13
movl $0x8, %ebx
jmp 0x4b691
movq %rbx, -0x38(%rbp)
movabsq $0xfffffffffffc, %r12   # imm = 0xFFFFFFFFFFFC
movq %rdx, %rdi
callq 0xdaeb
movq -0x50(%rbp), %rdi
movq %rax, %rsi
shrq $0x30, %rsi
andq %r12, %rax
leaq -0x80(%rbp), %rcx
movq %rax, %rdx
callq 0x2e18a
movq %rdx, %r13
movq %rax, -0x40(%rbp)
movq %rax, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0xca590(%rip), %rsi     # 0x115ae9
movq %rdx, %rax
andq %r12, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x4b56f
incl (%rax)
callq 0x95f6
movq %rdx, %rbx
movq -0x80(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0x10cdea2(%rip), %rdi   # 0x1119428
movq -0x38(%rbp), %rsi
callq 0x13ff0
addq $0x4, %r12
orq %rbx, %r12
leaq 0xc9d24(%rip), %rsi     # 0x1152c1
movq %r12, %rdi
movq %rax, %rdx
callq 0x14ab5
leaq -0x60(%rbp), %r12
movq %r12, (%rsp)
leaq -0x68(%rbp), %r9
movq -0x70(%rbp), %rdi
movl %r15d, %esi
movq %r14, %rdx
movq -0x40(%rbp), %rcx
movq %r13, %r8
callq 0x4b07d
movl %eax, %r15d
movq %rdx, %r14
movl (%r12), %ebx
movl 0x4(%r12), %eax
movq 0x8(%r12), %r13
leaq -0x68(%rbp), %rcx
movq (%rcx), %r12
jmp 0x4b68d
leaq 0x10cd9ff(%rip), %rdi   # 0x1118ff0
movq -0x38(%rbp), %rsi
callq 0x13ff0
movq %rax, %rdi
callq 0x140f0
movq %rax, %rbx
movq 0x10ce2a4(%rip), %r13   # 0x11198b0
incq %r13
movq %r13, 0x10ce29a(%rip)   # 0x11198b0
leaq 0x10ce283(%rip), %rdi   # 0x11198a0
movq %r13, %rsi
callq 0x13ff0
andq $-0x4, %rbx
leaq 0xca4b9(%rip), %rsi     # 0x115ae9
movq %rbx, %rdi
movq %rax, %rdx
callq 0x14ab5
movq %r13, %rdi
callq 0x2e4c2
movq %rdx, %r13
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %r13, %rdx
sete %al
testb $0x3, %r13b
setne %cl
orb %al, %cl
jne 0x4b663
incl (%rdx)
movl $0x3, %ebx
movl $0x3, %edi
movq %r13, %rsi
movq -0x38(%rbp), %rdx
movl %r15d, %ecx
movq %r14, %r8
callq 0x42925
movq %rax, %r14
movl $0x1, %r15d
jmp 0x4b68d
xorl %r13d, %r13d
movq -0x30(%rbp), %r9
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
movl $0x20, %edi
callq 0xf9f7
movq $0x20, 0x10(%rax)
movups 0x9907e(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0x99083(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5