	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sglist_add_mapping
_sglist_add_mapping:                    ## @sglist_add_mapping
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movslq	(%rsi), %rbx
	movq	_MAX_SGLIST_ENTRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	cmpl	%eax, %ebx
	jge	LBB0_2
## %bb.1:
	movq	%rcx, %r14
	movq	%rsi, %r15
	movq	8(%rsi), %r12
	movq	%rdx, %rdi
	callq	_cpu_to_le32
	shlq	$4, %rbx
	movq	%rax, 8(%r12,%rbx)
	movq	%r14, %rdi
	callq	_cpu_to_le32
	movq	%rax, (%r12,%rbx)
	incl	(%r15)
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_DE_ACT
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_SGLIST_ENTRIES,4,2         ## @MAX_SGLIST_ENTRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SGlist: too many fragments\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_sglist_add_mapping
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sglist_add_mapping
_sglist_add_mapping:                    ; @sglist_add_mapping
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldrsw	x21, [x1]
Lloh0:
	adrp	x8, _MAX_SGLIST_ENTRIES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_SGLIST_ENTRIES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w8, w8, #1
	cmp	w21, w8
	b.ge	LBB0_2
; %bb.1:
	mov	x20, x3
	mov	x19, x1
	ldr	x22, [x1, #8]
	mov	x0, x2
	bl	_cpu_to_le32
	add	x21, x22, x21, lsl #4
	str	x0, [x21, #8]
	mov	x0, x20
	bl	_cpu_to_le32
	mov	x8, x0
	mov	w0, #0
	str	x8, [x21]
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
	b	LBB0_3
LBB0_2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DE_ACT
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_SGLIST_ENTRIES,4,2         ; @MAX_SGLIST_ENTRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SGlist: too many fragments\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_sglist_add_mapping
.subsections_via_symbols
