// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
movq %r8, -0x38(%rbp)
movq %rcx, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq %rsi, -0x50(%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 0x72eff
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 0x72f20
incl (%rdx)
testb %cl, %cl
je 0x72f37
decl (%rax)
jne 0x72f37
movq %r14, %rdi
leaq 0x9592f(%rip), %rsi     # 0x108861
callq 0xce94
testl %r12d, %r12d
je 0x72f83
cmpl $0x1, %r12d
jne 0x73227
movq %r15, %rdi
callq 0xd491
leaq -0x30(%rbp), %rdx
leaq -0x58(%rbp), %rcx
movq %rbx, %rdi
movq %rax, %rsi
movq %rcx, %rbx
callq 0x2f773
movl %eax, %r15d
movq %rdx, -0x60(%rbp)
movq (%rbx), %rdi
leaq 0x9585c(%rip), %rsi     # 0x1087d1
callq 0x8d0c
leaq -0x30(%rbp), %rax
movq (%rax), %rbx
jmp 0x72f90
xorl %edx, %edx
movl %r12d, %r15d
movq $0x0, -0x60(%rbp)
movq %r14, %rdi
movl %r12d, %esi
callq 0x24cd1
movq %rax, %r14
movq 0x48(%rbx), %rdi
movq %rdi, %rax
andq %r13, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x72fc6
decl (%rax)
jne 0x72fc6
leaq 0x958a0(%rip), %rsi     # 0x108861
callq 0xce94
movq %r14, 0x48(%rbx)
testl %r15d, %r15d
je 0x7309c
cmpl $0x1, %r15d
jne 0x73227
movq -0x60(%rbp), %rdi
callq 0xd491
movq %rax, %rsi
shrq $0x30, %rsi
andq %r13, %rax
leaq -0x30(%rbp), %r14
movq %rbx, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0x7323e
movq (%r14), %rbx
testl %eax, %eax
je 0x7309c
cmpl $0x1, %eax
jne 0x73227
movq %rdx, %rdi
callq 0xd491
movq %rax, %r15
andq %rax, %r13
testb $0x1, %dl
je 0x7303e
testq %r13, %r13
sete %al
testb $0x3, %r15b
setne %cl
orb %al, %cl
jne 0x7303e
incl (%r13)
shrq $0x30, %r15
leaq -0x58(%rbp), %r12
movq %rbx, %rdi
movl %r15d, %esi
movq %r13, %rdx
movq %r12, %rcx
callq 0x456dc
movl %eax, %ebx
movq %rdx, %r14
movq (%r12), %r12
cmpq $0x2, %r15
je 0x73209
cmpl $0x1, %r15d
je 0x731ff
testl %r15d, %r15d
jne 0x73227
movq %r13, %rdi
callq 0x17c94
leaq -0x30(%rbp), %r15
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x1df20
jmp 0x73222
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0x3c460
movl %eax, %ebx
movq %rdx, %rax
andq %r13, %rax
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x730e1
decl (%rax)
jne 0x730e1
movq %rbx, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0x951e5(%rip), %rsi     # 0x1082c1
callq 0xce94
movq %rbx, %rdi
callq 0xd86d
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0xd759
movq -0x50(%rbp), %rcx
movq 0x10(%rcx), %rbx
testb %al, %al
je 0x73164
movq 0x109a2e1(%rip), %rdx   # 0x110d3e8
testq %rdx, %rdx
jne 0x73125
leaq 0x6932b(%rip), %rdi     # 0xdc43e
pushq $0x35
popq %rsi
callq 0x8a21
movq %rax, %rdx
movq %rax, 0x109a2c3(%rip)   # 0x110d3e8
andq %rdx, %r13
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x73139
incl (%r13)
movq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %r15
movq %rbx, %rsi
movq %r15, %rcx
callq 0x2ceb4
leaq 0x95996(%rip), %rsi     # 0x108ae9
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x1e400
movq %rdx, %r14
movq (%r15), %r12
jmp 0x731c7
movq 0x109a275(%rip), %rdx   # 0x110d3e0
testq %rdx, %rdx
jne 0x73189
leaq 0x69290(%rip), %rdi     # 0xdc407
pushq $0x36
popq %rsi
callq 0x8a21
movq %rax, %rdx
movq %rax, 0x109a257(%rip)   # 0x110d3e0
andq %rdx, %r13
sete %al
testb $0x3, %dl
setne %cl
orb %al, %cl
jne 0x7319d
incl (%r13)
movq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %r15
movq %rbx, %rsi
movq %r15, %rcx
callq 0x2ceb4
leaq 0x95932(%rip), %rsi     # 0x108ae9
xorl %edi, %edi
callq 0x1e454
movq %rdx, %r14
movq (%r15), %r12
pushq $0x1
popq %rbx
xorl %eax, %eax
xorl %edx, %edx
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdi
movl %eax, (%rdi)
andl $0x0, 0x4(%rdi)
movq %rdx, 0x8(%rdi)
movq -0x50(%rbp), %rax
movq %rax, (%rsi)
movq %r12, (%rcx)
movl %ebx, %eax
movq %r14, %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x17cb1
jmp 0x731c7
movq %r13, %rdi
callq 0x17cce
leaq -0x30(%rbp), %r15
movq %r12, %rdi
movl %eax, %esi
movq %r15, %rdx
callq 0x45d9f
movq (%r15), %r12
jmp 0x731cb
leaq 0x615df(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6