	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function LISTBOX_RemoveItem
_LISTBOX_RemoveItem:                    ## @LISTBOX_RemoveItem
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	%rsi, (%rdi)
	jbe	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_LISTBOX_InvalidateItems
	decq	(%rbx)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_LISTBOX_DeleteItem
	movq	(%rbx), %rax
	movq	_LB_OKAY@GOTPCREL(%rip), %r12
	testq	%rax, %rax
	je	LBB0_20
## %bb.3:
	movq	%rax, %rdx
	subq	%r14, %rdx
	jbe	LBB0_5
## %bb.4:
	movq	40(%rbx), %rax
	leaq	(%rax,%r14,4), %rdi
	leaq	(%rax,%r14,4), %rsi
	addq	$4, %rsi
	shlq	$2, %rdx
	callq	_RtlMoveMemory
	movq	(%rbx), %rax
LBB0_5:
	cmpq	%rax, 8(%rbx)
	jne	LBB0_7
## %bb.6:
	decq	%rax
	movq	%rax, 8(%rbx)
LBB0_7:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	40(%rbx), %rdx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapSize
	movslq	%eax, %r15
	shrq	$2, %r15
	movq	_LB_ARRAY_GRANULARITY@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%r15, %rdx
	subq	%rax, %rdx
	subq	%rax, %rdx
	cmpq	%rdx, (%rbx)
	jae	LBB0_10
## %bb.8:
	subq	%rax, %r15
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	40(%rbx), %rdx
	shlq	$2, %r15
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r15, %rcx
	callq	_HeapReAlloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%rax, 40(%rbx)
LBB0_10:
	movq	%rbx, %rdi
	callq	_LISTBOX_UpdateScroll
	movq	(%rbx), %rax
	cmpq	16(%rbx), %rax
	jne	LBB0_12
## %bb.11:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_LISTBOX_SetTopItem
LBB0_12:
	movq	%rbx, %rdi
	callq	_IS_MULTISELECT
	testl	%eax, %eax
	jne	LBB0_18
## %bb.13:
	movq	24(%rbx), %rsi
	cmpq	%r14, %rsi
	jne	LBB0_15
## %bb.14:
	movq	$-1, 24(%rbx)
	jmp	LBB0_18
LBB0_1:
	movq	_LB_ERR@GOTPCREL(%rip), %r12
	jmp	LBB0_20
LBB0_15:
	jbe	LBB0_18
## %bb.16:
	leaq	-1(%rsi), %rax
	movq	%rax, 24(%rbx)
	movq	_ISWIN31@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_18
## %bb.17:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_LISTBOX_SetSelection
LBB0_18:
	movslq	32(%rbx), %rcx
	movq	(%rbx), %rax
	cmpq	%rcx, %rax
	ja	LBB0_20
## %bb.19:
	decl	%eax
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmovgl	%eax, %ecx
	movl	%ecx, 32(%rbx)
LBB0_20:
	movl	(%r12), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LB_ERR,4,2                     ## @LB_ERR
	.comm	_LB_OKAY,4,2                    ## @LB_OKAY
	.comm	_LB_ARRAY_GRANULARITY,4,2       ## @LB_ARRAY_GRANULARITY
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_ISWIN31,8,3                    ## @ISWIN31
	.comm	_FALSE,4,2                      ## @FALSE
	.no_dead_strip	_LISTBOX_RemoveItem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function LISTBOX_RemoveItem
_LISTBOX_RemoveItem:                    ; @LISTBOX_RemoveItem
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0]
	cmp	x8, x1
	b.ls	LBB0_14
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	bl	_LISTBOX_InvalidateItems
	ldr	x8, [x19]
	sub	x8, x8, #1
	str	x8, [x19]
	mov	x0, x19
	mov	x1, x20
	bl	_LISTBOX_DeleteItem
	ldr	x8, [x19]
	cbz	x8, LBB0_20
; %bb.2:
	subs	x9, x8, x20
	b.ls	LBB0_4
; %bb.3:
	ldr	x8, [x19, #40]
	add	x0, x8, x20, lsl #2
	add	x1, x0, #4
	lsl	x2, x9, #2
	bl	_RtlMoveMemory
	ldr	x8, [x19]
LBB0_4:
	ldr	x9, [x19, #8]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	sub	x8, x8, #1
	str	x8, [x19, #8]
LBB0_6:
	bl	_GetProcessHeap
	ldr	x2, [x19, #40]
	mov	w1, #0
	bl	_HeapSize
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	lsr	x8, x8, #2
	ldr	x10, [x19]
Lloh0:
	adrp	x9, _LB_ARRAY_GRANULARITY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LB_ARRAY_GRANULARITY@GOTPAGEOFF]
Lloh2:
	ldrsw	x9, [x9]
	sub	x11, x8, x9, lsl #1
	cmp	x10, x11
	b.hs	LBB0_9
; %bb.7:
	sub	x21, x8, x9
	bl	_GetProcessHeap
	ldr	x2, [x19, #40]
	lsl	x3, x21, #2
	mov	w1, #0
	bl	_HeapReAlloc
	cbz	x0, LBB0_9
; %bb.8:
	str	x0, [x19, #40]
LBB0_9:
	mov	x0, x19
	bl	_LISTBOX_UpdateScroll
	ldr	x8, [x19]
	ldr	x9, [x19, #16]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
Lloh3:
	adrp	x8, _TRUE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_LISTBOX_SetTopItem
LBB0_11:
	mov	x0, x19
	bl	_IS_MULTISELECT
	cbnz	w0, LBB0_18
; %bb.12:
	ldr	x1, [x19, #24]
	cmp	x1, x20
	b.ne	LBB0_15
; %bb.13:
	mov	x8, #-1
	str	x8, [x19, #24]
	b	LBB0_18
LBB0_14:
Lloh6:
	adrp	x8, _LB_ERR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LB_ERR@GOTPAGEOFF]
	b	LBB0_21
LBB0_15:
	b.ls	LBB0_18
; %bb.16:
	sub	x8, x1, #1
	str	x8, [x19, #24]
Lloh8:
	adrp	x8, _ISWIN31@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ISWIN31@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cbz	x8, LBB0_18
; %bb.17:
Lloh11:
	adrp	x8, _TRUE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _FALSE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_LISTBOX_SetSelection
LBB0_18:
	ldrsw	x9, [x19, #32]
	ldr	x8, [x19]
	cmp	x8, x9
	b.hi	LBB0_20
; %bb.19:
	sub	w8, w8, #1
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	str	w8, [x19, #32]
LBB0_20:
Lloh17:
	adrp	x8, _LB_OKAY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LB_OKAY@GOTPAGEOFF]
LBB0_21:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_LB_ERR,4,2                     ; @LB_ERR
	.comm	_LB_OKAY,4,2                    ; @LB_OKAY
	.comm	_LB_ARRAY_GRANULARITY,4,2       ; @LB_ARRAY_GRANULARITY
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_ISWIN31,8,3                    ; @ISWIN31
	.comm	_FALSE,4,2                      ; @FALSE
	.no_dead_strip	_LISTBOX_RemoveItem
.subsections_via_symbols
