	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_epf_alloc_space            ## -- Begin function pci_epf_alloc_space
	.p2align	4, 0x90
_pci_epf_alloc_space:                   ## @pci_epf_alloc_space
	.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	%edx, %ebx
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	cmpq	$129, %rsi
	movl	$128, %edi
	cmovaeq	%rsi, %rdi
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.1:
	movq	%rcx, %rsi
	callq	_ALIGN
	jmp	LBB0_3
LBB0_2:
	callq	_roundup_pow_of_two
LBB0_3:
	movq	%rax, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_dma_alloc_coherent
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movl	-44(%rbp), %eax
	movq	(%r12), %rcx
	movl	%ebx, %edx
	shlq	$3, %rdx
	movl	%ebx, %esi
	leaq	(%rdx,%rdx,2), %rbx
	movl	%eax, 16(%rcx,%rbx)
	movq	%r14, (%rcx,%rbx)
	movl	%esi, 8(%rcx,%rbx)
	movq	%r14, %rdi
	callq	_upper_32_bits
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:
	movq	_PCI_BASE_ADDRESS_MEM_TYPE_32@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_9
LBB0_6:
	movq	_PCI_BASE_ADDRESS_MEM_TYPE_64@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	movq	(%r12), %rcx
	orl	%eax, 12(%rcx,%rbx)
LBB0_9:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate mem space\n"

	.comm	_PCI_BASE_ADDRESS_MEM_TYPE_64,4,2 ## @PCI_BASE_ADDRESS_MEM_TYPE_64
	.comm	_PCI_BASE_ADDRESS_MEM_TYPE_32,4,2 ## @PCI_BASE_ADDRESS_MEM_TYPE_32
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_epf_alloc_space            ; -- Begin function pci_epf_alloc_space
	.p2align	2
_pci_epf_alloc_space:                   ; @pci_epf_alloc_space
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	mov	w8, #128
	cmp	x1, #128
	csel	x0, x1, x8, hi
	cbz	x3, LBB0_2
; %bb.1:
	mov	x1, x3
	bl	_ALIGN
	b	LBB0_3
LBB0_2:
	bl	_roundup_pow_of_two
LBB0_3:
	mov	x23, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x23
	bl	_dma_alloc_coherent
	mov	x22, x0
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w8, [sp, #12]
	ldr	x9, [x20]
	mov	w21, #24
	umaddl	x9, w19, w21, x9
	str	w8, [x9, #16]
	str	x23, [x9]
	str	w19, [x9, #8]
	mov	x0, x23
	bl	_upper_32_bits
Lloh3:
	adrp	x8, _PCI_BASE_ADDRESS_MEM_TYPE_64@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_BASE_ADDRESS_MEM_TYPE_64@GOTPAGEOFF]
Lloh5:
	adrp	x9, _PCI_BASE_ADDRESS_MEM_TYPE_32@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PCI_BASE_ADDRESS_MEM_TYPE_32@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	ldr	x9, [x20]
	umaddl	x9, w19, w21, x9
	ldr	w10, [x9, #12]
	orr	w8, w10, w8
	str	w8, [x9, #12]
	b	LBB0_6
LBB0_5:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
LBB0_6:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate mem space\n"

	.comm	_PCI_BASE_ADDRESS_MEM_TYPE_64,4,2 ; @PCI_BASE_ADDRESS_MEM_TYPE_64
	.comm	_PCI_BASE_ADDRESS_MEM_TYPE_32,4,2 ; @PCI_BASE_ADDRESS_MEM_TYPE_32
.subsections_via_symbols
