	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hidinput_calc_abs_res          ## -- Begin function hidinput_calc_abs_res
	.p2align	4, 0x90
_hidinput_calc_abs_res:                 ## @hidinput_calc_abs_res
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	%rdi, %rax
	movl	4(%rdi), %edi
	subl	8(%rax), %edi
	jle	LBB0_21
## %bb.1:
	movl	%esi, %r8d
	movl	12(%rax), %esi
	subl	16(%rax), %esi
	testl	%esi, %esi
	jle	LBB0_21
## %bb.2:
	addl	$-128, %r8d
	cmpl	$14, %r8d
	ja	LBB0_21
## %bb.3:
	movl	(%rax), %edx
	movl	$32263, %ecx                    ## imm = 0x7E07
	btl	%r8d, %ecx
	jae	LBB0_9
## %bb.4:
	movl	20(%rax), %eax
	cmpl	$19, %eax
	je	LBB0_7
## %bb.5:
	cmpl	$17, %eax
	jne	LBB0_21
## %bb.6:
	incl	%edx
	jmp	LBB0_13
LBB0_9:
	movl	20(%rax), %eax
	cmpl	$18, %eax
	je	LBB0_13
## %bb.10:
	cmpl	$20, %eax
	jne	LBB0_21
## %bb.11:
	imull	$573, %edi, %eax                ## imm = 0x23D
	cmpl	%edi, %eax
	jl	LBB0_21
## %bb.12:
	incl	%edx
	movl	%eax, %edi
	jmp	LBB0_13
LBB0_7:
	movl	%esi, %eax
	shll	$8, %eax
	subl	%esi, %eax
	subl	%esi, %eax
	cmpl	%esi, %eax
	jge	LBB0_8
LBB0_21:
	xorl	%eax, %eax
	popq	%rbp
	retq
LBB0_8:
	decl	%edx
	movl	%eax, %esi
LBB0_13:
	testl	%edx, %edx
	js	LBB0_16
## %bb.14:
	je	LBB0_18
## %bb.15:
	incl	%edx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movl	%esi, %eax
	leal	(%rax,%rax), %ecx
	leal	(%rcx,%rcx,4), %esi
	cmpl	%eax, %esi
	jl	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_20 Depth=1
	decl	%edx
	cmpl	$2, %edx
	jge	LBB0_20
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%edi, %eax
	leal	(%rax,%rax), %ecx
	leal	(%rcx,%rcx,4), %edi
	cmpl	%eax, %edi
	jl	LBB0_21
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	incl	%edx
	jne	LBB0_16
LBB0_18:
	popq	%rbp
	jmp	_DIV_ROUND_CLOSEST              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hidinput_calc_abs_res          ; -- Begin function hidinput_calc_abs_res
	.p2align	2
_hidinput_calc_abs_res:                 ; @hidinput_calc_abs_res
	.cfi_startproc
; %bb.0:
	mov	x9, x1
	mov	x8, x0
	ldp	w10, w11, [x0, #4]
	sub	w0, w10, w11
	ldp	w10, w11, [x8, #12]
	sub	w1, w10, w11
	cmp	w0, #1
	ccmp	w1, #1, #8, ge
	b.ge	LBB0_2
LBB0_1:
	mov	w0, #0
	ret
LBB0_2:
	sub	w10, w9, #128
	cmp	w10, #14
	b.hi	LBB0_1
; %bb.3:
	ldr	w9, [x8]
	mov	w11, #1
	lsl	w10, w11, w10
	mov	w11, #32263
	tst	w10, w11
	b.eq	LBB0_7
; %bb.4:
	ldr	w8, [x8, #20]
	cmp	w8, #19
	b.eq	LBB0_11
; %bb.5:
	cmp	w8, #17
	b.ne	LBB0_1
; %bb.6:
	add	w9, w9, #1
	b	LBB0_13
LBB0_7:
	ldr	w8, [x8, #20]
	cmp	w8, #18
	b.eq	LBB0_13
; %bb.8:
	cmp	w8, #20
	b.ne	LBB0_1
; %bb.9:
	mov	w8, #573
	mul	w8, w0, w8
	cmp	w8, w0
	b.lt	LBB0_1
; %bb.10:
	add	w9, w9, #1
	mov	x0, x8
	b	LBB0_13
LBB0_11:
	mov	w8, #254
	mul	w8, w1, w8
	cmp	w8, w1
	b.lt	LBB0_1
; %bb.12:
	sub	w9, w9, #1
	mov	x1, x8
LBB0_13:
	tbnz	w9, #31, LBB0_18
; %bb.14:
	cbz	w9, LBB0_20
; %bb.15:
	add	w8, w9, #1
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x9, x1
	add	w10, w1, w1, lsl #2
	lsl	w1, w10, #1
	cmp	w1, w9
	b.lt	LBB0_1
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	sub	w8, w8, #1
	cmp	w8, #2
	b.ge	LBB0_16
	b	LBB0_20
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x8, x0
	add	w10, w0, w0, lsl #2
	lsl	w0, w10, #1
	cmp	w0, w8
	b.lt	LBB0_1
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	adds	w9, w9, #1
	b.lo	LBB0_18
LBB0_20:
	b	_DIV_ROUND_CLOSEST
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
