	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_sham_align_sgs
_omap_sham_align_sgs:                   ## @omap_sham_align_sgs
	.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
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.1:
	movl	%esi, %ebx
	testl	%esi, %esi
	je	LBB0_20
## %bb.2:
	movq	%rdi, %r15
	cmpl	$0, (%rdi)
	je	LBB0_20
## %bb.3:
	movl	%edx, %r12d
	movl	(%r8), %r13d
	testl	%ecx, %ecx
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	je	LBB0_5
## %bb.4:
	movl	%ebx, %edi
	movl	%r12d, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ecx
	imull	%r12d, %ecx
	jmp	LBB0_6
LBB0_5:
	leal	-1(%rbx), %ecx
	movl	%ecx, %eax
	cltd
	idivl	%r12d
	subl	%edx, %ecx
LBB0_6:
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ecx
	orl	%r13d, %ecx
	setne	-41(%rbp)                       ## 1-byte Folded Spill
	xorl	%r14d, %r14d
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_7 Depth=1
	subl	%eax, %ebx
	xorl	%r13d, %r13d
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rdi
	callq	_sg_next
	movq	%rax, %r15
	incl	%r14d
	testl	%ebx, %ebx
	js	LBB0_16
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	testl	%ebx, %ebx
	jle	LBB0_18
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	testq	%r15, %r15
	je	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	(%r15), %r13d
	jge	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	4(%r15), %edi
	addl	%r13d, %edi
	movl	$4, %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	je	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r15), %edi
	subl	%r13d, %edi
	movl	%r12d, %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	je	LBB0_17
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r15), %eax
	testl	%r13d, %r13d
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	subl	%eax, %r13d
	movl	%r13d, %eax
	sarl	$31, %eax
	andl	%r13d, %eax
	addl	%eax, %ebx
	testl	%r13d, %r13d
	movl	$0, %eax
	cmovlel	%eax, %r13d
	jmp	LBB0_15
LBB0_18:
	cmpb	$0, -41(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_19
LBB0_16:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_omap_sham_copy_sg_lists        ## TAILCALL
LBB0_17:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_omap_sham_copy_sgs             ## TAILCALL
LBB0_19:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, 4(%rax)
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 8(%rax)
LBB0_20:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ZONE_DMA,8,3                   ## @ZONE_DMA
	.no_dead_strip	_omap_sham_align_sgs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_sham_align_sgs
_omap_sham_align_sgs:                   ; @omap_sham_align_sgs
	.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
	cbz	x0, LBB0_17
; %bb.1:
	mov	x22, x1
	cbz	w1, LBB0_17
; %bb.2:
	mov	x21, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_17
; %bb.3:
	mov	x19, x4
	mov	x20, x2
	ldr	w25, [x4]
	cbz	w3, LBB0_5
; %bb.4:
	mov	x0, x22
	mov	x1, x20
	bl	_DIV_ROUND_UP
	mul	w23, w0, w20
	b	LBB0_6
LBB0_5:
	sub	w8, w22, #1
	sdiv	w8, w8, w20
	mul	w23, w8, w20
LBB0_6:
	mov	w26, #0
	cmp	w23, w22
	ccmp	w25, #0, #0, eq
	cset	w27, ne
	mov	x24, x21
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x24]
	sub	w9, w22, w8
	sub	w8, w25, w8
	cmp	w8, #0
	csel	w10, w8, wzr, lt
	add	w10, w10, w22
	csel	w8, w8, wzr, gt
	cmp	w25, #0
	csel	w22, w9, w10, eq
	csel	w25, wzr, w8, eq
	mov	x0, x24
	bl	_sg_next
	mov	x24, x0
	add	w26, w26, #1
	tbnz	w22, #31, LBB0_15
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w22, #1
	b.lt	LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	x24, LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x24]
	cmp	w25, w8
	b.ge	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x24, #4]
	add	w0, w8, w25
	mov	w1, #4
	bl	_IS_ALIGNED
	cbz	w0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x24]
	sub	w0, w8, w25
	mov	x1, x20
	bl	_IS_ALIGNED
	cbnz	w0, LBB0_7
LBB0_13:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	x3, x23
	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
	b	_omap_sham_copy_sgs
LBB0_14:
	cbz	w27, LBB0_16
LBB0_15:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	x3, x23
	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
	b	_omap_sham_copy_sg_lists
LBB0_16:
	str	w26, [x19, #4]
	str	x21, [x19, #8]
LBB0_17:
	mov	w0, #0
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_ZONE_DMA,8,3                   ; @ZONE_DMA
	.no_dead_strip	_omap_sham_align_sgs
.subsections_via_symbols
