	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scif_init_p2p_info
_scif_init_p2p_info:                    ## @scif_init_p2p_info
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rsi), %r14
	movq	16(%r14), %rax
	movl	(%rax), %r15d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r13
	movb	(%r13), %cl
	sarl	%cl, %r15d
	movq	8(%r14), %rax
	movl	(%rax), %r12d
	sarl	%cl, %r12d
	movq	8(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %rbx
	movq	16(%r14), %rax
	movl	4(%rax), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	callq	_scif_p2p_setsg
	movq	16(%rbx), %rdx
	movq	_SCIF_PPI_MMIO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, (%rdx,%rcx,8)
	movq	16(%rbx), %rax
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_7
## %bb.2:
	movq	(%rbx), %rax
	movl	%r15d, (%rax,%rcx,4)
	movq	8(%r14), %rax
	movl	(%rax), %edi
	movl	$1073741824, %esi               ## imm = 0x40000000
	callq	_min
	movl	%eax, %edi
	callq	_get_order
	movl	%eax, %ecx
	subl	(%r13), %ecx
	movl	%r12d, %r13d
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %r13d
	movq	8(%r14), %rcx
	movl	4(%rcx), %edi
	movl	$1, %esi
	movl	%eax, %ecx
	shll	%cl, %esi
	movl	%r13d, %edx
	callq	_scif_p2p_setsg
	movq	16(%rbx), %rcx
	movq	_SCIF_PPI_APER@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	(%rbx), %rax
	movl	%r13d, (%rax,%rdx,4)
	movq	16(%rbx), %rax
	movq	_SCIF_PPI_MMIO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rsi
	movq	_PCI_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_dma_map_sg
	cmpl	%r15d, %eax
	jne	LBB0_6
## %bb.3:
	movq	16(%rbx), %rax
	movq	_SCIF_PPI_APER@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rsi
	movq	_PCI_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_dma_map_sg
	movq	16(%rbx), %rdx
	movq	_SCIF_PPI_MMIO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rdx,%rcx,8), %rsi
	cmpl	%r13d, %eax
	jne	LBB0_5
## %bb.4:
	movq	%rsi, %rdi
	callq	_sg_dma_address
	movq	32(%rbx), %rcx
	movq	_SCIF_PPI_MMIO@GOTPCREL(%rip), %r14
	movq	(%r14), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	16(%rbx), %rax
	movq	_SCIF_PPI_APER@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_sg_dma_address
	movq	32(%rbx), %rcx
	movq	(%r13), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	8(%rbx), %rax
	movq	(%r14), %rcx
	movl	%r15d, (%rax,%rcx,4)
	movl	%r12d, (%rax,%rdx,4)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	jmp	LBB0_9
LBB0_5:
	movq	(%rbx), %rax
	movl	(%rax,%rcx,4), %edx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_dma_unmap_sg
LBB0_6:
	movq	16(%rbx), %rax
	movq	_SCIF_PPI_MMIO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_scif_p2p_freesg
	movq	16(%rbx), %rax
	movq	_SCIF_PPI_APER@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_scif_p2p_freesg
LBB0_7:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_8:
	xorl	%ebx, %ebx
LBB0_9:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_SCIF_PPI_MMIO,8,3              ## @SCIF_PPI_MMIO
	.comm	_SCIF_PPI_APER,8,3              ## @SCIF_PPI_APER
	.comm	_PCI_DMA_BIDIRECTIONAL,4,2      ## @PCI_DMA_BIDIRECTIONAL
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.no_dead_strip	_scif_init_p2p_info
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scif_init_p2p_info
_scif_init_p2p_info:                    ; @scif_init_p2p_info
	.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
	ldr	x26, [x1, #8]
	ldr	x21, [x0, #8]
Lloh0:
	adrp	x23, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PAGE_SHIFT@GOTPAGEOFF]
	ldp	x9, x8, [x26, #8]
	ldr	w22, [x8]
	ldr	w25, [x23]
	ldr	w27, [x9]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_8
; %bb.1:
	asr	w22, w22, w25
	ldr	x8, [x26, #16]
	ldr	w0, [x8, #4]
Lloh5:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x2, x22
	bl	_scif_p2p_setsg
	ldr	x9, [x19, #16]
Lloh8:
	adrp	x24, _SCIF_PPI_MMIO@GOTPAGE
Lloh9:
	ldr	x24, [x24, _SCIF_PPI_MMIO@GOTPAGEOFF]
	ldr	x8, [x24]
	lsl	x10, x8, #3
	str	x0, [x9, x10]
	ldr	x9, [x19, #16]
	ldr	x9, [x9, x10]
	cbz	x9, LBB0_7
; %bb.2:
	asr	w25, w27, w25
	ldr	x9, [x19]
	str	w22, [x9, x8, lsl #2]
	ldr	x8, [x26, #8]
	ldr	w0, [x8]
	mov	w1, #1073741824
	bl	_min
	bl	_get_order
	ldr	w8, [x23]
	sub	w8, w0, w8
	asr	w23, w25, w8
	ldr	x8, [x26, #8]
	ldr	w8, [x8, #4]
	mov	w9, #1
	lsl	w1, w9, w0
	mov	x0, x8
	mov	x2, x23
	bl	_scif_p2p_setsg
	ldr	x8, [x19, #16]
Lloh10:
	adrp	x26, _SCIF_PPI_APER@GOTPAGE
Lloh11:
	ldr	x26, [x26, _SCIF_PPI_APER@GOTPAGEOFF]
	ldr	x9, [x26]
	str	x0, [x8, x9, lsl #3]
	ldr	x8, [x19]
	str	w23, [x8, x9, lsl #2]
	ldr	x8, [x19, #16]
	ldr	x9, [x24]
	ldr	x1, [x8, x9, lsl #3]
Lloh12:
	adrp	x27, _PCI_DMA_BIDIRECTIONAL@GOTPAGE
Lloh13:
	ldr	x27, [x27, _PCI_DMA_BIDIRECTIONAL@GOTPAGEOFF]
	ldr	w3, [x27]
	mov	x0, x21
	mov	x2, x22
	bl	_dma_map_sg
	cmp	w0, w22
	b.ne	LBB0_6
; %bb.3:
	ldr	x8, [x19, #16]
	ldr	x9, [x26]
	ldr	x1, [x8, x9, lsl #3]
	ldr	w3, [x27]
	mov	x0, x21
	mov	x2, x23
	bl	_dma_map_sg
	ldr	x9, [x19, #16]
	ldr	x8, [x24]
	ldr	x1, [x9, x8, lsl #3]
	cmp	w0, w23
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x1
	bl	_sg_dma_address
	ldr	x8, [x19, #32]
	ldr	x9, [x24]
	str	x0, [x8, x9, lsl #3]
	ldr	x8, [x19, #16]
	ldr	x9, [x26]
	ldr	x0, [x8, x9, lsl #3]
	bl	_sg_dma_address
	ldr	x8, [x19, #32]
	ldr	x9, [x26]
	str	x0, [x8, x9, lsl #3]
	ldr	x8, [x19, #8]
	ldr	x10, [x24]
	str	w22, [x8, x10, lsl #2]
	str	w25, [x8, x9, lsl #2]
	ldr	w8, [x20]
	str	w8, [x19, #24]
	b	LBB0_8
LBB0_5:
	ldr	x9, [x19]
	ldr	w2, [x9, x8, lsl #2]
Lloh14:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_dma_unmap_sg
LBB0_6:
	ldr	x8, [x19, #16]
	ldr	x9, [x24]
	ldr	x0, [x8, x9, lsl #3]
	bl	_scif_p2p_freesg
	ldr	x8, [x19, #16]
	ldr	x9, [x26]
	ldr	x0, [x8, x9, lsl #3]
	bl	_scif_p2p_freesg
LBB0_7:
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
LBB0_8:
	mov	x0, x19
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_SCIF_PPI_MMIO,8,3              ; @SCIF_PPI_MMIO
	.comm	_SCIF_PPI_APER,8,3              ; @SCIF_PPI_APER
	.comm	_PCI_DMA_BIDIRECTIONAL,4,2      ; @PCI_DMA_BIDIRECTIONAL
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.no_dead_strip	_scif_init_p2p_info
.subsections_via_symbols
