// File: /workspace/github_c_makefile_star2_O3/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 0x307a8
movl (%r15), %edx
movq 0x8(%r15), %rcx
movq %rcx, %rax
andq %r12, %rax
sete %sil
testb $0x3, %cl
setne %dil
orb %sil, %dil
jne 0x356fd
incl (%rax)
movq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %r8
movq %rbx, %rsi
callq 0x35a10
testl %eax, %eax
movq %r14, -0x58(%rbp)
je 0x357cd
cmpl $0x1, %eax
jne 0x359a4
movq %rdx, %rdi
callq 0xd745
movq %rax, %r13
movq %rdx, %rbx
testb $0x1, %bl
je 0x3574b
movq %r13, %rax
andq %r12, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x3574b
incl (%rax)
movq -0x40(%rbp), %r14
leaq 0x10df89a(%rip), %rdi   # 0x1114ff0
movq %r13, %rsi
callq 0x13c85
movq %rax, %rdi
callq 0x13d82
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 0x35be8
andq %rdx, %r12
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x357b6
decl (%r12)
jne 0x357b6
shlq $0x30, %rax
orq %rdx, %rax
leaq 0xdc33b(%rip), %rsi     # 0x111ae9
movq %rax, %rdi
callq 0xd13d
movq %r13, %rdi
movq %rbx, %rsi
callq 0x9353
movq %rdx, %r12
movq -0x30(%rbp), %r13
jmp 0x3588a
cmpb $0x1, 0x19(%r15)
jne 0x35894
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 0x357f8
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 0x1ecc1
movq %rax, %rbx
movq (%r13), %r13
leaq 0xdc277(%rip), %rcx     # 0x111aa0
movl -0x44(%rbp), %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3df89
movl %eax, %r14d
movq 0x8(%r15), %rax
andq %rax, %r12
sete %cl
testb $0x3, %al
setne %sil
orb %cl, %sil
jne 0x35871
movl (%r15), %edi
decl (%r12)
jne 0x35871
movq %rdx, %r12
leaq 0xdba17(%rip), %rsi     # 0x111279
shlq $0x30, %rdi
orq %rax, %rdi
callq 0xd13d
movq %r12, %rdx
movl %r14d, (%r15)
movq %rdx, 0x8(%r15)
leaq 0xdc221(%rip), %rsi     # 0x111aa0
movq %rbx, %rdi
callq 0x9353
movq %rdx, %r12
movl $0x1, %ebx
jmp 0x35953
movq 0x10dfed5(%rip), %rbx   # 0x1115770
testq %rbx, %rbx
jne 0x358e0
movl $0x28, %edi
callq 0xf5e4
movq %rax, %rbx
movq $0x28, 0x10(%rax)
movabsq $0x2e65726568206465, %rax # imm = 0x2E65726568206465
movq %rax, 0x38(%rbx)
movups 0xaf39c(%rip), %xmm0    # 0xe4c66
movups %xmm0, 0x18(%rbx)
movups 0xaf3a1(%rip), %xmm0    # 0xe4c76
movups %xmm0, 0x28(%rbx)
movq %rbx, 0x10dfe90(%rip)   # 0x1115770
movq %rbx, %rax
andq %r12, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0x358f5
incl (%rax)
movq -0x40(%rbp), %rdi
leaq -0x68(%rbp), %r14
movq %r14, %rsi
callq 0x1b95a
movq (%r14), %rdi
leaq -0x30(%rbp), %r14
movq %rax, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
movq %r14, %r8
callq 0x1bc32
movq (%r14), %r13
movq -0x38(%rbp), %rdi
andq %rdi, %r12
sete %al
testb $0x3, %dil
setne %cl
orb %al, %cl
jne 0x3594e
decl (%r12)
jne 0x3594e
btsq $0x31, %rdi
leaq 0xdc1a0(%rip), %rsi     # 0x111ae9
callq 0xd13d
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x10(%r15), %rsi
leaq -0x30(%rbp), %r14
movq %r13, %rdi
movq %r14, %rdx
callq 0x27534
movq 0x10(%r15), %rax
movq (%r14), %rcx
leaq 0x1(%rax), %rdx
xorl %esi, %esi
cmpq %rax, 0x10dfa7e(%rip)   # 0x11153f8
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 0xaad22(%rip), %rdi     # 0xe06cd
movl $0x20, %esi
callq 0x9040
movq %rax, %rdi
callq 0x9302