	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcie_set_readrq                ## -- Begin function pcie_set_readrq
	.p2align	4, 0x90
_pcie_set_readrq:                       ## @pcie_set_readrq
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	leal	-4097(%rbx), %eax
	cmpl	$-3969, %eax                    ## imm = 0xF07F
	jb	LBB0_5
## %bb.1:
	movq	%rdi, %r14
	movl	%ebx, %edi
	callq	_is_power_of_2
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movq	_pcie_bus_config@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PCIE_BUS_PERFORMANCE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_pcie_get_mps
	cmpl	%ebx, %eax
	cmovll	%eax, %ebx
LBB0_4:
	bsfl	%ebx, %eax
	shll	$12, %eax
	addl	$-28672, %eax                   ## imm = 0x9000
	testl	%ebx, %ebx
	movl	$-32768, %ecx                   ## imm = 0x8000
	cmovnel	%eax, %ecx
	movq	_PCI_EXP_DEVCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PCI_EXP_DEVCTL_READRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_pcie_capability_clear_and_set_word ## TAILCALL
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_pcie_bus_config,8,3            ## @pcie_bus_config
	.comm	_PCIE_BUS_PERFORMANCE,8,3       ## @PCIE_BUS_PERFORMANCE
	.comm	_PCI_EXP_DEVCTL,4,2             ## @PCI_EXP_DEVCTL
	.comm	_PCI_EXP_DEVCTL_READRQ,4,2      ## @PCI_EXP_DEVCTL_READRQ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcie_set_readrq                ; -- Begin function pcie_set_readrq
	.p2align	2
_pcie_set_readrq:                       ; @pcie_set_readrq
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	w8, #-4097
	add	w8, w1, w8
	cmn	w8, #3969
	b.lo	LBB0_5
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_is_power_of_2
	cbz	w0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _pcie_bus_config@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pcie_bus_config@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _PCIE_BUS_PERFORMANCE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PCIE_BUS_PERFORMANCE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_pcie_get_mps
	cmp	w0, w20
	csel	w20, w0, w20, lt
LBB0_4:
	rbit	w8, w20
	clz	w8, w8
	lsl	w8, w8, #12
	sub	w8, w8, #7, lsl #12             ; =28672
	mov	w9, #-32768
	cmp	w20, #0
	csel	w3, w9, w8, eq
Lloh6:
	adrp	x8, _PCI_EXP_DEVCTL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PCI_EXP_DEVCTL@GOTPAGEOFF]
Lloh8:
	adrp	x9, _PCI_EXP_DEVCTL_READRQ@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PCI_EXP_DEVCTL_READRQ@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	ldr	w2, [x9]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_pcie_capability_clear_and_set_word
LBB0_5:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_pcie_bus_config,8,3            ; @pcie_bus_config
	.comm	_PCIE_BUS_PERFORMANCE,8,3       ; @PCIE_BUS_PERFORMANCE
	.comm	_PCI_EXP_DEVCTL,4,2             ; @PCI_EXP_DEVCTL
	.comm	_PCI_EXP_DEVCTL_READRQ,4,2      ; @PCI_EXP_DEVCTL_READRQ
.subsections_via_symbols
