	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function UPDOWN_OffsetVal
_UPDOWN_OffsetVal:                      ## @UPDOWN_OffsetVal
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movslq	%esi, %r15
	movq	(%rdi), %rsi
	addq	%r15, %rsi
	callq	_UPDOWN_InBounds
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movq	_UDS_WRAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_3
## %bb.2:
	movq	16(%rbx), %rax
	movq	24(%rbx), %rcx
	xorl	%edx, %edx
	cmpq	%rax, %rcx
	setle	%dl
	movl	$1, %edi
	subl	%edx, %edi
	subl	%edx, %edi
	testl	%r14d, %r14d
	leal	-1(%rdx,%rdx), %edx
	cmovsl	%edi, %edx
	subl	%eax, %ecx
	imull	%edx, %ecx
	movl	%r14d, %eax
	shrl	$31, %eax
	leal	(%rcx,%rax,2), %eax
	addl	%eax, %r14d
	decl	%r14d
	jmp	LBB0_9
LBB0_3:
	movq	16(%rbx), %r14
	movq	24(%rbx), %rax
	cmpq	%rax, %r14
	jle	LBB0_5
## %bb.4:
	movq	(%rbx), %rcx
	leaq	(%rcx,%r15), %rdx
	cmpq	%r14, %rdx
	jg	LBB0_7
LBB0_5:
	movq	(%rbx), %rcx
	cmpq	%rax, %r14
	jge	LBB0_8
## %bb.6:
	addq	%rcx, %r15
	cmpq	%r14, %r15
	jge	LBB0_8
LBB0_7:
	subl	%ecx, %r14d
	jmp	LBB0_9
LBB0_8:
	subl	%ecx, %eax
	movl	%eax, %r14d
LBB0_9:
	movslq	%r14d, %rcx
	addq	%rcx, (%rbx)
	xorl	%eax, %eax
	testl	%ecx, %ecx
	setne	%al
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UDS_WRAP,4,2                   ## @UDS_WRAP
	.no_dead_strip	_UPDOWN_OffsetVal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function UPDOWN_OffsetVal
_UPDOWN_OffsetVal:                      ; @UPDOWN_OffsetVal
	.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, x1
	mov	x19, x0
	ldr	x8, [x0]
	sxtw	x21, w20
	add	x1, x8, x21
	bl	_UPDOWN_InBounds
	cbnz	w0, LBB0_9
; %bb.1:
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x9, _UDS_WRAP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _UDS_WRAP@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	ldp	x8, x9, [x19, #16]
	cmp	x9, x8
	mov	w10, #-1
	cneg	w10, w10, le
	cmp	w20, #0
	cneg	w10, w10, lt
	sub	w8, w9, w8
	mul	w8, w8, w10
	sub	w9, w8, #1
	cmp	w20, #0
	csinc	w8, w9, w8, ge
	add	w20, w8, w20
	b	LBB0_9
LBB0_3:
	ldp	x8, x10, [x19, #16]
	cmp	x8, x10
	b.le	LBB0_5
; %bb.4:
	ldr	x9, [x19]
	add	x11, x9, x21
	cmp	x11, x8
	b.gt	LBB0_7
LBB0_5:
	ldr	x9, [x19]
	cmp	x8, x10
	b.ge	LBB0_8
; %bb.6:
	add	x11, x9, x21
	cmp	x11, x8
	b.ge	LBB0_8
LBB0_7:
	sub	w20, w8, w9
	b	LBB0_9
LBB0_8:
	sub	w20, w10, w9
LBB0_9:
	ldr	x8, [x19]
	add	x8, x8, w20, sxtw
	str	x8, [x19]
	cmp	w20, #0
	cset	w0, ne
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_UDS_WRAP,4,2                   ; @UDS_WRAP
	.no_dead_strip	_UPDOWN_OffsetVal
.subsections_via_symbols
