	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_next_page
_get_next_page:                         ## @get_next_page
	.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	%edi, %r13d
	movq	_cpu_data@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movslq	%edi, %rbx
	leaq	(%rbx,%rbx,2), %r14
	movq	16(%rax,%r14,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.1:
	movq	_read_page@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_9
## %bb.2:
	movq	(%rax,%r14,8), %rax
	movq	_page_size@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jle	LBB0_3
## %bb.4:
	movl	%r13d, %edi
	callq	_update_cpu_data_index
	movq	_input_fd@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_lseek
	movq	%rax, %r13
	movl	(%rbx), %edi
	movq	(%r15), %rax
	movq	8(%rax,%r14,8), %rsi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_lseek
	cmpq	$-1, %rax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_die
LBB0_6:
	movl	(%rbx), %edi
	movq	(%r15), %rax
	movq	16(%rax,%r14,8), %rsi
	movq	(%r12), %rdx
	callq	_read
	testq	%rax, %rax
	jns	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_die
LBB0_8:
	movl	(%rbx), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_lseek                          ## TAILCALL
LBB0_9:
	movq	_page_size@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_munmap
	movq	(%r15), %rax
	shlq	$3, %rbx
	leaq	(%rbx,%rbx,2), %r12
	movq	_page_size@GOTPCREL(%rip), %rbx
	movq	$0, 16(%rax,%r12)
	movq	(%r15), %rax
	movq	(%rax,%r12), %rax
	cmpq	(%rbx), %rax
	jle	LBB0_11
## %bb.10:
	movl	%r13d, %edi
	callq	_update_cpu_data_index
	movq	(%rbx), %rsi
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAP_PRIVATE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_input_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	(%r15), %rax
	movq	8(%rax,%r12), %r9
	xorl	%edi, %edi
	callq	_mmap
	movq	(%r15), %rcx
	movq	%rax, 16(%rcx,%r12)
	movq	(%r15), %rax
	movq	16(%rax,%r12), %rcx
	movq	_MAP_FAILED@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_11
## %bb.12:
	movq	8(%rax,%r14,8), %rdx
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_die                            ## TAILCALL
LBB0_3:
	callq	_free
	movq	(%r15), %rax
	movq	$0, 16(%rax,%r14,8)
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cpu_data,8,3                   ## @cpu_data
	.comm	_read_page,8,3                  ## @read_page
	.comm	_page_size,8,3                  ## @page_size
	.comm	_input_fd,4,2                   ## @input_fd
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to lseek"

L_.str.1:                               ## @.str.1
	.asciz	"failed to read page"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_PRIVATE,4,2                ## @MAP_PRIVATE
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.2:                               ## @.str.2
	.asciz	"failed to mmap cpu %d at offset 0x%llx"

	.no_dead_strip	_get_next_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_next_page
_get_next_page:                         ; @get_next_page
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _cpu_data@GOTPAGE
Lloh1:
	ldr	x21, [x21, _cpu_data@GOTPAGEOFF]
	ldr	x8, [x21]
	mov	w9, #24
	smaddl	x9, w0, w9, x8
	ldr	x0, [x9, #16]
	cbz	x0, LBB0_12
; %bb.1:
	sxtw	x20, w19
Lloh2:
	adrp	x9, _read_page@GOTPAGE
Lloh3:
	ldr	x9, [x9, _read_page@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cbz	x9, LBB0_8
; %bb.2:
	mov	w9, #24
	mul	x9, x20, x9
	ldr	x8, [x8, x9]
Lloh5:
	adrp	x23, _page_size@GOTPAGE
Lloh6:
	ldr	x23, [x23, _page_size@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.le	LBB0_11
; %bb.3:
	mov	x0, x19
	bl	_update_cpu_data_index
Lloh7:
	adrp	x22, _input_fd@GOTPAGE
Lloh8:
	ldr	x22, [x22, _input_fd@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh9:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x1, #0
	bl	_lseek
	mov	x19, x0
	ldr	w0, [x22]
	ldr	x8, [x21]
	mov	w9, #24
	madd	x8, x20, x9, x8
	ldr	x1, [x8, #8]
Lloh12:
	adrp	x24, _SEEK_SET@GOTPAGE
Lloh13:
	ldr	x24, [x24, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x24]
	bl	_lseek
	cmn	x0, #1
	b.ne	LBB0_5
; %bb.4:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_die
LBB0_5:
	ldr	w0, [x22]
	ldr	x8, [x21]
	mov	w9, #24
	madd	x8, x20, x9, x8
	ldr	x1, [x8, #16]
	ldr	x2, [x23]
	bl	_read
	tbz	x0, #63, LBB0_7
; %bb.6:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_die
LBB0_7:
	ldr	w0, [x22]
	ldr	w2, [x24]
	mov	x1, 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
	add	sp, sp, #80
	b	_lseek
LBB0_8:
Lloh18:
	adrp	x23, _page_size@GOTPAGE
Lloh19:
	ldr	x23, [x23, _page_size@GOTPAGEOFF]
	ldr	x1, [x23]
	bl	_munmap
	ldr	x8, [x21]
	add	x9, x20, x20, lsl #1
	lsl	x22, x9, #3
	add	x8, x8, x22
	str	xzr, [x8, #16]
	ldr	x8, [x21]
	ldr	x8, [x8, x22]
	ldr	x9, [x23]
	cmp	x8, x9
	b.le	LBB0_12
; %bb.9:
	mov	x0, x19
	bl	_update_cpu_data_index
	ldr	x1, [x23]
Lloh20:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	adrp	x8, _MAP_PRIVATE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MAP_PRIVATE@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
Lloh26:
	adrp	x8, _input_fd@GOTPAGE
Lloh27:
	ldr	x8, [x8, _input_fd@GOTPAGEOFF]
Lloh28:
	ldr	w4, [x8]
	ldr	x8, [x21]
	add	x8, x8, x22
	ldr	x5, [x8, #8]
	mov	x0, #0
	bl	_mmap
	ldr	x8, [x21]
	add	x8, x8, x22
	str	x0, [x8, #16]
	ldr	x8, [x21]
	add	x9, x8, x22
	ldr	x9, [x9, #16]
Lloh29:
	adrp	x10, _MAP_FAILED@GOTPAGE
Lloh30:
	ldr	x10, [x10, _MAP_FAILED@GOTPAGEOFF]
Lloh31:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_12
; %bb.10:
	mov	w9, #24
	madd	x8, x20, x9, x8
	ldr	x8, [x8, #8]
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	stp	x19, x8, [sp]
Lloh32:
	adrp	x0, l_.str.2@PAGE
Lloh33:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_die
	b	LBB0_12
LBB0_11:
	bl	_free
	ldr	x8, [x21]
	mov	w9, #24
	madd	x8, x20, x9, x8
	str	xzr, [x8, #16]
LBB0_12:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_cpu_data,8,3                   ; @cpu_data
	.comm	_read_page,8,3                  ; @read_page
	.comm	_page_size,8,3                  ; @page_size
	.comm	_input_fd,4,2                   ; @input_fd
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to lseek"

l_.str.1:                               ; @.str.1
	.asciz	"failed to read page"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_PRIVATE,4,2                ; @MAP_PRIVATE
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.2:                               ; @.str.2
	.asciz	"failed to mmap cpu %d at offset 0x%llx"

	.no_dead_strip	_get_next_page
.subsections_via_symbols
