// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_zaTypeElab_elabzeimplicitzevarzx
static struct std_maybe_Maybe_1 mw_mirth_elab_zaTypeElab_elabzeimplicitzevarzx (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_elab_zaTypeElab* in_zaTypeElab_2, uint64_t in_Name_3, struct mirth_type_Type in_Type_4, struct mirth_mirth_zaMirth* *out_zaMirth_5, struct mirth_elab_zaTypeElab* *out_zaTypeElab_6) {
	uint64_t v8 = in_zaTypeElab_2->mtoken;
	struct mirth_mirth_zaMirth* v9;
	mw_mirth_mirth_zaMirth_errorzetokenzx(in_zaMirth_1, v8, &v9);
	struct std_list_List_1 v10 = in_zaTypeElab_2->mctx;
	incref(MK_std_list_List_1(v10));
	struct mirth_mirth_zaMirth* v11;
	struct std_maybe_Maybe_1 v12 = mw_mirth_var_Ctx_lookup(v9, in_Name_3, v10, &v11);
	struct mirth_mirth_zaMirth* branch_zaMirth_13;
	struct mirth_elab_zaTypeElab* branch_zaTypeElab_14;
	struct std_maybe_Maybe_1 branch_Maybe_15;
	switch ((v12).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v16 = mtp_std_maybe_Maybe_1_Some(v12);
			incref(v16);
			struct mirth_mirth_zaMirth* v17;
			struct mirth_type_Type v18 = mw_mirth_var_Var_type(v11, V_mirth_var_Var(v16), &v17);
			struct mirth_mirth_zaMirth* v19;
			struct mirth_type_Type v20 = mw_mirth_type_Type_unifyzx(v17, in_Type_4, v18, &v19);
			decref(MK_mirth_type_Type(v20));
			struct std_maybe_Maybe_1 v21 = mtw_std_maybe_Maybe_1_Some(v16);
			branch_Maybe_15 = v21;
			branch_zaTypeElab_14 = in_zaTypeElab_2;
			branch_zaMirth_13 = v19;
		} break;
		case std_maybe_Maybe_1_None: {
			bool v22 = in_zaTypeElab_2->mallowzeimplicitzetypezevars;
			struct mirth_mirth_zaMirth* branch_zaMirth_23;
			struct mirth_elab_zaTypeElab* branch_zaTypeElab_24;
			struct std_maybe_Maybe_1 branch_Maybe_25;
			if (v22) {
				struct std_list_List_1 v26 = in_zaTypeElab_2->mctx;
				incref(MK_std_list_List_1(v26));
				struct mirth_mirth_zaMirth* v27;
				uint64_t v28 = mw_mirth_var_Var_Newzx(v11, in_Type_4, in_Name_3, &v27);
				struct std_list_List_1 v29 = mw_mirth_var_Ctx_new(v26, v28);
				struct std_list_List_1 v30 = in_zaTypeElab_2->mctx;
				decref(MK_std_list_List_1(v30));
				in_zaTypeElab_2->mctx = v29;
				struct std_maybe_Maybe_1 v31 = mtw_std_maybe_Maybe_1_Some(MK_mirth_var_Var(v28));
				branch_Maybe_25 = v31;
				branch_zaTypeElab_24 = in_zaTypeElab_2;
				branch_zaMirth_23 = v27;
			} else {
				STR* v32;
				STRLIT(v32, "Implicit type variable not allowed here.", 40);
				struct mirth_mirth_zaMirth* v33;
				mw_mirth_mirth_zaMirth_errorzx(v11, v32, &v33);
				decref(MK_mirth_type_Type(in_Type_4));
				struct std_maybe_Maybe_1 v34 = { .tag=std_maybe_Maybe_1_None };
				branch_Maybe_25 = v34;
				branch_zaTypeElab_24 = in_zaTypeElab_2;
				branch_zaMirth_23 = v33;
			}
			branch_Maybe_15 = branch_Maybe_25;
			branch_zaTypeElab_14 = branch_zaTypeElab_24;
			branch_zaMirth_13 = branch_zaMirth_23;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	uint64_t v35 = branch_zaTypeElab_14->mtoken;
	struct mirth_mirth_zaMirth* v36;
	mw_mirth_token_Token_argsze0(branch_zaMirth_13, v35, &v36);
	uint64_t v37 = branch_zaTypeElab_14->mtoken;
	struct mirth_mirth_zaMirth* v38;
	uint64_t v39 = mw_mirth_token_Token_succ(v36, v37, &v38);
	branch_zaTypeElab_14->mtoken = v39;
	*out_zaTypeElab_6 = branch_zaTypeElab_14;
	*out_zaMirth_5 = v38;
	return branch_Maybe_15;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, -0x50(%rbp)
movq %r8, %r14
movq %rcx, -0x38(%rbp)
movq %rdx, %rbx
movq %rsi, %r15
movabsq $0xfffffffffffc, %r12   # imm = 0xFFFFFFFFFFFC
movq 0x10(%rsi), %rsi
leaq -0x60(%rbp), %rdx
callq 0x316e2
movl (%r15), %edx
movq 0x8(%r15), %rcx
movq %rcx, %rax
andq %r12, %rax
sete %sil
testb $0x3, %cl
setne %dil
orb %sil, %dil
jne 0x368ac
incl (%rax)
movq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %r8
movq %rbx, %rsi
callq 0x36bc1
testl %eax, %eax
movq %r14, -0x58(%rbp)
je 0x3697c
cmpl $0x1, %eax
jne 0x36b55
movq %rdx, %rdi
callq 0xdaeb
movq %rax, %r13
movq %rdx, %rbx
testb $0x1, %bl
je 0x368fa
movq %r13, %rax
andq %r12, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x368fa
incl (%rax)
movq -0x40(%rbp), %r14
leaq 0x10e26eb(%rip), %rdi   # 0x1118ff0
movq %r13, %rsi
callq 0x13ff0
movq %rax, %rdi
callq 0x140f0
movq %rax, %rcx
shrq $0x30, %rcx
andq %r12, %rax
leaq -0x30(%rbp), %r9
movq %r14, %rdi
movl $0x2, %esi
movq -0x38(%rbp), %rdx
movq %rax, %r8
callq 0x36df1
andq %rdx, %r12
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x36965
decl (%r12)
jne 0x36965
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xdf18c(%rip), %rsi     # 0x115ae9
movq %rax, %rdi
callq 0xd4e3
movq %r13, %rdi
movq %rbx, %rsi
callq 0x95f6
movq %rdx, %r12
movq -0x30(%rbp), %r13
jmp 0x36a39
cmpb $0x1, 0x19(%r15)
jne 0x36a43
movl (%r15), %eax
movl %eax, -0x44(%rbp)
movq 0x8(%r15), %r14
movq %r14, %rax
andq %r12, %rax
sete %cl
testb $0x3, %r14b
setne %dl
orb %cl, %dl
jne 0x369a7
incl (%rax)
movq -0x40(%rbp), %rdi
leaq -0x30(%rbp), %r13
movq %r13, (%rsp)
movq %rbx, %rsi
movl $0x2, %edx
movq -0x38(%rbp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1f143
movq %rax, %rbx
movq (%r13), %r13
leaq 0xdf0c8(%rip), %rcx     # 0x115aa0
movl -0x44(%rbp), %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3f2d0
movl %eax, %r14d
movq 0x8(%r15), %rax
andq %rax, %r12
sete %cl
testb $0x3, %al
setne %sil
orb %cl, %sil
jne 0x36a20
movl (%r15), %edi
decl (%r12)
jne 0x36a20
movq %rdx, %r12
leaq 0xde868(%rip), %rsi     # 0x115279
shlq $0x30, %rdi
orq %rax, %rdi
callq 0xd4e3
movq %r12, %rdx
movl %r14d, (%r15)
movq %rdx, 0x8(%r15)
leaq 0xdf072(%rip), %rsi     # 0x115aa0
movq %rbx, %rdi
callq 0x95f6
movq %rdx, %r12
movl $0x1, %ebx
jmp 0x36b04
cmpq $0x0, 0x10e2d25(%rip)   # 0x1119770
jne 0x36a8a
movl $0x28, %edi
callq 0xf9f7
movq $0x28, 0x10(%rax)
movabsq $0x2e65726568206465, %rcx # imm = 0x2E65726568206465
movq %rcx, 0x38(%rax)
movups 0xb2323(%rip), %xmm0    # 0xe8d97
movups %xmm0, 0x18(%rax)
movups 0xb2328(%rip), %xmm0    # 0xe8da7
movups %xmm0, 0x28(%rax)
movq %rax, 0x10e2ce6(%rip)   # 0x1119770
movq 0x10e2cdf(%rip), %rbx   # 0x1119770
movq %rbx, %rax
andq %r12, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0x36aa6
incl (%rax)
movq -0x40(%rbp), %rdi
leaq -0x68(%rbp), %r14
movq %r14, %rsi
callq 0x1bc22
movq (%r14), %rdi
leaq -0x30(%rbp), %r14
movq %rax, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
movq %r14, %r8
callq 0x1bf3a
movq (%r14), %r13
movq -0x38(%rbp), %rdi
andq %rdi, %r12
sete %al
testb $0x3, %dil
setne %cl
orb %al, %cl
jne 0x36aff
decl (%r12)
jne 0x36aff
btsq $0x31, %rdi
leaq 0xdefef(%rip), %rsi     # 0x115ae9
callq 0xd4e3
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x10(%r15), %rsi
leaq -0x30(%rbp), %r14
movq %r13, %rdi
movq %r14, %rdx
callq 0x27b3d
movq 0x10(%r15), %rax
movq (%r14), %rcx
leaq 0x1(%rax), %rdx
xorl %esi, %esi
cmpq %rax, 0x10e28cd(%rip)   # 0x11193f8
cmovaq %rdx, %rsi
movq %rsi, 0x10(%r15)
movq -0x50(%rbp), %rax
movq %r15, (%rax)
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
movl %ebx, %eax
movq %r12, %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xadbf1(%rip), %rdi     # 0xe474d
movl $0x20, %esi
callq 0x92e9
movq %rax, %rdi
callq 0x95a5