	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function LISTBOX_SetTopItem
_LISTBOX_SetTopItem:                    ## @LISTBOX_SetTopItem
	.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
	movq	%rdx, %r12
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_LISTBOX_GetMaxTopIndex
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movq	%r12, %rdx
	callq	_TRACE
	cmpl	%ebx, %r15d
	cmovll	%r15d, %ebx
	xorl	%r15d, %r15d
	testl	%ebx, %ebx
	cmovgl	%ebx, %r15d
	movl	(%r14), %ecx
	movq	_LBS_MULTICOLUMN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%ecx, %esi
	je	LBB0_2
## %bb.1:
	movl	%r15d, %eax
	cltd
	idivl	4(%r14)
	subl	%edx, %r15d
LBB0_2:
	movslq	8(%r14), %rax
	cmpl	%r15d, %eax
	je	LBB0_34
## %bb.3:
	testq	%r12, %r12
	je	LBB0_32
## %bb.4:
	testl	%ecx, %esi
	je	LBB0_6
## %bb.5:
	subl	%r15d, %eax
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	4(%r14)
	movl	%eax, %edx
	imull	12(%r14), %edx
LBB0_31:
	movq	_SW_INVALIDATE@GOTPCREL(%rip), %rax
	movq	_SW_ERASE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	20(%r14), %edi
	movq	_SW_SCROLLCHILDREN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	$0
	callq	_ScrollWindowEx
	addq	$16, %rsp
	jmp	LBB0_33
LBB0_32:
	movl	20(%r14), %edi
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_InvalidateRect
LBB0_33:
	movl	%r15d, 8(%r14)
	movq	%r14, %rdi
	callq	_LISTBOX_UpdateScroll
LBB0_34:
	movq	_LB_OKAY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_LBS_OWNERDRAWVARIABLE@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_30
## %bb.7:
	cmpl	%r15d, %eax
	jge	LBB0_8
## %bb.19:
	movq	24(%r14), %rcx
	movslq	%r15d, %rsi
	movq	%rsi, %r10
	subq	%rax, %r10
	xorl	%edx, %edx
	cmpq	$4, %r10
	jb	LBB0_29
## %bb.20:
	movq	%r10, %r8
	andq	$-4, %r8
	leaq	-4(%r8), %rdx
	movq	%rdx, %r9
	shrq	$2, %r9
	incq	%r9
	testq	%rdx, %rdx
	je	LBB0_21
## %bb.22:
	movq	%r9, %rdx
	andq	$-2, %rdx
	leaq	(%rcx,%rsi,8), %rdi
	addq	$-16, %rdi
	pxor	%xmm0, %xmm0
	movq	$-2, %rbx
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-32(%rdi,%rbx,8), %xmm2
	movdqu	-16(%rdi,%rbx,8), %xmm3
	movdqu	(%rdi,%rbx,8), %xmm4
	paddd	%xmm2, %xmm4
	movdqu	16(%rdi,%rbx,8), %xmm2
	paddd	%xmm3, %xmm2
	pshufd	$226, %xmm2, %xmm2              ## xmm2 = xmm2[2,0,2,3]
	psubd	%xmm2, %xmm0
	pshufd	$226, %xmm4, %xmm2              ## xmm2 = xmm4[2,0,2,3]
	psubd	%xmm2, %xmm1
	addq	$-8, %rbx
	addq	$-2, %rdx
	jne	LBB0_23
## %bb.24:
	incq	%rbx
	jmp	LBB0_25
LBB0_30:
	subl	%r15d, %eax
	imull	16(%r14), %eax
	movl	%eax, %edx
	jmp	LBB0_31
LBB0_8:
	xorl	%edx, %edx
	cmpl	%r15d, %eax
	jle	LBB0_31
## %bb.9:
	movq	24(%r14), %rcx
	movslq	%r15d, %rsi
	movq	%rax, %r10
	subq	%rsi, %r10
	xorl	%edx, %edx
	cmpq	$4, %r10
	jb	LBB0_18
## %bb.10:
	movq	%r10, %r8
	andq	$-4, %r8
	leaq	-4(%r8), %rdx
	movq	%rdx, %r9
	shrq	$2, %r9
	incq	%r9
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.12:
	movq	%r9, %rdx
	andq	$-2, %rdx
	leaq	(%rcx,%rsi,8), %rdi
	addq	$48, %rdi
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm1, %xmm1
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-48(%rdi,%rbx,8), %xmm2
	movdqu	-32(%rdi,%rbx,8), %xmm3
	movdqu	-16(%rdi,%rbx,8), %xmm4
	movdqu	(%rdi,%rbx,8), %xmm5
	pshufd	$232, %xmm2, %xmm2              ## xmm2 = xmm2[0,2,2,3]
	paddd	%xmm0, %xmm2
	pshufd	$232, %xmm3, %xmm3              ## xmm3 = xmm3[0,2,2,3]
	paddd	%xmm1, %xmm3
	pshufd	$232, %xmm4, %xmm0              ## xmm0 = xmm4[0,2,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$232, %xmm5, %xmm1              ## xmm1 = xmm5[0,2,2,3]
	paddd	%xmm3, %xmm1
	addq	$8, %rbx
	addq	$-2, %rdx
	jne	LBB0_13
	jmp	LBB0_14
LBB0_21:
	pxor	%xmm0, %xmm0
	movq	$-1, %rbx
	pxor	%xmm1, %xmm1
LBB0_25:
	testb	$1, %r9b
	je	LBB0_27
## %bb.26:
	addq	%rsi, %rbx
	movdqu	-24(%rcx,%rbx,8), %xmm2
	movdqu	-8(%rcx,%rbx,8), %xmm3
	pshufd	$226, %xmm3, %xmm3              ## xmm3 = xmm3[2,0,2,3]
	psubd	%xmm3, %xmm0
	pshufd	$226, %xmm2, %xmm2              ## xmm2 = xmm2[2,0,2,3]
	psubd	%xmm2, %xmm1
LBB0_27:
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpq	%r8, %r10
	je	LBB0_31
## %bb.28:
	subq	%r8, %rsi
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	subl	-8(%rcx,%rsi,8), %edx
	decq	%rsi
	cmpq	%rax, %rsi
	jg	LBB0_29
	jmp	LBB0_31
LBB0_11:
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm1, %xmm1
LBB0_14:
	testb	$1, %r9b
	je	LBB0_16
## %bb.15:
	addq	%rsi, %rbx
	movdqu	(%rcx,%rbx,8), %xmm2
	movdqu	16(%rcx,%rbx,8), %xmm3
	pshufd	$232, %xmm2, %xmm2              ## xmm2 = xmm2[0,2,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$232, %xmm3, %xmm2              ## xmm2 = xmm3[0,2,2,3]
	paddd	%xmm2, %xmm1
LBB0_16:
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpq	%r8, %r10
	je	LBB0_31
## %bb.17:
	addq	%r8, %rsi
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	addl	(%rcx,%rsi,8), %edx
	incq	%rsi
	cmpq	%rsi, %rax
	jne	LBB0_18
	jmp	LBB0_31
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"setting top item %d, scroll %d\n"

	.comm	_LBS_MULTICOLUMN,4,2            ## @LBS_MULTICOLUMN
	.comm	_LB_OKAY,4,2                    ## @LB_OKAY
	.comm	_LBS_OWNERDRAWVARIABLE,4,2      ## @LBS_OWNERDRAWVARIABLE
	.comm	_SW_INVALIDATE,4,2              ## @SW_INVALIDATE
	.comm	_SW_ERASE,4,2                   ## @SW_ERASE
	.comm	_SW_SCROLLCHILDREN,4,2          ## @SW_SCROLLCHILDREN
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_LISTBOX_SetTopItem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function LISTBOX_SetTopItem
_LISTBOX_SetTopItem:                    ; @LISTBOX_SetTopItem
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_LISTBOX_GetMaxTopIndex
	mov	x22, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x20
	bl	_TRACE
	cmp	w22, w21
	csel	w8, w22, w21, lt
	cmp	w8, #0
	csel	w21, w8, wzr, gt
	ldr	w9, [x19]
Lloh2:
	adrp	x8, _LBS_MULTICOLUMN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LBS_MULTICOLUMN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ands	w10, w8, w9
	b.eq	LBB0_2
; %bb.1:
	ldr	w8, [x19, #4]
	sdiv	w11, w21, w8
	mul	w21, w11, w8
LBB0_2:
	ldrsw	x8, [x19, #8]
	cmp	w8, w21
	b.eq	LBB0_10
; %bb.3:
	cbz	x20, LBB0_8
; %bb.4:
	cbz	w10, LBB0_11
; %bb.5:
	sub	w8, w8, w21
	ldr	w9, [x19, #4]
	sdiv	w8, w8, w9
	ldr	w9, [x19, #12]
LBB0_6:
	mul	w2, w9, w8
LBB0_7:
	ldr	w0, [x19, #20]
Lloh5:
	adrp	x8, _SW_INVALIDATE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SW_INVALIDATE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _SW_ERASE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SW_ERASE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh11:
	adrp	x9, _SW_SCROLLCHILDREN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SW_SCROLLCHILDREN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w7, w8, w9
	mov	w1, #0
	mov	x3, #0
	mov	x4, #0
	mov	w5, #0
	mov	x6, #0
	bl	_ScrollWindowEx
	b	LBB0_9
LBB0_8:
	ldr	w0, [x19, #20]
Lloh14:
	adrp	x8, _TRUE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x1, #0
	bl	_InvalidateRect
LBB0_9:
	str	w21, [x19, #8]
	mov	x0, x19
	bl	_LISTBOX_UpdateScroll
LBB0_10:
Lloh17:
	adrp	x8, _LB_OKAY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LB_OKAY@GOTPAGEOFF]
Lloh19:
	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
LBB0_11:
Lloh20:
	adrp	x10, _LBS_OWNERDRAWVARIABLE@GOTPAGE
Lloh21:
	ldr	x10, [x10, _LBS_OWNERDRAWVARIABLE@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_15
; %bb.12:
	cmp	w8, w21
	b.ge	LBB0_16
; %bb.13:
	ldr	x10, [x19, #24]
	mov	x9, x21
	sxtw	x13, w9
	sub	x11, x13, x8
	cmp	x11, #8
	b.hs	LBB0_19
; %bb.14:
	mov	w2, #0
	mov	x9, x13
	b	LBB0_22
LBB0_15:
	sub	w8, w8, w21
	ldr	w9, [x19, #16]
	b	LBB0_6
LBB0_16:
	cmp	w8, w21
	b.le	LBB0_24
; %bb.17:
	ldr	x9, [x19, #24]
	sxtw	x13, w21
	sub	x11, x8, x13
	cmp	x11, #8
	b.hs	LBB0_25
; %bb.18:
	mov	w2, #0
	mov	x10, x13
	b	LBB0_28
LBB0_19:
	and	x12, x11, #0xfffffffffffffff8
	sub	x9, x13, x12
	add	x13, x10, x13, lsl #3
	sub	x13, x13, #32
	movi.2d	v0, #0000000000000000
	mov	x14, x12
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldp	q5, q4, [x13]
	ext.16b	v4, v4, v4, #8
	ext.16b	v5, v5, v5, #8
	ldp	q7, q6, [x13, #-32]
	ext.16b	v6, v6, v6, #8
	ext.16b	v7, v7, v7, #8
	xtn.2s	v4, v4
	xtn.2s	v5, v5
	xtn.2s	v6, v6
	xtn.2s	v7, v7
	sub.2s	v0, v0, v4
	sub.2s	v1, v1, v5
	sub.2s	v2, v2, v6
	sub.2s	v3, v3, v7
	sub	x13, x13, #64
	sub	x14, x14, #8
	cbnz	x14, LBB0_20
; %bb.21:
	add.2s	v0, v1, v0
	add.2s	v0, v2, v0
	add.2s	v0, v3, v0
	addp.2s	v0, v0, v0
	fmov	w2, s0
	cmp	x11, x12
	b.eq	LBB0_7
LBB0_22:
	sub	x10, x10, #8
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10, x9, lsl #3]
	sub	x12, x9, #1
	sub	w2, w2, w11
	mov	x9, x12
	cmp	x12, x8
	b.gt	LBB0_23
	b	LBB0_7
LBB0_24:
	mov	w2, #0
	b	LBB0_7
LBB0_25:
	and	x12, x11, #0xfffffffffffffff8
	add	x10, x12, x13
	add	x13, x9, x13, lsl #3
	add	x13, x13, #32
	movi.2d	v0, #0000000000000000
	mov	x14, x12
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x13, #-32]
	ldp	q6, q7, [x13], #64
	xtn.2s	v4, v4
	xtn.2s	v5, v5
	xtn.2s	v6, v6
	xtn.2s	v7, v7
	add.2s	v0, v0, v4
	add.2s	v1, v1, v5
	add.2s	v2, v2, v6
	add.2s	v3, v3, v7
	subs	x14, x14, #8
	b.ne	LBB0_26
; %bb.27:
	add.2s	v0, v1, v0
	add.2s	v0, v2, v0
	add.2s	v0, v3, v0
	addp.2s	v0, v0, v0
	fmov	w2, s0
	cmp	x11, x12
	b.eq	LBB0_7
LBB0_28:
	add	x9, x9, x10, lsl #3
	sub	x8, x8, x10
LBB0_29:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9], #8
	add	w2, w2, w10
	subs	x8, x8, #1
	b.ne	LBB0_29
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"setting top item %d, scroll %d\n"

	.comm	_LBS_MULTICOLUMN,4,2            ; @LBS_MULTICOLUMN
	.comm	_LB_OKAY,4,2                    ; @LB_OKAY
	.comm	_LBS_OWNERDRAWVARIABLE,4,2      ; @LBS_OWNERDRAWVARIABLE
	.comm	_SW_INVALIDATE,4,2              ; @SW_INVALIDATE
	.comm	_SW_ERASE,4,2                   ; @SW_ERASE
	.comm	_SW_SCROLLCHILDREN,4,2          ; @SW_SCROLLCHILDREN
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_LISTBOX_SetTopItem
.subsections_via_symbols
