	.file	"extr_gl518sm.c_set_fan_min.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	set_fan_min, @function
set_fan_min:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 8[rsp], rcx
	call	to_i2c_client@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	i2c_get_clientdata@PLT
	mov	rdi, r13
	mov	rbx, rax
	call	to_sensor_dev_attr@PLT
	mov	edx, 10
	xor	esi, esi
	mov	rdi, r14
	lea	r14, 16[rbx]
	movsx	r12, DWORD PTR [rax]
	call	simple_strtoul@PLT
	mov	rdi, r14
	mov	QWORD PTR 24[rsp], rax
	call	mutex_lock@PLT
	mov	esi, DWORD PTR GL518_REG_FAN_LIMIT[rip]
	mov	rdi, rbp
	call	gl518_read_value@PLT
	lea	rdx, 0[0+r12*4]
	mov	r15, rax
	mov	rax, QWORD PTR 24[rbx]
	mov	QWORD PTR 16[rsp], rdx
	mov	edi, DWORD PTR [rax+r12*4]
	call	DIV_FROM_REG@PLT
	mov	r9, QWORD PTR 24[rsp]
	mov	rdx, QWORD PTR 16[rsp]
	mov	esi, eax
	add	rdx, QWORD PTR [rbx]
	mov	rdi, r9
	mov	QWORD PTR 16[rsp], rdx
	call	FAN_TO_REG@PLT
	mov	rdx, QWORD PTR 16[rsp]
	lea	ecx, 0[0+r12*8]
	mov	rdi, rbp
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR [rbx]
	mov	edx, 255
	sal	edx, cl
	mov	ecx, 1
	mov	esi, DWORD PTR GL518_REG_FAN_LIMIT[rip]
	and	r15d, edx
	sub	ecx, r12d
	mov	edx, DWORD PTR [rax+r12*4]
	sal	ecx, 3
	sal	edx, cl
	or	edx, r15d
	call	gl518_write_value@PLT
	mov	esi, DWORD PTR GL518_REG_ALARM[rip]
	mov	rdi, rbp
	call	gl518_read_value@PLT
	mov	rdx, QWORD PTR [rbx]
	mov	DWORD PTR 8[rbx], eax
	mov	edx, DWORD PTR [rdx+r12*4]
	test	edx, edx
	jne	.L2
	mov	esi, 32
	mov	ecx, r12d
	sal	esi, cl
	mov	edx, esi
	not	edx
	and	edx, DWORD PTR 12[rbx]
.L3:
	mov	DWORD PTR 12[rbx], edx
	and	edx, eax
	mov	esi, DWORD PTR GL518_REG_ALARM[rip]
	mov	rdi, rbp
	mov	DWORD PTR 8[rbx], edx
	call	gl518_write_value@PLT
	mov	rdi, r14
	call	mutex_unlock@PLT
	mov	rax, QWORD PTR 8[rsp]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edx, 32
	mov	ecx, r12d
	sal	edx, cl
	or	edx, DWORD PTR 12[rbx]
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	set_fan_min, .-set_fan_min
	.comm	GL518_REG_FAN_LIMIT,4,4
	.comm	GL518_REG_ALARM,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_gl518sm.c_set_fan_min.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_fan_min, %function
set_fan_min:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r1
	mov	r5, r2
	mov	r7, r3
	bl	to_i2c_client
	mov	r6, r0
	bl	i2c_get_clientdata
	mov	r4, r0
	mov	r0, r8
	bl	to_sensor_dev_attr
	mov	r3, r0
	mov	r2, #10
	mov	r1, #0
	mov	r0, r5
	ldr	r5, [r3]
	bl	simple_strtoul
	ldr	r10, .L6
	add	r9, r4, #12
	mov	fp, r0
	mov	r0, r9
	bl	mutex_lock
	ldr	r1, [r10]
	mov	r0, r6
	bl	gl518_read_value
	ldr	r3, [r4, #16]
	mov	r8, r0
	ldr	r0, [r3, r5, lsl #2]
	bl	DIV_FROM_REG
	mov	r1, r0
	mov	r0, fp
	ldr	fp, [r4]
	bl	FAN_TO_REG
	mov	r1, #255
	ldr	r3, [r4]
	str	r0, [fp, r5, lsl #2]
	ldr	r2, [r3, r5, lsl #2]
	lsl	r0, r5, #3
	rsb	r3, r5, #1
	and	r0, r8, r1, lsl r0
	lsl	r3, r3, #3
	ldr	r8, .L6+4
	orr	r2, r0, r2, lsl r3
	ldr	r1, [r10]
	mov	r0, r6
	bl	gl518_write_value
	ldr	r1, [r8]
	mov	r0, r6
	bl	gl518_read_value
	mov	r2, #32
	ldr	r3, [r4]
	str	r0, [r4, #4]
	ldr	r3, [r3, r5, lsl #2]
	ldr	r1, [r8]
	cmp	r3, #0
	ldr	r3, [r4, #8]
	biceq	r5, r3, r2, lsl r5
	orrne	r5, r3, r2, lsl r5
	and	r2, r0, r5
	stmib	r4, {r2, r5}
	mov	r0, r6
	bl	gl518_write_value
	mov	r0, r9
	bl	mutex_unlock
	mov	r0, r7
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	.align	2
.L6:
	.word	GL518_REG_FAN_LIMIT
	.word	GL518_REG_ALARM
	.size	set_fan_min, .-set_fan_min
	.comm	GL518_REG_FAN_LIMIT,4,4
	.comm	GL518_REG_ALARM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
