	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setgain
_setgain:                               ## @setgain
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	(%rdi), %rcx
	movl	(%rcx), %eax
	leal	-128(%rcx), %edx
	cmpl	$7, %edx
	ja	LBB0_11
## %bb.1:
	leaq	LJTI0_0(%rip), %rsi
	movslq	(%rsi,%rdx,4), %rdx
	addq	%rsi, %rdx
	jmpq	*%rdx
LBB0_3:
	movaps	l___const.setgain.i2c.1+16(%rip), %xmm0
	movaps	%xmm0, -32(%rbp)
	movdqa	l___const.setgain.i2c.1(%rip), %xmm0
	movdqa	%xmm0, -48(%rbp)
	movl	$255, %ecx
	subl	%eax, %ecx
	movl	%ecx, -32(%rbp)
	jmp	LBB0_4
LBB0_8:
	movaps	l___const.setgain.i2cpgain+16(%rip), %xmm0
	movaps	%xmm0, -32(%rbp)
	movaps	l___const.setgain.i2cpgain(%rip), %xmm0
	movaps	%xmm0, -48(%rbp)
	movaps	l___const.setgain.i2cpcolorgain+16(%rip), %xmm0
	movaps	%xmm0, -64(%rbp)
	movaps	l___const.setgain.i2cpcolorgain(%rip), %xmm0
	movaps	%xmm0, -80(%rbp)
	movaps	l___const.setgain.i2cpdoit+16(%rip), %xmm0
	movaps	%xmm0, -96(%rbp)
	movaps	l___const.setgain.i2cpdoit(%rip), %xmm0
	movaps	%xmm0, -112(%rbp)
	cmpl	$132, %ecx
	jne	LBB0_10
## %bb.9:
	movl	$14, -40(%rbp)
	movl	$208, -80(%rbp)
	movl	$9, -72(%rbp)
	movl	$19, -104(%rbp)
LBB0_10:
	movl	%eax, -36(%rbp)
	movd	%eax, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	psrad	$1, %xmm0
	movdqu	%xmm0, -68(%rbp)
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_i2c_w
	leaq	-80(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_i2c_w
	leaq	-112(%rbp), %rsi
	jmp	LBB0_5
LBB0_7:
	movaps	l___const.setgain.i2c.3+16(%rip), %xmm0
	movaps	%xmm0, -32(%rbp)
	movdqa	l___const.setgain.i2c.3(%rip), %xmm0
	movdqa	%xmm0, -48(%rbp)
	leal	16(%rax), %edx
	cmpl	$32, %eax
	cmovll	%eax, %edx
	cmpl	$133, %ecx
	cmovnel	%eax, %edx
	movq	_sensor_data@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ecx, %ecx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -44(%rbp)
	movl	%edx, -36(%rbp)
	jmp	LBB0_4
LBB0_11:
	shrq	$32, %rcx
	movq	_BRIDGE_103@GOTPCREL(%rip), %rdx
	cmpl	%ecx, (%rdx)
	jne	LBB0_13
## %bb.12:
	movl	%eax, -48(%rbp)
	movl	%eax, -44(%rbp)
	movl	%eax, -40(%rbp)
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$5, %esi
	movl	$3, %ecx
	jmp	LBB0_14
LBB0_6:
	movaps	l___const.setgain.i2c.2(%rip), %xmm0
	movaps	%xmm0, -48(%rbp)
	movdqa	l___const.setgain.i2c.2+16(%rip), %xmm0
	movdqa	%xmm0, -32(%rbp)
	notb	%al
	rolb	$4, %al
	movl	%eax, %ecx
	andb	$51, %cl
	shlb	$2, %cl
	shrb	$2, %al
	andb	$51, %al
	orb	%cl, %al
	movl	%eax, %ecx
	andb	$85, %cl
	addb	%cl, %cl
	shrb	%al
	andb	$85, %al
	orb	%cl, %al
	movzbl	%al, %eax
	movl	%eax, -36(%rbp)
	jmp	LBB0_4
LBB0_2:
	movaps	l___const.setgain.i2c(%rip), %xmm0
	movaps	%xmm0, -48(%rbp)
	movdqa	l___const.setgain.i2c+16(%rip), %xmm0
	movdqa	%xmm0, -32(%rbp)
	movl	$63, %ecx
	subl	%eax, %ecx
	movl	%ecx, -36(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%ecx, -28(%rbp)
LBB0_4:
	leaq	-48(%rbp), %rsi
LBB0_5:
	movq	%rbx, %rdi
	callq	_i2c_w
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-16(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	addq	$104, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_13:
	movl	%eax, %ecx
	shll	$4, %ecx
	orl	%eax, %ecx
	movl	%ecx, -48(%rbp)
	movl	%eax, -44(%rbp)
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$16, %esi
	movl	$2, %ecx
LBB0_14:
	callq	_reg_w
	jmp	LBB0_15
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
LJTI0_0:
	.long	L0_0_set_3
	.long	L0_0_set_6
	.long	L0_0_set_3
	.long	L0_0_set_8
	.long	L0_0_set_8
	.long	L0_0_set_7
	.long	L0_0_set_7
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @__const.setgain.i2c
l___const.setgain.i2c:
	.long	192                             ## 0xc0
	.long	17                              ## 0x11
	.long	49                              ## 0x31
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	23                              ## 0x17

	.p2align	4                               ## @__const.setgain.i2c.1
l___const.setgain.i2c.1:
	.long	48                              ## 0x30
	.long	17                              ## 0x11
	.long	2                               ## 0x2
	.long	32                              ## 0x20
	.long	112                             ## 0x70
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	16                              ## 0x10

	.p2align	4                               ## @__const.setgain.i2c.2
l___const.setgain.i2c.2:
	.long	176                             ## 0xb0
	.long	97                              ## 0x61
	.long	2                               ## 0x2
	.long	0                               ## 0x0
	.long	16                              ## 0x10
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	23                              ## 0x17

	.p2align	4                               ## @__const.setgain.i2c.3
l___const.setgain.i2c.3:
	.long	160                             ## 0xa0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	16                              ## 0x10

	.comm	_sensor_data,8,3                ## @sensor_data
	.p2align	4                               ## @__const.setgain.i2cpgain
l___const.setgain.i2cpgain:
	.long	160                             ## 0xa0
	.long	64                              ## 0x40
	.long	16                              ## 0x10
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	21                              ## 0x15

	.p2align	4                               ## @__const.setgain.i2cpcolorgain
l___const.setgain.i2cpcolorgain:
	.long	192                             ## 0xc0
	.long	64                              ## 0x40
	.long	7                               ## 0x7
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	21                              ## 0x15

	.p2align	4                               ## @__const.setgain.i2cpdoit
l___const.setgain.i2cpdoit:
	.long	160                             ## 0xa0
	.long	64                              ## 0x40
	.long	17                              ## 0x11
	.long	1                               ## 0x1
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	22                              ## 0x16

	.comm	_BRIDGE_103,4,2                 ## @BRIDGE_103
	.no_dead_strip	_setgain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setgain
_setgain:                               ; @setgain
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	ldr	x9, [x0]
	ldr	w8, [x9]
	sub	w10, w9, #128
	cmp	w10, #7
	b.hi	LBB0_7
; %bb.1:
Lloh3:
	adrp	x11, lJTI0_0@PAGE
Lloh4:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x12, LBB0_2
	ldrb	w13, [x11, x10]
	add	x12, x12, x13, lsl #2
	br	x12
LBB0_2:
Lloh5:
	adrp	x9, l___const.setgain.i2c.1@PAGE
Lloh6:
	add	x9, x9, l___const.setgain.i2c.1@PAGEOFF
	ldp	q1, q0, [x9]
	stp	q1, q0, [sp, #64]
	mov	w9, #255
	sub	w8, w9, w8
	str	w8, [sp, #80]
	b	LBB0_12
LBB0_3:
Lloh7:
	adrp	x10, l___const.setgain.i2cpgain@PAGE
Lloh8:
	add	x10, x10, l___const.setgain.i2cpgain@PAGEOFF
	ldp	q0, q1, [x10]
Lloh9:
	adrp	x10, l___const.setgain.i2cpcolorgain@PAGE
Lloh10:
	add	x10, x10, l___const.setgain.i2cpcolorgain@PAGEOFF
	stp	q0, q1, [sp, #64]
	ldp	q0, q1, [x10]
Lloh11:
	adrp	x10, l___const.setgain.i2cpdoit@PAGE
Lloh12:
	add	x10, x10, l___const.setgain.i2cpdoit@PAGEOFF
	stp	q0, q1, [sp, #32]
	ldp	q0, q1, [x10]
	stp	q0, q1, [sp]
	cmp	w9, #132
	b.ne	LBB0_5
; %bb.4:
	mov	w9, #14
	str	w9, [sp, #72]
	mov	w9, #208
	mov	w10, #9
	str	w9, [sp, #32]
	str	w10, [sp, #40]
	mov	w9, #19
	str	w9, [sp, #8]
LBB0_5:
	str	w8, [sp, #76]
	asr	w8, w8, #1
	dup.4s	v0, w8
	stur	q0, [sp, #44]
	add	x1, sp, #64
	mov	x0, x19
	bl	_i2c_w
	add	x1, sp, #32
	mov	x0, x19
	bl	_i2c_w
	mov	x1, sp
	b	LBB0_13
LBB0_6:
Lloh13:
	adrp	x10, l___const.setgain.i2c.3@PAGE
Lloh14:
	add	x10, x10, l___const.setgain.i2c.3@PAGEOFF
	ldp	q0, q1, [x10]
	cmp	w8, #31
	mov	w10, #133
	ccmp	w9, w10, #0, gt
	add	w10, w8, #16
	csel	w8, w10, w8, eq
Lloh15:
	adrp	x10, _sensor_data@GOTPAGE
Lloh16:
	ldr	x10, [x10, _sensor_data@GOTPAGEOFF]
	stp	q0, q1, [sp, #64]
Lloh17:
	ldr	x10, [x10]
	ldr	w9, [x10, w9, uxtw #2]
	str	w9, [sp, #68]
	b	LBB0_10
LBB0_7:
	lsr	x9, x9, #32
Lloh18:
	adrp	x10, _BRIDGE_103@GOTPAGE
Lloh19:
	ldr	x10, [x10, _BRIDGE_103@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	cmp	w10, w9
	b.ne	LBB0_16
; %bb.8:
	stp	w8, w8, [sp, #64]
	str	w8, [sp, #72]
	add	x2, sp, #64
	mov	x0, x19
	mov	w1, #5
	mov	w3, #3
	b	LBB0_17
LBB0_9:
Lloh21:
	adrp	x9, l___const.setgain.i2c.2@PAGE
Lloh22:
	add	x9, x9, l___const.setgain.i2c.2@PAGEOFF
	ldp	q0, q1, [x9]
	stp	q0, q1, [sp, #64]
	mvn	w8, w8
	rbit	w8, w8
	lsr	w8, w8, #24
LBB0_10:
	str	w8, [sp, #76]
	b	LBB0_12
LBB0_11:
Lloh23:
	adrp	x9, l___const.setgain.i2c@PAGE
Lloh24:
	add	x9, x9, l___const.setgain.i2c@PAGEOFF
	ldp	q0, q1, [x9]
	stp	q0, q1, [sp, #64]
	mov	w9, #63
	sub	w8, w9, w8
	stp	w8, w8, [sp, #76]
	str	w8, [sp, #84]
LBB0_12:
	add	x1, sp, #64
LBB0_13:
	mov	x0, x19
	bl	_i2c_w
LBB0_14:
	ldur	x8, [x29, #-24]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.15:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_16:
	orr	w9, w8, w8, lsl #4
	stp	w9, w8, [sp, #64]
	add	x2, sp, #64
	mov	x0, x19
	mov	w1, #16
	mov	w3, #2
LBB0_17:
	bl	_reg_w
	b	LBB0_14
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
                                        ; -- End function
	.p2align	2                               ; @__const.setgain.i2c
l___const.setgain.i2c:
	.long	192                             ; 0xc0
	.long	17                              ; 0x11
	.long	49                              ; 0x31
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	23                              ; 0x17

	.p2align	2                               ; @__const.setgain.i2c.1
l___const.setgain.i2c.1:
	.long	48                              ; 0x30
	.long	17                              ; 0x11
	.long	2                               ; 0x2
	.long	32                              ; 0x20
	.long	112                             ; 0x70
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	16                              ; 0x10

	.p2align	2                               ; @__const.setgain.i2c.2
l___const.setgain.i2c.2:
	.long	176                             ; 0xb0
	.long	97                              ; 0x61
	.long	2                               ; 0x2
	.long	0                               ; 0x0
	.long	16                              ; 0x10
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	23                              ; 0x17

	.p2align	2                               ; @__const.setgain.i2c.3
l___const.setgain.i2c.3:
	.long	160                             ; 0xa0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	16                              ; 0x10

	.comm	_sensor_data,8,3                ; @sensor_data
	.p2align	2                               ; @__const.setgain.i2cpgain
l___const.setgain.i2cpgain:
	.long	160                             ; 0xa0
	.long	64                              ; 0x40
	.long	16                              ; 0x10
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	21                              ; 0x15

	.p2align	2                               ; @__const.setgain.i2cpcolorgain
l___const.setgain.i2cpcolorgain:
	.long	192                             ; 0xc0
	.long	64                              ; 0x40
	.long	7                               ; 0x7
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	21                              ; 0x15

	.p2align	2                               ; @__const.setgain.i2cpdoit
l___const.setgain.i2cpdoit:
	.long	160                             ; 0xa0
	.long	64                              ; 0x40
	.long	17                              ; 0x11
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	22                              ; 0x16

	.comm	_BRIDGE_103,4,2                 ; @BRIDGE_103
	.no_dead_strip	_setgain
.subsections_via_symbols
