	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apds9960_set_pxs_gain
_apds9960_set_pxs_gain:                 ## @apds9960_set_pxs_gain
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	_apds9960_pxs_gain_map@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_8
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	cmpl	%r15d, (%rdi,%rbx,4)
	je	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_2
	jmp	LBB0_8
LBB0_3:
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	8(%r14), %edi
	movq	_APDS9960_REG_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_APDS9960_REG_CONTROL_PGAIN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %eax
	shll	%cl, %eax
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	movl	8(%r14), %edi
	movq	_APDS9960_REG_CONFIG_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_APDS9960_REG_CONFIG_2_GGAIN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %eax
	shll	%cl, %eax
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movl	%ebx, (%r14)
LBB0_6:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_8:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_apds9960_pxs_gain_map,8,3      ## @apds9960_pxs_gain_map
	.comm	_APDS9960_REG_CONTROL,4,2       ## @APDS9960_REG_CONTROL
	.comm	_APDS9960_REG_CONTROL_PGAIN_MASK,4,2 ## @APDS9960_REG_CONTROL_PGAIN_MASK
	.comm	_APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT,4,2 ## @APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT
	.comm	_APDS9960_REG_CONFIG_2,4,2      ## @APDS9960_REG_CONFIG_2
	.comm	_APDS9960_REG_CONFIG_2_GGAIN_MASK,4,2 ## @APDS9960_REG_CONFIG_2_GGAIN_MASK
	.comm	_APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT,4,2 ## @APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT
	.no_dead_strip	_apds9960_set_pxs_gain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apds9960_set_pxs_gain
_apds9960_set_pxs_gain:                 ; @apds9960_set_pxs_gain
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
Lloh3:
	adrp	x23, _apds9960_pxs_gain_map@GOTPAGE
Lloh4:
	ldr	x23, [x23, _apds9960_pxs_gain_map@GOTPAGEOFF]
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x23]
	ldr	w8, [x0, x22, lsl #2]
	cmp	w8, w21
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x22, x22, #1
	bl	_ARRAY_SIZE
	cmp	x22, w0, sxtw
	b.lt	LBB0_2
	b	LBB0_8
LBB0_4:
	add	x21, x19, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w0, [x19, #8]
Lloh5:
	adrp	x8, _APDS9960_REG_CONTROL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _APDS9960_REG_CONTROL@GOTPAGEOFF]
Lloh7:
	adrp	x9, _APDS9960_REG_CONTROL_PGAIN_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _APDS9960_REG_CONTROL_PGAIN_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	ldr	w2, [x9]
Lloh11:
	adrp	x8, _APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	lsl	w3, w22, w8
	bl	_regmap_update_bits
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.5:
	ldr	w0, [x19, #8]
Lloh14:
	adrp	x8, _APDS9960_REG_CONFIG_2@GOTPAGE
Lloh15:
	ldr	x8, [x8, _APDS9960_REG_CONFIG_2@GOTPAGEOFF]
Lloh16:
	adrp	x9, _APDS9960_REG_CONFIG_2_GGAIN_MASK@GOTPAGE
Lloh17:
	ldr	x9, [x9, _APDS9960_REG_CONFIG_2_GGAIN_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	ldr	w2, [x9]
Lloh20:
	adrp	x8, _APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	lsl	w3, w22, w8
	bl	_regmap_update_bits
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.6:
	str	w22, [x19]
LBB0_7:
	mov	x0, x21
	bl	_mutex_unlock
LBB0_8:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_apds9960_pxs_gain_map,8,3      ; @apds9960_pxs_gain_map
	.comm	_APDS9960_REG_CONTROL,4,2       ; @APDS9960_REG_CONTROL
	.comm	_APDS9960_REG_CONTROL_PGAIN_MASK,4,2 ; @APDS9960_REG_CONTROL_PGAIN_MASK
	.comm	_APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT,4,2 ; @APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT
	.comm	_APDS9960_REG_CONFIG_2,4,2      ; @APDS9960_REG_CONFIG_2
	.comm	_APDS9960_REG_CONFIG_2_GGAIN_MASK,4,2 ; @APDS9960_REG_CONFIG_2_GGAIN_MASK
	.comm	_APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT,4,2 ; @APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT
	.no_dead_strip	_apds9960_set_pxs_gain
.subsections_via_symbols
