	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_epf_test_bind
_pci_epf_test_bind:                     ## @pci_epf_test_bind
	.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
	movq	%rax, %r14
	movq	16(%r13), %r15
	movq	24(%r13), %rbx
	movq	_BAR_0@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	xorl	%edi, %edi
	testq	%r15, %r15
	sete	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_2:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rbx
	movl	4(%r13), %esi
	movq	%r15, %rdi
	callq	_pci_epc_get_features
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	(%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	4(%r14), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	8(%r14), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_pci_epc_get_first_free_bar
	movl	%eax, %r12d
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_pci_epf_configure_bar
	jmp	LBB0_5
LBB0_3:
	movl	$1, -52(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
LBB0_5:
	leaq	12(%r13), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, (%rbx)
	movq	%r14, 8(%rbx)
	movq	%rbx, %r14
	movl	4(%r13), %esi
	movq	%r15, %rdi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_pci_epc_write_header
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	jmp	LBB0_18
LBB0_7:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_pci_epf_test_alloc_space
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.8:
	movq	%r13, %rdi
	callq	_pci_epf_test_set_bar
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.9:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_13
## %bb.10:
	movl	4(%r13), %esi
	movl	8(%r13), %edx
	movq	%r15, %rdi
	callq	_pci_epc_set_msi
	testl	%eax, %eax
	je	LBB0_13
## %bb.11:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_12
LBB0_13:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_16
## %bb.14:
	movl	(%r13), %edx
	movl	4(%r13), %esi
	movq	%r15, %rdi
	callq	_pci_epc_set_msix
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
LBB0_12:
	movq	%r12, %rdi
	callq	_dev_err
	jmp	LBB0_18
LBB0_16:
	xorl	%ebx, %ebx
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_18
## %bb.17:
	movq	_kpcitest_workqueue@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$4, %r14
	movq	%r14, %rsi
	callq	_queue_work
LBB0_18:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BAR_0,4,2                      ## @BAR_0
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Configuration header write failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"MSI configuration failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"MSI-X configuration failed\n"

	.comm	_kpcitest_workqueue,4,2         ## @kpcitest_workqueue
	.no_dead_strip	_pci_epf_test_bind
.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_bind
_pci_epf_test_bind:                     ; @pci_epf_test_bind
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x0
	bl	_epf_get_drvdata
	mov	x19, x0
Lloh0:
	adrp	x8, _BAR_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BAR_0@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	ldp	x22, x23, [x20, #16]
	cmp	x22, #0
	cset	w0, eq
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_10
LBB0_2:
	add	x21, x20, #12
	ldr	w1, [x20, #4]
	mov	x0, x22
	bl	_pci_epc_get_features
	mov	x25, x0
	cbz	x0, LBB0_4
; %bb.3:
	ldp	w26, w27, [x25]
	ldr	w28, [x25, #8]
	mov	x0, x25
	bl	_pci_epc_get_first_free_bar
	mov	x24, x0
	mov	x0, x20
	mov	x1, x25
	bl	_pci_epf_configure_bar
	b	LBB0_5
LBB0_4:
	mov	w26, #0
	mov	w27, #0
	mov	w28, #1
LBB0_5:
	str	w24, [x19]
	str	x25, [x19, #8]
	ldr	w1, [x20, #4]
	mov	x0, x22
	mov	x2, x23
	bl	_pci_epc_write_header
	cbz	w0, LBB0_8
; %bb.6:
	mov	x23, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
LBB0_7:
	mov	x0, x21
	bl	_dev_err
	b	LBB0_10
LBB0_8:
	mov	x0, x20
	bl	_pci_epf_test_alloc_space
	mov	x23, x0
	cbnz	w0, LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_pci_epf_test_set_bar
	mov	x23, x0
	cbz	w0, LBB0_11
LBB0_10:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_11:
	cbz	w28, LBB0_14
; %bb.12:
	ldp	w1, w2, [x20, #4]
	mov	x0, x22
	bl	_pci_epc_set_msi
	cbz	w0, LBB0_14
; %bb.13:
	mov	x23, x0
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_14:
	cbz	w27, LBB0_17
; %bb.15:
	ldp	w2, w1, [x20]
	mov	x0, x22
	bl	_pci_epc_set_msix
	cbz	w0, LBB0_17
; %bb.16:
	mov	x23, x0
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_17:
	cbnz	w26, LBB0_19
; %bb.18:
Lloh12:
	adrp	x8, _kpcitest_workqueue@GOTPAGE
Lloh13:
	ldr	x8, [x8, _kpcitest_workqueue@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	add	x1, x19, #4
	bl	_queue_work
LBB0_19:
	mov	w23, #0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_BAR_0,4,2                      ; @BAR_0
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Configuration header write failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"MSI configuration failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"MSI-X configuration failed\n"

	.comm	_kpcitest_workqueue,4,2         ; @kpcitest_workqueue
	.no_dead_strip	_pci_epf_test_bind
.subsections_via_symbols
