	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_set_fan_gear_mode
_do_set_fan_gear_mode:                  ## @do_set_fan_gear_mode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	callq	_g762_update_client
	movq	%rax, %rbx
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.10:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	cmpq	$2, %r15
	je	LBB0_5
## %bb.2:
	cmpq	$1, %r15
	je	LBB0_7
## %bb.3:
	testq	%r15, %r15
	jne	LBB0_6
## %bb.4:
	movq	_G762_REG_FAN_CMD2_GEAR_MODE_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_G762_REG_FAN_CMD2_GEAR_MODE_1@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	notl	%edx
	andl	8(%r14), %edx
	jmp	LBB0_8
LBB0_5:
	movq	_G762_REG_FAN_CMD2_GEAR_MODE_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	8(%r14), %edx
	movq	_G762_REG_FAN_CMD2_GEAR_MODE_1@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	jmp	LBB0_8
LBB0_7:
	movq	_G762_REG_FAN_CMD2_GEAR_MODE_0@GOTPCREL(%rip), %rax
	movl	8(%r14), %ecx
	orl	(%rax), %ecx
	movq	_G762_REG_FAN_CMD2_GEAR_MODE_1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	%ecx, %edx
LBB0_8:
	movl	%edx, 8(%r14)
	movl	12(%r14), %edi
	movq	_G762_REG_FAN_CMD2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %r15d
	movl	$0, (%r14)
	jmp	LBB0_9
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_9:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_G762_REG_FAN_CMD2_GEAR_MODE_0,4,2 ## @G762_REG_FAN_CMD2_GEAR_MODE_0
	.comm	_G762_REG_FAN_CMD2_GEAR_MODE_1,4,2 ## @G762_REG_FAN_CMD2_GEAR_MODE_1
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_G762_REG_FAN_CMD2,4,2          ## @G762_REG_FAN_CMD2
	.no_dead_strip	_do_set_fan_gear_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_set_fan_gear_mode
_do_set_fan_gear_mode:                  ; @do_set_fan_gear_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x1
	bl	_g762_update_client
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_2:
	add	x19, x20, #4
	mov	x0, x19
	bl	_mutex_lock
	cmp	x21, #2
	b.eq	LBB0_6
; %bb.3:
	cmp	x21, #1
	b.eq	LBB0_7
; %bb.4:
	cbnz	x21, LBB0_9
; %bb.5:
Lloh0:
	adrp	x8, _G762_REG_FAN_CMD2_GEAR_MODE_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _G762_REG_FAN_CMD2_GEAR_MODE_0@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
Lloh3:
	adrp	x10, _G762_REG_FAN_CMD2_GEAR_MODE_1@GOTPAGE
Lloh4:
	ldr	x10, [x10, _G762_REG_FAN_CMD2_GEAR_MODE_1@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w8, w8, w10
	bic	w2, w9, w8
	b	LBB0_8
LBB0_6:
Lloh6:
	adrp	x8, _G762_REG_FAN_CMD2_GEAR_MODE_0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _G762_REG_FAN_CMD2_GEAR_MODE_0@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	bic	w8, w9, w8
Lloh9:
	adrp	x9, _G762_REG_FAN_CMD2_GEAR_MODE_1@GOTPAGE
Lloh10:
	ldr	x9, [x9, _G762_REG_FAN_CMD2_GEAR_MODE_1@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w2, w9, w8
	b	LBB0_8
LBB0_7:
Lloh12:
	adrp	x8, _G762_REG_FAN_CMD2_GEAR_MODE_0@GOTPAGE
Lloh13:
	ldr	x8, [x8, _G762_REG_FAN_CMD2_GEAR_MODE_0@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _G762_REG_FAN_CMD2_GEAR_MODE_1@GOTPAGE
Lloh16:
	ldr	x9, [x9, _G762_REG_FAN_CMD2_GEAR_MODE_1@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	bic	w2, w8, w9
LBB0_8:
	str	w2, [x20, #8]
	ldr	w0, [x20, #12]
Lloh18:
	adrp	x8, _G762_REG_FAN_CMD2@GOTPAGE
Lloh19:
	ldr	x8, [x8, _G762_REG_FAN_CMD2@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_i2c_smbus_write_byte_data
	mov	x21, x0
	str	wzr, [x20]
	b	LBB0_10
LBB0_9:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_G762_REG_FAN_CMD2_GEAR_MODE_0,4,2 ; @G762_REG_FAN_CMD2_GEAR_MODE_0
	.comm	_G762_REG_FAN_CMD2_GEAR_MODE_1,4,2 ; @G762_REG_FAN_CMD2_GEAR_MODE_1
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_G762_REG_FAN_CMD2,4,2          ; @G762_REG_FAN_CMD2
	.no_dead_strip	_do_set_fan_gear_mode
.subsections_via_symbols
