	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_epf_test_alloc_space
_pci_epf_test_alloc_space:              ## @pci_epf_test_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	callq	_epf_get_drvdata
	movl	(%rax), %r14d
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	16(%rax), %rcx
	movq	8(%rcx), %rax
	cmpq	$0, (%rax,%r14,8)
	je	LBB0_1
## %bb.2:
	movq	_bar_size@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r14,8), %rsi
	jmp	LBB0_3
LBB0_1:
	movl	$4, %esi
LBB0_3:
	leaq	8(%r13), %r15
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	4(%rcx), %ecx
	movq	%r13, %rdi
	movl	%r14d, %edx
	callq	_pci_epf_alloc_space
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rcx
	movq	%rax, (%rcx,%r14,8)
	movq	_BAR_0@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_BAR_5@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r12d, %r12d
	cmpl	%eax, %ebx
	jg	LBB0_14
## %bb.6:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	_PCI_BASE_ADDRESS_MEM_TYPE_64@GOTPCREL(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	%r14, (%rax,%r12,8)
	movq	_BAR_5@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	_PCI_BASE_ADDRESS_MEM_TYPE_64@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	addl	%r15d, %ebx
	cmpl	%eax, %ebx
	jg	LBB0_13
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rcx
	movslq	%ebx, %r12
	movl	(%rsi), %edx
	andl	(%rcx,%r12,4), %edx
	cmpl	$1, %edx
	movl	$2, %r15d
	sbbl	$0, %r15d
	cmpl	%r14d, %r12d
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	(%rdi), %ecx
	btl	%ebx, %ecx
	jb	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_bar_size@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r12,8), %rsi
	movl	4(%rdi), %ecx
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_pci_epf_alloc_space
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_11
LBB0_4:
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_14
LBB0_13:
	xorl	%r12d, %r12d
LBB0_14:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bar_size,8,3                   ## @bar_size
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocated register space\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_BAR_0,4,2                      ## @BAR_0
	.comm	_BAR_5,4,2                      ## @BAR_5
	.comm	_PCI_BASE_ADDRESS_MEM_TYPE_64,4,2 ## @PCI_BASE_ADDRESS_MEM_TYPE_64
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate space for BAR%d\n"

	.no_dead_strip	_pci_epf_test_alloc_space
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_epf_test_alloc_space
_pci_epf_test_alloc_space:              ; @pci_epf_test_alloc_space
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_epf_get_drvdata
	mov	x21, x0
	add	x20, x19, #8
	ldr	w22, [x0]
	ldr	x26, [x0, #16]
	ldr	x8, [x26, #8]
	ldr	x8, [x8, x22, lsl #3]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _bar_size@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bar_size@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x1, [x8, x22, lsl #3]
	b	LBB0_3
LBB0_2:
	mov	w1, #4
LBB0_3:
	ldr	w3, [x26, #4]
	mov	x0, x19
	mov	x2, x22
	bl	_pci_epf_alloc_space
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x21, #8]
	str	x0, [x8, x22, lsl #3]
Lloh3:
	adrp	x8, _BAR_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BAR_0@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x8]
Lloh6:
	adrp	x27, _BAR_5@GOTPAGE
Lloh7:
	ldr	x27, [x27, _BAR_5@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w9, w8
	b.le	LBB0_8
LBB0_5:
	mov	w0, #0
	b	LBB0_7
LBB0_6:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
Lloh13:
	adrp	x28, _PCI_BASE_ADDRESS_MEM_TYPE_64@GOTPAGE
Lloh14:
	ldr	x28, [x28, _PCI_BASE_ADDRESS_MEM_TYPE_64@GOTPAGEOFF]
	mov	w23, #1
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x21, #8]
	str	x25, [x8, x24, lsl #3]
	ldr	w8, [x27]
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	w9, w20, w24
	cmp	w9, w8
	b.gt	LBB0_5
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x19]
	sxtw	x24, w9
	ldr	w10, [x10, w9, sxtw #2]
	ldr	w11, [x28]
	tst	w11, w10
	cinc	w20, w23, ne
	cmp	w9, w22
	b.eq	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w9, [x26]
	lsr	w9, w9, w24
	tbnz	w9, #0, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
Lloh15:
	adrp	x8, _bar_size@GOTPAGE
Lloh16:
	ldr	x8, [x8, _bar_size@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	x1, [x8, x24, lsl #3]
	ldr	w3, [x26, #4]
	mov	x0, x19
	mov	x2, x24
	bl	_pci_epf_alloc_space
	mov	x25, x0
	cbnz	x0, LBB0_9
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	str	x24, [sp]
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_bar_size,8,3                   ; @bar_size
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocated register space\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_BAR_0,4,2                      ; @BAR_0
	.comm	_BAR_5,4,2                      ; @BAR_5
	.comm	_PCI_BASE_ADDRESS_MEM_TYPE_64,4,2 ; @PCI_BASE_ADDRESS_MEM_TYPE_64
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate space for BAR%d\n"

	.no_dead_strip	_pci_epf_test_alloc_space
.subsections_via_symbols
