// File: /workspace/github_c_makefile_star2_O3/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_var_Ctx_lookup
static struct std_maybe_Maybe_1 mw_mirth_var_Ctx_lookup (struct mirth_mirth_zaMirth* in_zaMirth_1, uint64_t in_Name_2, struct std_list_List_1 in_Ctx_3, struct mirth_mirth_zaMirth* *out_zaMirth_4) {
	struct std_list_List_1 v6 = mw_mirth_var_Ctx_zgList(in_Ctx_3);
	struct std_list_List_1 v7 = mw_std_list_List_1_reverse(v6);
	struct std_maybe_Maybe_1 v8 = { .tag=std_maybe_Maybe_1_None };
	bool v9 = true;
	struct mirth_mirth_zaMirth* r10 = in_zaMirth_1;
	uint64_t v11 = in_Name_2;
	struct std_maybe_Maybe_1 v12 = v8;
	struct std_list_List_1 v13 = v7;
	bool v14 = v9;
	bool v15 = v9;
	while (v15) {
		struct mirth_mirth_zaMirth* r16 = r10;
		uint64_t v17 = v11;
		struct std_maybe_Maybe_1 v18 = v12;
		struct std_list_List_1 v19 = v13;
		bool v20 = v14;
		struct std_list_List_1 v21;
		struct std_maybe_Maybe_1 v22 = mw_std_list_List_1_uncons(v19, &v21);
		struct mirth_mirth_zaMirth* branch_zaMirth_23;
		uint64_t branch_Name_24;
		struct std_maybe_Maybe_1 branch_Maybe_25;
		struct std_list_List_1 branch_List_26;
		bool branch_Bool_27;
		switch ((v22).tag) {
			case std_maybe_Maybe_1_Some: {
				VAL v28 = mtp_std_maybe_Maybe_1_Some(v22);
				incref(v28);
				struct mirth_mirth_zaMirth* v29;
				uint64_t v30 = mw_mirth_var_Var_name(r16, V_mirth_var_Var(v28), &v29);
				uint64_t v31 = v30;
				uint64_t v32 = v17;
				bool v33 = (v31 == v32);
				struct mirth_mirth_zaMirth* branch_zaMirth_34;
				uint64_t branch_Name_35;
				struct std_maybe_Maybe_1 branch_Maybe_36;
				if (v33) {
					struct std_maybe_Maybe_1 v37 = mtw_std_maybe_Maybe_1_Some(v28);
					branch_Maybe_36 = v37;
					branch_Name_35 = v17;
					branch_zaMirth_34 = v29;
				} else {
					decref(v28);
					struct std_maybe_Maybe_1 v38 = { .tag=std_maybe_Maybe_1_None };
					branch_Maybe_36 = v38;
					branch_Name_35 = v17;
					branch_zaMirth_34 = v29;
				}
				struct mirth_mirth_zaMirth* branch_zaMirth_39;
				uint64_t branch_Name_40;
				struct std_maybe_Maybe_1 branch_Maybe_41;
				struct std_list_List_1 branch_List_42;
				switch ((branch_Maybe_36).tag) {
					case std_maybe_Maybe_1_None: {
						branch_List_42 = v21;
						branch_Maybe_41 = v18;
						branch_Name_40 = branch_Name_35;
						branch_zaMirth_39 = branch_zaMirth_34;
					} break;
					default: {
						decref(MK_std_list_List_1(v21));
						decref(MK_std_maybe_Maybe_1(v18));
						struct std_list_List_1 v43 = { .tag=std_list_List_1_Nil };
						branch_List_42 = v43;
						branch_Maybe_41 = branch_Maybe_36;
						branch_Name_40 = branch_Name_35;
						branch_zaMirth_39 = branch_zaMirth_34;
					} break;
				}
				bool v44 = true;
				branch_Bool_27 = v44;
				branch_List_26 = branch_List_42;
				branch_Maybe_25 = branch_Maybe_41;
				branch_Name_24 = branch_Name_40;
				branch_zaMirth_23 = branch_zaMirth_39;
			} break;
			case std_maybe_Maybe_1_None: {
				bool v45 = false;
				branch_Bool_27 = v45;
				branch_List_26 = v21;
				branch_Maybe_25 = v18;
				branch_Name_24 = v17;
				branch_zaMirth_23 = r16;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v15 = branch_Bool_27;
		v14 = branch_Bool_27;
		v13 = branch_List_26;
		v12 = branch_Maybe_25;
		v11 = branch_Name_24;
		r10 = branch_zaMirth_23;
	}
	decref(MK_std_list_List_1(v13));
	*out_zaMirth_4 = r10;
	return v12;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, -0x50(%rbp)
movq %rsi, %rbx
movq %rdi, -0x48(%rbp)
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
callq 0xd01b
movl %eax, %edi
movq %rdx, %rsi
movq $0x0, -0x30(%rbp)
leaq -0x40(%rbp), %rdx
callq 0x111eb
cmpl $0x1, %eax
jne 0x35b64
movq %rdx, %rdi
callq 0xd745
movq %rax, %r12
movq %rdx, %r15
testb $0x1, %r15b
je 0x35a8b
movq %r12, %rax
andq %r13, %rax
sete %cl
testb $0x3, %r12b
setne %dl
orb %cl, %dl
jne 0x35a8b
incl (%rax)
leaq 0x10df54e(%rip), %rdi   # 0x1114fe0
movq %r12, %rsi
callq 0x13c85
movq %rax, %rdi
callq 0x13d82
cmpq %rbx, %rax
jne 0x35b2f
movq %r12, %rdi
movq %r15, %rsi
callq 0x9353
movq %rdx, %r15
movq -0x38(%rbp), %rax
movq %rax, %rcx
andq %r13, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x35aeb
movl -0x40(%rbp), %edi
decl (%rcx)
jne 0x35aeb
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xdb793(%rip), %rsi     # 0x111279
callq 0xd13d
movq %r14, %rax
andq %r13, %rax
sete %cl
testb $0x3, %r14b
setne %dl
orb %cl, %dl
jne 0x35b1a
decl (%rax)
jne 0x35b1a
movq -0x30(%rbp), %rdi
shlq $0x30, %rdi
orq %r14, %rdi
leaq 0xdb7ac(%rip), %rsi     # 0x1112c1
callq 0xd13d
xorl %edi, %edi
movl $0x1, %eax
movq %rax, -0x30(%rbp)
movq %r15, %r14
xorl %esi, %esi
jmp 0x35a4f
testb $0x1, %r15b
je 0x35b58
movq %r12, %rax
andq %r13, %rax
sete %cl
testb $0x3, %r12b
setne %dl
orb %cl, %dl
jne 0x35b58
decl (%rax)
jne 0x35b58
movq %r12, %rdi
movq %r15, %rsi
callq 0xd13d
movl -0x40(%rbp), %edi
movq -0x38(%rbp), %rsi
jmp 0x35a4f
testl %eax, %eax
jne 0x35bb8
movq -0x38(%rbp), %rax
andq %rax, %r13
sete %cl
testb $0x3, %al
setne %dl
orb %cl, %dl
jne 0x35b97
movl -0x40(%rbp), %edi
decl (%r13)
jne 0x35b97
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xdb6e7(%rip), %rsi     # 0x111279
callq 0xd13d
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %r14, %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf5e4
movq $0x20, 0x10(%rax)
movups 0xaaafc(%rip), %xmm0    # 0xe06cd
movups %xmm0, 0x18(%rax)
movups 0xaab01(%rip), %xmm0    # 0xe06dd
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x9302