	.file	"extr_adt7475.c_adt7475_update_limits.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	adt7475_update_limits, @function
adt7475_update_limits:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	i2c_get_clientdata@PLT
	mov	edi, DWORD PTR REG_CONFIG4[rip]
	mov	rbx, rax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	DWORD PTR [rbx], eax
	mov	edi, DWORD PTR REG_CONFIG5[rip]
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	r8d, DWORD PTR ADT7475_VOLTAGE_COUNT[rip]
	mov	DWORD PTR 4[rbx], eax
	mov	eax, DWORD PTR 8[rbx]
	test	r8d, r8d
	jle	.L3
	xor	ebp, ebp
	.p2align 4,,10
	.p2align 3
.L5:
	bt	eax, ebp
	jnc	.L4
	mov	edi, ebp
	call	VOLTAGE_MIN_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 16[rbx]
	mov	rcx, QWORD PTR MIN[rip]
	sal	eax, 2
	mov	edi, ebp
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR [rdx+rbp*4], eax
	call	VOLTAGE_MAX_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 16[rbx]
	mov	rcx, QWORD PTR MAX[rip]
	sal	eax, 2
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR [rdx+rbp*4], eax
	mov	eax, DWORD PTR 8[rbx]
.L4:
	add	rbp, 1
	cmp	DWORD PTR ADT7475_VOLTAGE_COUNT[rip], ebp
	jg	.L5
.L3:
	test	al, 32
	jne	.L36
.L6:
	mov	edi, DWORD PTR ADT7475_TEMP_COUNT[rip]
	test	edi, edi
	jle	.L10
	xor	ebp, ebp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L37:
	mov	rdx, QWORD PTR 24[rbx]
	mov	rcx, QWORD PTR MIN[rip]
	sal	eax, 2
	mov	edi, ebp
	lea	r13, 0[0+rbp*4]
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR [rdx+rbp*4], eax
	call	TEMP_MAX_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 24[rbx]
	mov	rcx, QWORD PTR MAX[rip]
	sal	eax, 2
	mov	edi, ebp
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR [rdx+rbp*4], eax
	call	TEMP_TMIN_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 24[rbx]
	mov	rcx, QWORD PTR AUTOMIN[rip]
	sal	eax, 2
	mov	edi, ebp
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR [rdx+r13], eax
	call	TEMP_THERM_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 24[rbx]
	mov	rcx, QWORD PTR THERM[rip]
	sal	eax, 2
	mov	edi, ebp
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR [rdx+r13], eax
	call	TEMP_OFFSET_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 24[rbx]
	mov	rcx, QWORD PTR OFFSET[rip]
	add	rbp, 1
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR [rdx+r13], eax
	cmp	DWORD PTR ADT7475_TEMP_COUNT[rip], ebp
	jle	.L10
.L7:
	mov	edi, ebp
	call	TEMP_MIN_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	jns	.L37
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L36:
	.cfi_restore_state
	mov	edi, DWORD PTR REG_VTT_MIN[rip]
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 16[rbx]
	mov	rcx, QWORD PTR MIN[rip]
	sal	eax, 2
	mov	edi, DWORD PTR REG_VTT_MAX[rip]
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR 20[rdx], eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 16[rbx]
	mov	rcx, QWORD PTR MAX[rip]
	sal	eax, 2
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR 20[rdx], eax
	jmp	.L6
.L10:
	mov	rdi, r12
	xor	ebp, ebp
	call	adt7475_read_hystersis@PLT
	mov	esi, DWORD PTR ADT7475_TACH_COUNT[rip]
	test	esi, esi
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	mov	edi, ebp
	cmp	rbp, 3
	jne	.L13
	mov	edx, DWORD PTR 60[rbx]
	test	edx, edx
	je	.L14
.L13:
	call	TACH_MIN_REG@PLT
	mov	rdi, r12
	mov	esi, eax
	call	adt7475_read_word@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 32[rbx]
	mov	rcx, QWORD PTR MIN[rip]
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR [rdx+rbp*4], eax
.L14:
	add	rbp, 1
	cmp	DWORD PTR ADT7475_TACH_COUNT[rip], ebp
	jg	.L8
.L9:
	mov	ecx, DWORD PTR ADT7475_PWM_COUNT[rip]
	xor	ebp, ebp
	test	ecx, ecx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	mov	r13d, ebp
	cmp	rbp, 1
	jne	.L16
	mov	eax, DWORD PTR 56[rbx]
	test	eax, eax
	je	.L17
.L16:
	mov	edi, r13d
	call	PWM_MAX_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 40[rbx]
	mov	rcx, QWORD PTR MAX[rip]
	mov	edi, r13d
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR [rdx+rbp*4], eax
	call	PWM_MIN_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 40[rbx]
	mov	rcx, QWORD PTR MIN[rip]
	mov	esi, r13d
	mov	rdi, r12
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	DWORD PTR [rdx+rbp*4], eax
	call	adt7475_read_pwm@PLT
.L17:
	add	rbp, 1
	cmp	DWORD PTR ADT7475_PWM_COUNT[rip], ebp
	jg	.L11
.L12:
	xor	edi, edi
	call	TEMP_TRANGE_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 48[rbx]
	mov	edi, 1
	mov	DWORD PTR [rdx], eax
	call	TEMP_TRANGE_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 48[rbx]
	mov	edi, 2
	mov	DWORD PTR 4[rdx], eax
	call	TEMP_TRANGE_REG@PLT
	mov	edi, eax
	call	adt7475_read@PLT
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR 48[rbx]
	mov	DWORD PTR 8[rdx], eax
	xor	eax, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	adt7475_update_limits, .-adt7475_update_limits
	.comm	THERM,8,8
	.comm	REG_VTT_MIN,4,4
	.comm	REG_VTT_MAX,4,4
	.comm	REG_CONFIG5,4,4
	.comm	REG_CONFIG4,4,4
	.comm	OFFSET,8,8
	.comm	MIN,8,8
	.comm	MAX,8,8
	.comm	AUTOMIN,8,8
	.comm	ADT7475_VOLTAGE_COUNT,4,4
	.comm	ADT7475_TEMP_COUNT,4,4
	.comm	ADT7475_TACH_COUNT,4,4
	.comm	ADT7475_PWM_COUNT,4,4
	.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_adt7475.c_adt7475_update_limits.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	adt7475_update_limits, %function
adt7475_update_limits:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #12
	str	r0, [sp, #4]
	bl	i2c_get_clientdata
	ldr	r3, .L42
	mov	r5, r0
	ldr	r0, [r3]
	bl	adt7475_read
	subs	r3, r0, #0
	blt	.L1
	ldr	r1, .L42+4
	str	r3, [r5]
	ldr	r0, [r1]
	bl	adt7475_read
	subs	r3, r0, #0
	blt	.L1
	ldr	r8, .L42+8
	str	r3, [r5, #4]
	ldr	r3, [r8]
	ldr	r1, [r5, #8]
	cmp	r3, #0
	ble	.L3
	mov	r7, #0
	ldr	r4, .L42+12
	ldr	r6, .L42+16
.L5:
	asr	r3, r1, r7
	tst	r3, #1
	beq	.L4
	mov	r0, r7
	bl	VOLTAGE_MIN_REG
	bl	adt7475_read
	subs	r3, r0, #0
	lsl	r1, r3, #2
	blt	.L1
	ldr	ip, [r4]
	ldr	r3, [r5, #12]
	mov	r0, r7
	ldr	r3, [r3, ip, lsl #2]
	str	r1, [r3, r7, lsl #2]
	bl	VOLTAGE_MAX_REG
	bl	adt7475_read
	subs	r3, r0, #0
	blt	.L1
	ldr	ip, [r6]
	ldr	r1, [r5, #12]
	lsl	r0, r3, #2
	ldr	r1, [r1, ip, lsl #2]
	str	r0, [r1, r7, lsl #2]
	ldr	r1, [r5, #8]
.L4:
	ldr	r3, [r8]
	add	r7, r7, #1
	cmp	r3, r7
	bgt	.L5
.L3:
	tst	r1, #32
	bne	.L40
.L6:
	ldr	r6, .L42+20
	ldr	r3, [r6]
	cmp	r3, #0
	ble	.L10
	mov	fp, #0
	ldr	r7, .L42+12
	ldr	r8, .L42+16
	ldr	r9, .L42+24
	ldr	r10, .L42+28
	b	.L7
.L41:
	ldr	lr, [r7]
	ldr	r3, [r5, #16]
	mov	r0, fp
	ldr	r3, [r3, lr, lsl #2]
	lsl	r4, fp, #2
	str	ip, [r3, fp, lsl #2]
	bl	TEMP_MAX_REG
	bl	adt7475_read
	subs	r3, r0, #0
	lsl	ip, r3, #2
	blt	.L1
	ldr	lr, [r8]
	ldr	r3, [r5, #16]
	mov	r0, fp
	ldr	r3, [r3, lr, lsl #2]
	str	ip, [r3, fp, lsl #2]
	bl	TEMP_TMIN_REG
	bl	adt7475_read
	subs	r3, r0, #0
	lsl	ip, r3, #2
	blt	.L1
	ldr	lr, [r9]
	ldr	r3, [r5, #16]
	mov	r0, fp
	ldr	r3, [r3, lr, lsl #2]
	str	ip, [r3, r4]
	bl	TEMP_THERM_REG
	bl	adt7475_read
	subs	r3, r0, #0
	lsl	ip, r3, #2
	blt	.L1
	ldr	lr, [r10]
	ldr	r3, [r5, #16]
	mov	r0, fp
	ldr	r3, [r3, lr, lsl #2]
	add	fp, fp, #1
	str	ip, [r3, r4]
	bl	TEMP_OFFSET_REG
	bl	adt7475_read
	subs	r3, r0, #0
	blt	.L1
	ldr	r2, .L42+32
	ldr	r0, [r5, #16]
	ldr	ip, [r2]
	ldr	r0, [r0, ip, lsl #2]
	str	r3, [r0, r4]
	ldr	r3, [r6]
	cmp	r3, fp
	ble	.L10
.L7:
	mov	r0, fp
	bl	TEMP_MIN_REG
	bl	adt7475_read
	subs	r3, r0, #0
	lsl	ip, r3, #2
	bge	.L41
.L1:
	mov	r0, r3
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L40:
	ldr	r3, .L42+36
	ldr	r0, [r3]
	bl	adt7475_read
	subs	r3, r0, #0
	blt	.L1
	ldr	r1, .L42+12
	ldr	r0, [r5, #12]
	ldr	ip, [r1]
	ldr	r1, .L42+40
	ldr	r0, [r0, ip, lsl #2]
	lsl	r3, r3, #2
	str	r3, [r0, #20]
	ldr	r0, [r1]
	bl	adt7475_read
	subs	r3, r0, #0
	blt	.L1
	ldr	r0, .L42+16
	ldr	r1, [r5, #12]
	ldr	r0, [r0]
	lsl	r3, r3, #2
	ldr	r1, [r1, r0, lsl #2]
	str	r3, [r1, #20]
	b	.L6
.L10:
	ldr	r6, .L42+44
	ldr	r0, [sp, #4]
	bl	adt7475_read_hystersis
	ldr	r3, [r6]
	cmp	r3, #0
	movgt	r4, #0
	ldrgt	r7, .L42+12
	ble	.L9
.L8:
	cmp	r4, #3
	bne	.L13
	ldr	r3, [r5, #36]
	cmp	r3, #0
	beq	.L14
.L13:
	mov	r0, r4
	bl	TACH_MIN_REG
	mov	r1, r0
	ldr	r0, [sp, #4]
	bl	adt7475_read_word
	subs	r3, r0, #0
	blt	.L1
	ldr	r0, [r7]
	ldr	r1, [r5, #20]
	ldr	r1, [r1, r0, lsl #2]
	str	r3, [r1, r4, lsl #2]
.L14:
	ldr	r3, [r6]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L8
.L9:
	ldr	r6, .L42+48
	ldr	r3, [r6]
	cmp	r3, #0
	ble	.L12
	mov	r4, #0
	ldr	r8, .L42+16
	ldr	r7, .L42+12
.L11:
	cmp	r4, #1
	bne	.L16
	ldr	r3, [r5, #32]
	cmp	r3, #0
	beq	.L17
.L16:
	mov	r0, r4
	bl	PWM_MAX_REG
	bl	adt7475_read
	subs	r3, r0, #0
	blt	.L1
	ldr	ip, [r8]
	ldr	r1, [r5, #24]
	mov	r0, r4
	ldr	r1, [r1, ip, lsl #2]
	str	r3, [r1, r4, lsl #2]
	bl	PWM_MIN_REG
	bl	adt7475_read
	subs	r3, r0, #0
	blt	.L1
	ldr	r0, [r5, #24]
	ldr	ip, [r7]
	mov	r1, r4
	ldr	ip, [r0, ip, lsl #2]
	ldr	r0, [sp, #4]
	str	r3, [ip, r4, lsl #2]
	bl	adt7475_read_pwm
.L17:
	ldr	r3, [r6]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L11
.L12:
	mov	r0, #0
	bl	TEMP_TRANGE_REG
	bl	adt7475_read
	subs	r3, r0, #0
	blt	.L1
	ldr	r1, [r5, #28]
	mov	r0, #1
	str	r3, [r1]
	bl	TEMP_TRANGE_REG
	bl	adt7475_read
	subs	r3, r0, #0
	blt	.L1
	ldr	r1, [r5, #28]
	mov	r0, #2
	str	r3, [r1, #4]
	bl	TEMP_TRANGE_REG
	bl	adt7475_read
	subs	r3, r0, #0
	ldrge	r2, [r5, #28]
	strge	r3, [r2, #8]
	movge	r3, #0
	b	.L1
.L43:
	.align	2
.L42:
	.word	REG_CONFIG4
	.word	REG_CONFIG5
	.word	ADT7475_VOLTAGE_COUNT
	.word	MIN
	.word	MAX
	.word	ADT7475_TEMP_COUNT
	.word	AUTOMIN
	.word	THERM
	.word	OFFSET
	.word	REG_VTT_MIN
	.word	REG_VTT_MAX
	.word	ADT7475_TACH_COUNT
	.word	ADT7475_PWM_COUNT
	.size	adt7475_update_limits, .-adt7475_update_limits
	.comm	THERM,4,4
	.comm	REG_VTT_MIN,4,4
	.comm	REG_VTT_MAX,4,4
	.comm	REG_CONFIG5,4,4
	.comm	REG_CONFIG4,4,4
	.comm	OFFSET,4,4
	.comm	MIN,4,4
	.comm	MAX,4,4
	.comm	AUTOMIN,4,4
	.comm	ADT7475_VOLTAGE_COUNT,4,4
	.comm	ADT7475_TEMP_COUNT,4,4
	.comm	ADT7475_TACH_COUNT,4,4
	.comm	ADT7475_PWM_COUNT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
