	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kboot_readin                   ## -- Begin function kboot_readin
	.p2align	4, 0x90
_kboot_readin:                          ## @kboot_readin
	.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
	movq	%rdx, %r12
	movl	%esi, %r13d
	movl	%edi, -52(%rbp)                 ## 4-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rdx, %rsi
	callq	_min
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r15
	testq	%r12, %r12
	je	LBB0_2
## %bb.4:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rbx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_min
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_read
	testq	%rax, %rax
	jle	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rax, %r12
	movq	%r15, %rdi
	movl	%r13d, %esi
	movq	%rax, %rdx
	callq	_kboot_copyin
	addl	%r12d, %r13d
	subq	%r12, %rbx
	jne	LBB0_5
## %bb.9:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_3:
	leaq	L_str.2(%rip), %rdi
	callq	_puts
	xorl	%r12d, %r12d
	jmp	LBB0_12
LBB0_2:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_6:
	jns	LBB0_10
## %bb.7:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_10:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_11:
	movq	%r15, %rdi
	callq	_free
	subq	%rbx, %r12
LBB0_12:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"kboot_readin: read failed"

L_str.2:                                ## @str.2
	.asciz	"kboot_readin: buf malloc failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kboot_readin                   ; -- Begin function kboot_readin
	.p2align	2
_kboot_readin:                          ; @kboot_readin
	.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	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x0, [x8]
	mov	x1, x2
	bl	_min
	mov	x24, x0
	bl	_malloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	cbz	x19, LBB0_6
; %bb.2:
	mov	x23, x19
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	x1, x23
	bl	_min
	mov	x2, x0
	mov	x0, x22
	mov	x1, x20
	bl	_read
	mov	x25, x0
	cmp	x0, #0
	b.le	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x25
	bl	_kboot_copyin
	add	w21, w21, w25
	subs	x23, x23, x25
	b.ne	LBB0_3
	b	LBB0_9
LBB0_5:
Lloh3:
	adrp	x0, l_str.2@PAGE
Lloh4:
	add	x0, x0, l_str.2@PAGEOFF
	bl	_puts
	mov	x0, #0
	b	LBB0_10
LBB0_6:
	mov	x23, #0
	b	LBB0_9
LBB0_7:
	tbz	x25, #63, LBB0_9
; %bb.8:
Lloh5:
	adrp	x0, l_str@PAGE
Lloh6:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_9:
	mov	x0, x20
	bl	_free
	sub	x0, x19, x23
LBB0_10:
	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
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"kboot_readin: read failed"

l_str.2:                                ; @str.2
	.asciz	"kboot_readin: buf malloc failed"

.subsections_via_symbols
