	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grub_nilfs2_btree_lookup
_grub_nilfs2_btree_lookup:              ## @grub_nilfs2_btree_lookup
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_NILFS2_BLOCK_SIZE
	movl	%eax, %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movq	%rbx, %rdi
	callq	_grub_nilfs2_btree_get_root
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_grub_nilfs2_btree_get_level
	movl	%eax, %ebx
	leaq	-52(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r14d, -64(%rbp)                ## 4-byte Spill
	movl	%r14d, %esi
	callq	_grub_nilfs2_btree_node_lookup
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	-52(%rbp), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_grub_nilfs2_btree_node_get_ptr
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_grub_nilfs2_dat_translate
LBB0_2:
	movq	_NILFS_BTREE_LEVEL_NODE_MIN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jle	LBB0_14
## %bb.3:
	movl	$-1, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_NILFS_BTREE_LEVEL_NODE_MIN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jle	LBB0_14
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%eax, %esi
	movq	%r13, %rdx
	callq	_grub_nilfs2_btree_get_nonroot_node
	movq	_grub_errno@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_15
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	decl	%ebx
	cmpl	(%r13), %ebx
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$0, -52(%rbp)
	xorl	%r14d, %r14d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	leaq	-52(%rbp), %rdx
	callq	_grub_nilfs2_btree_node_lookup
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	-52(%rbp), %r14d
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_grub_nilfs2_btree_node_nchildren_max
	cmpl	%eax, %r14d
	jge	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	-52(%rbp), %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_grub_nilfs2_btree_node_get_ptr
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_grub_nilfs2_dat_translate
	jmp	LBB0_13
LBB0_14:
	xorl	%r15d, %r15d
	cmpl	$1, -56(%rbp)                   ## 4-byte Folded Reload
	sbbl	%r15d, %r15d
	orl	%eax, %r15d
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_18
## %bb.16:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_GRUB_ERR_BAD_FS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_grub_error
	jmp	LBB0_15
LBB0_17:
	movq	_GRUB_ERR_BAD_FS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_grub_error
	jmp	LBB0_15
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NILFS_BTREE_LEVEL_NODE_MIN,4,2 ## @NILFS_BTREE_LEVEL_NODE_MIN
	.comm	_grub_errno,8,3                 ## @grub_errno
	.comm	_GRUB_ERR_BAD_FS,4,2            ## @GRUB_ERR_BAD_FS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"btree level mismatch\n"

L_.str.1:                               ## @.str.1
	.asciz	"btree corruption\n"

	.no_dead_strip	_grub_nilfs2_btree_lookup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grub_nilfs2_btree_lookup
_grub_nilfs2_btree_lookup:              ; @grub_nilfs2_btree_lookup
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x19, x3
	mov	x20, x2
	mov	x23, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	bl	_NILFS2_BLOCK_SIZE
	mov	w8, w0
	mov	x9, x8
Lloh3:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh4:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x22, x9, x8
	mov	sp, x22
	mov	x0, x23
	bl	_grub_nilfs2_btree_get_root
	mov	x25, x0
	bl	_grub_nilfs2_btree_get_level
	mov	x23, x0
	sub	x2, x29, #92
	mov	x0, x25
	mov	x1, x20
	bl	_grub_nilfs2_btree_node_lookup
	mov	x24, x0
	ldur	w2, [x29, #-92]
	mov	x0, x21
	mov	x1, x25
	bl	_grub_nilfs2_btree_node_get_ptr
	mov	x1, x0
	cbz	w19, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_grub_nilfs2_dat_translate
	mov	x1, x0
LBB0_2:
Lloh5:
	adrp	x25, _NILFS_BTREE_LEVEL_NODE_MIN@GOTPAGE
Lloh6:
	ldr	x25, [x25, _NILFS_BTREE_LEVEL_NODE_MIN@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w23, w8
	b.le	LBB0_13
; %bb.3:
Lloh7:
	adrp	x26, _grub_errno@GOTPAGE
Lloh8:
	ldr	x26, [x26, _grub_errno@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x25]
	cmp	w23, w8
	b.le	LBB0_13
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x2, x22
	bl	_grub_nilfs2_btree_get_nonroot_node
	ldr	x8, [x26]
	cbnz	x8, LBB0_17
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	sub	w23, w23, #1
	ldr	w8, [x22]
	cmp	w23, w8
	b.ne	LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cbz	w24, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w27, #0
	stur	wzr, [x29, #-92]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	x2, x29, #92
	mov	x0, x22
	mov	x1, x20
	bl	_grub_nilfs2_btree_node_lookup
	mov	x24, x0
	ldur	w27, [x29, #-92]
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_grub_nilfs2_btree_node_nchildren_max
	cmp	w27, w0
	b.ge	LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	ldur	w2, [x29, #-92]
	mov	x0, x21
	mov	x1, x22
	bl	_grub_nilfs2_btree_node_get_ptr
	mov	x1, x0
	cbz	w19, LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_grub_nilfs2_dat_translate
	mov	x1, x0
	b	LBB0_4
LBB0_13:
	cmp	w24, #0
	csinv	w0, w1, wzr, ne
	b	LBB0_18
LBB0_14:
Lloh9:
	adrp	x8, _GRUB_ERR_BAD_FS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GRUB_ERR_BAD_FS@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_16
LBB0_15:
Lloh14:
	adrp	x8, _GRUB_ERR_BAD_FS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GRUB_ERR_BAD_FS@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_16:
	bl	_grub_error
LBB0_17:
	mov	w0, #-1
LBB0_18:
	ldur	x8, [x29, #-88]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.19:
	sub	sp, x29, #80
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_20:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_NILFS_BTREE_LEVEL_NODE_MIN,4,2 ; @NILFS_BTREE_LEVEL_NODE_MIN
	.comm	_grub_errno,8,3                 ; @grub_errno
	.comm	_GRUB_ERR_BAD_FS,4,2            ; @GRUB_ERR_BAD_FS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"btree level mismatch\n"

l_.str.1:                               ; @.str.1
	.asciz	"btree corruption\n"

	.no_dead_strip	_grub_nilfs2_btree_lookup
.subsections_via_symbols
