	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function balance_case_nodes
_balance_case_nodes:                    ## @balance_case_nodes
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_29
## %bb.1:
	movq	%rsi, %r14
	movq	_use_cost_table@GOTPCREL(%rip), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	testl	%r14d, %r14d
	je	LBB0_17
LBB0_25:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax)
	movq	$0, (%r15)
	movq	%r13, (%r14)
	leaq	16(%r14), %rdi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r14)
	movq	%r14, %rsi
	callq	_balance_case_nodes
	leaq	8(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_29
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##     Child Loop BB0_12 Depth 2
                                        ##     Child Loop BB0_24 Depth 2
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=2
	movq	8(%rbx), %rbx
	decl	%r15d
	testq	%rbx, %rbx
	je	LBB0_9
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	callq	_tree_int_cst_equal
	testl	%eax, %eax
	je	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=2
	cmpq	$0, (%r12)
	jne	LBB0_7
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=2
	incl	%r14d
	cmpq	$0, (%r12)
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	24(%rbx), %edi
	callq	_TREE_INT_CST_LOW
	movl	%eax, %edi
	callq	_COST_TABLE
	addl	%eax, %r13d
	cmpq	$0, (%r12)
	je	LBB0_8
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=2
	movl	28(%rbx), %edi
	callq	_TREE_INT_CST_LOW
	movl	%eax, %edi
	callq	_COST_TABLE
	addl	%eax, %r13d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %eax
	notl	%eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	cmpl	$2, %eax
	jb	LBB0_26
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, (%r12)
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %eax
	incl	%eax
	shrl	$31, %eax
	leal	(%rax,%r13), %ebx
	incl	%ebx
	sarl	%ebx
	xorl	%r14d, %r14d
	movq	%rcx, %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	24(%rax), %esi
	movl	28(%rax), %edi
	callq	_tree_int_cst_equal
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=2
	movq	(%r15), %rax
	movl	24(%rax), %edi
	callq	_TREE_INT_CST_LOW
	movl	%eax, %edi
	callq	_COST_TABLE
	subl	%eax, %ebx
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=2
	movq	(%r15), %rax
	movl	28(%rax), %edi
	callq	_TREE_INT_CST_LOW
	movl	%eax, %edi
	callq	_COST_TABLE
	subl	%eax, %ebx
	testl	%ebx, %ebx
	jle	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=2
	movq	(%r15), %r15
	movq	8(%r15), %rax
	addq	$8, %r15
	decl	%r14d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-3, %r15d
	jne	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	8(%rcx), %r15
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_25
LBB0_22:                                ##   in Loop: Header=BB0_2 Depth=1
	subl	%r15d, %r14d
	movl	%r14d, %eax
	incl	%eax
	shrl	$31, %eax
	leal	(%r14,%rax), %ebx
	incl	%ebx
	sarl	%ebx
	movl	24(%rcx), %esi
	movl	28(%rcx), %edi
	callq	_tree_int_cst_equal
	cmpl	$1, %eax
	sbbl	$0, %ebx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	cmpl	$2, %ebx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jl	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_24:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r15), %r15
	movq	8(%r15), %rax
	movl	24(%rax), %esi
	movl	28(%rax), %edi
	callq	_tree_int_cst_equal
	xorl	%ecx, %ecx
	testl	%eax, %eax
	sete	%cl
	addq	$8, %r15
	notl	%ecx
	addl	%ecx, %ebx
	cmpl	$1, %ebx
	ja	LBB0_24
	jmp	LBB0_25
LBB0_26:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	8(%rcx), %rax
	testq	%rax, %rax
	je	LBB0_29
	.p2align	4, 0x90
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, (%rax)
	movq	%rax, %rcx
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_27
LBB0_29:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rbx
	movq	%r13, (%rbx)
	leaq	16(%rbx), %rdi
	movq	%rbx, %rsi
	callq	_balance_case_nodes
	movq	8(%rbx), %rax
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	testq	%rax, %rax
	je	LBB0_29
## %bb.18:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	%rbx, (%rax)
	movq	%rax, %rbx
	movq	8(%rax), %rax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_use_cost_table,8,3             ## @use_cost_table
	.no_dead_strip	_balance_case_nodes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function balance_case_nodes
_balance_case_nodes:                    ; @balance_case_nodes
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x23, [x0]
	cbz	x23, LBB0_27
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _use_cost_table@GOTPAGE
Lloh1:
	ldr	x22, [x22, _use_cost_table@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	w21, LBB0_25
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x21, [x24]
	str	x21, [x20]
	str	xzr, [x24]
	str	x19, [x21]
	mov	x0, x21
	str	x23, [x0, #16]!
	mov	x1, x21
	bl	_balance_case_nodes
	mov	x20, x21
	ldr	x23, [x20, #8]!
	mov	x19, x21
	cbz	x23, LBB0_27
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;     Child Loop BB0_14 Depth 2
                                        ;     Child Loop BB0_22 Depth 2
	mov	w21, #0
	mov	w24, #0
	mov	w25, #-1
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	ldr	x23, [x23, #8]
	add	w25, w25, #1
	cbz	x23, LBB0_11
LBB0_6:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	w1, w0, [x23, #24]
	bl	_tree_int_cst_equal
	cbz	w0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x8, [x22]
	cbnz	x8, LBB0_10
	b	LBB0_5
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=2
	add	w21, w21, #1
	ldr	x8, [x22]
	cbz	x8, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	w0, [x23, #24]
	bl	_TREE_INT_CST_LOW
	bl	_COST_TABLE
	add	w24, w24, w0
	ldr	x8, [x22]
	cbz	x8, LBB0_5
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	w0, [x23, #28]
	bl	_TREE_INT_CST_LOW
	bl	_COST_TABLE
	add	w24, w24, w0
	b	LBB0_5
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x23, [x20]
	cmp	w25, #2
	b.lo	LBB0_23
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x22]
	cbz	x8, LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w21, #0
	add	w8, w24, #1
	add	w9, w24, #2
	cmp	w8, #0
	csinc	w8, w9, w24, lt
	asr	w25, w8, #1
	mov	x8, x23
	mov	x24, x20
LBB0_14:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	w1, w0, [x8, #24]
	bl	_tree_int_cst_equal
	cbnz	w0, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=2
	ldr	x8, [x24]
	ldr	w0, [x8, #24]
	bl	_TREE_INT_CST_LOW
	bl	_COST_TABLE
	sub	w25, w25, w0
LBB0_16:                                ;   in Loop: Header=BB0_14 Depth=2
	ldr	x8, [x24]
	ldr	w0, [x8, #28]
	bl	_TREE_INT_CST_LOW
	bl	_COST_TABLE
	sub	w25, w25, w0
	cmp	w25, #1
	b.lt	LBB0_2
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=2
	ldr	x24, [x24]
	ldr	x8, [x24, #8]!
	sub	w21, w21, #1
	b	LBB0_14
LBB0_18:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w25, #2
	b.ne	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x23, #8
	b	LBB0_3
LBB0_20:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w8, w21, w25
	add	w9, w8, #2
	add	w8, w8, #3
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w21, w8, #1
	ldp	w1, w0, [x23, #24]
	bl	_tree_int_cst_equal
	cmp	w0, #0
	cset	w8, eq
	sub	w21, w21, w8
	mov	x24, x20
	cmp	w21, #2
	b.lt	LBB0_3
; %bb.21:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x24, x20
LBB0_22:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x24, [x24]
	ldr	x8, [x24, #8]!
	ldp	w1, w0, [x8, #24]
	bl	_tree_int_cst_equal
	cmp	w0, #0
	cset	w8, eq
	mvn	w8, w8
	add	w21, w8, w21
	cmp	w21, #1
	b.hi	LBB0_22
	b	LBB0_3
LBB0_23:
	str	x19, [x23]
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_27
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	str	x23, [x8]
	mov	x23, x8
	ldr	x8, [x8, #8]
	cbnz	x8, LBB0_24
	b	LBB0_27
LBB0_25:
	ldr	x20, [x20]
	str	x19, [x20]
	add	x0, x20, #16
	mov	x1, x20
	bl	_balance_case_nodes
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_27
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	str	x20, [x8]
	mov	x20, x8
	ldr	x8, [x8, #8]
	cbnz	x8, LBB0_26
LBB0_27:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_use_cost_table,8,3             ; @use_cost_table
	.no_dead_strip	_balance_case_nodes
.subsections_via_symbols
