	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_testrombar
_pci_testrombar:                        ## @pci_testrombar
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	cmpl	$0, (%rsi)
	jne	LBB0_4
## %bb.1:
	movl	%edi, %r14d
	movl	4(%rsi), %eax
	movl	%eax, -36(%rbp)
	movq	_PCI_CFG_ROM_BAR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movabsq	$-4294967292, %rax              ## imm = 0xFFFFFFFF00000004
	movq	%rax, -48(%rbp)
	movq	_PCIOCWRITE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-48(%rbp), %rdx
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.2:
	movq	_PCIOCREAD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movl	%r14d, %edi
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.3:
	movq	_PCI_ROM_ADDR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	-44(%rbp), %r12d
	negl	%r12d
	movl	$0, -44(%rbp)
	movl	(%r15), %esi
	leaq	-48(%rbp), %rdx
	movl	%r14d, %edi
	callq	_ioctl
	xorl	%ebx, %ebx
	cmpl	$-1, %eax
	cmovnel	%r12d, %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_CFG_ROM_BAR,4,2            ## @PCI_CFG_ROM_BAR
	.comm	_PCIOCWRITE,4,2                 ## @PCIOCWRITE
	.comm	_PCIOCREAD,4,2                  ## @PCIOCREAD
	.comm	_PCI_ROM_ADDR_MASK,4,2          ## @PCI_ROM_ADDR_MASK
	.no_dead_strip	_pci_testrombar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function pci_testrombar
lCPI0_0:
	.long	4                               ; 0x4
	.long	4294967295                      ; 0xffffffff
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_pci_testrombar:                        ; @pci_testrombar
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x1]
	cbz	w8, LBB0_3
LBB0_1:
	mov	w0, #0
LBB0_2:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_3:
	mov	x19, x0
	ldr	w8, [x1, #4]
Lloh0:
	adrp	x9, _PCI_CFG_ROM_BAR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_CFG_ROM_BAR@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #8]
Lloh3:
	adrp	x8, lCPI0_0@PAGE
Lloh4:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp]
Lloh5:
	adrp	x20, _PCIOCWRITE@GOTPAGE
Lloh6:
	ldr	x20, [x20, _PCIOCWRITE@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x2, sp
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_1
; %bb.4:
Lloh7:
	adrp	x8, _PCIOCREAD@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PCIOCREAD@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_1
; %bb.5:
	ldr	w8, [sp, #4]
Lloh10:
	adrp	x9, _PCI_ROM_ADDR_MASK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PCI_ROM_ADDR_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	and	w21, w9, w8
	str	wzr, [sp, #4]
	ldr	w1, [x20]
	mov	x2, sp
	mov	x0, x19
	bl	_ioctl
	cmn	w0, #1
	csneg	w0, wzr, w21, eq
	b	LBB0_2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_CFG_ROM_BAR,4,2            ; @PCI_CFG_ROM_BAR
	.comm	_PCIOCWRITE,4,2                 ; @PCIOCWRITE
	.comm	_PCIOCREAD,4,2                  ; @PCIOCREAD
	.comm	_PCI_ROM_ADDR_MASK,4,2          ; @PCI_ROM_ADDR_MASK
	.no_dead_strip	_pci_testrombar
.subsections_via_symbols
