	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bootrom_init                   ## -- Begin function bootrom_init
	.p2align	4, 0x90
_bootrom_init:                          ## @bootrom_init
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	movl	%eax, %r13d
	leaq	-48(%rbp), %rsi
	movl	%eax, %edi
	callq	_fstat
	testq	%rax, %rax
	js	LBB0_7
## %bb.2:
	movl	-48(%rbp), %r15d
	movq	_MAX_BOOTROM_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jg	LBB0_8
## %bb.3:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jl	LBB0_8
## %bb.4:
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_13
## %bb.5:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_9
LBB0_6:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movq	%r14, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	movl	$-1, %r12d
	jmp	LBB0_12
LBB0_7:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movq	%r14, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_10
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_9:
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_10:
	movl	$-1, %r12d
LBB0_11:
	movl	%r13d, %edi
	callq	_close
LBB0_12:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_VM_BOOTROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %ecx
	callq	_vm_create_devmem
	movq	_MAP_FAILED@GOTPCREL(%rip), %rcx
	movl	$-1, %r12d
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.14:
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movq	_PROT_EXEC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	orl	(%rax), %r9d
	movl	%r15d, %esi
	negl	%esi
	movq	_VM_BOOTROM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movl	%r15d, %r8d
	callq	_vm_mmap_memseg
	testq	%rax, %rax
	jne	LBB0_11
## %bb.15:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r15d, %eax
	cltd
	idivl	%r8d
	movl	$0, %r12d
	testl	%eax, %eax
	jle	LBB0_11
## %bb.16:
	xorl	%ebx, %ebx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	%r8d, %eax
	imull	%ebx, %eax
	movslq	%eax, %rsi
	addq	-56(%rbp), %rsi                 ## 8-byte Folded Reload
	movl	%r13d, %edi
	movl	%r8d, %edx
	callq	_read
	movl	%eax, %r8d
	cmpl	(%r12), %eax
	jne	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	incl	%ebx
	movl	%r15d, %eax
	cltd
	idivl	%r8d
	cmpl	%eax, %ebx
	jl	LBB0_17
## %bb.19:
	xorl	%r12d, %r12d
	jmp	LBB0_21
LBB0_20:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	movl	%ebx, %edx
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	movl	$-1, %r12d
LBB0_21:
	testl	%r13d, %r13d
	jns	LBB0_11
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error opening bootrom \"%s\": %s\n"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"Could not fstat bootrom file \"%s\": %s\n"

	.comm	_MAX_BOOTROM_SIZE,4,2           ## @MAX_BOOTROM_SIZE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"Invalid bootrom size %ld\n"

	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
L_.str.3:                               ## @.str.3
	.asciz	"Bootrom size %ld is not a multiple of the page size\n"

	.comm	_VM_BOOTROM,4,2                 ## @VM_BOOTROM
L_.str.4:                               ## @.str.4
	.asciz	"bootrom"

	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_EXEC,4,2                  ## @PROT_EXEC
L_.str.5:                               ## @.str.5
	.asciz	"Incomplete read of page %d of bootrom file %s: %ld bytes\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bootrom_init                   ; -- Begin function bootrom_init
	.p2align	2
_bootrom_init:                          ; @bootrom_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_open
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x19, x0
	add	x1, sp, #24
	bl	_fstat
	tbnz	x0, #63, LBB0_5
; %bb.2:
	ldr	w21, [sp, #24]
Lloh3:
	adrp	x8, _MAX_BOOTROM_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_BOOTROM_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w9, [x24]
	cmp	w21, w8
	ccmp	w21, w9, #8, le
	b.ge	LBB0_6
; %bb.3:
Lloh8:
	adrp	x8, _stderr@GOTPAGE
Lloh9:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	str	x21, [sp]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_4:
Lloh13:
	adrp	x8, _stderr@GOTPAGE
Lloh14:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh15:
	ldr	w19, [x8]
Lloh16:
	adrp	x8, _errno@GOTPAGE
Lloh17:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_strerror
	stp	x20, x0, [sp]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_fprintf
	mov	w20, #-1
	b	LBB0_11
LBB0_5:
Lloh21:
	adrp	x8, _stderr@GOTPAGE
Lloh22:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh23:
	ldr	w21, [x8]
Lloh24:
	adrp	x8, _errno@GOTPAGE
Lloh25:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	bl	_strerror
	stp	x20, x0, [sp]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	b	LBB0_8
LBB0_6:
Lloh29:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh30:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_12
; %bb.7:
Lloh32:
	adrp	x8, _stderr@GOTPAGE
Lloh33:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	str	x21, [sp]
Lloh35:
	adrp	x1, l_.str.3@PAGE
Lloh36:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_8:
	bl	_fprintf
LBB0_9:
	mov	w20, #-1
LBB0_10:
	mov	x0, x19
	bl	_close
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_12:
Lloh37:
	adrp	x25, _VM_BOOTROM@GOTPAGE
Lloh38:
	ldr	x25, [x25, _VM_BOOTROM@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh39:
	adrp	x2, l_.str.4@PAGE
Lloh40:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x22
	mov	x3, x21
	bl	_vm_create_devmem
Lloh41:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh42:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh43:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_9
; %bb.13:
	mov	x23, x0
Lloh44:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh45:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
Lloh47:
	adrp	x9, _PROT_EXEC@GOTPAGE
Lloh48:
	ldr	x9, [x9, _PROT_EXEC@GOTPAGEOFF]
Lloh49:
	ldr	w9, [x9]
	orr	w5, w9, w8
	neg	w1, w21
	ldr	w2, [x25]
	mov	x0, x22
	mov	w3, #0
	mov	x4, x21
	bl	_vm_mmap_memseg
	cbnz	x0, LBB0_9
; %bb.14:
	ldr	w2, [x24]
	sdiv	w8, w21, w2
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.15:
	mov	w22, #0
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mul	w8, w2, w22
	add	x1, x23, w8, sxtw
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_read
	mov	x2, x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	add	w22, w22, #1
	sdiv	w8, w21, w2
	cmp	w22, w8
	b.lt	LBB0_16
; %bb.18:
	mov	w20, #0
	b	LBB0_21
LBB0_19:
	mov	w20, #0
	b	LBB0_10
LBB0_20:
Lloh50:
	adrp	x8, _stderr@GOTPAGE
Lloh51:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh52:
	ldr	w0, [x8]
	stp	x20, x2, [sp, #8]
	str	x22, [sp]
Lloh53:
	adrp	x1, l_.str.5@PAGE
Lloh54:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_fprintf
	mov	w20, #-1
LBB0_21:
	tbz	w19, #31, LBB0_10
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error opening bootrom \"%s\": %s\n"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"Could not fstat bootrom file \"%s\": %s\n"

	.comm	_MAX_BOOTROM_SIZE,4,2           ; @MAX_BOOTROM_SIZE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"Invalid bootrom size %ld\n"

	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
l_.str.3:                               ; @.str.3
	.asciz	"Bootrom size %ld is not a multiple of the page size\n"

	.comm	_VM_BOOTROM,4,2                 ; @VM_BOOTROM
l_.str.4:                               ; @.str.4
	.asciz	"bootrom"

	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_EXEC,4,2                  ; @PROT_EXEC
l_.str.5:                               ; @.str.5
	.asciz	"Incomplete read of page %d of bootrom file %s: %ld bytes\n"

.subsections_via_symbols
