	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_fav_to_menu
_add_fav_to_menu:                       ## @add_fav_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movq	%rdx, %r15
	movl	%esi, %r13d
	callq	_get_menu_item_count
	movl	%eax, %ebx
	addl	$-2, %ebx
	movq	_ID_BROWSE_GOTOFAV_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_ID_BROWSE_GOTOFAV_FIRST@GOTPCREL(%rip), %r14
	subl	(%r14), %eax
	cmpl	%eax, %ebx
	jle	LBB0_1
## %bb.4:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_FIXME                          ## TAILCALL
LBB0_1:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	%r12d, %edi
	callq	_lstrlenW
                                        ## kill: def $eax killed $eax def $rax
	leal	4(,%rax,4), %edi
	callq	_heap_alloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rax, %r13
	movq	%rax, %rdi
	movl	%r12d, %esi
	callq	_lstrcpyW
	movq	_MIIM_FTYPE@GOTPCREL(%rip), %rax
	movq	_MIIM_STRING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_MIIM_DATA@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_MIIM_ID@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	$40, -88(%rbp)
	movl	%ecx, -84(%rbp)
	movq	_MFT_STRING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	%r15, -64(%rbp)
	addl	(%r14), %ebx
	movl	%ebx, -80(%rbp)
	movq	%r13, -72(%rbp)
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-88(%rbp), %rcx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	$-1, %esi
	callq	_InsertMenuItemW
LBB0_3:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ID_BROWSE_GOTOFAV_MAX,4,2      ## @ID_BROWSE_GOTOFAV_MAX
	.comm	_ID_BROWSE_GOTOFAV_FIRST,4,2    ## @ID_BROWSE_GOTOFAV_FIRST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Add support for more than %d Favorites\n"

	.comm	_MIIM_FTYPE,4,2                 ## @MIIM_FTYPE
	.comm	_MIIM_STRING,4,2                ## @MIIM_STRING
	.comm	_MIIM_DATA,4,2                  ## @MIIM_DATA
	.comm	_MIIM_ID,4,2                    ## @MIIM_ID
	.comm	_MFT_STRING,4,2                 ## @MFT_STRING
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_add_fav_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_fav_to_menu
_add_fav_to_menu:                       ; @add_fav_to_menu
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x22, x3
	mov	x20, x2
	mov	x19, x1
	bl	_get_menu_item_count
	sub	w21, w0, #2
Lloh0:
	adrp	x8, _ID_BROWSE_GOTOFAV_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ID_BROWSE_GOTOFAV_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x24, _ID_BROWSE_GOTOFAV_FIRST@GOTPAGE
Lloh4:
	ldr	x24, [x24, _ID_BROWSE_GOTOFAV_FIRST@GOTPAGEOFF]
	ldr	w9, [x24]
	sub	w8, w8, w9
	cmp	w21, w8
	b.le	LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_FIXME
LBB0_2:
	mov	x0, x22
	bl	_lstrlenW
	lsl	w8, w0, #2
	add	w0, w8, #4
	bl	_heap_alloc
	cbz	x0, LBB0_4
; %bb.3:
	mov	x23, x0
	mov	x1, x22
	bl	_lstrcpyW
Lloh7:
	adrp	x8, _MIIM_FTYPE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MIIM_FTYPE@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _MIIM_STRING@GOTPAGE
Lloh11:
	ldr	x9, [x9, _MIIM_STRING@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh13:
	adrp	x9, _MIIM_DATA@GOTPAGE
Lloh14:
	ldr	x9, [x9, _MIIM_DATA@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
Lloh16:
	adrp	x10, _MIIM_ID@GOTPAGE
Lloh17:
	ldr	x10, [x10, _MIIM_ID@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh18:
	ldr	w9, [x10]
	orr	w8, w8, w9
	mov	w9, #40
	stp	w9, w8, [sp, #8]
Lloh19:
	adrp	x8, _MFT_STRING@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MFT_STRING@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [sp, #40]
	ldr	w8, [x24]
	add	w8, w8, w21
	str	w8, [sp, #16]
	stp	x23, x20, [sp, #24]
Lloh22:
	adrp	x8, _TRUE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x19
	mov	w1, #-1
	bl	_InsertMenuItemW
LBB0_4:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ID_BROWSE_GOTOFAV_MAX,4,2      ; @ID_BROWSE_GOTOFAV_MAX
	.comm	_ID_BROWSE_GOTOFAV_FIRST,4,2    ; @ID_BROWSE_GOTOFAV_FIRST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Add support for more than %d Favorites\n"

	.comm	_MIIM_FTYPE,4,2                 ; @MIIM_FTYPE
	.comm	_MIIM_STRING,4,2                ; @MIIM_STRING
	.comm	_MIIM_DATA,4,2                  ; @MIIM_DATA
	.comm	_MIIM_ID,4,2                    ; @MIIM_ID
	.comm	_MFT_STRING,4,2                 ; @MFT_STRING
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_add_fav_to_menu
.subsections_via_symbols
