	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grub_file_pb_read              ## -- Begin function grub_file_pb_read
	.p2align	4, 0x90
_grub_file_pb_read:                     ## @grub_file_pb_read
	.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
	movl	%edx, %ebx
	movq	%rsi, %r14
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	testl	%ecx, %ecx
	je	LBB0_9
## %bb.1:
	movq	_GRUB_FILE_PB_MIN_SIZE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jg	LBB0_9
## %bb.2:
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_grub_file_pb_init
	movl	%ebx, %eax
	cltd
	idivl	-48(%rbp)                       ## 4-byte Folded Reload
	testl	%ebx, %ebx
	jle	LBB0_3
## %bb.4:
	movl	%eax, %r15d
	addl	$511, %r15d                     ## imm = 0x1FF
	andl	$-512, %r15d                    ## imm = 0xFE00
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_grub_file_pb_show
	cmpl	%r15d, %ebx
	movl	%r15d, %edx
	cmovll	%ebx, %edx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r14, %rsi
	callq	_grub_file_read
	testq	%rax, %rax
	jle	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	addq	%rax, %r14
	subl	%eax, %ebx
	addq	%rax, %r12
	incl	%r13d
	testl	%ebx, %ebx
	jg	LBB0_5
	jmp	LBB0_8
LBB0_9:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r14, %rsi
	movl	%ebx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_grub_file_read                 ## TAILCALL
LBB0_3:
	xorl	%r12d, %r12d
	jmp	LBB0_8
LBB0_6:
	xorl	%eax, %eax
	cmpq	$1, %r12
	sbbq	%rax, %rax
	orq	%rax, %r12
LBB0_8:
	xorl	%eax, %eax
	callq	_grub_file_pb_fini
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GRUB_FILE_PB_MIN_SIZE,4,2      ## @GRUB_FILE_PB_MIN_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grub_file_pb_read              ; -- Begin function grub_file_pb_read
	.p2align	2
_grub_file_pb_read:                     ; @grub_file_pb_read
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
	cbz	w3, LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _GRUB_FILE_PB_MIN_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GRUB_FILE_PB_MIN_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w19
	b.gt	LBB0_6
; %bb.2:
	mov	x21, x3
	bl	_grub_file_pb_init
	cmp	w19, #1
	b.lt	LBB0_7
; %bb.3:
	mov	w24, #0
	mov	x23, #0
	sdiv	w8, w19, w21
	add	w8, w8, #511
	and	w25, w8, #0xfffffe00
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	x1, x21
	bl	_grub_file_pb_show
	cmp	w19, w25
	csel	w2, w19, w25, lt
	mov	x0, x22
	mov	x1, x20
	bl	_grub_file_read
	cmp	x0, #0
	b.le	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x20, x20, x0
	sub	w19, w19, w0
	add	x23, x0, x23
	add	w24, w24, #1
	cmp	w19, #0
	b.gt	LBB0_4
	b	LBB0_9
LBB0_6:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_grub_file_read
LBB0_7:
	mov	x23, #0
	b	LBB0_9
LBB0_8:
	cmp	x23, #0
	csinv	x23, x23, xzr, ne
LBB0_9:
	bl	_grub_file_pb_fini
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_GRUB_FILE_PB_MIN_SIZE,4,2      ; @GRUB_FILE_PB_MIN_SIZE
.subsections_via_symbols
