	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d40_size_2_dmalen
_d40_size_2_dmalen:                     ## @d40_size_2_dmalen
	.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
	movl	%edx, %r15d
	movl	%esi, %ebx
	movl	%edi, %r14d
	movl	%esi, %edi
	movl	%edx, %esi
	callq	_max
	movl	%eax, %r12d
	movl	%ebx, %edi
	movl	%r15d, %esi
	callq	_min
	movq	_STEDMA40_MAX_SEG_SIZE@GOTPCREL(%rip), %rbx
	imull	(%rbx), %eax
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_ALIGN
	movl	%eax, %r13d
	xorl	%r15d, %r15d
	cmpl	(%rbx), %eax
	movl	$0, %ebx
	cmovgl	%r12d, %ebx
	movl	%r14d, %edi
	movl	%r12d, %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	subl	%ebx, %r13d
	movl	$1, %r15d
	cmpl	%r14d, %r13d
	jge	LBB0_4
## %bb.3:
	movl	%r14d, %eax
	cltd
	idivl	%r13d
	imull	%eax, %r13d
	xorl	%r15d, %r15d
	cmpl	%r14d, %r13d
	setl	%r15b
	addl	%eax, %r15d
	jmp	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STEDMA40_MAX_SEG_SIZE,4,2      ## @STEDMA40_MAX_SEG_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_d40_size_2_dmalen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d40_size_2_dmalen
_d40_size_2_dmalen:                     ; @d40_size_2_dmalen
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	mov	x0, x1
	mov	x1, x2
	bl	_max
	mov	x22, x0
	mov	x0, x21
	mov	x1, x20
	bl	_min
Lloh0:
	adrp	x21, _STEDMA40_MAX_SEG_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _STEDMA40_MAX_SEG_SIZE@GOTPAGEOFF]
	ldr	w8, [x21]
	mul	w0, w8, w0
	mov	x1, x22
	bl	_ALIGN
	mov	x20, x0
	ldr	w8, [x21]
	cmp	w0, w8
	csel	w21, w22, wzr, gt
	mov	x0, x19
	mov	x1, x22
	bl	_IS_ALIGNED
	cbz	w0, LBB0_3
; %bb.1:
	sub	w8, w20, w21
	cmp	w8, w19
	b.ge	LBB0_4
; %bb.2:
	sdiv	w9, w19, w8
	mul	w8, w9, w8
	cmp	w8, w19
	cinc	w0, w9, lt
	b	LBB0_5
LBB0_3:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_4:
	mov	w0, #1
LBB0_5:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_STEDMA40_MAX_SEG_SIZE,4,2      ; @STEDMA40_MAX_SEG_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_d40_size_2_dmalen
.subsections_via_symbols
