	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_smc_cs_encode_ncycles
_atmel_smc_cs_encode_ncycles:           ## @atmel_smc_cs_encode_ncycles
	.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	%r8, -48(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r12d
	movl	%edx, %ebx
	movl	%esi, %r15d
	movl	%edi, %r14d
	leal	-1(%r15), %edi
	xorl	%esi, %esi
	callq	_GENMASK
	movl	%eax, %r13d
	decl	%ebx
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	movl	%eax, %ecx
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%r12d
	xorl	%edi, %edi
	cmpl	%r13d, %edx
	seta	%dil
	movl	$0, %ebx
	cmoval	%ebx, %edx
	movq	_ERANGE@GOTPCREL(%rip), %r8
	xorl	%esi, %esi
	subl	(%r8), %esi
	addl	%eax, %edi
	cmpl	%ecx, %edi
	cmovael	%ecx, %edi
	cmoval	%r13d, %edx
	cmovbel	%ebx, %esi
	movl	%r15d, %ecx
	shll	%cl, %edi
	orl	%edx, %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%edi, (%rax)
	movl	%esi, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERANGE,4,2                     ## @ERANGE
	.no_dead_strip	_atmel_smc_cs_encode_ncycles
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_smc_cs_encode_ncycles
_atmel_smc_cs_encode_ncycles:           ; @atmel_smc_cs_encode_ncycles
	.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, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	sub	w0, w1, #1
	mov	w1, #0
	bl	_GENMASK
	mov	x24, x0
	sub	w0, w21, #1
	mov	w1, #0
	bl	_GENMASK
	udiv	w8, w23, w20
	msub	w9, w8, w20, w23
	cmp	w9, w24
	csel	w9, wzr, w9, hi
	cinc	w8, w8, hi
Lloh0:
	adrp	x10, _ERANGE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _ERANGE@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	cmp	w8, w0
	csel	w8, w8, w0, lo
	csel	w9, w24, w9, hi
	csneg	w0, wzr, w10, ls
	lsl	w8, w8, w22
	orr	w8, w8, w9
	str	w8, [x19]
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ERANGE,4,2                     ; @ERANGE
	.no_dead_strip	_atmel_smc_cs_encode_ncycles
.subsections_via_symbols
