	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function balance
_balance:                               ## @balance
	.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, %r15
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_1
LBB0_23:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ecx, %ecx
	cmpq	%rbx, %rax
	sete	%cl
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	callq	_rleft
	movq	%rbx, %rdi
	callq	_rright
LBB0_24:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	24(%r15), %rcx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, (%rcx,%rsi,8)
	xorl	%eax, %eax
	cmpl	$0, (%rbx)
	setg	%al
	negl	%eax
	movq	16(%rbx), %rcx
	movl	%eax, (%rcx)
	movl	(%rbx), %eax
	shrl	$31, %eax
	movq	8(%rbx), %rcx
	movl	%eax, (%rcx)
LBB0_25:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
LBB0_26:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%r14d, (%rbx)
	movl	%eax, %ecx
LBB0_27:                                ##   in Loop: Header=BB0_1 Depth=1
	movb	%r13b, %r12b
	xorl	%eax, %eax
	testl	%ecx, %ecx
	sete	%al
	movl	%r12d, %esi
	cmpl	%edx, %eax
	jne	LBB0_28
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rbx
	movq	32(%r15), %r15
	testq	%r15, %r15
	je	LBB0_28
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%r15), %rax
	xorl	%r12d, %r12d
	cmpq	%rbx, %rax
	sete	%r13b
	movl	(%rbx), %ecx
	xorl	%r14d, %r14d
	cmpl	%edx, %esi
	jne	LBB0_3
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$-1, %ecx
	je	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	$0, %eax
	cmpl	$1, %ecx
	je	LBB0_26
## %bb.16:                              ##   in Loop: Header=BB0_1 Depth=1
	testl	%ecx, %ecx
	jne	LBB0_27
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$-1, %ecx
	je	LBB0_25
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$1, %ecx
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%ecx, %ecx
	jne	LBB0_27
	jmp	LBB0_6
LBB0_18:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	16(%rbx), %rdi
	movl	(%rdi), %esi
	cmpl	$1, %esi
	je	LBB0_23
## %bb.19:                              ##   in Loop: Header=BB0_1 Depth=1
	testl	%esi, %esi
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	$-1, %ecx
	cmpl	$-1, %esi
	jne	LBB0_27
## %bb.21:                              ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ecx, %ecx
	cmpq	%rbx, %rax
	sete	%cl
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_rright
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	24(%r15), %rcx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, (%rcx,%rsi,8)
	movq	8(%rbx), %rax
	movl	$0, (%rax)
	jmp	LBB0_25
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rbx), %rdi
	movl	(%rdi), %esi
	cmpl	$-1, %esi
	je	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%esi, %esi
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$-1, %ecx
	cmpl	$1, %esi
	jne	LBB0_27
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ecx, %ecx
	cmpq	%rbx, %rax
	sete	%cl
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_rleft
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	24(%r15), %rcx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, (%rcx,%rsi,8)
	movq	16(%rbx), %rax
	movl	$0, (%rax)
	jmp	LBB0_25
LBB0_22:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%r14d, %r14d
	cmpq	%rbx, %rax
	sete	%r14b
	movq	%rbx, %rdi
	callq	_rright
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	24(%r15), %rcx
	movq	%rax, (%rcx,%r14,8)
	movq	8(%rbx), %rax
	movl	$-1, (%rax)
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	$-1, %eax
	movl	$1, %r14d
	jmp	LBB0_26
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ecx, %ecx
	cmpq	%rbx, %rax
	sete	%cl
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	callq	_rright
	movq	%rbx, %rdi
	callq	_rleft
	jmp	LBB0_24
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%r14d, %r14d
	cmpq	%rbx, %rax
	sete	%r14b
	movq	%rbx, %rdi
	callq	_rleft
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	24(%r15), %rcx
	movq	%rax, (%rcx,%r14,8)
	movq	16(%rbx), %rax
	movl	$1, (%rax)
LBB0_17:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	$-1, %r14d
	movl	$-1, %eax
	jmp	LBB0_26
LBB0_28:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_balance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function balance
_balance:                               ; @balance
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	mov	x20, x0
	mov	w22, #1
	b	LBB0_4
LBB0_1:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w9, #0
	mov	w8, #0
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	w9, [x21]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	w8, #0
	cset	w8, eq
	mov	x1, x23
	cmp	w8, w19
	b.ne	LBB0_28
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x21, x20
	ldr	x20, [x20, #32]
	cbz	x20, LBB0_28
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x20, #8]
	cmp	x9, x21
	cset	w23, eq
	ldr	w8, [x21]
	cmp	w1, w19
	b.ne	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmn	w8, #1
	b.eq	LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w8, #1
	b.eq	LBB0_1
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w8, LBB0_3
	b	LBB0_27
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmn	w8, #1
	b.eq	LBB0_1
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	w8, #1
	b.eq	LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w8, LBB0_3
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w8, #-1
	mov	w9, #1
	b	LBB0_2
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x21, #16]
	ldr	w8, [x0]
	cmp	w8, #1
	b.eq	LBB0_22
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	cbz	w8, LBB0_23
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	cmn	w8, #1
	b.ne	LBB0_21
; %bb.16:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	x9, x21
	cset	w24, eq
	mov	x0, x21
	bl	_rright
	mov	w9, #0
	mov	w8, #0
	ldr	x10, [x20, #24]
	str	x0, [x10, w24, uxtw #3]
	ldr	x10, [x21, #8]
	str	wzr, [x10]
	b	LBB0_2
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x21, #8]
	ldr	w8, [x0]
	cmn	w8, #1
	b.eq	LBB0_24
; %bb.18:                               ;   in Loop: Header=BB0_4 Depth=1
	cbz	w8, LBB0_26
; %bb.19:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	w8, #1
	b.ne	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	x9, x21
	cset	w24, eq
	mov	x0, x21
	bl	_rleft
	mov	w9, #0
	mov	w8, #0
	ldr	x10, [x20, #24]
	str	x0, [x10, w24, uxtw #3]
	ldr	x10, [x21, #16]
	str	wzr, [x10]
	b	LBB0_2
LBB0_21:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w8, #-1
	b	LBB0_3
LBB0_22:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x9, x21
	cset	w24, eq
	bl	_rleft
	mov	x0, x21
	bl	_rright
	b	LBB0_25
LBB0_23:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x9, x21
	cset	w24, eq
	mov	x0, x21
	bl	_rright
	ldr	x8, [x20, #24]
	str	x0, [x8, w24, uxtw #3]
	ldr	x9, [x21, #8]
	mov	w8, #-1
	str	w8, [x9]
	mov	w9, #1
	b	LBB0_2
LBB0_24:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x9, x21
	cset	w24, eq
	bl	_rright
	mov	x0, x21
	bl	_rleft
LBB0_25:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w9, #0
	mov	w8, #0
	ldr	x10, [x20, #24]
	str	x0, [x10, w24, uxtw #3]
	ldr	w10, [x21]
	cmp	w10, #0
	csetm	w10, gt
	ldp	x12, x11, [x21, #8]
	str	w10, [x11]
	ldr	w10, [x21]
	lsr	w10, w10, #31
	str	w10, [x12]
	b	LBB0_2
LBB0_26:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x9, x21
	cset	w24, eq
	mov	x0, x21
	bl	_rleft
	ldr	x8, [x20, #24]
	str	x0, [x8, w24, uxtw #3]
	ldr	x8, [x21, #16]
	str	w22, [x8]
LBB0_27:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w9, #-1
	mov	w8, #-1
	b	LBB0_2
LBB0_28:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_balance
.subsections_via_symbols
