	.file	"extr_bbc_envctrl.c_maybe_new_ambient_fan_speed.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	maybe_new_ambient_fan_speed, @function
maybe_new_ambient_fan_speed:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	rbx, rdi
	mov	edi, DWORD PTR FAN_AMBIENT[rip]
	call	prioritize_fan_action@PLT
	xor	r8d, r8d
	cmp	eax, DWORD PTR FAN_SAME[rip]
	je	.L1
	cmp	eax, DWORD PTR FAN_FULLBLAST[rip]
	mov	edx, DWORD PTR [rbx]
	je	.L12
	cmp	eax, DWORD PTR FAN_FASTER[rip]
	je	.L13
	cmp	DWORD PTR FAN_SPEED_MIN[rip], edx
	jge	.L1
	mov	eax, DWORD PTR 4[rbx]
	sub	eax, 2
	cmp	eax, edx
	jg	.L1
	sub	edx, 1
	mov	r8d, 1
	mov	DWORD PTR [rbx], edx
.L1:
	mov	eax, r8d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	eax, DWORD PTR FAN_SPEED_MAX[rip]
	cmp	eax, edx
	jle	.L1
	mov	r8d, 1
	mov	DWORD PTR [rbx], eax
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	mov	eax, r8d
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	cmp	DWORD PTR FAN_SPEED_MAX[rip], edx
	jle	.L1
	add	edx, 2
	mov	r8d, 1
	mov	DWORD PTR [rbx], edx
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	maybe_new_ambient_fan_speed, .-maybe_new_ambient_fan_speed
	.comm	FAN_SPEED_MIN,4,4
	.comm	FAN_SPEED_MAX,4,4
	.comm	FAN_SAME,4,4
	.comm	FAN_FULLBLAST,4,4
	.comm	FAN_FASTER,4,4
	.comm	FAN_AMBIENT,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_maybe_new_ambient_fan_speed.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	maybe_new_ambient_fan_speed, %function
maybe_new_ambient_fan_speed:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L15
	push	{r4, lr}
	mov	r4, r0
	ldr	r0, [r3]
	bl	prioritize_fan_action
	ldr	r3, .L15+4
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L9
	ldr	r2, .L15+8
	ldr	r3, [r4]
	ldr	r2, [r2]
	cmp	r0, r2
	beq	.L12
	ldr	r2, .L15+12
	ldr	r2, [r2]
	cmp	r0, r2
	beq	.L13
	ldr	r2, .L15+16
	ldr	r2, [r2]
	cmp	r2, r3
	bge	.L9
	ldr	r2, [r4, #4]
	sub	r2, r2, #2
	cmp	r2, r3
	bgt	.L9
	sub	r3, r3, #1
	mov	r0, #1
	str	r3, [r4]
	pop	{r4, pc}
.L12:
	ldr	r2, .L15+20
	ldr	r2, [r2]
	cmp	r2, r3
	bgt	.L14
.L9:
	mov	r0, #0
	pop	{r4, pc}
.L13:
	ldr	r2, .L15+20
	ldr	r2, [r2]
	cmp	r2, r3
	ble	.L9
	add	r3, r3, #2
	mov	r0, #1
	str	r3, [r4]
	pop	{r4, pc}
.L14:
	mov	r0, #1
	str	r2, [r4]
	pop	{r4, pc}
.L16:
	.align	2
.L15:
	.word	FAN_AMBIENT
	.word	FAN_SAME
	.word	FAN_FULLBLAST
	.word	FAN_FASTER
	.word	FAN_SPEED_MIN
	.word	FAN_SPEED_MAX
	.size	maybe_new_ambient_fan_speed, .-maybe_new_ambient_fan_speed
	.comm	FAN_SPEED_MIN,4,4
	.comm	FAN_SPEED_MAX,4,4
	.comm	FAN_SAME,4,4
	.comm	FAN_FULLBLAST,4,4
	.comm	FAN_FASTER,4,4
	.comm	FAN_AMBIENT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
