	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cm36651_set_operation_mode
_cm36651_set_operation_mode:            ## @cm36651_set_operation_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $esi killed $esi def $rsi
	movq	32(%rdi), %r14
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	addl	$-128, %esi
	cmpl	$3, %esi
	ja	LBB0_15
## %bb.1:
	movq	%rdi, %rbx
	movq	24(%rdi), %r15
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rsi,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_3:
	movq	_CM36651_PROXIMITY_EV_EN@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	16(%rbx), %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	(%r12), %r12d
	jmp	LBB0_18
LBB0_2:
	movq	_CM36651_CS_CONF1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	(%rbx), %rax
	movl	(%rax,%rsi,4), %edx
	movq	%r14, %rdi
	jmp	LBB0_14
LBB0_6:
	movq	_CM36651_PROXIMITY_EV_EN@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	addq	$16, %rbx
	movq	%rbx, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_17
LBB0_10:
	movq	_CM36651_PROXIMITY_EV_EN@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	addq	$16, %rbx
	movq	%rbx, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	movl	(%r13), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	_CM36651_PS_CONF1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_CM36651_PS_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	jmp	LBB0_13
LBB0_5:
	movq	_CM36651_PS_CONF1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	8(%rbx), %rax
	movl	(%rax,%rsi,4), %edx
LBB0_13:
	movq	%r15, %rdi
LBB0_14:
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %r12d
LBB0_15:
	testl	%r12d, %r12d
	jns	LBB0_18
## %bb.16:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_17
LBB0_8:
	movl	(%r13), %edi
	movq	%rbx, %rsi
	callq	_set_bit
	movq	_cm36651_ps_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_CM36651_PS_INT_EN@GOTPCREL(%rip), %rcx
	movq	_CM36651_PS_PERS2@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_CM36651_PS_CONF1@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rsi
	movq	_CM36651_PS_IT2@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_18
## %bb.9:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_17
LBB0_11:
	leaq	L_.str.2(%rip), %rsi
LBB0_17:
	movq	%r14, %rdi
	callq	_dev_err
LBB0_18:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_3
	.long	L0_0_set_2
	.long	L0_0_set_6
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CM36651_CS_CONF1,8,3           ## @CM36651_CS_CONF1
	.comm	_CM36651_PROXIMITY_EV_EN,4,2    ## @CM36651_PROXIMITY_EV_EN
	.comm	_CM36651_PS_CONF1,8,3           ## @CM36651_PS_CONF1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Already proximity event enable state\n"

	.comm	_cm36651_ps_reg,8,3             ## @cm36651_ps_reg
	.comm	_CM36651_PS_INT_EN,4,2          ## @CM36651_PS_INT_EN
	.comm	_CM36651_PS_PERS2,4,2           ## @CM36651_PS_PERS2
	.comm	_CM36651_PS_IT2,4,2             ## @CM36651_PS_IT2
L_.str.1:                               ## @.str.1
	.asciz	"Proximity enable event failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"Already proximity event disable state\n"

	.comm	_CM36651_PS_DISABLE,4,2         ## @CM36651_PS_DISABLE
L_.str.3:                               ## @.str.3
	.asciz	"Write register failed\n"

	.no_dead_strip	_cm36651_set_operation_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cm36651_set_operation_mode
_cm36651_set_operation_mode:            ; @cm36651_set_operation_mode
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	x19, [x0, #32]
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	sub	w8, w1, #128
	cmp	w8, #3
	b.hi	LBB0_12
; %bb.1:
	mov	x22, x0
	ldr	x21, [x0, #24]
Lloh3:
	adrp	x9, lJTI0_0@PAGE
Lloh4:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
Lloh5:
	adrp	x20, _CM36651_PROXIMITY_EV_EN@GOTPAGE
Lloh6:
	ldr	x20, [x20, _CM36651_PROXIMITY_EV_EN@GOTPAGEOFF]
	ldr	w0, [x20]
	add	x1, x22, #16
	bl	_test_bit
	cbz	w0, LBB0_9
; %bb.3:
	ldr	w20, [x20]
	b	LBB0_18
LBB0_4:
Lloh7:
	adrp	x8, _CM36651_CS_CONF1@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CM36651_CS_CONF1@GOTPAGEOFF]
Lloh9:
	ldr	x1, [x8]
	ldr	x8, [x22]
	ldr	w2, [x8, x1, lsl #2]
	mov	x0, x19
	b	LBB0_11
LBB0_5:
Lloh10:
	adrp	x23, _CM36651_PROXIMITY_EV_EN@GOTPAGE
Lloh11:
	ldr	x23, [x23, _CM36651_PROXIMITY_EV_EN@GOTPAGEOFF]
	ldr	w0, [x23]
	add	x22, x22, #16
	mov	x1, x22
	bl	_test_bit
	cbz	w0, LBB0_14
; %bb.6:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_17
LBB0_7:
Lloh14:
	adrp	x23, _CM36651_PROXIMITY_EV_EN@GOTPAGE
Lloh15:
	ldr	x23, [x23, _CM36651_PROXIMITY_EV_EN@GOTPAGEOFF]
	ldr	w0, [x23]
	add	x22, x22, #16
	mov	x1, x22
	bl	_test_bit
	cbz	w0, LBB0_16
; %bb.8:
	ldr	w0, [x23]
	mov	x1, x22
	bl	_clear_bit
Lloh16:
	adrp	x8, _CM36651_PS_CONF1@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CM36651_PS_CONF1@GOTPAGEOFF]
Lloh18:
	ldr	x1, [x8]
Lloh19:
	adrp	x8, _CM36651_PS_DISABLE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CM36651_PS_DISABLE@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	b	LBB0_10
LBB0_9:
Lloh22:
	adrp	x8, _CM36651_PS_CONF1@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CM36651_PS_CONF1@GOTPAGEOFF]
Lloh24:
	ldr	x1, [x8]
	ldr	x8, [x22, #8]
	ldr	w2, [x8, x1, lsl #2]
LBB0_10:
	mov	x0, x21
LBB0_11:
	bl	_i2c_smbus_write_byte_data
	mov	x20, x0
LBB0_12:
	tbz	w20, #31, LBB0_18
; %bb.13:
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_17
LBB0_14:
	ldr	w0, [x23]
	mov	x1, x22
	bl	_set_bit
Lloh27:
	adrp	x8, _cm36651_ps_reg@GOTPAGE
Lloh28:
	ldr	x8, [x8, _cm36651_ps_reg@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
Lloh30:
	adrp	x9, _CM36651_PS_CONF1@GOTPAGE
Lloh31:
	ldr	x9, [x9, _CM36651_PS_CONF1@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	ldr	x1, [x8, x9, lsl #3]
Lloh33:
	adrp	x8, _CM36651_PS_INT_EN@GOTPAGE
Lloh34:
	ldr	x8, [x8, _CM36651_PS_INT_EN@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _CM36651_PS_PERS2@GOTPAGE
Lloh37:
	ldr	x9, [x9, _CM36651_PS_PERS2@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh39:
	adrp	x9, _CM36651_PS_IT2@GOTPAGE
Lloh40:
	ldr	x9, [x9, _CM36651_PS_IT2@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x21
	bl	_i2c_smbus_write_byte_data
	mov	x20, x0
	tbz	w0, #31, LBB0_18
; %bb.15:
Lloh42:
	adrp	x1, l_.str.1@PAGE
Lloh43:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh44:
	adrp	x1, l_.str.2@PAGE
Lloh45:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_17:
	mov	x0, x19
	bl	_dev_err
LBB0_18:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CM36651_CS_CONF1,8,3           ; @CM36651_CS_CONF1
	.comm	_CM36651_PROXIMITY_EV_EN,4,2    ; @CM36651_PROXIMITY_EV_EN
	.comm	_CM36651_PS_CONF1,8,3           ; @CM36651_PS_CONF1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Already proximity event enable state\n"

	.comm	_cm36651_ps_reg,8,3             ; @cm36651_ps_reg
	.comm	_CM36651_PS_INT_EN,4,2          ; @CM36651_PS_INT_EN
	.comm	_CM36651_PS_PERS2,4,2           ; @CM36651_PS_PERS2
	.comm	_CM36651_PS_IT2,4,2             ; @CM36651_PS_IT2
l_.str.1:                               ; @.str.1
	.asciz	"Proximity enable event failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"Already proximity event disable state\n"

	.comm	_CM36651_PS_DISABLE,4,2         ; @CM36651_PS_DISABLE
l_.str.3:                               ; @.str.3
	.asciz	"Write register failed\n"

	.no_dead_strip	_cm36651_set_operation_mode
.subsections_via_symbols
