// File: /workspace/github_c_makefile_star2_O3/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_zaTypeElab_elabzeselfzx
static struct std_either_Either_2 mw_mirth_elab_zaTypeElab_elabzeselfzx (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_elab_zaTypeElab* in_zaTypeElab_2, struct mirth_mirth_zaMirth* *out_zaMirth_3, struct mirth_elab_zaTypeElab* *out_zaTypeElab_4, struct std_list_List_1 *out_List_6) {
	struct mirth_mirth_zaMirth* v7;
	struct std_maybe_Maybe_1 v8 = mw_mirth_mirth_zaMirth_definingzetyconzy(in_zaMirth_1, &v7);
	struct mirth_elab_zaTypeElab* branch_zaTypeElab_9;
	struct std_either_Either_2 branch_Either_10;
	struct mirth_mirth_zaMirth* branch_zaMirth_11;
	struct std_list_List_1 branch_List_12;
	switch ((v8).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v13 = mtp_std_maybe_Maybe_1_Some(v8);
			incref(v13);
			struct mirth_mirth_zaMirth* v14;
			struct std_either_Either_2 v15 = mw_mirth_tycon_Tycon_fullzetype(v7, V_mirth_tycon_Tycon(v13), &v14);
			struct mirth_mirth_zaMirth* v16;
			struct std_list_List_1 v17 = mw_mirth_tycon_Tycon_params(v14, V_mirth_tycon_Tycon(v13), &v16);
			branch_List_12 = v17;
			branch_zaMirth_11 = v16;
			branch_Either_10 = v15;
			branch_zaTypeElab_9 = in_zaTypeElab_2;
		} break;
		case std_maybe_Maybe_1_None: {
			uint64_t v18 = in_zaTypeElab_2->mtoken;
			struct mirth_mirth_zaMirth* v19;
			struct std_maybe_Maybe_1 v20 = mw_mirth_token_Token_sigzeresourcezeconzy(v7, v18, &v19);
			int64_t v21 = (v20).tag;
			decref(MK_std_maybe_Maybe_1(v20));
			INT v22 = WRAP_I63(0LL);
			INT v23 = v22;
			INT v24 = i64_to_int(v21);
			bool v25 = int_eq(v24, v23);
			bool v26 = !v25;
			struct mirth_elab_zaTypeElab* branch_zaTypeElab_27;
			struct mirth_mirth_zaMirth* branch_zaMirth_28;
			struct std_either_Either_2 branch_Either_29;
			if (v26) {
				uint64_t v30 = in_zaTypeElab_2->mtoken;
				STR* v31;
				STRLIT(v31, "Not currently inside a type block, +Self is not bound.", 54);
				struct mirth_mirth_zaMirth* v32;
				mw_mirth_mirth_zaMirth_emitzeerrorzx(v19, v30, v31, &v32);
				struct mirth_type_Type v33 = mw_mirth_type_Resource_Error();
				struct std_either_Either_2 v34 = mtw_std_either_Either_2_Right(MK_mirth_type_Type(v33));
				branch_Either_29 = v34;
				branch_zaMirth_28 = v32;
				branch_zaTypeElab_27 = in_zaTypeElab_2;
			} else {
				uint64_t v35 = in_zaTypeElab_2->mtoken;
				STR* v36;
				STRLIT(v36, "Not currently inside a type block, Self is not bound.", 53);
				struct mirth_mirth_zaMirth* v37;
				mw_mirth_mirth_zaMirth_emitzeerrorzx(v19, v35, v36, &v37);
				struct mirth_type_Type v38 = { .tag=mirth_type_Type_Error };
				struct std_either_Either_2 v39 = mtw_std_either_Either_2_Left(MK_mirth_type_Type(v38));
				branch_Either_29 = v39;
				branch_zaMirth_28 = v37;
				branch_zaTypeElab_27 = in_zaTypeElab_2;
			}
			struct std_list_List_1 v40 = { .tag=std_list_List_1_Nil };
			branch_List_12 = v40;
			branch_zaMirth_11 = branch_zaMirth_28;
			branch_Either_10 = branch_Either_29;
			branch_zaTypeElab_9 = branch_zaTypeElab_27;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_List_6 = branch_List_12;
	*out_zaTypeElab_4 = branch_zaTypeElab_9;
	*out_zaMirth_3 = branch_zaMirth_11;
	return branch_Either_10;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movq %rdx, -0x50(%rbp)
movq %rsi, -0x60(%rbp)
movq %rdi, %rbx
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
movq 0x48(%rdi), %r14
movq %r14, %rax
andq %r13, %rax
setne %dl
testb $0x3, %r14b
sete %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x79927
addl $0x2, (%rax)
movl 0x18(%r14), %r12d
movq 0x20(%r14), %r15
movq %r15, %rdx
andq %r13, %rdx
sete %sil
testb $0x3, %r15b
setne %dil
orb %sil, %dil
jne 0x79948
incl (%rdx)
testb %cl, %cl
je 0x7995f
decl (%rax)
jne 0x7995f
movq %r14, %rdi
leaq 0x97f07(%rip), %rsi     # 0x111861
callq 0xd13d
testl %r12d, %r12d
je 0x799ab
cmpl $0x1, %r12d
jne 0x79d4f
movq %r15, %rdi
callq 0xd745
leaq -0x38(%rbp), %rdx
leaq -0x58(%rbp), %rcx
movq %rbx, %rdi
movq %rax, %rsi
movq %rcx, %rbx
callq 0x32143
movl %eax, %r15d
movq %rdx, -0x30(%rbp)
movq (%rbx), %rdi
leaq 0x97e34(%rip), %rsi     # 0x1117d1
callq 0x9353
leaq -0x38(%rbp), %rax
movq (%rax), %rbx
jmp 0x799b8
xorl %edx, %edx
movl %r12d, %r15d
movq $0x0, -0x30(%rbp)
movq %r14, %rdi
movl %r12d, %esi
callq 0x277df
movq %rax, %r14
movq 0x48(%rbx), %rdi
movq %rdi, %rax
andq %r13, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x799ee
decl (%rax)
jne 0x799ee
leaq 0x97e78(%rip), %rsi     # 0x111861
callq 0xd13d
movq %r14, 0x48(%rbx)
testl %r15d, %r15d
movq -0x60(%rbp), %r12
je 0x79af0
cmpl $0x1, %r15d
jne 0x79d4f
movq -0x30(%rbp), %rdi
callq 0xd745
movq %rax, %rsi
shrq $0x30, %rsi
andq %r13, %rax
leaq -0x38(%rbp), %r14
movq %rbx, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0x79d7f
movq (%r14), %rbx
testl %eax, %eax
je 0x79af0
cmpl $0x1, %eax
jne 0x79d4f
movq %rdx, %rdi
callq 0xd745
movq %rax, %r15
movq %rax, %r12
andq %r13, %r12
testb $0x1, %dl
je 0x79a6d
testq %r12, %r12
sete %al
testb $0x3, %r15b
setne %cl
orb %al, %cl
jne 0x79a6d
incl (%r12)
shrq $0x30, %r15
leaq -0x58(%rbp), %r14
movq %rbx, %rdi
movl %r15d, %esi
movq %r12, %rdx
movq %r14, %rcx
callq 0x49a49
movq %rax, -0x30(%rbp)
movq %rdx, %rbx
movq (%r14), %r14
cmpq $0x2, %r15
je 0x79ce7
cmpl $0x1, %r15d
je 0x79cd2
testl %r15d, %r15d
jne 0x79d4f
movq 0x8(%r12), %r15
decl (%r12)
jne 0x79ac0
movq %r12, %rdi
callq 0x5030
leaq 0x109b771(%rip), %rdi   # 0x1115238
movq %r15, %rsi
callq 0x13c85
leaq -0x38(%rbp), %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x1a6db
movq (%r15), %r14
andq %rax, %r13
shrq $0x30, %rax
jmp 0x79d13
movq 0x10(%r12), %rsi
leaq -0x68(%rbp), %rdx
movq %rbx, %rdi
callq 0x3f8cb
movl %eax, %ebx
movq %rdx, %rax
andq %r13, %rax
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x79b32
decl (%rax)
jne 0x79b32
movq %rbx, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0x97794(%rip), %rsi     # 0x1112c1
callq 0xd13d
leaq 0x1(,%rbx,2), %rdi
movl $0x1, %esi
callq 0xe83a
movq 0x10(%r12), %rbx
testl %eax, %eax
je 0x79c0c
movq 0x109c888(%rip), %r14   # 0x11163e0
testq %r14, %r14
jne 0x79bab
movl $0x36, %edi
callq 0xf5e4
movq %rax, %r14
movq $0x36, 0x10(%rax)
movabsq $0x2e646e756f622074, %rax # imm = 0x2E646E756F622074
movq %rax, 0x46(%r14)
movups 0x6e682(%rip), %xmm0    # 0xe8209
movups %xmm0, 0x18(%r14)
movups 0x6e686(%rip), %xmm0    # 0xe8219
movups %xmm0, 0x28(%r14)
movups 0x6e68a(%rip), %xmm0    # 0xe8229
movups %xmm0, 0x38(%r14)
movq %r14, 0x109c835(%rip)   # 0x11163e0
andq %r14, %r13
sete %al
testb $0x3, %r14b
setne %cl
orb %al, %cl
jne 0x79bc0
incl (%r13)
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %r15
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1b59d
movq (%r15), %rdi
leaq -0x38(%rbp), %rbx
movq %rax, %rsi
movq %r14, %rdx
movl $0x2, %ecx
movq %rbx, %r8
callq 0x1bc32
movq (%rbx), %r14
leaq 0x97ef2(%rip), %rsi     # 0x111ae9
xorl %edi, %edi
callq 0x206fc
movq %rdx, %rbx
movl $0x1, %r15d
jmp 0x79cbf
movq 0x109c7d5(%rip), %r14   # 0x11163e8
testq %r14, %r14
jne 0x79c66
movl $0x35, %edi
callq 0xf5e4
movq %rax, %r14
movq $0x35, 0x10(%rax)
movabsq $0x2e646e756f622074, %rax # imm = 0x2E646E756F622074
movq %rax, 0x45(%r14)
movups 0x6e5fe(%rip), %xmm0    # 0xe8240
movups %xmm0, 0x18(%r14)
movups 0x6e602(%rip), %xmm0    # 0xe8250
movups %xmm0, 0x28(%r14)
movups 0x6e606(%rip), %xmm0    # 0xe8260
movups %xmm0, 0x38(%r14)
movq %r14, 0x109c782(%rip)   # 0x11163e8
andq %r14, %r13
sete %al
testb $0x3, %r14b
setne %cl
orb %al, %cl
jne 0x79c7b
incl (%r13)
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %r15
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1b59d
movq (%r15), %rdi
leaq -0x38(%rbp), %rbx
movq %rax, %rsi
movq %r14, %rdx
movl $0x2, %ecx
movq %rbx, %r8
callq 0x1bc32
movq (%rbx), %r14
leaq 0x97e37(%rip), %rsi     # 0x111ae9
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2069e
movq %rdx, %rbx
xorl %eax, %eax
xorl %r13d, %r13d
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rsi
jmp 0x79d27
decl (%r12)
jne 0x79ce0
movq %r12, %rdi
callq 0x5030
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0x79d13
movl 0x4(%r12), %r15d
decl (%r12)
jne 0x79cfa
movq %r12, %rdi
callq 0x5030
leaq -0x38(%rbp), %r12
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x4a1e4
movq %rdx, %r13
movq (%r12), %r14
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %r15
movq -0x60(%rbp), %r12
movl %eax, (%rsi)
movl $0x0, 0x4(%rsi)
movq %r13, 0x8(%rsi)
movq %r12, (%rdx)
movq %r14, (%rcx)
movl %r15d, %eax
movq %rbx, %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf5e4
movq $0x20, 0x10(%rax)
movups 0x66965(%rip), %xmm0    # 0xe06cd
movups %xmm0, 0x18(%rax)
movups 0x6696a(%rip), %xmm0    # 0xe06dd
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x9302