// File: /workspace/github_c_makefile_star2_O3/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 $0x58, %rsp
movq %rcx, -0x78(%rbp)
movq %rdx, %rbx
movq %rsi, -0x60(%rbp)
movq %rdi, -0x70(%rbp)
movabsq $0xfffffffffffc, %rsi   # imm = 0xFFFFFFFFFFFC
movq %rdx, %rax
andq %rsi, %rax
setne %dl
testb $0x3, %bl
sete %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x5dc4c
incl (%rax)
movl 0x18(%rbx), %r13d
movq 0x20(%rbx), %r15
movq %r15, %rdx
andq %rsi, %rdx
sete %sil
testb $0x3, %r15b
setne %dil
orb %sil, %dil
jne 0x5dc6d
incl (%rdx)
testb %cl, %cl
je 0x5dc84
decl (%rax)
jne 0x5dc84
leaq 0xb4a85(%rip), %rsi     # 0x112701
movq %rbx, %rdi
callq 0xd13d
movq %rbx, -0x68(%rbp)
movq $0x0, -0x30(%rbp)
xorl %r12d, %r12d
movq $0x0, -0x58(%rbp)
xorl %ebx, %ebx
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movl %r13d, %edi
movq %r15, %rsi
leaq -0x40(%rbp), %rdx
callq 0x111eb
cmpl $0x1, %eax
jne 0x5de1e
movq %rdx, %rdi
callq 0xd745
movq %rdx, %r15
movq %rax, %r13
testb $0x1, %r15b
movabsq $0xfffffffffffc, %rdi   # imm = 0xFFFFFFFFFFFC
je 0x5dcfb
movq %rax, %rcx
andq %rdi, %rcx
sete %dl
testb $0x3, %r13b
setne %sil
orb %dl, %sil
jne 0x5dcfb
incl (%rcx)
movq 0x8(%r13), %r14
testb $0x1, 0x10(%r13)
je 0x5dd1e
movq %r14, %rcx
andq %rdi, %rcx
sete %dl
testb $0x3, %r14b
setne %sil
orb %dl, %sil
jne 0x5dd1e
incl (%rcx)
andq %rdi, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x5dd4c
decl (%rax)
jne 0x5dd4c
movq %r13, %rdi
leaq 0xb4784(%rip), %rsi     # 0x1124c1
callq 0xd13d
movabsq $0xfffffffffffc, %rdi   # imm = 0xFFFFFFFFFFFC
cmpq -0x60(%rbp), %r14
jne 0x5ddf7
movq -0x30(%rbp), %rdx
movq %rdx, %rax
andq %rdi, %rax
sete %cl
testb $0x3, %dl
setne %dl
orb %cl, %dl
jne 0x5dd88
decl (%rax)
jne 0x5dd88
shlq $0x30, %r12
orq -0x30(%rbp), %r12
movq %r12, %rdi
leaq 0xb34f6(%rip), %rsi     # 0x111279
callq 0xd13d
movq %r13, %rdi
movq %r15, %rsi
callq 0x9353
movq %rdx, %r13
movq -0x50(%rbp), %rsi
movq %rsi, %rax
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq %rcx, %rax
sete %cl
testb $0x3, %sil
setne %dl
orb %cl, %dl
jne 0x5ddd3
decl (%rax)
jne 0x5ddd3
movq -0x48(%rbp), %rdi
shlq $0x30, %rdi
orq %rsi, %rdi
leaq 0xb34f3(%rip), %rsi     # 0x1112c1
callq 0xd13d
movl -0x40(%rbp), %r12d
xorl %r15d, %r15d
movl $0x1, %eax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %r13, -0x50(%rbp)
xorl %r13d, %r13d
jmp 0x5dcad
movq %r13, %rdi
movq %r15, %rsi
movl %ebx, %edx
movq -0x58(%rbp), %rcx
callq 0xd1ec
movq %rdx, -0x58(%rbp)
movl -0x40(%rbp), %r13d
movl $0x1, %ebx
movq -0x38(%rbp), %r15
jmp 0x5dcad
testl %eax, %eax
jne 0x5dfae
movq -0x38(%rbp), %rax
movq %rax, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
movq -0x30(%rbp), %r13
jne 0x5de66
movl -0x40(%rbp), %edi
decl (%rcx)
jne 0x5de66
shlq $0x30, %rdi
orq %rax, %rdi
leaq 0xb3418(%rip), %rsi     # 0x111279
callq 0xd13d
leaq -0x40(%rbp), %r15
movq -0x58(%rbp), %rdi
cmpl $0x1, %ebx
jne 0x5de9e
movq %r15, %rsi
callq 0xd0aa
movq %rax, %rdi
movq %rdx, %rsi
movl %r12d, %edx
movq %r13, %rcx
callq 0xd1ec
movq %rdx, %r13
movl -0x40(%rbp), %ebx
movq -0x38(%rbp), %rdi
movl $0x1, %r12d
jmp 0x5de6e
testl %ebx, %ebx
jne 0x5dfae
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x42171
movl $0x3, %edi
testl %eax, %eax
je 0x5deeb
cmpl $0x1, %eax
jne 0x5dfae
movq %rdx, %rdi
callq 0xd745
movq %rax, %rbx
movq %rax, %rdi
movq %rdx, %rsi
callq 0x324c1
movl $0x3, %esi
movq %rbx, %rdi
callq 0xe50f
movq %rax, %rdi
leaq 0xb321f(%rip), %rsi     # 0x111111
callq 0x9353
movq %rdx, %rdi
callq 0xd745
movq %rdx, %rcx
leaq 0xb43bf(%rip), %rsi     # 0x1122c8
movq -0x60(%rbp), %rdi
movq %rax, %rdx
callq 0x41817
movabsq $0xfffffffffffc, %r8    # imm = 0xFFFFFFFFFFFC
andq %r13, %r8
setne %cl
testb $0x3, %r13b
sete %dl
testb %dl, %cl
je 0x5df6b
incl (%r8)
movq %rax, %rdi
leaq 0xb4584(%rip), %rsi     # 0x1124c1
movl %r12d, %edx
movq %r13, %rcx
movq %r8, %r14
callq 0xd1ec
movq %rdx, %rbx
decl (%r14)
jne 0x5df83
shlq $0x30, %r12
orq %r13, %r12
movq %r12, %rdi
leaq 0xb3315(%rip), %rsi     # 0x111279
callq 0xd13d
jmp 0x5df83
movq %rax, %rdi
leaq 0xb454c(%rip), %rsi     # 0x1124c1
movl %r12d, %edx
movq %r13, %rcx
callq 0xd1ec
movq %rdx, %rbx
movq -0x68(%rbp), %rdi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x5e1b2
movq -0x78(%rbp), %rcx
movq -0x70(%rbp), %rdx
movq %rdx, (%rcx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf5e4
movq $0x20, 0x10(%rax)
movups 0x82706(%rip), %xmm0    # 0xe06cd
movups %xmm0, 0x18(%rax)
movups 0x8270b(%rip), %xmm0    # 0xe06dd
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x9302