	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ib_umem_add_sg_table
_ib_umem_add_sg_table:                  ## @ib_umem_add_sg_table
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -120(%rbp)                 ## 8-byte Spill
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r14
	movq	%rsi, %r13
	movq	%rdi, %r15
	callq	_sg_page
	xorl	%ecx, %ecx
	testq	%rax, %rax
	sete	%r12b
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_sg_page
	movq	%rax, %rdi
	callq	_page_to_pfn
	movq	%r14, %rbx
	movl	(%r15), %r14d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrq	%cl, %r14
	addq	%rax, %r14
	movq	(%r13), %rdi
	callq	_page_to_pfn
	xorl	%edx, %edx
	cmpq	%rax, %r14
	movl	$0, %ecx
	movq	%rbx, %r14
	sete	%dl
	testq	%r14, %r14
	jne	LBB0_4
	jmp	LBB0_23
LBB0_1:
	xorl	%edx, %edx
	testq	%r14, %r14
	je	LBB0_23
LBB0_4:
	movb	%r12b, %cl
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movq	%r14, %rax
	negq	%rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rdi
	callq	_sg_page
	movl	(%r15), %edx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shlq	%cl, %r13
	addq	%rdx, %r13
	movq	%r15, %rdi
	movq	%rax, %rsi
LBB0_22:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	callq	_sg_set_page
	xorl	%edx, %edx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	cmpq	%r14, %rbx
	movq	%r12, %r13
	je	LBB0_23
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	(%r13,%rbx,8), %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	callq	_page_to_pfn
	cmpq	%r14, %rbx
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %r12
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%rax, %r12
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	subq	%rbx, %r14
	movq	%r14, -112(%rbp)                ## 8-byte Spill
	movq	-104(%rbp), %rax                ## 8-byte Reload
	addq	%rbx, %rax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	movq	%r13, %r14
	leaq	(,%rbx,8), %r14
	addq	%r13, %r14
	movq	%rbx, %r15
	xorl	%r13d, %r13d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leaq	(%r12,%r13), %rbx
	movq	(%r14,%r13,8), %rdi
	callq	_page_to_pfn
	cmpq	%rax, %rbx
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=2
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	shrq	%cl, %rax
	cmpq	%rax, %r13
	jae	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=2
	incq	%r15
	incq	%r13
	movq	-128(%rbp), %rax                ## 8-byte Reload
	addq	%r13, %rax
	jne	LBB0_8
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	-112(%rbp), %r13                ## 8-byte Reload
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_15
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	addq	%r13, -56(%rbp)                 ## 8-byte Folded Spill
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movq	-80(%rbp), %r14                 ## 8-byte Reload
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-72(%rbp), %r12                 ## 8-byte Reload
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	je	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	-64(%rbp), %eax                 ## 4-byte Reload
                                        ## kill: def $eax killed $eax def $rax
	subl	(%r15), %eax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	%r13, %rdx
	shlq	%cl, %rdx
	cmpq	%rax, %rdx
	jbe	LBB0_18
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rdi
	callq	_sg_next
	movq	%rax, %r15
LBB0_21:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movq	-120(%rbp), %rax                ## 8-byte Reload
	incl	(%rax)
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %r13
	movl	$0, -60(%rbp)                   ## 4-byte Folded Spill
	movq	%r15, %rdi
	jmp	LBB0_22
LBB0_23:
	movq	%r15, %rax
	addq	$88, %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
	.no_dead_strip	_ib_umem_add_sg_table
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ib_umem_add_sg_table
_ib_umem_add_sg_table:                  ; @ib_umem_add_sg_table
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	str	x4, [sp, #48]                   ; 8-byte Folded Spill
	str	w3, [sp, #44]                   ; 4-byte Folded Spill
	mov	x22, x2
	mov	x26, x1
	mov	x21, x0
	bl	_sg_page
	cmp	x0, #0
	cset	w24, eq
Lloh0:
	adrp	x27, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x27, [x27, _PAGE_SHIFT@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_sg_page
	bl	_page_to_pfn
	ldr	w8, [x21]
	ldr	w9, [x27]
	lsr	x8, x8, x9
	add	x19, x0, x8
	ldr	x0, [x26]
	bl	_page_to_pfn
	cmp	x19, x0
	cset	w23, eq
	cbnz	x22, LBB0_3
	b	LBB0_21
LBB0_2:
	mov	w23, #0
	cbz	x22, LBB0_21
LBB0_3:
	mov	x20, #0
	neg	x8, x22
	stp	x22, x8, [sp, #16]              ; 16-byte Folded Spill
	ldr	w8, [sp, #44]                   ; 4-byte Folded Reload
	mov	w28, w8
	str	x26, [sp, #8]                   ; 8-byte Folded Spill
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	bl	_sg_page
	mov	x1, x0
	ldr	w8, [x21]
	ldr	w9, [x27]
	lsl	x9, x19, x9
	add	x2, x9, x8
	mov	x0, x21
	mov	w3, #0
	bl	_sg_set_page
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	w23, #0
	cmp	x20, x22
	b.eq	LBB0_21
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	x0, [x26, x20, lsl #3]
	str	x0, [sp, #72]                   ; 8-byte Folded Spill
	bl	_page_to_pfn
	cmp	x20, x22
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x19, #0
	mov	x20, x22
	cbnz	w23, LBB0_17
	b	LBB0_18
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x25, x0
	str	w24, [sp, #60]                  ; 4-byte Folded Spill
	mov	x24, x27
	str	x21, [sp, #64]                  ; 8-byte Folded Spill
	mov	x19, #0
	sub	x8, x22, x20
	str	x8, [sp, #32]                   ; 8-byte Folded Spill
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	add	x27, x8, x20
	mov	x22, x20
	add	x21, x26, x20, lsl #3
LBB0_9:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x26, x25, x19
	ldr	x0, [x21, x19, lsl #3]
	bl	_page_to_pfn
	cmp	x26, x0
	b.ne	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	w8, [x24]
	lsr	x8, x28, x8
	cmp	x19, x8
	b.hs	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	add	x22, x22, #1
	add	x19, x19, #1
	cmn	x27, x19
	b.ne	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x22, [sp, #16]                  ; 8-byte Folded Reload
	mov	x20, x22
	ldr	x19, [sp, #32]                  ; 8-byte Folded Reload
	ldr	x21, [sp, #64]                  ; 8-byte Folded Reload
	b	LBB0_16
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x20, x22
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x20, x20, x19
LBB0_15:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x21, [sp, #64]                  ; 8-byte Folded Reload
	ldr	x22, [sp, #16]                  ; 8-byte Folded Reload
LBB0_16:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x26, [sp, #8]                   ; 8-byte Folded Reload
	mov	x27, x24
	ldr	w24, [sp, #60]                  ; 4-byte Folded Reload
	cbz	w23, LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x21]
	ldr	w9, [x27]
	lsl	x9, x19, x9
	ldr	w10, [sp, #44]                  ; 4-byte Folded Reload
	sub	w8, w10, w8
	cmp	x9, x8
	b.ls	LBB0_4
LBB0_18:                                ;   in Loop: Header=BB0_6 Depth=1
	cbnz	w24, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	bl	_sg_next
	mov	x21, x0
LBB0_20:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x1, [sp, #72]                   ; 8-byte Folded Reload
	ldr	x9, [sp, #48]                   ; 8-byte Folded Reload
	ldr	w8, [x9]
	add	w8, w8, #1
	str	w8, [x9]
	ldr	w8, [x27]
	lsl	x2, x19, x8
	mov	x0, x21
	mov	w3, #0
	bl	_sg_set_page
	mov	w24, #0
	b	LBB0_5
LBB0_21:
	mov	x0, x21
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_ib_umem_add_sg_table
.subsections_via_symbols
