	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_iov_add_virtfn             ## -- Begin function pci_iov_add_virtfn
	.p2align	4, 0x90
_pci_iov_add_virtfn:                    ## @pci_iov_add_virtfn
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	_VIRTFN_ID_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	48(%rbx), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	4(%rbx), %r14d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movl	%r13d, %esi
	callq	_pci_iov_virtfn_bus
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_virtfn_add_bus
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_pci_alloc_dev
	testq	%rax, %rax
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_16
## %bb.2:
	movq	%rax, %r13
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, %r12
	movq	%rbx, %rdi
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %esi
	callq	_pci_iov_virtfn_devfn
	movl	%eax, 44(%r13)
	movl	40(%rbx), %eax
	movl	%eax, 40(%r13)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, 36(%r13)
	movl	$1, (%r13)
	movq	%rbx, %rdi
	callq	_pci_dev_get
	movl	%eax, 32(%r13)
	testl	%r15d, %r15d
	jne	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_pci_read_vf_config_common
LBB0_4:
	movq	%r12, %rdi
	callq	_pci_setup_device
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.5:
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	movl	12(%rbx), %eax
	movl	%eax, 12(%r12)
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movq	$0, 24(%r12)
	movq	_PCI_SRIOV_NUM_BARS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_10
## %bb.6:
	xorl	%r15d, %r15d
	movq	_PCI_IOV_RESOURCES@GOTPCREL(%rip), %rdx
	xorl	%r13d, %r13d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	incq	%r13
	movslq	%eax, %rcx
	addq	$32, %r15
	cmpq	%rcx, %r13
	jge	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %r12
	movslq	(%rdx), %r14
	addq	%r13, %r14
	shlq	$5, %r14
	cmpl	$0, 24(%r12,%r14)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	leaq	(%r12,%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_pci_name
	movq	16(%rbx), %rcx
	movl	%eax, 20(%rcx,%r15)
	movl	16(%r12,%r14), %eax
	movl	%eax, 16(%rcx,%r15)
	movq	_PCI_IOV_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	%r13d, %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_pci_iov_resource_size
	movslq	%eax, %rcx
	imull	-52(%rbp), %eax                 ## 4-byte Folded Reload
	cltq
	addq	(%r12,%r14), %rax
	movq	16(%rbx), %rdx
	leaq	(%rdx,%r15), %rsi
	movq	%rax, (%rdx,%r15)
	addq	%rcx, %rax
	decq	%rax
	movq	%rax, 8(%rdx,%r15)
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	callq	_request_resource
	movl	%eax, %edi
	callq	_BUG_ON
	movq	_PCI_IOV_RESOURCES@GOTPCREL(%rip), %rdx
	movq	_PCI_SRIOV_NUM_BARS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_10:
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movl	4(%r12), %esi
	movq	%r12, %rdi
	callq	_pci_device_add
	leaq	L_.str(%rip), %rsi
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_sprintf
	addq	$8, %rbx
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	addq	$8, %r13
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	callq	_sysfs_create_link
	movl	%eax, %r15d
	testl	%eax, %eax
	movq	-104(%rbp), %r14                ## 8-byte Reload
	jne	LBB0_14
## %bb.11:
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_sysfs_create_link
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_sysfs_remove_link
LBB0_14:
	movq	%r12, %rdi
	callq	_pci_stop_and_remove_bus_device
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_15:
	movq	%rbx, %rdi
	callq	_pci_dev_put
LBB0_16:
	movl	4(%rbx), %edi
	movq	%r14, %rsi
	callq	_virtfn_remove_bus
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.18:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_KOBJ_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_kobject_uevent
	movq	%r12, %rdi
	callq	_pci_bus_add_device
	xorl	%r15d, %r15d
	jmp	LBB0_17
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VIRTFN_ID_LEN,4,2              ## @VIRTFN_ID_LEN
	.comm	_PCI_SRIOV_NUM_BARS,4,2         ## @PCI_SRIOV_NUM_BARS
	.comm	_PCI_IOV_RESOURCES,4,2          ## @PCI_IOV_RESOURCES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"virtfn%u"

L_.str.1:                               ## @.str.1
	.asciz	"physfn"

	.comm	_KOBJ_CHANGE,4,2                ## @KOBJ_CHANGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_iov_add_virtfn             ; -- Begin function pci_iov_add_virtfn
	.p2align	2
_pci_iov_add_virtfn:                    ; @pci_iov_add_virtfn
	.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
	sub	sp, sp, #16
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ENOMEM@GOTPAGEOFF]
	stur	x8, [x29, #-88]
Lloh5:
	ldr	w8, [x9]
	neg	w24, w8
Lloh6:
	adrp	x8, _VIRTFN_ID_LEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VIRTFN_ID_LEN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mov	x9, x8
Lloh9:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh10:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldr	x25, [x0, #48]
	ldr	w20, [x0, #4]
	bl	_pci_iov_virtfn_bus
	mov	x1, x0
	mov	x0, x20
	bl	_virtfn_add_bus
	cbz	x0, LBB0_16
; %bb.1:
	mov	x20, x0
	bl	_pci_alloc_dev
	cbz	x0, LBB0_15
; %bb.2:
	mov	x22, x0
	mov	x0, x19
	mov	x1, x23
	bl	_pci_iov_virtfn_devfn
	str	w0, [x22, #44]
	ldr	w8, [x19, #40]
	ldr	w9, [x25]
	stp	w9, w8, [x22, #36]
	mov	w8, #1
	str	w8, [x22]
	mov	x0, x19
	bl	_pci_dev_get
	str	w0, [x22, #32]
	cbnz	w23, LBB0_4
; %bb.3:
	mov	x0, x22
	bl	_pci_read_vf_config_common
LBB0_4:
	mov	x0, x22
	bl	_pci_setup_device
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.5:
	ldr	w8, [x19, #12]
	str	w8, [x22, #12]
	str	xzr, [x22, #24]
Lloh11:
	adrp	x25, _PCI_SRIOV_NUM_BARS@GOTPAGE
Lloh12:
	ldr	x25, [x25, _PCI_SRIOV_NUM_BARS@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.6:
	mov	x26, #0
	mov	x27, #0
Lloh13:
	adrp	x28, _PCI_IOV_RESOURCES@GOTPAGE
Lloh14:
	ldr	x28, [x28, _PCI_IOV_RESOURCES@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x27, x27, #1
	add	x26, x26, #32
	cmp	x27, w8, sxtw
	b.ge	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #16]
	ldrsw	x10, [x28]
	add	x10, x27, x10
	add	x24, x9, x10, lsl #5
	ldr	w9, [x24, #24]
	cbz	w9, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x22
	bl	_pci_name
	ldr	x8, [x22, #16]
	add	x8, x8, x26
	ldr	w9, [x24, #16]
	stp	w9, w0, [x8, #16]
	ldr	w8, [x28]
	add	w1, w27, w8
	mov	x0, x19
	bl	_pci_iov_resource_size
	ldr	x8, [x24]
	mul	w9, w0, w23
	add	x8, x8, w9, sxtw
	ldr	x9, [x22, #16]
	add	x1, x9, x26
	add	x9, x8, w0, sxtw
	sub	x9, x9, #1
	stp	x8, x9, [x1]
	mov	x0, x24
	bl	_request_resource
	bl	_BUG_ON
	ldr	w8, [x25]
	b	LBB0_7
LBB0_10:
	ldr	w1, [x22, #4]
	mov	x0, x22
	bl	_pci_device_add
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_sprintf
	add	x23, x19, #8
	add	x25, x22, #8
	mov	x0, x23
	mov	x1, x25
	mov	x2, x21
	bl	_sysfs_create_link
	mov	x24, x0
	cbnz	w0, LBB0_13
; %bb.11:
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x25
	mov	x1, x23
	bl	_sysfs_create_link
	mov	x24, x0
	cbz	w0, LBB0_18
; %bb.12:
	mov	x0, x23
	mov	x1, x21
	bl	_sysfs_remove_link
LBB0_13:
	mov	x0, x22
	bl	_pci_stop_and_remove_bus_device
LBB0_14:
	mov	x0, x19
	bl	_pci_dev_put
LBB0_15:
	ldr	w0, [x19, #4]
	mov	x1, x20
	bl	_virtfn_remove_bus
LBB0_16:
	ldur	x8, [x29, #-88]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.17:
	mov	x0, x24
	sub	sp, x29, #80
	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_18:
Lloh22:
	adrp	x8, _KOBJ_CHANGE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _KOBJ_CHANGE@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x25
	bl	_kobject_uevent
	mov	x0, x22
	bl	_pci_bus_add_device
	b	LBB0_16
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VIRTFN_ID_LEN,4,2              ; @VIRTFN_ID_LEN
	.comm	_PCI_SRIOV_NUM_BARS,4,2         ; @PCI_SRIOV_NUM_BARS
	.comm	_PCI_IOV_RESOURCES,4,2          ; @PCI_IOV_RESOURCES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"virtfn%u"

l_.str.1:                               ; @.str.1
	.asciz	"physfn"

	.comm	_KOBJ_CHANGE,4,2                ; @KOBJ_CHANGE
.subsections_via_symbols
