	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_enable_resources           ## -- Begin function pci_enable_resources
	.p2align	4, 0x90
_pci_enable_resources:                  ## @pci_enable_resources
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_PCI_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_pci_read_config_word
	movq	_PCI_NUM_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%esi, %esi
	jle	LBB0_1
## %bb.2:
	movl	-44(%rbp), %ecx
	movq	_IORESOURCE_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	%r9d, %edi
	orl	%r8d, %edi
	movq	_PCI_ROM_RESOURCE@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	movq	_IORESOURCE_ROM_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_IORESOURCE_UNSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	_PCI_COMMAND_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_PCI_COMMAND_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	shlq	$3, %r10
	shlq	$3, %rsi
	xorl	%edx, %edx
	xorl	%eax, %eax
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	incl	%eax
	addq	$8, %rdx
	cmpq	%rdx, %rsi
	je	LBB0_17
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	btl	%eax, %r15d
	jae	LBB0_16
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r14), %rbx
	movl	(%rbx,%rdx), %r12d
	testl	%r12d, %edi
	je	LBB0_16
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%rdx, %r10
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r13d, %r11d
	andl	%r12d, %r11d
	je	LBB0_16
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	testl	%r12d, -60(%rbp)                ## 4-byte Folded Reload
	jne	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, 4(%rbx,%rdx)
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	testl	%r12d, %r8d
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	orl	-56(%rbp), %ecx                 ## 4-byte Folded Reload
	movl	%ecx, -44(%rbp)
	movl	(%rbx,%rdx), %r12d
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	testl	%r9d, %r12d
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	orl	-52(%rbp), %ecx                 ## 4-byte Folded Reload
	movl	%ecx, -44(%rbp)
	jmp	LBB0_16
LBB0_17:
	xorl	%ebx, %ebx
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, %ecx
	je	LBB0_19
## %bb.18:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_pci_info
	movq	_PCI_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %edx
	movq	%r14, %rdi
	callq	_pci_write_config_word
	jmp	LBB0_19
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_19
LBB0_8:
	addq	%rdx, %rbx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_9
LBB0_11:
	addq	%rdx, %rbx
	leaq	L_.str.1(%rip), %rsi
LBB0_9:
	movq	%r14, %rdi
	movl	%eax, %edx
	movq	%rbx, %rcx
	callq	_pci_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_COMMAND,4,2                ## @PCI_COMMAND
	.comm	_PCI_NUM_RESOURCES,4,2          ## @PCI_NUM_RESOURCES
	.comm	_IORESOURCE_IO,4,2              ## @IORESOURCE_IO
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.comm	_PCI_ROM_RESOURCE,4,2           ## @PCI_ROM_RESOURCE
	.comm	_IORESOURCE_ROM_ENABLE,4,2      ## @IORESOURCE_ROM_ENABLE
	.comm	_IORESOURCE_UNSET,4,2           ## @IORESOURCE_UNSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't enable device: BAR %d %pR not assigned\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"can't enable device: BAR %d %pR not claimed\n"

	.comm	_PCI_COMMAND_IO,4,2             ## @PCI_COMMAND_IO
	.comm	_PCI_COMMAND_MEMORY,4,2         ## @PCI_COMMAND_MEMORY
L_.str.2:                               ## @.str.2
	.asciz	"enabling device (%04x -> %04x)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_enable_resources           ; -- Begin function pci_enable_resources
	.p2align	2
_pci_enable_resources:                  ; @pci_enable_resources
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _PCI_COMMAND@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PCI_COMMAND@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_pci_read_config_word
Lloh2:
	adrp	x8, _PCI_NUM_RESOURCES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_NUM_RESOURCES@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_15
; %bb.1:
	mov	x10, #0
	mov	w2, #0
Lloh5:
	adrp	x11, _IORESOURCE_IO@GOTPAGE
Lloh6:
	ldr	x11, [x11, _IORESOURCE_IO@GOTPAGEOFF]
	ldr	w8, [sp, #12]
Lloh7:
	ldr	w11, [x11]
Lloh8:
	adrp	x12, _IORESOURCE_MEM@GOTPAGE
Lloh9:
	ldr	x12, [x12, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh10:
	ldr	w12, [x12]
	orr	w13, w12, w11
Lloh11:
	adrp	x14, _PCI_ROM_RESOURCE@GOTPAGE
Lloh12:
	ldr	x14, [x14, _PCI_ROM_RESOURCE@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x14]
Lloh14:
	adrp	x14, _IORESOURCE_ROM_ENABLE@GOTPAGE
Lloh15:
	ldr	x14, [x14, _IORESOURCE_ROM_ENABLE@GOTPAGEOFF]
Lloh16:
	ldr	w14, [x14]
Lloh17:
	adrp	x15, _IORESOURCE_UNSET@GOTPAGE
Lloh18:
	ldr	x15, [x15, _IORESOURCE_UNSET@GOTPAGEOFF]
Lloh19:
	ldr	w15, [x15]
Lloh20:
	adrp	x16, _PCI_COMMAND_IO@GOTPAGE
Lloh21:
	ldr	x16, [x16, _PCI_COMMAND_IO@GOTPAGEOFF]
Lloh22:
	ldr	w16, [x16]
Lloh23:
	adrp	x17, _PCI_COMMAND_MEMORY@GOTPAGE
Lloh24:
	ldr	x17, [x17, _PCI_COMMAND_MEMORY@GOTPAGEOFF]
Lloh25:
	ldr	w17, [x17]
	lsl	x0, x0, #3
	lsl	x1, x9, #3
	mov	x3, x8
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w2, w2, #1
	add	x10, x10, #8
	cmp	x1, x10
	b.eq	LBB0_13
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w9, w20, w2
	tbz	w9, #0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x5, [x19]
	ldr	w4, [x5, x10]
	tst	w13, w4
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	x0, x10
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	and	w9, w14, w4
	cbz	w9, LBB0_2
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	tst	w15, w4
	b.ne	LBB0_17
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x5, x10
	ldr	w6, [x9, #4]
	cbz	w6, LBB0_18
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	tst	w11, w4
	b.eq	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	orr	w3, w3, w16
	str	w3, [sp, #12]
	ldr	w4, [x5, x10]
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	tst	w4, w12
	b.eq	LBB0_2
; %bb.12:                               ;   in Loop: Header=BB0_3 Depth=1
	orr	w3, w3, w17
	str	w3, [sp, #12]
	b	LBB0_2
LBB0_13:
	cmp	w3, w8
	b.eq	LBB0_15
; %bb.14:
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x8
	bl	_pci_info
	ldr	w1, [x21]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_pci_write_config_word
LBB0_15:
	mov	w0, #0
LBB0_16:
	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_17:
	add	x3, x5, x10
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	b	LBB0_19
LBB0_18:
Lloh30:
	adrp	x1, l_.str.1@PAGE
Lloh31:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x3, x9
LBB0_19:
	bl	_pci_err
Lloh32:
	adrp	x8, _EINVAL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_COMMAND,4,2                ; @PCI_COMMAND
	.comm	_PCI_NUM_RESOURCES,4,2          ; @PCI_NUM_RESOURCES
	.comm	_IORESOURCE_IO,4,2              ; @IORESOURCE_IO
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.comm	_PCI_ROM_RESOURCE,4,2           ; @PCI_ROM_RESOURCE
	.comm	_IORESOURCE_ROM_ENABLE,4,2      ; @IORESOURCE_ROM_ENABLE
	.comm	_IORESOURCE_UNSET,4,2           ; @IORESOURCE_UNSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't enable device: BAR %d %pR not assigned\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"can't enable device: BAR %d %pR not claimed\n"

	.comm	_PCI_COMMAND_IO,4,2             ; @PCI_COMMAND_IO
	.comm	_PCI_COMMAND_MEMORY,4,2         ; @PCI_COMMAND_MEMORY
l_.str.2:                               ; @.str.2
	.asciz	"enabling device (%04x -> %04x)\n"

.subsections_via_symbols
