	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_tbs_to_menu
_add_tbs_to_menu:                       ## @add_tbs_to_menu
	.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	$232, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_KEY_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TRUE@GOTPCREL(%rip), %r14
	movl	(%r14), %r8d
	leaq	_add_tbs_to_menu.toolbar_key(%rip), %rdi
	leaq	-224(%rbp), %rcx
	xorl	%edx, %edx
	callq	_SHRegOpenUSKeyW
	movq	_ERROR_SUCCESS@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	jne	LBB0_13
## %bb.1:
	leaq	-96(%rbp), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, -212(%rbp)
	movq	_KEY_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %r8d
	leaq	_add_tbs_to_menu.classes_key(%rip), %rdi
	leaq	-248(%rbp), %rcx
	xorl	%edx, %edx
	callq	_SHRegOpenUSKeyW
	movq	-224(%rbp), %rdi
	cmpq	(%r13), %rax
	jne	LBB0_15
## %bb.2:
	movl	%ebx, -228(%rbp)                ## 4-byte Spill
	movq	_SHREGENUM_HKLM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	-96(%rbp), %rdx
	leaq	-212(%rbp), %rcx
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%rax
	pushq	$0
	callq	_SHRegEnumUSValueW
	addq	$16, %rsp
	cmpq	(%r13), %rax
	jne	LBB0_12
## %bb.3:
	movl	$1, %ebx
	leaq	-208(%rbp), %rdi
	leaq	-96(%rbp), %r15
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	_debugstr_w
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_TRACE
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-224(%rbp), %rdi
	movq	_SHREGENUM_HKLM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ebx, %esi
	movq	%r15, %rdx
	leaq	-212(%rbp), %rcx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%rax
	pushq	$0
	callq	_SHRegEnumUSValueW
	addq	$16, %rsp
	incl	%ebx
	cmpq	(%r13), %rax
	movq	%r12, %rdi
	jne	LBB0_12
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rdi, %r12
	callq	_ARRAY_SIZE
	movl	%eax, -232(%rbp)
	movq	%r15, %rdi
	callq	_ARRAY_SIZE
	movl	%eax, -212(%rbp)
	movq	%r15, %rdi
	callq	_lstrlenW
	cmpl	$38, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_KEY_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-248(%rbp), %rdx
	movl	(%r14), %r8d
	movq	%r15, %rdi
	leaq	-240(%rbp), %rcx
	callq	_SHRegOpenUSKeyW
	cmpq	(%r13), %rax
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-240(%rbp), %rdi
	movl	(%r14), %r9d
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	%r12, %r15
	movq	%r12, %rcx
	leaq	-232(%rbp), %r8
	pushq	$0
	pushq	$0
	callq	_SHRegQueryUSValueW
	addq	$16, %rsp
	movq	%rax, %r14
	movq	-240(%rbp), %rdi
	callq	_SHRegCloseUSKey
	cmpq	(%r13), %r14
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	$24, -272(%rbp)
	movq	_MIIM_STRING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -256(%rbp)
	movq	%r15, -264(%rbp)
	movl	-228(%rbp), %r14d               ## 4-byte Reload
	movl	%r14d, %edi
	callq	_GetMenuItemCount
	movq	_TRUE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movl	%r14d, %edi
	movl	%eax, %esi
	leaq	-272(%rbp), %rcx
	callq	_InsertMenuItemW
	movq	%r15, %r14
	movq	_ERROR_SUCCESS@GOTPCREL(%rip), %r13
	leaq	-96(%rbp), %r15
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	_debugstr_w
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_ERR
	jmp	LBB0_11
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	leaq	-96(%rbp), %r15
	movq	%r15, %rdi
	callq	_debugstr_w
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	callq	_ERR
	movq	_TRUE@GOTPCREL(%rip), %r14
	movq	_ERROR_SUCCESS@GOTPCREL(%rip), %r13
	jmp	LBB0_11
LBB0_15:
	callq	_SHRegCloseUSKey
	leaq	_add_tbs_to_menu.classes_key(%rip), %rdi
	callq	_debugstr_w
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_ERR
	jmp	LBB0_13
LBB0_12:
	movq	-248(%rbp), %rdi
	callq	_SHRegCloseUSKey
	movq	-224(%rbp), %rdi
	callq	_SHRegCloseUSKey
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.14:
	addq	$232, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @add_tbs_to_menu.toolbar_key
_add_tbs_to_menu.toolbar_key:
	.asciz	"Software\\Microsoft\\Internet Explorer\\Toolbar"

	.comm	_KEY_READ,4,2                   ## @KEY_READ
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_ERROR_SUCCESS,8,3              ## @ERROR_SUCCESS
	.p2align	4                               ## @add_tbs_to_menu.classes_key
_add_tbs_to_menu.classes_key:
	.asciz	"Software\\Classes\\CLSID"

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to open key %s\n"

	.comm	_SHREGENUM_HKLM,4,2             ## @SHREGENUM_HKLM
L_.str.1:                               ## @.str.1
	.asciz	"Found invalid IE toolbar entry: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to get class info for %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to get toolbar name for %s\n"

	.comm	_MIIM_STRING,4,2                ## @MIIM_STRING
	.no_dead_strip	_add_tbs_to_menu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_tbs_to_menu
_add_tbs_to_menu:                       ; @add_tbs_to_menu
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #320
	.cfi_def_cfa_offset 320
	stp	x28, x27, [sp, #224]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #240]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #256]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #272]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #288]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #304]            ; 16-byte Folded Spill
	add	x29, sp, #304
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
Lloh3:
	adrp	x25, _KEY_READ@GOTPAGE
Lloh4:
	ldr	x25, [x25, _KEY_READ@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh5:
	adrp	x26, _TRUE@GOTPAGE
Lloh6:
	ldr	x26, [x26, _TRUE@GOTPAGEOFF]
	ldr	w4, [x26]
Lloh7:
	adrp	x0, _add_tbs_to_menu.toolbar_key@PAGE
Lloh8:
	add	x0, x0, _add_tbs_to_menu.toolbar_key@PAGEOFF
	add	x3, sp, #56
	mov	x2, #0
	bl	_SHRegOpenUSKeyW
Lloh9:
	adrp	x27, _ERROR_SUCCESS@GOTPAGE
Lloh10:
	ldr	x27, [x27, _ERROR_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x27]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.1:
	sub	x0, x29, #135
	bl	_ARRAY_SIZE
	str	w0, [sp, #44]
	ldr	w1, [x25]
	ldr	w4, [x26]
Lloh11:
	adrp	x0, _add_tbs_to_menu.classes_key@PAGE
Lloh12:
	add	x0, x0, _add_tbs_to_menu.classes_key@PAGEOFF
	add	x3, sp, #48
	mov	x2, #0
	bl	_SHRegOpenUSKeyW
	mov	x8, x0
	ldr	x9, [x27]
	ldr	x0, [sp, #56]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.2:
Lloh13:
	adrp	x28, _SHREGENUM_HKLM@GOTPAGE
Lloh14:
	ldr	x28, [x28, _SHREGENUM_HKLM@GOTPAGEOFF]
	ldr	w7, [x28]
	sub	x2, x29, #135
	add	x3, sp, #44
	mov	w1, #0
	mov	x4, #0
	mov	x5, #0
	mov	x6, #0
	bl	_SHRegEnumUSValueW
	ldr	x8, [x27]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.3:
	mov	w20, #1
Lloh15:
	adrp	x21, l_.str.3@PAGE
Lloh16:
	add	x21, x21, l_.str.3@PAGEOFF
Lloh17:
	adrp	x22, l_.str.2@PAGE
Lloh18:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh19:
	adrp	x23, l_.str.1@PAGE
Lloh20:
	add	x23, x23, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	sub	x0, x29, #135
	bl	_debugstr_w
	mov	x1, x0
	mov	x0, x23
	bl	_TRACE
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [sp, #56]
	ldr	w7, [x28]
	sub	x2, x29, #135
	add	x3, sp, #44
	mov	x1, x20
	mov	x4, #0
	mov	x5, #0
	mov	x6, #0
	bl	_SHRegEnumUSValueW
	ldr	x8, [x27]
	add	w20, w20, #1
	cmp	x0, x8
	b.ne	LBB0_13
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #69
	bl	_ARRAY_SIZE
	str	w0, [sp, #40]
	sub	x0, x29, #135
	bl	_ARRAY_SIZE
	str	w0, [sp, #44]
	sub	x0, x29, #135
	bl	_lstrlenW
	cmp	w0, #38
	b.ne	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x25]
	ldr	x2, [sp, #48]
	ldr	w4, [x26]
	sub	x0, x29, #135
	add	x3, sp, #32
	bl	_SHRegOpenUSKeyW
	ldr	x8, [x27]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [sp, #32]
	ldr	w5, [x26]
	add	x3, sp, #69
	add	x4, sp, #40
	mov	x1, #0
	mov	x2, #0
	mov	x6, #0
	mov	w7, #0
	bl	_SHRegQueryUSValueW
	mov	x24, x0
	ldr	x0, [sp, #32]
	bl	_SHRegCloseUSKey
	ldr	x8, [x27]
	cmp	x24, x8
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w8, #24
	str	w8, [sp, #8]
Lloh21:
	adrp	x8, _MIIM_STRING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MIIM_STRING@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	add	x8, sp, #69
	str	x8, [sp, #16]
	mov	x0, x19
	bl	_GetMenuItemCount
	mov	x1, x0
	ldr	w2, [x26]
	add	x3, sp, #8
	mov	x0, x19
	bl	_InsertMenuItemW
	b	LBB0_5
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	x0, x29, #135
	bl	_debugstr_w
	mov	x1, x0
	mov	x0, x22
	bl	_ERR
	b	LBB0_5
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	x0, x29, #135
	bl	_debugstr_w
	mov	x1, x0
	mov	x0, x21
	bl	_ERR
	b	LBB0_5
LBB0_12:
	bl	_SHRegCloseUSKey
Lloh24:
	adrp	x0, _add_tbs_to_menu.classes_key@PAGE
Lloh25:
	add	x0, x0, _add_tbs_to_menu.classes_key@PAGEOFF
	bl	_debugstr_w
	mov	x1, x0
Lloh26:
	adrp	x0, l_.str@PAGE
Lloh27:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
	b	LBB0_14
LBB0_13:
	ldr	x0, [sp, #48]
	bl	_SHRegCloseUSKey
	ldr	x0, [sp, #56]
	bl	_SHRegCloseUSKey
LBB0_14:
	ldur	x8, [x29, #-96]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	ldp	x29, x30, [sp, #304]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #288]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #272]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #256]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #240]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #224]            ; 16-byte Folded Reload
	add	sp, sp, #320
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_add_tbs_to_menu.toolbar_key:           ; @add_tbs_to_menu.toolbar_key
	.asciz	"Software\\Microsoft\\Internet Explorer\\Toolbar"

	.comm	_KEY_READ,4,2                   ; @KEY_READ
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_ERROR_SUCCESS,8,3              ; @ERROR_SUCCESS
_add_tbs_to_menu.classes_key:           ; @add_tbs_to_menu.classes_key
	.asciz	"Software\\Classes\\CLSID"

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to open key %s\n"

	.comm	_SHREGENUM_HKLM,4,2             ; @SHREGENUM_HKLM
l_.str.1:                               ; @.str.1
	.asciz	"Found invalid IE toolbar entry: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to get class info for %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to get toolbar name for %s\n"

	.comm	_MIIM_STRING,4,2                ; @MIIM_STRING
	.no_dead_strip	_add_tbs_to_menu
.subsections_via_symbols
