	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function bin_to_res_menuitems
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_bin_to_res_menuitems:                  ## @bin_to_res_menuitems
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	$0, -80(%rbp)
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	$0, (%rcx)
	testl	%edx, %edx
	jle	LBB0_1
## %bb.2:
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %r12
	leaq	-80(%rbp), %r13
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	cmpl	$3, %r14d
	ja	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	__
	movl	%eax, %edi
	callq	_toosmall
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$56, %edi
	callq	_res_alloc
	movq	%rax, %r13
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rax)
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$2, %edx
	callq	_windres_get_16
	movq	%rax, %rdx
	movq	_MENUITEM_ENDMENU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_MENUITEM_POPUP@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	notl	%eax
	andl	%edx, %eax
	movl	%eax, (%r13)
	xorl	%ebx, %ebx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	testl	%edx, (%rcx)
	sete	%bl
	leal	(%rbx,%rbx), %eax
	addl	$4, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	cmpl	%eax, %r14d
	jae	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	__
	movl	%eax, %edi
	callq	_toosmall
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	addl	%ebx, %ebx
	addl	$2, %ebx
	movl	%ebx, %eax
	movq	%r15, -112(%rbp)                ## 8-byte Spill
	leaq	(%r15,%rax,4), %r12
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$2, %edx
	callq	_windres_get_16
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%r14d, %edx
	subl	%ebx, %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	leaq	-44(%rbp), %rcx
	callq	_get_unicode
	movl	-44(%rbp), %ecx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$0, -44(%rbp)
	xorl	%ecx, %ecx
	xorl	%eax, %eax
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, 32(%r13)
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%rcx,2), %ebx
	movq	_MENUITEM_POPUP@GOTPCREL(%rip), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	testl	%ecx, (%rax)
	movq	-112(%rbp), %r15                ## 8-byte Reload
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	$0, 24(%r13)
	movslq	%ebx, %rbx
	leaq	(%r15,%rbx,4), %rsi
	movl	%r14d, %edx
	subl	%ebx, %edx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	leaq	-60(%rbp), %rcx
	callq	_bin_to_res_menuitems
	movq	%rax, 16(%r13)
	addl	-60(%rbp), %ebx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	$0, 16(%r13)
	leaq	8(%r15), %rsi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	$2, %edx
	callq	_windres_get_16
	movq	%rax, 24(%r13)
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	$0, 8(%r13)
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	%r13, (%rax)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	addl	%ebx, (%rax)
	movq	-80(%rbp), %rax
	movq	_MENUITEM_ENDMENU@GOTPCREL(%rip), %rcx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	andl	(%rcx), %edx
	jne	LBB0_15
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	addq	$8, %r13
	movslq	%ebx, %rcx
	leaq	(%r15,%rcx,4), %r15
	subl	%ebx, %r14d
	jg	LBB0_4
	jmp	LBB0_15
LBB0_1:
	xorl	%eax, %eax
LBB0_15:
	addq	$72, %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	"menuitem header"

	.comm	_MENUITEM_POPUP,4,2             ## @MENUITEM_POPUP
	.comm	_MENUITEM_ENDMENU,4,2           ## @MENUITEM_ENDMENU
	.no_dead_strip	_bin_to_res_menuitems
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bin_to_res_menuitems
_bin_to_res_menuitems:                  ; @bin_to_res_menuitems
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	str	xzr, [sp, #40]
	str	x3, [sp, #16]                   ; 8-byte Folded Spill
	str	wzr, [x3]
	cmp	w2, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	add	x8, sp, #40
Lloh0:
	adrp	x27, _MENUITEM_POPUP@GOTPAGE
Lloh1:
	ldr	x27, [x27, _MENUITEM_POPUP@GOTPAGEOFF]
Lloh2:
	adrp	x19, _MENUITEM_ENDMENU@GOTPAGE
Lloh3:
	ldr	x19, [x19, _MENUITEM_ENDMENU@GOTPAGEOFF]
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	cmp	w20, #3
	b.hi	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	__
	bl	_toosmall
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #56
	bl	_res_alloc
	mov	x24, x0
	stp	xzr, xzr, [x0, #40]
	mov	x0, x22
	mov	x1, x21
	mov	w2, #2
	bl	_windres_get_16
	mov	x25, x0
	ldr	w8, [x27]
	mov	x23, x19
	ldr	w9, [x19]
	orr	w8, w9, w8
	bic	w8, w25, w8
	str	w8, [x24]
	mov	x19, x27
	ldr	w8, [x27]
	tst	w8, w25
	mov	w8, #2
	mov	w9, #4
	csel	w27, w9, w8, eq
	add	w28, w27, #2
	cmp	w20, w28
	b.hs	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	__
	bl	_toosmall
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x26, x21, w27, uxtw #2
	mov	x0, x22
	mov	x1, x26
	mov	w2, #2
	bl	_windres_get_16
	cbz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w2, w20, w27
	add	x3, sp, #36
	mov	x0, x22
	mov	x1, x26
	bl	_get_unicode
	ldr	w8, [sp, #36]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w8, #0
	str	wzr, [sp, #36]
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x27, x19
	mov	x19, x23
	str	x0, [x24, #32]
	add	w26, w28, w8, lsl #1
	ldr	w8, [x27]
	tst	w8, w25
	b.eq	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	str	xzr, [x24, #24]
	add	x1, x21, w26, sxtw #2
	sub	w2, w20, w26
	add	x3, sp, #32
	ldr	x22, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x22
	bl	_bin_to_res_menuitems
	str	x0, [x24, #16]
	ldr	w8, [sp, #32]
	add	w26, w8, w26
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_2 Depth=1
	str	xzr, [x24, #16]
	add	x1, x21, #8
	ldr	x22, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x22
	mov	w2, #2
	bl	_windres_get_16
	str	x0, [x24, #24]
LBB0_12:                                ;   in Loop: Header=BB0_2 Depth=1
	ldp	x10, x9, [sp, #16]              ; 16-byte Folded Reload
	mov	x8, x24
	str	xzr, [x8, #8]!
	str	x24, [x9]
	ldr	w9, [x10]
	add	w9, w9, w26
	str	w9, [x10]
	ldr	w9, [x19]
	ldr	x0, [sp, #40]
	and	w9, w9, w25
	cbnz	w9, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, w26, sxtw #2
	sub	w20, w20, w26
	cmp	w20, #0
	b.gt	LBB0_2
	b	LBB0_15
LBB0_14:
	mov	x0, #0
LBB0_15:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"menuitem header"

	.comm	_MENUITEM_POPUP,4,2             ; @MENUITEM_POPUP
	.comm	_MENUITEM_ENDMENU,4,2           ; @MENUITEM_ENDMENU
	.no_dead_strip	_bin_to_res_menuitems
.subsections_via_symbols
