// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_type_StackTypeCounts_label
static INT mw_mirth_type_StackTypeCounts_label (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) {
	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_maybe_Maybe_1 v7 = { .tag=std_maybe_Maybe_1_None };
	bool v8 = true;
	uint64_t v9 = in_Label_2;
	struct std_maybe_Maybe_1 v10 = v7;
	struct std_list_List_1 v11 = v6;
	bool v12 = v8;
	bool v13 = v8;
	while (v13) {
		uint64_t v14 = v9;
		struct std_maybe_Maybe_1 v15 = v10;
		struct std_list_List_1 v16 = v11;
		bool v17 = v12;
		struct std_list_List_1 v18;
		struct std_maybe_Maybe_1 v19 = mw_std_list_List_1_uncons(v16, &v18);
		uint64_t branch_Label_20;
		struct std_maybe_Maybe_1 branch_Maybe_21;
		struct std_list_List_1 branch_List_22;
		bool branch_Bool_23;
		switch ((v19).tag) {
			case std_maybe_Maybe_1_Some: {
				VAL v24 = mtp_std_maybe_Maybe_1_Some(v19);
				incref(v24);
				VAL v25 = V_std_map_KeyValuePair_2(v24)->mkey;
				incref(v25);
				decref(MK_std_map_KeyValuePair_2(V_std_map_KeyValuePair_2(v24)));
				uint64_t v26 = V_mirth_label_Label(v25);
				uint64_t v27 = v14;
				bool v28 = (v26 == v27);
				uint64_t branch_Label_29;
				struct std_maybe_Maybe_1 branch_Maybe_30;
				if (v28) {
					struct std_maybe_Maybe_1 v31 = mtw_std_maybe_Maybe_1_Some(v24);
					branch_Maybe_30 = v31;
					branch_Label_29 = v14;
				} else {
					decref(v24);
					struct std_maybe_Maybe_1 v32 = { .tag=std_maybe_Maybe_1_None };
					branch_Maybe_30 = v32;
					branch_Label_29 = v14;
				}
				uint64_t branch_Label_33;
				struct std_maybe_Maybe_1 branch_Maybe_34;
				struct std_list_List_1 branch_List_35;
				switch ((branch_Maybe_30).tag) {
					case std_maybe_Maybe_1_None: {
						branch_List_35 = v18;
						branch_Maybe_34 = v15;
						branch_Label_33 = branch_Label_29;
					} break;
					default: {
						decref(MK_std_list_List_1(v18));
						decref(MK_std_maybe_Maybe_1(v15));
						struct std_list_List_1 v36 = { .tag=std_list_List_1_Nil };
						branch_List_35 = v36;
						branch_Maybe_34 = branch_Maybe_30;
						branch_Label_33 = branch_Label_29;
					} break;
				}
				bool v37 = true;
				branch_Bool_23 = v37;
				branch_List_22 = branch_List_35;
				branch_Maybe_21 = branch_Maybe_34;
				branch_Label_20 = branch_Label_33;
			} break;
			case std_maybe_Maybe_1_None: {
				bool v38 = false;
				branch_Bool_23 = v38;
				branch_List_22 = v18;
				branch_Maybe_21 = v15;
				branch_Label_20 = v14;
			} break;
			default: {
				do_panic(str_make("unexpected fallthrough in match\n", 32));
			}
		}
		v13 = branch_Bool_23;
		v12 = branch_Bool_23;
		v11 = branch_List_22;
		v10 = branch_Maybe_21;
		v9 = branch_Label_20;
	}
	decref(MK_std_list_List_1(v11));
	struct std_maybe_Maybe_1 v39 = mw_std_maybe_Maybe_1_map_1_sp18(v10);
	INT branch_Nat_40;
	switch ((v39).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v41 = mtp_std_maybe_Maybe_1_Some(v39);
			branch_Nat_40 = value_nat(v41);
		} break;
		case std_maybe_Maybe_1_None: {
			INT v42 = WRAP_I63(0LL);
			branch_Nat_40 = v42;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_zaMirth_4 = in_zaMirth_1;
	return branch_Nat_40;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, -0x60(%rbp)
movq %rsi, -0x50(%rbp)
movq %rdi, -0x58(%rbp)
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
movl 0x18(%rdx), %ebx
movq 0x20(%rdx), %r14
movq %r14, %rax
andq %r13, %rax
sete %cl
testb $0x3, %r14b
setne %sil
orb %cl, %sil
jne 0x5fd70
incl (%rax)
movq %rdx, %rax
andq %r13, %rax
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x5fd98
decl (%rax)
jne 0x5fd98
leaq 0xb6971(%rip), %rsi     # 0x116701
movq %rdx, %rdi
callq 0xd4e3
movq $0x0, -0x38(%rbp)
leaq -0x48(%rbp), %r12
movq $0x0, -0x30(%rbp)
movl %ebx, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x115ef
testl %eax, %eax
je 0x5fe56
cmpl $0x1, %eax
jne 0x5ffb0
movq %rdx, %rdi
callq 0xdaeb
movq %rax, %r14
movq %rdx, %rbx
movq %rax, %r12
testb $0x1, %bl
je 0x5fdf6
movq %r14, %rax
andq %r13, %rax
sete %cl
testb $0x3, %r12b
setne %dl
orb %cl, %dl
jne 0x5fdf6
incl (%rax)
movq 0x8(%r12), %r15
testb $0x1, 0x10(%r12)
je 0x5fe19
movq %r15, %rax
andq %r13, %rax
sete %cl
testb $0x3, %r15b
setne %dl
orb %cl, %dl
jne 0x5fe19
incl (%rax)
andq %r13, %r14
sete %al
testb $0x3, %r12b
setne %r13b
orb %al, %r13b
jne 0x5fe40
decl (%r14)
jne 0x5fe40
movq %r12, %rdi
leaq 0xb6686(%rip), %rsi     # 0x1164c1
callq 0xd4e3
cmpq -0x50(%rbp), %r15
jne 0x5fe65
movq %r12, %rdi
movq %rbx, %rsi
callq 0x95f6
movq %rdx, %r14
jmp 0x5fe73
movl -0x48(%rbp), %ebx
movq -0x40(%rbp), %r14
xorl %r15d, %r15d
jmp 0x5ff2c
testb $0x1, %bl
sete %al
orb %r13b, %al
je 0x5fe7f
xorl %r14d, %r14d
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
jmp 0x5fe9c
decl (%r14)
movabsq $0xfffffffffffc, %r13   # imm = 0xFFFFFFFFFFFC
jne 0x5fe99
movq %r12, %rdi
movq %rbx, %rsi
callq 0xd4e3
xorl %r14d, %r14d
movl -0x48(%rbp), %ebx
cmpq -0x50(%rbp), %r15
leaq -0x48(%rbp), %r12
jne 0x5ff25
movq -0x40(%rbp), %rax
movq %rax, %rcx
andq %r13, %rcx
sete %dl
testb $0x3, %al
setne %sil
orb %dl, %sil
jne 0x5fedb
decl (%rcx)
jne 0x5fedb
shlq $0x30, %rbx
orq %rax, %rbx
movq %rbx, %rdi
leaq 0xb53a3(%rip), %rsi     # 0x115279
callq 0xd4e3
movq -0x38(%rbp), %rsi
movq %rsi, %rax
andq %r13, %rax
sete %cl
testb $0x3, %sil
setne %dl
movb $0x1, %r15b
orb %cl, %dl
jne 0x5ff11
decl (%rax)
jne 0x5ff11
movq -0x30(%rbp), %rdi
shlq $0x30, %rdi
orq %rsi, %rdi
leaq 0xb53b5(%rip), %rsi     # 0x1152c1
callq 0xd4e3
xorl %ebx, %ebx
movl $0x1, %eax
movq %rax, -0x30(%rbp)
movq %r14, -0x38(%rbp)
xorl %r14d, %r14d
jmp 0x5ff2c
movb $0x1, %r15b
movq -0x40(%rbp), %r14
testb %r15b, %r15b
jne 0x5fdac
andq %r14, %r13
sete %al
testb $0x3, %r14b
setne %cl
orb %al, %cl
jne 0x5ff62
decl (%r13)
jne 0x5ff62
shlq $0x30, %rbx
orq %r14, %rbx
movq %rbx, %rdi
leaq 0xb531c(%rip), %rsi     # 0x115279
callq 0xd4e3
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x435e5
movl $0x1, %ebx
testl %eax, %eax
je 0x5ff93
cmpl $0x1, %eax
jne 0x5ffb0
movq %rdx, %rdi
callq 0xdaeb
movq %rax, %rbx
movq %rax, %rdi
movq %rdx, %rsi
callq 0x33553
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, (%rax)
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0xf9f7
movq $0x20, 0x10(%rax)
movups 0x84784(%rip), %xmm0    # 0xe474d
movups %xmm0, 0x18(%rax)
movups 0x84789(%rip), %xmm0    # 0xe475d
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0x95a5