// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_data_Tag_numzeresourcezeinputszefromzesig
static INT mw_mirth_data_Tag_numzeresourcezeinputszefromzesig (struct mirth_mirth_zaMirth* in_zaMirth_1, uint64_t in_Tag_2, struct mirth_mirth_zaMirth* *out_zaMirth_3) {
	struct mirth_mirth_zaMirth* v5;
	struct std_maybe_Maybe_1 v6 = mw_mirth_data_Tag_sigzy(in_zaMirth_1, in_Tag_2, &v5);
	struct mirth_mirth_zaMirth* branch_zaMirth_7;
	INT branch_Nat_8;
	switch ((v6).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v9 = mtp_std_maybe_Maybe_1_Some(v6);
			struct mirth_mirth_zaMirth* v10;
			struct std_list_List_1 v11 = mw_mirth_token_Token_sigzestackzetokens(v5, V_mirth_token_Token(v9), &v10);
			struct std_list_List_1 v12 = { .tag=std_list_List_1_Nil };
			struct std_list_List_1 v13;
			mw_std_list_List_1_buildzx(v12, &v13);
			bool v14 = true;
			struct mirth_mirth_zaMirth* r15 = v10;
			struct std_list_List_1 r16 = v13;
			struct std_list_List_1 v17 = v11;
			bool v18 = v14;
			bool v19 = v14;
			while (v19) {
				struct mirth_mirth_zaMirth* r20 = r15;
				struct std_list_List_1 r21 = r16;
				struct std_list_List_1 v22 = v17;
				bool v23 = v18;
				struct mirth_mirth_zaMirth* branch_zaMirth_24;
				struct std_list_List_1 branch_zaLister_25;
				struct std_list_List_1 branch_List_26;
				bool branch_Bool_27;
				switch ((v22).tag) {
					case std_list_List_1_Cons: {
						struct std_list_List_1 v28;
						VAL v29 = mtp_std_list_List_1_Cons(v22, &v28);
						incref(v29);
						struct mirth_mirth_zaMirth* v30;
						bool v31 = mw_mirth_token_Token_couldzebezesigzelabelzy(r20, V_mirth_token_Token(v29), &v30);
						bool v32 = !v31;
						struct mirth_mirth_zaMirth* branch_zaMirth_33;
						struct std_list_List_1 branch_zaLister_34;
						if (v32) {
							struct std_list_List_1 v35;
							mw_std_list_zaLister_1_pushzx(v29, r21, &v35);
							branch_zaLister_34 = v35;
							branch_zaMirth_33 = v30;
						} else {
							decref(v29);
							branch_zaLister_34 = r21;
							branch_zaMirth_33 = v30;
						}
						bool v36 = true;
						branch_Bool_27 = v36;
						branch_List_26 = v28;
						branch_zaLister_25 = branch_zaLister_34;
						branch_zaMirth_24 = branch_zaMirth_33;
					} break;
					case std_list_List_1_Nil: {
						struct std_list_List_1 v37 = { .tag=std_list_List_1_Nil };
						bool v38 = false;
						branch_Bool_27 = v38;
						branch_List_26 = v37;
						branch_zaLister_25 = r21;
						branch_zaMirth_24 = r20;
					} break;
					default: {
						do_panic(str_make("unexpected fallthrough in match\n", 32));
					}
				}
				v19 = branch_Bool_27;
				v18 = branch_Bool_27;
				v17 = branch_List_26;
				r16 = branch_zaLister_25;
				r15 = branch_zaMirth_24;
			}
			decref(MK_std_list_List_1(v17));
			struct std_list_List_1 v39 = mw_std_list_zaLister_1_donezx(r16);
			struct std_list_List_1 v40 = { .tag=std_list_List_1_Nil };
			struct std_list_List_1 v41;
			mw_std_list_List_1_buildzx(v40, &v41);
			bool v42 = true;
			struct mirth_mirth_zaMirth* r43 = r15;
			struct std_list_List_1 r44 = v41;
			struct std_list_List_1 v45 = v39;
			bool v46 = v42;
			bool v47 = v42;
			while (v47) {
				struct mirth_mirth_zaMirth* r48 = r43;
				struct std_list_List_1 r49 = r44;
				struct std_list_List_1 v50 = v45;
				bool v51 = v46;
				struct mirth_mirth_zaMirth* branch_zaMirth_52;
				struct std_list_List_1 branch_zaLister_53;
				struct std_list_List_1 branch_List_54;
				bool branch_Bool_55;
				switch ((v50).tag) {
					case std_list_List_1_Cons: {
						struct std_list_List_1 v56;
						VAL v57 = mtp_std_list_List_1_Cons(v50, &v56);
						struct mirth_mirth_zaMirth* v58;
						struct std_maybe_Maybe_1 v59 = mw_mirth_token_Token_lastzenamezy(r48, V_mirth_token_Token(v57), &v58);
						struct std_list_List_1 v60;
						mw_std_maybe_Maybe_1_for_1_sp2(r49, v59, &v60);
						bool v61 = true;
						branch_Bool_55 = v61;
						branch_List_54 = v56;
						branch_zaLister_53 = v60;
						branch_zaMirth_52 = v58;
					} break;
					case std_list_List_1_Nil: {
						struct std_list_List_1 v62 = { .tag=std_list_List_1_Nil };
						bool v63 = false;
						branch_Bool_55 = v63;
						branch_List_54 = v62;
						branch_zaLister_53 = r49;
						branch_zaMirth_52 = r48;
					} break;
					default: {
						do_panic(str_make("unexpected fallthrough in match\n", 32));
					}
				}
				v47 = branch_Bool_55;
				v46 = branch_Bool_55;
				v45 = branch_List_54;
				r44 = branch_zaLister_53;
				r43 = branch_zaMirth_52;
			}
			decref(MK_std_list_List_1(v45));
			struct std_list_List_1 v64 = mw_std_list_zaLister_1_donezx(r44);
			struct std_list_List_1 v65 = { .tag=std_list_List_1_Nil };
			struct std_list_List_1 v66;
			mw_std_list_List_1_buildzx(v65, &v66);
			bool v67 = true;
			struct mirth_mirth_zaMirth* r68 = r43;
			struct std_list_List_1 r69 = v66;
			struct std_list_List_1 v70 = v64;
			bool v71 = v67;
			bool v72 = v67;
			while (v72) {
				struct mirth_mirth_zaMirth* r73 = r68;
				struct std_list_List_1 r74 = r69;
				struct std_list_List_1 v75 = v70;
				bool v76 = v71;
				struct mirth_mirth_zaMirth* branch_zaMirth_77;
				struct std_list_List_1 branch_zaLister_78;
				struct std_list_List_1 branch_List_79;
				bool branch_Bool_80;
				switch ((v75).tag) {
					case std_list_List_1_Cons: {
						struct std_list_List_1 v81;
						VAL v82 = mtp_std_list_List_1_Cons(v75, &v81);
						incref(v82);
						incref(v82);
						struct mirth_mirth_zaMirth* v83;
						bool v84 = mw_mirth_name_Name_couldzebezeresourcezevar(r73, V_mirth_name_Name(v82), &v83);
						struct mirth_mirth_zaMirth* branch_zaMirth_85;
						bool branch_Bool_86;
						if (v84) {
							decref(v82);
							bool v87 = true;
							branch_Bool_86 = v87;
							branch_zaMirth_85 = v83;
						} else {
							struct mirth_mirth_zaMirth* v88;
							bool v89 = mw_mirth_name_Name_couldzebezeresourcezecon(v83, V_mirth_name_Name(v82), &v88);
							branch_Bool_86 = v89;
							branch_zaMirth_85 = v88;
						}
						struct mirth_mirth_zaMirth* branch_zaMirth_90;
						struct std_list_List_1 branch_zaLister_91;
						if (branch_Bool_86) {
							struct std_list_List_1 v92;
							mw_std_list_zaLister_1_pushzx(v82, r74, &v92);
							branch_zaLister_91 = v92;
							branch_zaMirth_90 = branch_zaMirth_85;
						} else {
							decref(v82);
							branch_zaLister_91 = r74;
							branch_zaMirth_90 = branch_zaMirth_85;
						}
						bool v93 = true;
						branch_Bool_80 = v93;
						branch_List_79 = v81;
						branch_zaLister_78 = branch_zaLister_91;
						branch_zaMirth_77 = branch_zaMirth_90;
					} break;
					case std_list_List_1_Nil: {
						struct std_list_List_1 v94 = { .tag=std_list_List_1_Nil };
						bool v95 = false;
						branch_Bool_80 = v95;
						branch_List_79 = v94;
						branch_zaLister_78 = r74;
						branch_zaMirth_77 = r73;
					} break;
					default: {
						do_panic(str_make("unexpected fallthrough in match\n", 32));
					}
				}
				v72 = branch_Bool_80;
				v71 = branch_Bool_80;
				v70 = branch_List_79;
				r69 = branch_zaLister_78;
				r68 = branch_zaMirth_77;
			}
			decref(MK_std_list_List_1(v70));
			struct std_list_List_1 v96 = mw_std_list_zaLister_1_donezx(r69);
			INT v97 = mw_std_list_List_1_len(v96);
			branch_Nat_8 = v97;
			branch_zaMirth_7 = r68;
		} break;
		case std_maybe_Maybe_1_None: {
			INT v98 = WRAP_I63(0LL);
			branch_Nat_8 = v98;
			branch_zaMirth_7 = v5;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_zaMirth_3 = branch_zaMirth_7;
	return branch_Nat_8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
leaq -0x68(%rbp), %rdx
callq 0x190c9
testl %eax, %eax
je 0x6f5b4
movq %rbx, -0x70(%rbp)
cmpl $0x1, %eax
jne 0x6f855
movq %rdx, %rdi
callq 0xd491
movq -0x68(%rbp), %rdi
leaq -0x78(%rbp), %r14
movq %rax, %rsi
movq %r14, %rdx
callq 0x6d3c5
movl %eax, %ebx
movq %rdx, %r15
xorl %edi, %edi
xorl %esi, %esi
callq 0xcd32
movl %eax, %r12d
movq (%r14), %r14
leaq -0x50(%rbp), %rsi
leaq -0x30(%rbp), %rcx
movb $0x1, %al
movq %r15, %rdi
testb $0x1, %al
je 0x6f5c0
xorl %eax, %eax
movl $0x0, %r15d
testl %ebx, %ebx
je 0x6f41c
cmpl $0x1, %ebx
jne 0x6f855
movq %rdx, %r15
movq %rcx, %r13
callq 0xce01
movq %rax, %rbx
movq %rdx, -0x60(%rbp)
testb $0x1, %dl
je 0x6f472
movq %rbx, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0x6f472
incl (%rax)
movq %r14, %rdi
movq %rbx, %rsi
leaq -0x40(%rbp), %rdx
callq 0x2df97
cmpl $0x1, %eax
jne 0x6f579
movl %r12d, -0x54(%rbp)
movq %rdx, %rdi
callq 0xd491
movq -0x40(%rbp), %rdi
movq %rax, %rsi
movq %r13, %r12
movq %r13, %rdx
callq 0x3c637
movq -0x30(%rbp), %r14
testb %al, %al
je 0x6f57f
cmpq %rbx, 0x109cf3d(%rip)   # 0x110c3f8
leaq 0x1(%rbx), %rsi
movl $0x0, %eax
cmovbeq %rax, %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x3c713
movl %eax, %r14d
movq %rdx, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x6f50f
decl (%rax)
jne 0x6f50f
movq %r14, %rdi
shlq $0x30, %rdi
orq %rdx, %rdi
leaq 0x98db7(%rip), %rsi     # 0x1082c1
callq 0xce94
movq %r14, %rdi
callq 0xd86d
movq %rax, %rdi
pushq $0x1
popq %rsi
callq 0xd759
movq -0x30(%rbp), %r14
testb %al, %al
movl -0x54(%rbp), %r12d
jne 0x6f583
movq -0x60(%rbp), %r8
testb $0x1, %r8b
movq %r15, %rdx
je 0x6f5a1
movq %rbx, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %bl
setne %sil
orb %cl, %sil
jne 0x6f5a1
decl (%rax)
leaq -0x50(%rbp), %rsi
jne 0x6f5a5
movq %rbx, %rdi
movq %r8, %rsi
callq 0xce94
movq %r15, %rdx
movq %r13, %rcx
leaq -0x50(%rbp), %rsi
jmp 0x6f5a8
movq -0x40(%rbp), %r14
jmp 0x6f583
movl -0x54(%rbp), %r12d
movq -0x60(%rbp), %rsi
movq %rbx, %rdi
movl %r12d, %edx
movq %r15, %rcx
leaq -0x40(%rbp), %r8
callq 0x8e35
movl -0x40(%rbp), %r12d
movq -0x38(%rbp), %rdx
leaq -0x50(%rbp), %rsi
movq %r13, %rcx
movl -0x50(%rbp), %ebx
movq -0x48(%rbp), %r15
jmp 0x6f41a
pushq $0x1
popq %rax
movq -0x68(%rbp), %r14
jmp 0x6f843
leaq 0x98cb2(%rip), %rsi     # 0x108279
movq %rdi, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dil
setne %r8b
orb %cl, %r8b
jne 0x6f600
decl (%rax)
jne 0x6f600
shlq $0x30, %rbx
orq %rdi, %rbx
movq %rbx, %rdi
movq %rdx, %rbx
callq 0xce94
movq %rbx, %rdx
movl %r12d, %edi
movq %rdx, %rsi
callq 0xcd32
movl %eax, %r12d
movq %rdx, %r13
xorl %edi, %edi
xorl %esi, %esi
callq 0xcd32
movl %eax, %ebx
movq %rdx, %r15
leaq -0x50(%rbp), %rcx
movb $0x1, %al
movq %r13, %rdi
testb $0x1, %al
je 0x6f688
xorl %eax, %eax
movl $0x0, %r13d
testl %r12d, %r12d
je 0x6f625
cmpl $0x1, %r12d
jne 0x6f855
movq %rcx, %r12
movq %rcx, %rsi
callq 0xce01
movq %r14, %rdi
movq %rax, %rsi
leaq -0x30(%rbp), %rdx
callq 0x6aa98
movq %rdx, %rcx
movl %ebx, %edi
movq %r15, %rsi
movl %eax, %edx
leaq -0x40(%rbp), %r8
callq 0x2cdac
movq %r12, %rcx
movl -0x50(%rbp), %r12d
movq -0x48(%rbp), %r13
movl -0x40(%rbp), %ebx
movq -0x38(%rbp), %r15
movq -0x30(%rbp), %r14
jmp 0x6f623
movq %rdi, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x6f6c0
decl (%rax)
jne 0x6f6c0
shlq $0x30, %r12
orq %rdi, %r12
movq %r12, %rdi
leaq 0x98bbe(%rip), %rsi     # 0x108279
callq 0xce94
movl %ebx, %edi
movq %r15, %rsi
callq 0xcd32
movl %eax, %ebx
movq %rdx, %r15
xorl %edi, %edi
xorl %esi, %esi
callq 0xcd32
movl %eax, %r13d
movq %rdx, %r12
movb $0x1, %al
movq %r15, %rdi
testb $0x1, %al
je 0x6f7f5
xorl %r15d, %r15d
movl $0x0, %eax
testl %ebx, %ebx
je 0x6f6e0
cmpl $0x1, %ebx
jne 0x6f855
leaq -0x50(%rbp), %rsi
callq 0xce01
movq %rax, %r15
movq %rdx, %rbx
testb $0x1, %bl
je 0x6f735
movq %r15, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x6f735
addl $0x2, (%rax)
movq %r14, %rdi
movq %r15, %rsi
leaq -0x30(%rbp), %rdx
callq 0x1c692
testb %al, %al
je 0x6f780
testb $0x1, %bl
je 0x6f77a
movq %r15, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x6f77a
decl (%rax)
jne 0x6f77a
movq %r15, %rdi
movq %rbx, %rsi
callq 0xce94
movq -0x30(%rbp), %r14
jmp 0x6f798
movq -0x30(%rbp), %rdi
movq %r15, %rsi
leaq -0x40(%rbp), %rdx
callq 0x1e5df
movq -0x40(%rbp), %r14
testb %al, %al
je 0x6f7c1
movq %r15, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r12, %rcx
leaq -0x40(%rbp), %r8
callq 0x8e35
movl -0x40(%rbp), %r13d
movq -0x38(%rbp), %r12
movl -0x50(%rbp), %ebx
movq -0x48(%rbp), %r15
jmp 0x6f6de
testb $0x1, %bl
je 0x6f7b5
movq %r15, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x6f7b5
decl (%rax)
jne 0x6f7b5
movq %r15, %rdi
movq %rbx, %rsi
callq 0xce94
jmp 0x6f7b5
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdi, %rdx
sete %al
testb $0x3, %dil
setne %cl
orb %al, %cl
jne 0x6f82a
decl (%rdx)
jne 0x6f82a
shlq $0x30, %rbx
orq %rdi, %rbx
movq %rbx, %rdi
leaq 0x98a54(%rip), %rsi     # 0x108279
callq 0xce94
movl %r13d, %edi
movq %r12, %rsi
callq 0xcd32
movl %eax, %edi
movq %rdx, %rsi
callq 0x10bca
movq -0x70(%rbp), %rbx
movq %r14, (%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x64fb1(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6