	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_enum_devs
_pci_enum_devs:                         ## @pci_enum_devs
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -72(%rbp)                 ## 4-byte Spill
	movl	%edi, %r13d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_PCI_DEVS@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	leaq	(%rbx,%rbx,8), %rax
	leaq	(%rax,%rax,2), %rax
	addq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	leaq	-112(%rbp), %r12
	movq	%r12, %rdi
	movl	$32, %esi
	callq	_bzero
	leal	(%rbx,%rbx,8), %eax
	leal	(%rax,%rax,2), %eax
	addl	%ebx, %eax
	movl	%eax, -112(%rbp)
	movq	%r14, -88(%rbp)
	movq	_PCIOCGETCONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	movq	%r12, %rdx
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movq	-104(%rbp), %rax
	movq	_PCI_GETCONF_ERROR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_20
LBB0_4:
	movq	_PCI_GETCONF_MORE_DEVS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %ecx
	leaq	L_.str.2(%rip), %rsi
	movl	%ecx, %edx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_6:
	cmpq	$0, -96(%rbp)
	jle	LBB0_20
## %bb.7:
	movl	$-1, -68(%rbp)                  ## 4-byte Folded Spill
	movq	%r14, %r15
	jmp	LBB0_8
LBB0_17:                                ##   in Loop: Header=BB0_8 Depth=1
	leaq	L_.str.10(%rip), %rsi
LBB0_18:                                ##   in Loop: Header=BB0_8 Depth=1
	xorl	%eax, %eax
	callq	_fprintf
	movl	%r12d, %r13d
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_8 Depth=1
	addq	$28, %r15
	movq	-96(%rbp), %rax
	leaq	(%rax,%rax,8), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	addq	%rax, %rcx
	addq	%r14, %rcx
	cmpq	%rcx, %r15
	jae	LBB0_20
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%r15)
	jne	LBB0_19
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%r13d, %edi
	movq	%r15, %rsi
	callq	_pci_testrombar
	movl	%eax, %r12d
	movl	-72(%rbp), %eax                 ## 4-byte Reload
	cmpl	$128, %eax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$129, %eax
	jne	LBB0_19
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	12(%r15), %esi
	movl	16(%r15), %edx
	movl	20(%r15), %ecx
	movl	24(%r15), %r8d
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	testl	%r12d, %r12d
	leaq	L_.str.4(%rip), %rdi
	leaq	L_.str.5(%rip), %rax
	cmoveq	%rax, %rdi
	leal	1023(%r12), %esi
	cmovnsl	%r12d, %esi
	sarl	$10, %esi
	xorl	%eax, %eax
	callq	_printf
	leaq	L_str(%rip), %rdi
	callq	_puts
	jmp	LBB0_19
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	testl	%r12d, %r12d
	je	LBB0_19
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	4(%r15), %ecx
	shll	$16, %ecx
	orl	8(%r15), %ecx
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$16, %esi
	leaq	L_.str.7(%rip), %rdx
	callq	_snprintf
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.8(%rip), %rsi
	movl	%r12d, %edx
	movq	%rbx, %rcx
	leaq	-76(%rbp), %rbx
	xorl	%eax, %eax
	callq	_fprintf
	movl	%r13d, %edi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_pci_enable_bars
	testl	%eax, %eax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	leaq	-64(%rbp), %rdi
	movl	%r12d, %esi
	callq	_pci_save_rom
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
LBB0_15:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%r13d, %r12d
	movl	%r13d, %edi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_pci_disable_bars
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$0, -68(%rbp)                   ## 4-byte Folded Spill
	leaq	L_.str.9(%rip), %rsi
	jmp	LBB0_18
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_perror
LBB0_20:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_22
## %bb.21:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_PCI_DEVS,4,2               ## @MAX_PCI_DEVS
	.comm	_PCIOCGETCONF,4,2               ## @PCIOCGETCONF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ioctl PCIOCGETCONF"

	.comm	_PCI_GETCONF_ERROR,8,3          ## @PCI_GETCONF_ERROR
	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"Error fetching PCI device list from kernel.\r\n"

	.comm	_PCI_GETCONF_MORE_DEVS,8,3      ## @PCI_GETCONF_MORE_DEVS
L_.str.2:                               ## @.str.2
	.asciz	"More than %d devices exist. Only the first %d will be inspected.\r\n"

L_.str.3:                               ## @.str.3
	.asciz	"Domain %04Xh Bus %02Xh Device %02Xh Function %02Xh: "

L_.str.4:                               ## @.str.4
	.asciz	"%dKB ROM aperture detected."

L_.str.5:                               ## @.str.5
	.asciz	"No ROM present."

L_.str.7:                               ## @.str.7
	.asciz	"%08X.rom"

L_.str.8:                               ## @.str.8
	.asciz	"Saving %dKB ROM image to %s...\r\n"

L_.str.9:                               ## @.str.9
	.asciz	"Done.\r\n"

L_.str.10:                              ## @.str.10
	.asciz	"An error occurred whilst saving the ROM.\r\n"

L_str:                                  ## @str
	.asciz	"\r"

	.no_dead_strip	_pci_enum_devs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_enum_devs
_pci_enum_devs:                         ; @pci_enum_devs
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #64
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x22, _MAX_PCI_DEVS@GOTPAGE
Lloh4:
	ldr	x22, [x22, _MAX_PCI_DEVS@GOTPAGEOFF]
	stur	x8, [x29, #-88]
	ldr	w21, [x22]
	mov	w23, #28
	mul	x9, x21, x23
	add	x8, x9, #15
	and	x8, x8, #0x3ffffffff0
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x24, x9, x8
	mov	sp, x24
	sub	x0, x29, #136
	mov	w1, #32
	bl	_bzero
	mul	w8, w21, w23
	stur	w8, [x29, #-136]
	stur	x24, [x29, #-112]
Lloh7:
	adrp	x8, _PCIOCGETCONF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PCIOCGETCONF@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	sub	x2, x29, #136
	mov	x0, x20
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_19
; %bb.1:
	ldur	x8, [x29, #-128]
Lloh10:
	adrp	x9, _PCI_GETCONF_ERROR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PCI_GETCONF_ERROR@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
Lloh13:
	adrp	x8, _stderr@GOTPAGE
Lloh14:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	b	LBB0_20
LBB0_3:
Lloh18:
	adrp	x9, _PCI_GETCONF_MORE_DEVS@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PCI_GETCONF_MORE_DEVS@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
Lloh21:
	adrp	x21, _stderr@GOTPAGE
Lloh22:
	ldr	x21, [x21, _stderr@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	ldr	w0, [x21]
	ldr	w8, [x22]
	stp	x8, x8, [sp, #-16]!
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
	add	sp, sp, #16
LBB0_5:
	ldur	x8, [x29, #-120]
	cmp	x8, #1
	b.lt	LBB0_20
; %bb.6:
	mov	w28, #-1
Lloh25:
	adrp	x22, l_.str.5@PAGE
Lloh26:
	add	x22, x22, l_.str.5@PAGEOFF
	mov	w25, #28
	mov	x26, x24
Lloh27:
	adrp	x27, l_str@PAGE
Lloh28:
	add	x27, x27, l_str@PAGEOFF
	b	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_10 Depth=1
Lloh29:
	adrp	x1, l_.str.10@PAGE
Lloh30:
	add	x1, x1, l_.str.10@PAGEOFF
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	bl	_fprintf
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x26, x26, #28
	ldur	x8, [x29, #-120]
	madd	x8, x8, x25, x24
	cmp	x26, x8
	b.hs	LBB0_20
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x26]
	cbnz	w8, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x20
	mov	x1, x26
	bl	_pci_testrombar
	mov	x23, x0
	cmp	w19, #128
	b.eq	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	cmp	w19, #129
	b.ne	LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	ldp	w8, w9, [x26, #12]
	ldp	w10, w11, [x26, #20]
	sub	sp, sp, #32
	stp	x10, x11, [sp, #16]
	stp	x8, x9, [sp]
Lloh31:
	adrp	x0, l_.str.3@PAGE
Lloh32:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	add	sp, sp, #32
	add	w8, w23, #1023
	cmp	w23, #0
	csel	w8, w8, w23, lt
Lloh33:
	adrp	x9, l_.str.4@PAGE
Lloh34:
	add	x9, x9, l_.str.4@PAGEOFF
	csel	x0, x22, x9, eq
	asr	w8, w8, #10
	str	x8, [sp, #-16]!
	bl	_printf
	add	sp, sp, #16
	mov	x0, x27
	bl	_puts
	b	LBB0_9
LBB0_14:                                ;   in Loop: Header=BB0_10 Depth=1
	cbz	w23, LBB0_9
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=1
	ldp	w8, w9, [x26, #4]
	orr	w3, w9, w8, lsl #16
	sub	x0, x29, #104
	mov	w1, #16
Lloh35:
	adrp	x2, l_.str.7@PAGE
Lloh36:
	add	x2, x2, l_.str.7@PAGEOFF
	bl	_snprintf
	ldr	w0, [x21]
	sub	x8, x29, #104
	stp	x23, x8, [sp, #-16]!
Lloh37:
	adrp	x1, l_.str.8@PAGE
Lloh38:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_fprintf
	add	sp, sp, #16
	sub	x2, x29, #140
	mov	x0, x20
	mov	x1, x26
	bl	_pci_enable_bars
	cbnz	w0, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=1
	sub	x0, x29, #104
	mov	x1, x23
	bl	_pci_save_rom
	mov	x28, x0
LBB0_17:                                ;   in Loop: Header=BB0_10 Depth=1
	sub	x2, x29, #140
	mov	x0, x20
	mov	x1, x26
	bl	_pci_disable_bars
	ldr	w0, [x21]
	cbnz	w28, LBB0_7
; %bb.18:                               ;   in Loop: Header=BB0_10 Depth=1
Lloh39:
	adrp	x1, l_.str.9@PAGE
Lloh40:
	add	x1, x1, l_.str.9@PAGEOFF
	b	LBB0_8
LBB0_19:
Lloh41:
	adrp	x0, l_.str@PAGE
Lloh42:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
LBB0_20:
	ldur	x8, [x29, #-88]
Lloh43:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh44:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh45:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_PCI_DEVS,4,2               ; @MAX_PCI_DEVS
	.comm	_PCIOCGETCONF,4,2               ; @PCIOCGETCONF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ioctl PCIOCGETCONF"

	.comm	_PCI_GETCONF_ERROR,8,3          ; @PCI_GETCONF_ERROR
	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"Error fetching PCI device list from kernel.\r\n"

	.comm	_PCI_GETCONF_MORE_DEVS,8,3      ; @PCI_GETCONF_MORE_DEVS
l_.str.2:                               ; @.str.2
	.asciz	"More than %d devices exist. Only the first %d will be inspected.\r\n"

l_.str.3:                               ; @.str.3
	.asciz	"Domain %04Xh Bus %02Xh Device %02Xh Function %02Xh: "

l_.str.4:                               ; @.str.4
	.asciz	"%dKB ROM aperture detected."

l_.str.5:                               ; @.str.5
	.asciz	"No ROM present."

l_.str.7:                               ; @.str.7
	.asciz	"%08X.rom"

l_.str.8:                               ; @.str.8
	.asciz	"Saving %dKB ROM image to %s...\r\n"

l_.str.9:                               ; @.str.9
	.asciz	"Done.\r\n"

l_.str.10:                              ; @.str.10
	.asciz	"An error occurred whilst saving the ROM.\r\n"

l_str:                                  ; @str
	.asciz	"\r"

	.no_dead_strip	_pci_enum_devs
.subsections_via_symbols
