	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grub_hfsplus_cmp_catkey
_grub_hfsplus_cmp_catkey:               ## @grub_hfsplus_cmp_catkey
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	movl	16(%rdi), %edi
	callq	_grub_be_to_cpu32
	movl	%eax, %r15d
	subl	(%r14), %r15d
	je	LBB0_1
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	(%r13), %edi
	callq	_grub_be_to_cpu16
	testl	%eax, %eax
	jle	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_grub_be_to_cpu16
	movq	8(%r13), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	movl	(%r13), %edi
	callq	_grub_be_to_cpu16
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_4:
	movl	(%r13), %edi
	callq	_grub_be_to_cpu16
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %edi
	callq	_grub_malloc
	movq	%rax, %r12
	movq	8(%r13), %r15
	movl	(%r13), %edi
	callq	_grub_be_to_cpu16
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_grub_utf16_to_utf8
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	4(%r14), %r14d
	movl	(%r13), %edi
	callq	_grub_be_to_cpu16
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_grub_strncmp
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_grub_free
	movl	(%r13), %edi
	callq	_grub_be_to_cpu16
	testl	%eax, %eax
	jle	LBB0_9
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_grub_cpu_to_be16
	movq	8(%r13), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	movl	(%r13), %edi
	callq	_grub_be_to_cpu16
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_8
	jmp	LBB0_9
LBB0_5:
	movl	$-1, %r15d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_grub_hfsplus_cmp_catkey
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grub_hfsplus_cmp_catkey
_grub_hfsplus_cmp_catkey:               ; @grub_hfsplus_cmp_catkey
	.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, x1
	mov	x19, x0
	ldr	w0, [x0, #16]
	bl	_grub_be_to_cpu32
	ldr	w8, [x20]
	subs	w21, w0, w8
	b.eq	LBB0_2
LBB0_1:
	mov	x0, x21
	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_2:
	ldr	w0, [x19]
	bl	_grub_be_to_cpu16
	cmp	w0, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x21, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	lsl	x22, x21, #2
	ldr	w0, [x8, x22]
	bl	_grub_be_to_cpu16
	ldr	x8, [x19, #8]
	str	w0, [x8, x22]
	add	x21, x21, #1
	ldr	w0, [x19]
	bl	_grub_be_to_cpu16
	cmp	x21, w0, sxtw
	b.lt	LBB0_4
LBB0_5:
	ldr	w0, [x19]
	bl	_grub_be_to_cpu16
	add	w0, w0, #1
	bl	_grub_malloc
	mov	x22, x0
	ldr	x21, [x19, #8]
	ldr	w0, [x19]
	bl	_grub_be_to_cpu16
	mov	x2, x0
	mov	x0, x22
	mov	x1, x21
	bl	_grub_utf16_to_utf8
	cbz	w0, LBB0_9
; %bb.6:
	ldr	w20, [x20, #4]
	ldr	w0, [x19]
	bl	_grub_be_to_cpu16
	mov	x2, x0
	mov	x0, x22
	mov	x1, x20
	bl	_grub_strncmp
	mov	x21, x0
	mov	x0, x22
	bl	_grub_free
	ldr	w0, [x19]
	bl	_grub_be_to_cpu16
	cmp	w0, #1
	b.lt	LBB0_1
; %bb.7:
	mov	x20, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	lsl	x22, x20, #2
	ldr	w0, [x8, x22]
	bl	_grub_cpu_to_be16
	ldr	x8, [x19, #8]
	str	w0, [x8, x22]
	add	x20, x20, #1
	ldr	w0, [x19]
	bl	_grub_be_to_cpu16
	cmp	x20, w0, sxtw
	b.lt	LBB0_8
	b	LBB0_1
LBB0_9:
	mov	w21, #-1
	b	LBB0_1
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_grub_hfsplus_cmp_catkey
.subsections_via_symbols
