	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_p2pmem_find_many           ## -- Begin function pci_p2pmem_find_many
	.p2align	4, 0x90
_pci_p2pmem_find_many:                  ## @pci_p2pmem_find_many
	.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
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	_PCI_ANY_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%r15d, %r15d
	movl	%edi, %esi
	xorl	%edx, %edx
	callq	_pci_get_device
	testq	%rax, %rax
	je	LBB0_22
## %bb.3:
	movq	%rax, %r14
	xorl	%ebx, %ebx
	sarl	$3, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_PCI_ANY_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, %esi
	movq	%r14, %rdx
	callq	_pci_get_device
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_6
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
	movq	%r14, %rdi
	callq	_pci_has_p2pmem
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	setl	%r13b
	movq	%r14, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	xorl	%ecx, %ecx
	callq	_pci_p2pdma_distance_many
	movl	%eax, %r15d
	cmpl	%r12d, %eax
	setne	%al
	testl	%r15d, %r15d
	js	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%r12d, %r15d
	jg	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	orb	%r13b, %al
	je	LBB0_5
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%r12d, %r15d
	jge	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r12d, %r12d
	testl	%ebx, %ebx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jle	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r13,%rbx,8), %rdi
	callq	_pci_dev_put
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r12d, %r12d
	jmp	LBB0_16
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%r12d, %r15d
	movl	%ebx, %r12d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_16:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_pci_dev_get
	movslq	%r12d, %rcx
	incl	%r12d
	movq	%rax, (%r13,%rcx,8)
	movq	_PCI_ANY_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, %esi
	movq	%r14, %rdx
	callq	_pci_get_device
	movq	%rax, %r14
	movl	%r12d, %ebx
	movl	%r12d, %eax
	movl	%r15d, %r12d
	testq	%r14, %r14
	jne	LBB0_4
	jmp	LBB0_17
LBB0_6:
	movl	%ebx, %eax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_17:
	testl	%eax, %eax
	je	LBB0_18
## %bb.19:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_prandom_u32_max
	movq	(%r13,%rax,8), %rdi
	callq	_pci_dev_get
	movq	%rax, %r15
	testl	%ebx, %ebx
	jle	LBB0_22
## %bb.20:
	movl	%ebx, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13,%rbx,8), %rdi
	callq	_pci_dev_put
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_21
	jmp	LBB0_22
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_23
LBB0_18:
	xorl	%r15d, %r15d
LBB0_22:
	movq	%r13, %rdi
	callq	_kfree
LBB0_23:
	movq	%r15, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PCI_ANY_ID,4,2                 ## @PCI_ANY_ID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_p2pmem_find_many           ; -- Begin function pci_p2pmem_find_many
	.p2align	2
_pci_p2pmem_find_many:                  ; @pci_p2pmem_find_many
	.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, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w27, [x8]
Lloh3:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_kmalloc
	cbz	x0, LBB0_20
; %bb.1:
	mov	x19, x0
Lloh9:
	adrp	x25, _PCI_ANY_ID@GOTPAGE
Lloh10:
	ldr	x25, [x25, _PCI_ANY_ID@GOTPAGEOFF]
	ldr	w0, [x25]
	mov	x1, x0
	mov	x2, #0
	bl	_pci_get_device
	cbz	x0, LBB0_21
; %bb.2:
	mov	x22, x0
	mov	w28, #0
	asr	w26, w23, #3
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x25]
	mov	x1, x0
	mov	x2, x22
	bl	_pci_get_device
	mov	x22, x0
	cbz	x0, LBB0_15
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	mov	x0, x22
	bl	_pci_has_p2pmem
	cbz	w0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	w3, #0
	bl	_pci_p2pdma_distance_many
	cmp	w0, w27
	ccmp	w28, w26, #8, eq
	cset	w8, lt
	tbnz	w0, #31, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x0
	cmp	w0, w27
	b.gt	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	w8, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w23, w27
	b.ge	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w28, #1
	b.lt	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w24, w28
	mov	x27, x19
LBB0_11:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x27], #8
	bl	_pci_dev_put
	subs	x24, x24, #1
	b.ne	LBB0_11
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w28, #0
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x27
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x22
	bl	_pci_dev_get
	add	w24, w28, #1
	str	x0, [x19, w28, sxtw #3]
	ldr	w0, [x25]
	mov	x1, x0
	mov	x2, x22
	bl	_pci_get_device
	mov	x22, x0
	mov	x28, x24
	mov	x27, x23
	cbnz	x0, LBB0_4
	b	LBB0_16
LBB0_15:
	mov	x24, x28
LBB0_16:
	cbz	w24, LBB0_21
; %bb.17:
	mov	x0, x24
	bl	_prandom_u32_max
	ldr	x0, [x19, x0, lsl #3]
	bl	_pci_dev_get
	mov	x20, x0
	cmp	w24, #1
	b.lt	LBB0_22
; %bb.18:
	mov	w21, w24
	mov	x22, x19
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x22], #8
	bl	_pci_dev_put
	subs	x21, x21, #1
	b.ne	LBB0_19
	b	LBB0_22
LBB0_20:
	mov	x20, #0
	b	LBB0_23
LBB0_21:
	mov	x20, #0
LBB0_22:
	mov	x0, x19
	bl	_kfree
LBB0_23:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PCI_ANY_ID,4,2                 ; @PCI_ANY_ID
.subsections_via_symbols
