// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_StackTypeCounts_addzelabelzx
static struct mirth_type_StackTypeCounts* mw_mirth_type_StackTypeCounts_addzelabelzx (struct mirth_mirth_zaMirth* in_zaMirth_1, uint64_t in_Label_2, struct mirth_type_StackTypeCounts* in_StackTypeCounts_3, struct mirth_mirth_zaMirth* *out_zaMirth_4) {
	incref(MK_mirth_type_StackTypeCounts(in_StackTypeCounts_3));
	struct std_list_List_1 v6 = in_StackTypeCounts_3->mlabels;
	incref(MK_std_list_List_1(v6));
	decref(MK_mirth_type_StackTypeCounts(in_StackTypeCounts_3));
	struct std_list_List_1 v7 = { .tag=std_list_List_1_Nil };
	struct std_list_List_1 v8 = { .tag=std_list_List_1_Nil };
	struct std_maybe_Maybe_1 v9 = { .tag=std_maybe_Maybe_1_None };
	bool v10 = true;
	uint64_t v11 = in_Label_2;
	struct std_list_List_1 v12 = v8;
	struct std_list_List_1 v13 = v7;
	struct std_maybe_Maybe_1 v14 = v9;
	struct std_list_List_1 v15 = v6;
	bool v16 = v10;
	bool v17 = v10;
	while (v17) {
		uint64_t v18 = v11;
		struct std_list_List_1 v19 = v12;
		struct std_list_List_1 v20 = v13;
		struct std_maybe_Maybe_1 v21 = v14;
		struct std_list_List_1 v22 = v15;
		bool v23 = v16;
		struct std_list_List_1 v24;
		struct std_maybe_Maybe_1 v25 = mw_std_list_List_1_uncons(v22, &v24);
		uint64_t branch_Label_26;
		struct std_list_List_1 branch_List_27;
		struct std_list_List_1 branch_List_28;
		struct std_maybe_Maybe_1 branch_Maybe_29;
		struct std_list_List_1 branch_List_30;
		bool branch_Bool_31;
		switch ((v25).tag) {
			case std_maybe_Maybe_1_Some: {
				VAL v32 = mtp_std_maybe_Maybe_1_Some(v25);
				incref(v32);
				VAL v33 = V_std_map_KeyValuePair_2(v32)->mkey;
				incref(v33);
				decref(MK_std_map_KeyValuePair_2(V_std_map_KeyValuePair_2(v32)));
				uint64_t v34 = V_mirth_label_Label(v33);
				uint64_t v35 = v18;
				bool v36 = (v34 == v35);
				uint64_t branch_Label_37;
				struct std_list_List_1 branch_List_38;
				struct std_list_List_1 branch_List_39;
				struct std_maybe_Maybe_1 branch_Maybe_40;
				struct std_list_List_1 branch_List_41;
				if (v36) {
					decref(MK_std_list_List_1(v19));
					struct std_maybe_Maybe_1 v42 = mtw_std_maybe_Maybe_1_Some(v32);
					decref(MK_std_maybe_Maybe_1(v21));
					struct std_list_List_1 v43 = { .tag=std_list_List_1_Nil };
					branch_List_41 = v43;
					branch_Maybe_40 = v42;
					branch_List_39 = v24;
					branch_List_38 = v20;
					branch_Label_37 = v18;
				} else {
					struct std_list_List_1 v44 = mw_std_list_List_1_cons(v32, v20);
					branch_List_41 = v24;
					branch_Maybe_40 = v21;
					branch_List_39 = v19;
					branch_List_38 = v44;
					branch_Label_37 = v18;
				}
				bool v45 = true;
				branch_Bool_31 = v45;
				branch_List_30 = branch_List_41;
				branch_Maybe_29 = branch_Maybe_40;
				branch_List_28 = branch_List_39;
				branch_List_27 = branch_List_38;
				branch_Label_26 = branch_Label_37;
			} break;
			case std_maybe_Maybe_1_None: {
				bool v46 = false;
				branch_Bool_31 = v46;
				branch_List_30 = v24;
				branch_Maybe_29 = v21;
				branch_List_28 = v19;
				branch_List_27 = v20;
				branch_Label_26 = v18;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v17 = branch_Bool_31;
		v16 = branch_Bool_31;
		v15 = branch_List_30;
		v14 = branch_Maybe_29;
		v13 = branch_List_27;
		v12 = branch_List_28;
		v11 = branch_Label_26;
	}
	decref(MK_std_list_List_1(v15));
	struct std_list_List_1 v47;
	mw_std_list_List_1_for_1_sp82(v12, v13, &v47);
	struct std_maybe_Maybe_1 v48 = mw_std_maybe_Maybe_1_map_1_sp18(v14);
	VAL branch_zux1_49;
	INT branch_Nat_50;
	switch ((v48).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v51 = mtp_std_maybe_Maybe_1_Some(v48);
			INT v52 = WRAP_I63(1LL);
			INT v53 = value_nat(v51);
			INT v54 = v52;
			INT v55 = int_add(v53, v54);
			INT v56 = v55;
			branch_Nat_50 = v56;
			branch_zux1_49 = MK_mirth_label_Label(v11);
		} break;
		case std_maybe_Maybe_1_None: {
			INT v57 = WRAP_I63(1LL);
			branch_Nat_50 = v57;
			branch_zux1_49 = MK_mirth_label_Label(v11);
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	struct std_maybe_Maybe_1 v58 = mtw_std_maybe_Maybe_1_Some(MKNAT(branch_Nat_50));
	struct std_list_List_1 v59 = mw_std_maybe_Maybe_1_ifzy_2_sp54(branch_zux1_49, v47, v58);
	struct mirth_type_StackTypeCounts* v60 = mirth_type_StackTypeCounts_set_labels(in_StackTypeCounts_3, v59);
	*out_zaMirth_4 = in_zaMirth_1;
	return v60;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, -0x88(%rbp)
movq %rdx, %r15
movq %rsi, -0x78(%rbp)
movq %rdi, -0x80(%rbp)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
movq %rdx, %rax
movq %rcx, -0x50(%rbp)
andq %rcx, %rax
setne %dl
testb $0x3, %r15b
sete %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x58e30
incl (%rax)
movl 0x18(%r15), %r14d
movq 0x20(%r15), %rbx
movq %rbx, %rdx
movabsq $0xfffffffffffc, %rsi   # imm = 0xFFFFFFFFFFFC
andq %rsi, %rdx
sete %sil
testb $0x3, %bl
setne %dil
orb %sil, %dil
jne 0x58e5a
incl (%rdx)
testb %cl, %cl
je 0x58e71
decl (%rax)
jne 0x58e71
leaq 0xb0898(%rip), %rsi     # 0x109701
movq %r15, %rdi
callq 0xce94
movq %r15, -0x70(%rbp)
movq $0x0, -0x58(%rbp)
movb $0x1, %al
leaq -0x48(%rbp), %r12
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
xorl %r13d, %r13d
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
testb $0x1, %al
je 0x5904f
movl %r14d, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1075d
testl %eax, %eax
je 0x59015
cmpl $0x1, %eax
jne 0x5921d
movq %rdx, %rdi
callq 0xd491
movq %rdx, %rbx
movq %rax, %r14
testb $0x1, %bl
je 0x58f02
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %r14b
setne %sil
orb %dl, %sil
jne 0x58f02
incl (%rcx)
movq 0x8(%r14), %r15
testb $0x1, 0x10(%r14)
je 0x58f2f
movq %r15, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %r15b
setne %sil
orb %dl, %sil
jne 0x58f2f
incl (%rcx)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %r14b
setne %dl
orb %cl, %dl
jne 0x58f5d
decl (%rax)
jne 0x58f5d
movq %r14, %rdi
leaq 0xb0569(%rip), %rsi     # 0x1094c1
callq 0xce94
cmpq -0x78(%rbp), %r15
jne 0x59024
movq -0x30(%rbp), %rdx
movq %rdx, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dl
setne %dl
orb %cl, %dl
jne 0x58fa4
decl (%rax)
jne 0x58fa4
movq -0x38(%rbp), %rdi
shlq $0x30, %rdi
orq -0x30(%rbp), %rdi
leaq 0xaf2da(%rip), %rsi     # 0x108279
callq 0xce94
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8d0c
movq %rdx, %r15
movq -0x60(%rbp), %rsi
movq %rsi, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %sil
setne %dl
orb %cl, %dl
jne 0x58fef
decl (%rax)
jne 0x58fef
movq -0x58(%rbp), %rdi
shlq $0x30, %rdi
orq %rsi, %rdi
leaq 0xaf2d7(%rip), %rsi     # 0x1082c1
callq 0xce94
movl -0x48(%rbp), %eax
movq %rax, -0x38(%rbp)
xorl %r14d, %r14d
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movb $0x1, %al
xorl %ebx, %ebx
pushq $0x1
popq %rcx
movq %rcx, -0x58(%rbp)
movq %r15, -0x60(%rbp)
jmp 0x58ea6
movl -0x48(%rbp), %r14d
movq -0x40(%rbp), %rbx
xorl %eax, %eax
jmp 0x58ea6
movq %r14, %rdi
movq %rbx, %rsi
movq -0x68(%rbp), %rdx
movq %r13, %rcx
callq 0xcf39
movq %rdx, %r13
movl -0x48(%rbp), %r14d
movq -0x40(%rbp), %rbx
movb $0x1, %al
pushq $0x1
popq %rcx
movq %rcx, -0x68(%rbp)
jmp 0x58ea6
movq %rbx, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0x59086
decl (%rax)
jne 0x59086
shlq $0x30, %r14
orq %rbx, %r14
movq %r14, %rdi
leaq 0xaf1f8(%rip), %rsi     # 0x108279
callq 0xce94
leaq -0x48(%rbp), %rbx
pushq $0x1
popq %r14
movq -0x68(%rbp), %rsi
movb $0x1, %al
movq %r13, %rdi
testb $0x1, %al
je 0x590df
xorl %eax, %eax
movl $0x0, %r13d
testl %esi, %esi
je 0x59094
cmpl $0x1, %esi
jne 0x5921d
movq %rbx, %rsi
callq 0xce01
movq %rax, %rdi
movq %rdx, %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0xcf39
movq %rdx, -0x30(%rbp)
movl -0x48(%rbp), %esi
movq -0x40(%rbp), %r13
movl %r14d, %eax
movq %rax, -0x38(%rbp)
jmp 0x59092
movq %rdi, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x59117
decl (%rax)
jne 0x59117
shlq $0x30, %rsi
orq %rdi, %rsi
movq %rsi, %rdi
leaq 0xaf167(%rip), %rsi     # 0x108279
callq 0xce94
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x3e5cd
testl %eax, %eax
je 0x5915f
cmpl $0x1, %eax
movq -0x70(%rbp), %r15
movq -0x38(%rbp), %r12
jne 0x5921d
movq %rdx, %rdi
callq 0xd491
movq %rax, %rbx
movq %rax, %rdi
movq %rdx, %rsi
callq 0x2fb0c
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xdd03
movq %rax, %rdi
jmp 0x5916a
pushq $0x3
popq %rdi
movq -0x70(%rbp), %r15
movq -0x38(%rbp), %r12
leaq 0xaefa0(%rip), %rsi     # 0x108111
callq 0x8d0c
movq %rdx, %rdi
callq 0xd491
movq %rdx, %rcx
leaq 0xb0140(%rip), %rsi     # 0x1092c8
movq -0x78(%rbp), %rdi
movq %rax, %rdx
callq 0x3dceb
movq -0x30(%rbp), %rdx
andq %rdx, -0x50(%rbp)
setne %cl
testb $0x3, %dl
sete %r14b
andb %cl, %r14b
cmpb $0x1, %r14b
jne 0x591b5
movq -0x50(%rbp), %rcx
incl (%rcx)
movq %rax, %rdi
leaq 0xb0302(%rip), %rsi     # 0x1094c1
movl %r12d, %edx
movq -0x30(%rbp), %rcx
callq 0xcf39
movq %rdx, %rbx
testb %r14b, %r14b
je 0x591f2
movq -0x50(%rbp), %rax
decl (%rax)
jne 0x591f2
shlq $0x30, %r12
orq -0x30(%rbp), %r12
movq %r12, %rdi
leaq 0xaf08c(%rip), %rsi     # 0x108279
callq 0xce94
pushq $0x1
popq %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x593f4
movq -0x88(%rbp), %rcx
movq -0x80(%rbp), %rdx
movq %rdx, (%rcx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7b5e9(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6