	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcix_set_mmrbc                 ## -- Begin function pcix_set_mmrbc
	.p2align	4, 0x90
_pcix_set_mmrbc:                        ## @pcix_set_mmrbc
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	leal	-4097(%rbx), %eax
	cmpl	$-3585, %eax                    ## imm = 0xF1FF
	jb	LBB0_2
## %bb.1:
	movq	%rdi, %r15
	movl	%ebx, %edi
	callq	_is_power_of_2
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movq	_PCI_CAP_ID_PCIX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_pci_find_capability
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movslq	%eax, %r14
	movq	_PCI_X_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r14, %rsi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_dword
	testq	%rax, %rax
	je	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_13:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	bsfl	%ebx, %r12d
	addl	$-9, %r12d
	movq	_PCI_X_STATUS_MAX_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-48(%rbp), %eax
	sarl	$21, %eax
	cmpl	%eax, %r12d
	jle	LBB0_7
## %bb.6:
	movq	_E2BIG@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_7:
	movq	_PCI_X_CMD@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	addq	%r14, %rsi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_word
	testq	%rax, %rax
	jne	LBB0_2
## %bb.8:
	movl	-44(%rbp), %eax
	movq	_PCI_X_CMD_MAX_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	andl	%eax, %edx
	sarl	$2, %edx
	xorl	%ebx, %ebx
	cmpl	%r12d, %edx
	je	LBB0_14
## %bb.9:
	jge	LBB0_11
## %bb.10:
	movq	(%r15), %rdx
	movq	_PCI_BUS_FLAGS_NO_MMRBC@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, (%rdx)
	jne	LBB0_12
LBB0_11:
	notl	%ecx
	andl	%ecx, %eax
	shll	$2, %r12d
	orl	%eax, %r12d
	movl	%r12d, -44(%rbp)
	addq	(%r13), %r14
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%r12d, %edx
	callq	_pci_write_config_word
	testq	%rax, %rax
	je	LBB0_14
LBB0_12:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PCI_CAP_ID_PCIX,4,2            ## @PCI_CAP_ID_PCIX
	.comm	_PCI_X_STATUS,8,3               ## @PCI_X_STATUS
	.comm	_PCI_X_STATUS_MAX_READ,4,2      ## @PCI_X_STATUS_MAX_READ
	.comm	_E2BIG,4,2                      ## @E2BIG
	.comm	_PCI_X_CMD,8,3                  ## @PCI_X_CMD
	.comm	_PCI_X_CMD_MAX_READ,4,2         ## @PCI_X_CMD_MAX_READ
	.comm	_PCI_BUS_FLAGS_NO_MMRBC,4,2     ## @PCI_BUS_FLAGS_NO_MMRBC
	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcix_set_mmrbc                 ; -- Begin function pcix_set_mmrbc
	.p2align	2
_pcix_set_mmrbc:                        ; @pcix_set_mmrbc
	.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	w8, #-4097
	add	w8, w1, w8
	cmn	w8, #3585
	b.lo	LBB0_4
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_is_power_of_2
	cbz	w0, LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _PCI_CAP_ID_PCIX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_CAP_ID_PCIX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pci_find_capability
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_4
; %bb.3:
	sxtw	x21, w0
Lloh3:
	adrp	x8, _PCI_X_STATUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_X_STATUS@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x1, x8, x21
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	cbz	x0, LBB0_7
LBB0_4:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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_7:
	rbit	w8, w20
	clz	w8, w8
	sub	w20, w8, #9
	ldr	w8, [sp, #12]
Lloh8:
	adrp	x9, _PCI_X_STATUS_MAX_READ@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PCI_X_STATUS_MAX_READ@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	and	w8, w9, w8
	cmp	w20, w8, asr #21
	b.le	LBB0_9
; %bb.8:
Lloh11:
	adrp	x8, _E2BIG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
	b	LBB0_5
LBB0_9:
Lloh13:
	adrp	x22, _PCI_X_CMD@GOTPAGE
Lloh14:
	ldr	x22, [x22, _PCI_X_CMD@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x1, x8, x21
	add	x2, sp, #8
	mov	x0, x19
	bl	_pci_read_config_word
	cbnz	x0, LBB0_4
; %bb.10:
	ldr	w8, [sp, #8]
Lloh15:
	adrp	x9, _PCI_X_CMD_MAX_READ@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PCI_X_CMD_MAX_READ@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	and	w10, w9, w8
	asr	w10, w10, #2
	cmp	w10, w20
	b.ne	LBB0_12
; %bb.11:
	mov	w0, #0
	b	LBB0_6
LBB0_12:
	cmp	w20, w10
	b.le	LBB0_14
; %bb.13:
	ldr	x10, [x19]
	ldr	w10, [x10]
Lloh18:
	adrp	x11, _PCI_BUS_FLAGS_NO_MMRBC@GOTPAGE
Lloh19:
	ldr	x11, [x11, _PCI_BUS_FLAGS_NO_MMRBC@GOTPAGEOFF]
Lloh20:
	ldr	w11, [x11]
	tst	w11, w10
	b.ne	LBB0_15
LBB0_14:
	bic	w8, w8, w9
	orr	w2, w8, w20, lsl #2
	str	w2, [sp, #8]
	ldr	x8, [x22]
	add	x1, x8, x21
	mov	x0, x19
	bl	_pci_write_config_word
	cbz	x0, LBB0_6
LBB0_15:
Lloh21:
	adrp	x8, _EIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PCI_CAP_ID_PCIX,4,2            ; @PCI_CAP_ID_PCIX
	.comm	_PCI_X_STATUS,8,3               ; @PCI_X_STATUS
	.comm	_PCI_X_STATUS_MAX_READ,4,2      ; @PCI_X_STATUS_MAX_READ
	.comm	_E2BIG,4,2                      ; @E2BIG
	.comm	_PCI_X_CMD,8,3                  ; @PCI_X_CMD
	.comm	_PCI_X_CMD_MAX_READ,4,2         ; @PCI_X_CMD_MAX_READ
	.comm	_PCI_BUS_FLAGS_NO_MMRBC,4,2     ; @PCI_BUS_FLAGS_NO_MMRBC
	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
