	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_save_rom
_pci_save_rom:                          ## @pci_save_rom
	.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	%esi, %r15d
	movq	%rdi, %r12
	movq	__PATH_DEVMEM@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%eax, %eax
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %r14d
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movq	_MAP_NOCORE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_base_addr@GOTPCREL(%rip), %rax
	movq	(%rax), %r9
	xorl	%edi, %edi
	movl	%r15d, %esi
	movl	%r14d, %r8d
	callq	_mmap
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movq	_O_RDWR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movq	%rax, %r13
	movq	_O_TRUNC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_O_NOFOLLOW@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_S_IRUSR@GOTPCREL(%rip), %rax
	movq	_S_IWUSR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.3:
	movl	%eax, %ebx
	movl	%eax, %edi
	movq	%r13, %rsi
	movl	%r15d, %edx
	callq	_write
	cmpl	%r15d, %eax
	jne	LBB0_4
LBB0_5:
	movl	%ebx, %edi
	callq	_close
	xorl	%ebx, %ebx
LBB0_6:
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	je	LBB0_8
## %bb.7:
	movq	_base_addr@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	%r15d, %esi
	callq	_munmap
LBB0_8:
	movl	%r14d, %edi
	callq	_close
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_perror
	movl	$-1, %ebx
	jmp	LBB0_9
LBB0_10:
	leaq	L_.str(%rip), %rdi
	callq	_perror
	movl	$-1, %ebx
	jmp	LBB0_6
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	callq	_perror
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.comm	__PATH_DEVMEM,4,2               ## @_PATH_DEVMEM
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_NOCORE,4,2                 ## @MAP_NOCORE
	.comm	_base_addr,8,3                  ## @base_addr
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.comm	_O_NOFOLLOW,4,2                 ## @O_NOFOLLOW
	.comm	_S_IRUSR,4,2                    ## @S_IRUSR
	.comm	_S_IWUSR,4,2                    ## @S_IWUSR
L_.str.1:                               ## @.str.1
	.asciz	"write"

	.no_dead_strip	_pci_save_rom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_save_rom
_pci_save_rom:                          ; @pci_save_rom
	.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, x1
	mov	x22, x0
Lloh0:
	adrp	x8, __PATH_DEVMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, __PATH_DEVMEM@GOTPAGEOFF]
Lloh2:
	ldrsw	x0, [x8]
Lloh3:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.1:
	mov	x20, x0
Lloh6:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh11:
	adrp	x9, _MAP_NOCORE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MAP_NOCORE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	ldr	w9, [x9]
	orr	w3, w9, w8
Lloh15:
	adrp	x23, _base_addr@GOTPAGE
Lloh16:
	ldr	x23, [x23, _base_addr@GOTPAGEOFF]
	ldr	x5, [x23]
	mov	x0, #0
	mov	x1, x19
	mov	x4, x20
	bl	_mmap
	mov	x21, x0
Lloh17:
	adrp	x8, _O_CREAT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _O_CREAT@GOTPAGEOFF]
Lloh19:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh20:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh23:
	adrp	x9, _O_TRUNC@GOTPAGE
Lloh24:
	ldr	x9, [x9, _O_TRUNC@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh26:
	adrp	x9, _O_NOFOLLOW@GOTPAGE
Lloh27:
	ldr	x9, [x9, _O_NOFOLLOW@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
Lloh29:
	adrp	x10, _S_IRUSR@GOTPAGE
Lloh30:
	ldr	x10, [x10, _S_IRUSR@GOTPAGEOFF]
	orr	w1, w8, w9
Lloh31:
	ldr	w8, [x10]
Lloh32:
	adrp	x9, _S_IWUSR@GOTPAGE
Lloh33:
	ldr	x9, [x9, _S_IWUSR@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	x8, [sp]
	mov	x0, x22
	bl	_open
	mov	x22, x0
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.2:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x19
	bl	_write
	cmp	w0, w19
	b.ne	LBB0_10
LBB0_3:
	mov	x0, x22
	bl	_close
	mov	w22, #0
LBB0_4:
Lloh35:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh36:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh37:
	ldr	x8, [x8]
	cmp	x21, x8
	b.eq	LBB0_6
; %bb.5:
	ldr	x0, [x23]
	mov	x1, x19
	bl	_munmap
LBB0_6:
	mov	x0, x20
	bl	_close
LBB0_7:
	mov	x0, x22
	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
LBB0_8:
Lloh38:
	adrp	x0, l_.str@PAGE
Lloh39:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	mov	w22, #-1
	b	LBB0_7
LBB0_9:
Lloh40:
	adrp	x0, l_.str@PAGE
Lloh41:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	b	LBB0_4
LBB0_10:
Lloh42:
	adrp	x0, l_.str.1@PAGE
Lloh43:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perror
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.comm	__PATH_DEVMEM,4,2               ; @_PATH_DEVMEM
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_NOCORE,4,2                 ; @MAP_NOCORE
	.comm	_base_addr,8,3                  ; @base_addr
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.comm	_O_NOFOLLOW,4,2                 ; @O_NOFOLLOW
	.comm	_S_IRUSR,4,2                    ; @S_IRUSR
	.comm	_S_IWUSR,4,2                    ; @S_IWUSR
l_.str.1:                               ; @.str.1
	.asciz	"write"

	.no_dead_strip	_pci_save_rom
.subsections_via_symbols
