	.file	"extr_hid-input.c_hidinput_calc_abs_res.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	hidinput_calc_abs_res
	.type	hidinput_calc_abs_res, @function
hidinput_calc_abs_res:
.LFB0:
	.cfi_startproc
	endbr64
	mov	edx, DWORD PTR 4[rdi]
	sub	edx, DWORD PTR 8[rdi]
	mov	r8d, DWORD PTR 12[rdi]
	sub	r8d, DWORD PTR 16[rdi]
	test	edx, edx
	jle	.L1
	test	r8d, r8d
	jle	.L1
	mov	eax, DWORD PTR [rdi]
	cmp	esi, 136
	jg	.L3
	cmp	esi, 130
	jg	.L4
	add	esi, -128
	cmp	esi, 2
	ja	.L1
.L5:
	mov	ecx, DWORD PTR 20[rdi]
	cmp	ecx, 17
	je	.L28
	cmp	ecx, 19
	jne	.L1
	imul	ecx, r8d, 254
	cmp	r8d, ecx
	jg	.L1
	sub	eax, 1
	mov	r8d, ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	sub	esi, 137
	cmp	esi, 5
	jbe	.L5
.L1:
	xor	eax, eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	mov	ecx, DWORD PTR 20[rdi]
	cmp	ecx, 20
	je	.L29
	cmp	ecx, 18
	jne	.L1
.L7:
	test	eax, eax
	jns	.L11
	lea	edi, [rdx+rdx*4]
	add	edi, edi
	cmp	edx, edi
	jle	.L12
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	lea	edx, [rdi+rdi*4]
	add	edx, edx
	cmp	edx, edi
	jl	.L1
	mov	edi, edx
.L12:
	add	eax, 1
	jne	.L9
.L10:
	mov	esi, r8d
	jmp	DIV_ROUND_CLOSEST@PLT
	.p2align 4,,10
	.p2align 3
.L29:
	imul	ecx, edx, 573
	cmp	edx, ecx
	jg	.L1
	add	eax, 1
	mov	edx, ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L28:
	add	eax, 1
	jmp	.L7
.L11:
	je	.L24
	lea	esi, [r8+r8*4]
	add	esi, esi
	cmp	esi, r8d
	jge	.L13
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	lea	ecx, [rsi+rsi*4]
	add	ecx, ecx
	cmp	ecx, esi
	jl	.L1
	mov	esi, ecx
.L13:
	sub	eax, 1
	jne	.L14
	mov	edi, edx
	mov	r8d, esi
	jmp	.L10
.L24:
	mov	edi, edx
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	hidinput_calc_abs_res, .-hidinput_calc_abs_res
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_hid-input.c_hidinput_calc_abs_res.c"
	.text
	.align	2
	.global	hidinput_calc_abs_res
	.syntax unified
	.arm
	.fpu softvfp
	.type	hidinput_calc_abs_res, %function
hidinput_calc_abs_res:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	str	lr, [sp, #-4]!
	ldr	r3, [r0, #8]
	ldr	lr, [r0, #4]
	ldr	ip, [r0, #12]
	ldr	r2, [r0, #16]
	sub	r3, lr, r3
	sub	ip, ip, r2
	cmp	ip, #0
	cmpgt	r3, #0
	ble	.L1
	cmp	r1, #136
	ldr	r2, [r0]
	bgt	.L3
	cmp	r1, #130
	bgt	.L4
	sub	r1, r1, #128
	cmp	r1, #2
	bhi	.L1
	ldr	r1, [r0, #20]
	cmp	r1, #17
	addeq	r2, r2, #1
	beq	.L7
.L30:
	cmp	r1, #19
	bne	.L1
	rsb	r1, ip, ip, lsl #7
	cmp	ip, r1, lsl #1
	lsl	r1, r1, #1
	bgt	.L1
	mov	ip, r1
	sub	r2, r2, #1
.L7:
	cmp	r2, #0
	bge	.L11
	add	r0, r3, r3, lsl #2
	cmp	r3, r0, lsl #1
	lsl	r0, r0, #1
	ble	.L12
	b	.L1
.L9:
	cmp	r0, r3, lsl #1
	lsl	r0, r3, #1
	bgt	.L1
.L12:
	adds	r2, r2, #1
	add	r3, r0, r0, lsl #2
	bne	.L9
.L10:
	mov	r1, ip
	ldr	lr, [sp], #4
	b	DIV_ROUND_CLOSEST
.L4:
	ldr	r1, [r0, #20]
	cmp	r1, #20
	beq	.L29
	cmp	r1, #18
	beq	.L7
.L1:
	mov	r0, #0
	ldr	pc, [sp], #4
.L3:
	sub	r1, r1, #137
	cmp	r1, #5
	bhi	.L1
	ldr	r1, [r0, #20]
	cmp	r1, #17
	addeq	r2, r2, #1
	bne	.L30
	b	.L7
.L29:
	add	r1, r3, r3, lsl #1
	rsb	r1, r3, r1, lsl #6
	rsb	r1, r1, r1, lsl #2
	cmp	r3, r1
	bgt	.L1
	mov	r3, r1
	add	r2, r2, #1
	b	.L7
.L11:
	beq	.L24
	add	r1, ip, ip, lsl #2
	cmp	ip, r1, lsl #1
	lsl	r1, r1, #1
	ble	.L13
	b	.L1
.L14:
	cmp	r1, r0, lsl #1
	lsl	r1, r0, #1
	bgt	.L1
.L13:
	subs	r2, r2, #1
	add	r0, r1, r1, lsl #2
	bne	.L14
	mov	r0, r3
	mov	ip, r1
	b	.L10
.L24:
	mov	r0, r3
	b	.L10
	.size	hidinput_calc_abs_res, .-hidinput_calc_abs_res
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
