	.file	"extr_bbc_envctrl.c_set_fan_speeds.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	set_fan_speeds, @function
set_fan_speeds:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	rax, QWORD PTR FAN_SPEED_MIN[rip]
	mov	rbx, rdi
	mov	rsi, QWORD PTR [rdi]
	cmp	rsi, rax
	jge	.L2
	mov	QWORD PTR [rdi], rax
	mov	rsi, rax
.L2:
	mov	rdx, QWORD PTR FAN_SPEED_MAX[rip]
	cmp	rdx, rsi
	jge	.L3
	mov	QWORD PTR [rbx], rdx
	mov	rsi, rdx
.L3:
	mov	rcx, QWORD PTR 8[rbx]
	cmp	rax, rcx
	jle	.L4
	mov	QWORD PTR 8[rbx], rax
	mov	rcx, rax
.L4:
	cmp	rdx, rcx
	jge	.L5
	mov	QWORD PTR 8[rbx], rdx
.L5:
	mov	edi, DWORD PTR 24[rbx]
	mov	edx, DWORD PTR CPU_FAN_REG[rip]
	call	bbc_i2c_writeb@PLT
	mov	rsi, QWORD PTR 8[rbx]
	mov	edx, DWORD PTR SYS_FAN_REG[rip]
	mov	edi, DWORD PTR 24[rbx]
	call	bbc_i2c_writeb@PLT
	cmp	QWORD PTR 16[rbx], 0
	mov	edx, DWORD PTR PSUPPLY_FAN_REG[rip]
	mov	rsi, QWORD PTR PSUPPLY_FAN_OFF[rip]
	je	.L7
	mov	rsi, QWORD PTR PSUPPLY_FAN_ON[rip]
.L7:
	mov	edi, DWORD PTR 24[rbx]
	pop	rbx
	.cfi_def_cfa_offset 8
	jmp	bbc_i2c_writeb@PLT
	.cfi_endproc
.LFE0:
	.size	set_fan_speeds, .-set_fan_speeds
	.comm	SYS_FAN_REG,4,4
	.comm	PSUPPLY_FAN_REG,4,4
	.comm	PSUPPLY_FAN_ON,8,8
	.comm	PSUPPLY_FAN_OFF,8,8
	.comm	FAN_SPEED_MIN,8,8
	.comm	FAN_SPEED_MAX,8,8
	.comm	CPU_FAN_REG,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_bbc_envctrl.c_set_fan_speeds.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_fan_speeds, %function
set_fan_speeds:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L10
	ldr	r1, [r0]
	ldr	r3, [r3]
	ldr	r2, .L10+4
	cmp	r1, r3
	movlt	r1, r3
	ldr	r2, [r2]
	push	{r4, lr}
	strlt	r3, [r0]
	cmp	r2, r1
	mov	r4, r0
	strlt	r2, [r0]
	ldr	r0, [r0, #4]
	movlt	r1, r2
	cmp	r3, r0
	movgt	r0, r3
	strgt	r3, [r4, #4]
	ldr	r3, .L10+8
	cmp	r2, r0
	strlt	r2, [r4, #4]
	ldr	r0, [r4, #12]
	ldr	r2, [r3]
	bl	bbc_i2c_writeb
	ldr	r3, .L10+12
	ldr	r1, [r4, #4]
	ldr	r2, [r3]
	ldr	r0, [r4, #12]
	bl	bbc_i2c_writeb
	ldr	r3, [r4, #8]
	ldr	r0, [r4, #12]
	cmp	r3, #0
	ldrne	r3, .L10+16
	ldreq	r3, .L10+20
	pop	{r4, lr}
	ldr	r1, [r3]
	ldr	r3, .L10+24
	ldr	r2, [r3]
	b	bbc_i2c_writeb
.L11:
	.align	2
.L10:
	.word	FAN_SPEED_MIN
	.word	FAN_SPEED_MAX
	.word	CPU_FAN_REG
	.word	SYS_FAN_REG
	.word	PSUPPLY_FAN_ON
	.word	PSUPPLY_FAN_OFF
	.word	PSUPPLY_FAN_REG
	.size	set_fan_speeds, .-set_fan_speeds
	.comm	SYS_FAN_REG,4,4
	.comm	PSUPPLY_FAN_REG,4,4
	.comm	PSUPPLY_FAN_ON,4,4
	.comm	PSUPPLY_FAN_OFF,4,4
	.comm	FAN_SPEED_MIN,4,4
	.comm	FAN_SPEED_MAX,4,4
	.comm	CPU_FAN_REG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
