	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atp_calculate_abs
_atp_calculate_abs:                     ## @atp_calculate_abs
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$0, (%r8)
	testl	%esi, %esi
	jle	LBB0_16
## %bb.1:
	movq	_threshold@GOTPCREL(%rip), %rax
	movl	(%rax), %r11d
	xorl	%eax, %eax
	movl	$0, %r9d
	movl	$0, %r15d
	cmpl	%r11d, (%rdi)
	jl	LBB0_3
## %bb.2:
	movl	$1, (%r8)
	movl	(%rdi), %r9d
	movq	_threshold@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r11d
	subl	%r11d, %r9d
	movl	$1, %r15d
LBB0_3:
	cmpl	$1, %esi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	jne	LBB0_7
LBB0_4:
	testl	%r9d, %r9d
	jle	LBB0_16
## %bb.5:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%r9d, (%rcx)
	imull	-44(%rbp), %eax                 ## 4-byte Folded Reload
	cltd
	idivl	%r9d
	jmp	LBB0_17
LBB0_16:
	xorl	%eax, %eax
LBB0_17:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%esi, %r12d
	xorl	%ecx, %ecx
	movl	$1, %ebx
	movabsq	$4294967296, %rsi               ## imm = 0x100000000
	movl	%r15d, %r13d
	xorl	%eax, %eax
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_10 Depth=1
	xorl	%r13d, %r13d
LBB0_9:                                 ##   in Loop: Header=BB0_10 Depth=1
	incq	%rbx
	incq	%rsi
	cmpq	%rbx, %r12
	je	LBB0_4
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%rbx,4), %r10d
	cmpl	%r11d, %r10d
	jl	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%esi, %r14d
	testl	%r13d, %r13d
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	%r10d, (%rdi,%r14,4)
	jge	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	incl	%r15d
	movl	%r15d, (%r8)
	movl	(%rdi,%rbx,4), %r10d
	movq	_threshold@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r11d
	movl	$1, %r13d
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	(%rdi,%r14,4), %edx
	subl	%r10d, %edx
	cmpl	%r11d, %edx
	cmovgl	%ecx, %r13d
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=1
	subl	%r11d, %r10d
	movl	%ebx, %edx
	imull	%r10d, %edx
	addl	%edx, %eax
	addl	%r10d, %r9d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_threshold,4,2                  ## @threshold
	.no_dead_strip	_atp_calculate_abs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atp_calculate_abs
_atp_calculate_abs:                     ; @atp_calculate_abs
	.cfi_startproc
; %bb.0:
	str	wzr, [x4]
	cmp	w1, #1
	b.lt	LBB0_16
; %bb.1:
	ldr	w9, [x0]
Lloh0:
	adrp	x8, _threshold@GOTPAGE
Lloh1:
	ldr	x8, [x8, _threshold@GOTPAGEOFF]
	ldr	w11, [x8]
	cmp	w9, w11
	b.ge	LBB0_12
; %bb.2:
	mov	w9, #0
	mov	w10, #0
	cmp	w1, #1
	b.eq	LBB0_13
LBB0_3:
	mov	x13, #0
	mov	w12, #0
	mov	w15, w1
	add	x14, x0, #4
	sub	x15, x15, #1
	mov	x16, x10
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	w16, #0
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x13, x13, #1
	cmp	x15, x13
	b.eq	LBB0_14
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w17, [x14, x13, lsl #2]
	cmp	w17, w11
	b.lt	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	and	x1, x13, #0xffffffff
	cbnz	w16, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w5, [x0, x1, lsl #2]
	cmp	w5, w17
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w10, w10, #1
	str	w10, [x4]
	ldr	w17, [x14, x13, lsl #2]
	ldr	w11, [x8]
	mov	w16, #1
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x0, x1, lsl #2]
	sub	w1, w1, w17
	cmp	w1, w11
	csel	w16, wzr, w16, gt
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	w17, w17, w11
	add	w9, w17, w9
	madd	w17, w17, w13, w17
	add	w12, w17, w12
	b	LBB0_5
LBB0_12:
	mov	w10, #1
	str	w10, [x4]
	ldr	w9, [x0]
	ldr	w11, [x8]
	sub	w9, w9, w11
	cmp	w1, #1
	b.ne	LBB0_3
LBB0_13:
	mov	w12, #0
LBB0_14:
	cmp	w9, #1
	b.lt	LBB0_16
; %bb.15:
	str	w9, [x3]
	mul	w8, w12, w2
	sdiv	w0, w8, w9
	ret
LBB0_16:
	mov	w0, #0
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_threshold,4,2                  ; @threshold
	.no_dead_strip	_atp_calculate_abs
.subsections_via_symbols
