	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_enable_ats                 ## -- Begin function pci_enable_ats
	.p2align	4, 0x90
_pci_enable_ats:                        ## @pci_enable_ats
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 8(%rdi)
	je	LBB0_1
## %bb.3:
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_5:
	movq	_PCI_ATS_MIN_STU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r15d, %eax
	jg	LBB0_1
## %bb.6:
	movq	_PCI_ATS_CTRL_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	cmpq	$0, 24(%rbx)
	je	LBB0_9
## %bb.7:
	movq	%rbx, %rdi
	callq	_pci_physfn
	cmpl	%r15d, 4(%rax)
	jne	LBB0_1
## %bb.8:
	addq	$16, %rax
	movq	%rax, %rdi
	callq	_atomic_inc
	jmp	LBB0_10
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	%r15d, 4(%rbx)
	subl	%eax, %r15d
	movl	%r15d, %edi
	callq	_PCI_ATS_CTRL_STU
	orl	%eax, %r14d
LBB0_10:
	movq	_PCI_ATS_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_pci_write_config_word
	movl	$1, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_PCI_ATS_MIN_STU,4,2            ## @PCI_ATS_MIN_STU
	.comm	_PCI_ATS_CTRL_ENABLE,4,2        ## @PCI_ATS_CTRL_ENABLE
	.comm	_PCI_ATS_CTRL,8,3               ## @PCI_ATS_CTRL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_enable_ats                 ; -- Begin function pci_enable_ats
	.p2align	2
_pci_enable_ats:                        ; @pci_enable_ats
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x8, [x0, #8]
	cbz	x8, LBB0_7
; %bb.1:
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_WARN_ON
	cbz	x0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_8
LBB0_3:
Lloh2:
	adrp	x8, _PCI_ATS_MIN_STU@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_ATS_MIN_STU@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w21
	b.gt	LBB0_7
; %bb.4:
Lloh5:
	adrp	x9, _PCI_ATS_CTRL_ENABLE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PCI_ATS_CTRL_ENABLE@GOTPAGEOFF]
Lloh7:
	ldr	w20, [x9]
	ldr	x9, [x19, #24]
	cbz	x9, LBB0_10
; %bb.5:
	mov	x0, x19
	bl	_pci_physfn
	ldr	w8, [x0, #4]
	cmp	w8, w21
	b.ne	LBB0_7
; %bb.6:
	add	x0, x0, #16
	bl	_atomic_inc
	b	LBB0_11
LBB0_7:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_10:
	str	w21, [x19, #4]
	sub	w0, w21, w8
	bl	_PCI_ATS_CTRL_STU
	orr	w20, w0, w20
LBB0_11:
	ldr	x8, [x19, #8]
Lloh10:
	adrp	x9, _PCI_ATS_CTRL@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PCI_ATS_CTRL@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x19
	mov	x2, x20
	bl	_pci_write_config_word
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_PCI_ATS_MIN_STU,4,2            ; @PCI_ATS_MIN_STU
	.comm	_PCI_ATS_CTRL_ENABLE,4,2        ; @PCI_ATS_CTRL_ENABLE
	.comm	_PCI_ATS_CTRL,8,3               ; @PCI_ATS_CTRL
.subsections_via_symbols
