	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _bus_dmamap_addseg
__bus_dmamap_addseg:                    ## @_bus_dmamap_addseg
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movl	%ecx, %r12d
	movl	%edx, %ebx
	movq	%rdi, %r13
	movl	(%rdi), %eax
	movl	%eax, %r14d
	negl	%r14d
	testl	%eax, %eax
	jle	LBB0_2
## %bb.1:
	addl	%ebx, %eax
	andl	%r14d, %eax
	subl	%ebx, %eax
	cmpl	%r12d, %eax
	cmovll	%eax, %r12d
LBB0_2:
	movq	16(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.3:
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movl	12(%r13), %esi
	movl	%ebx, %edx
	callq	__bus_dma_inrange
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	subl	4(%rax), %ebx
	addl	(%rax), %ebx
	movq	-48(%rbp), %r8                  ## 8-byte Reload
LBB0_6:
	movslq	(%r15), %rcx
	testq	%rcx, %rcx
	js	LBB0_12
## %bb.7:
	movl	%ecx, %eax
	movl	(%r8,%rax,8), %esi
	movl	4(%r8,%rax,8), %edx
	leal	(%rdx,%rsi), %edi
	cmpl	%edi, %ebx
	jne	LBB0_12
## %bb.8:
	addl	%r12d, %edx
	cmpl	4(%r13), %edx
	jg	LBB0_12
## %bb.9:
	cmpl	$0, (%r13)
	je	LBB0_11
## %bb.10:
	xorl	%ebx, %esi
	testl	%r14d, %esi
	je	LBB0_11
LBB0_12:
	leal	1(%rcx), %edx
	xorl	%eax, %eax
	cmpl	8(%r13), %edx
	jge	LBB0_15
## %bb.13:
	movl	%ebx, 8(%r8,%rcx,8)
	movl	%r12d, 12(%r8,%rcx,8)
	movl	%edx, %ecx
LBB0_14:
	movl	%ecx, (%r15)
	movl	%r12d, %eax
	jmp	LBB0_15
LBB0_4:
	xorl	%eax, %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	%edx, 4(%r8,%rax,8)
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	__bus_dmamap_addseg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _bus_dmamap_addseg
__bus_dmamap_addseg:                    ; @_bus_dmamap_addseg
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x5
	mov	x21, x4
	mov	x22, x2
	mov	x23, x0
	ldr	w8, [x0]
	neg	w24, w8
	add	w9, w8, w2
	and	w9, w9, w24
	sub	w9, w9, w2
	cmp	w9, w3
	csel	w9, w9, w3, lt
	cmp	w8, #1
	csel	w20, w3, w9, lt
	ldr	x0, [x0, #16]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w1, [x23, #12]
	mov	x2, x22
	bl	__bus_dma_inrange
	cbz	x0, LBB0_11
; %bb.2:
	ldp	w9, w8, [x0]
	sub	w8, w22, w8
	add	w22, w8, w9
LBB0_3:
	ldr	w8, [x19]
	tbnz	w8, #31, LBB0_8
; %bb.4:
	lsl	x10, x8, #3
	add	x9, x21, x10
	ldr	w10, [x21, x10]
	ldr	w11, [x9, #4]!
	add	w12, w11, w10
	cmp	w22, w12
	b.ne	LBB0_8
; %bb.5:
	ldr	w12, [x23, #4]
	add	w11, w11, w20
	cmp	w11, w12
	b.gt	LBB0_8
; %bb.6:
	ldr	w12, [x23]
	cbz	w12, LBB0_13
; %bb.7:
	eor	w10, w10, w22
	tst	w10, w24
	b.eq	LBB0_13
LBB0_8:
	add	w8, w8, #1
	ldr	w9, [x23, #8]
	cmp	w8, w9
	b.ge	LBB0_11
; %bb.9:
	add	x9, x21, w8, sxtw #3
	stp	w22, w20, [x9]
LBB0_10:
	str	w8, [x19]
	b	LBB0_12
LBB0_11:
	mov	w20, #0
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
	str	w11, [x9]
	b	LBB0_10
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	__bus_dmamap_addseg
.subsections_via_symbols
