	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function TOOLBAR_Cust_AddButton
_TOOLBAR_Cust_AddButton:                ## @TOOLBAR_Cust_AddButton
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	movl	%edx, %esi
	movl	%ecx, %edx
	callq	_TRACE
	movl	%r13d, -64(%rbp)
	leaq	-60(%rbp), %rdi
	movl	(%rbx), %esi
	movq	_TBN_QUERYINSERT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_TOOLBAR_SendNotify
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_IDC_TOOLBARBTN_LBOX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_GetDlgItem
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_IDC_AVAILBTN_LBOX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_GetDlgItem
	movl	%eax, %r15d
	movq	_LB_GETCOUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_SendMessageW
	movl	%eax, %r14d
	movq	_LB_GETITEMDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	callq	_SendMessageW
	movslq	%eax, %rbx
	testl	%r13d, %r13d
	je	LBB0_5
## %bb.2:
	movq	_LB_DELETESTRING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	callq	_SendMessageW
	decl	%r14d
	movq	_LB_SETCURSEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	%r13d, %r14d
	jne	LBB0_4
## %bb.3:
	decl	%r13d
LBB0_4:
	movl	%r15d, %edi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	callq	_SendMessageW
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%rbx, %r15
	jmp	LBB0_6
LBB0_5:
	movl	$4, %edi
	callq	_Alloc
	movq	%rax, %r15
	movl	(%rbx), %ecx
	movl	%ecx, (%rax)
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_6:
	movq	_LB_INSERTSTRING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	callq	_SendMessageW
	movq	_LB_SETITEMDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	callq	_SendMessageW
	movl	4(%r14), %edi
	movq	_TB_INSERTBUTTONW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	callq	_SendMessageW
	movl	(%r14), %esi
	movq	_TBN_TOOLBARCHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-68(%rbp), %rdi
	callq	_TOOLBAR_SendNotify
LBB0_7:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Add: nIndexAvail %d, nIndexTo %d\n"

	.comm	_TBN_QUERYINSERT,4,2            ## @TBN_QUERYINSERT
	.comm	_IDC_TOOLBARBTN_LBOX,4,2        ## @IDC_TOOLBARBTN_LBOX
	.comm	_IDC_AVAILBTN_LBOX,4,2          ## @IDC_AVAILBTN_LBOX
	.comm	_LB_GETCOUNT,4,2                ## @LB_GETCOUNT
	.comm	_LB_GETITEMDATA,4,2             ## @LB_GETITEMDATA
	.comm	_LB_DELETESTRING,4,2            ## @LB_DELETESTRING
	.comm	_LB_SETCURSEL,4,2               ## @LB_SETCURSEL
	.comm	_LB_INSERTSTRING,4,2            ## @LB_INSERTSTRING
	.comm	_LB_SETITEMDATA,4,2             ## @LB_SETITEMDATA
	.comm	_TB_INSERTBUTTONW,4,2           ## @TB_INSERTBUTTONW
	.comm	_TBN_TOOLBARCHANGE,4,2          ## @TBN_TOOLBARCHANGE
	.no_dead_strip	_TOOLBAR_Cust_AddButton
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function TOOLBAR_Cust_AddButton
_TOOLBAR_Cust_AddButton:                ; @TOOLBAR_Cust_AddButton
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x2
	mov	x2, x3
	bl	_TRACE
	str	w22, [sp, #8]
	add	x8, sp, #8
	orr	x0, x8, #0x4
	ldr	w1, [x19]
Lloh2:
	adrp	x8, _TBN_QUERYINSERT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TBN_QUERYINSERT@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_TOOLBAR_SendNotify
	cbz	x0, LBB0_8
; %bb.1:
Lloh5:
	adrp	x8, _IDC_TOOLBARBTN_LBOX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IDC_TOOLBARBTN_LBOX@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_GetDlgItem
	mov	x21, x0
Lloh8:
	adrp	x8, _IDC_AVAILBTN_LBOX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IDC_AVAILBTN_LBOX@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_GetDlgItem
	mov	x24, x0
Lloh11:
	adrp	x8, _LB_GETCOUNT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LB_GETCOUNT@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w2, #0
	mov	w3, #0
	bl	_SendMessageW
	mov	x25, x0
Lloh14:
	adrp	x8, _LB_GETITEMDATA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LB_GETITEMDATA@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x24
	mov	x2, x22
	mov	w3, #0
	bl	_SendMessageW
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x23, w0
	cbz	w22, LBB0_4
; %bb.2:
Lloh17:
	adrp	x8, _LB_DELETESTRING@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LB_DELETESTRING@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x24
	mov	x2, x22
	mov	w3, #0
	bl	_SendMessageW
	sub	w8, w25, #1
Lloh20:
	adrp	x9, _LB_SETCURSEL@GOTPAGE
Lloh21:
	ldr	x9, [x9, _LB_SETCURSEL@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x9]
	cmp	w8, w22
	b.ne	LBB0_5
; %bb.3:
	sub	w2, w22, #1
	mov	x0, x24
	b	LBB0_6
LBB0_4:
	mov	w0, #4
	bl	_Alloc
	ldr	w8, [x23]
	str	w8, [x0]
	mov	x23, x0
	b	LBB0_7
LBB0_5:
	mov	x0, x24
	mov	x2, x22
LBB0_6:
	mov	w3, #0
	bl	_SendMessageW
LBB0_7:
Lloh23:
	adrp	x8, _LB_INSERTSTRING@GOTPAGE
Lloh24:
	ldr	x8, [x8, _LB_INSERTSTRING@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x20
	mov	w3, #0
	bl	_SendMessageW
Lloh26:
	adrp	x8, _LB_SETITEMDATA@GOTPAGE
Lloh27:
	ldr	x8, [x8, _LB_SETITEMDATA@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x20
	mov	x3, x23
	bl	_SendMessageW
	ldr	w0, [x19, #4]
Lloh29:
	adrp	x8, _TB_INSERTBUTTONW@GOTPAGE
Lloh30:
	ldr	x8, [x8, _TB_INSERTBUTTONW@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x2, x20
	mov	x3, x23
	bl	_SendMessageW
	ldr	w1, [x19]
Lloh32:
	adrp	x8, _TBN_TOOLBARCHANGE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _TBN_TOOLBARCHANGE@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	add	x0, sp, #4
	bl	_TOOLBAR_SendNotify
LBB0_8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Add: nIndexAvail %d, nIndexTo %d\n"

	.comm	_TBN_QUERYINSERT,4,2            ; @TBN_QUERYINSERT
	.comm	_IDC_TOOLBARBTN_LBOX,4,2        ; @IDC_TOOLBARBTN_LBOX
	.comm	_IDC_AVAILBTN_LBOX,4,2          ; @IDC_AVAILBTN_LBOX
	.comm	_LB_GETCOUNT,4,2                ; @LB_GETCOUNT
	.comm	_LB_GETITEMDATA,4,2             ; @LB_GETITEMDATA
	.comm	_LB_DELETESTRING,4,2            ; @LB_DELETESTRING
	.comm	_LB_SETCURSEL,4,2               ; @LB_SETCURSEL
	.comm	_LB_INSERTSTRING,4,2            ; @LB_INSERTSTRING
	.comm	_LB_SETITEMDATA,4,2             ; @LB_SETITEMDATA
	.comm	_TB_INSERTBUTTONW,4,2           ; @TB_INSERTBUTTONW
	.comm	_TBN_TOOLBARCHANGE,4,2          ; @TBN_TOOLBARCHANGE
	.no_dead_strip	_TOOLBAR_Cust_AddButton
.subsections_via_symbols
