	.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
	subq	$32, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	$0, -16(%rbp)
	movq	$0, -24(%rbp)
	movq	_sensor_data@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rdi), %rcx
	movq	_F_GAIN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rax,%rcx,4)
	je	LBB0_3
## %bb.1:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-8(%rbp), %rax
	jne	LBB0_8
## %bb.2:
	addq	$32, %rsp
	popq	%rbp
	jmp	_setsensorgain                  ## TAILCALL
LBB0_3:
	movq	8(%rdi), %rcx
	movq	_BRIDGE_103@GOTPCREL(%rip), %rdx
	movl	16(%rdi), %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_5
## %bb.4:
	sarl	%eax
	movl	%eax, -24(%rbp)
	movl	%eax, -20(%rbp)
	movl	%eax, -16(%rbp)
	leaq	-24(%rbp), %rdx
	movl	$5, %esi
	movl	$3, %ecx
	jmp	LBB0_6
LBB0_5:
	movl	%eax, %ecx
	sarl	$4, %ecx
	andl	$-16, %eax
	orl	%ecx, %eax
	movl	%eax, -24(%rbp)
	movl	%ecx, -20(%rbp)
	leaq	-24(%rbp), %rdx
	movl	$16, %esi
	movl	$2, %ecx
LBB0_6:
	callq	_reg_w
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-8(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	addq	$32, %rsp
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_sensor_data,8,3                ## @sensor_data
	.comm	_F_GAIN,4,2                     ## @F_GAIN
	.comm	_BRIDGE_103,8,3                 ## @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, #48
	.cfi_def_cfa_offset 48
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-8]
	str	wzr, [sp, #16]
	str	xzr, [sp, #8]
Lloh3:
	adrp	x8, _sensor_data@GOTPAGE
Lloh4:
	ldr	x8, [x8, _sensor_data@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x9, [x0]
	ldr	w8, [x8, x9, lsl #2]
Lloh6:
	adrp	x9, _F_GAIN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _F_GAIN@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	ldur	x8, [x29, #-8]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_setsensorgain
LBB0_3:
	ldr	x9, [x0, #8]
Lloh12:
	adrp	x8, _BRIDGE_103@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BRIDGE_103@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x8]
	ldr	w8, [x0, #16]
	cmp	x9, x10
	b.ne	LBB0_5
; %bb.4:
	asr	w8, w8, #1
	stp	w8, w8, [sp, #8]
	str	w8, [sp, #16]
	add	x2, sp, #8
	mov	w1, #5
	mov	w3, #3
	b	LBB0_6
LBB0_5:
	asr	w9, w8, #4
	and	w8, w8, #0xfffffff0
	orr	w8, w8, w9
	stp	w8, w9, [sp, #8]
	add	x2, sp, #8
	mov	w1, #16
	mov	w3, #2
LBB0_6:
	bl	_reg_w
	ldur	x8, [x29, #-8]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_sensor_data,8,3                ; @sensor_data
	.comm	_F_GAIN,4,2                     ; @F_GAIN
	.comm	_BRIDGE_103,8,3                 ; @BRIDGE_103
	.no_dead_strip	_setgain
.subsections_via_symbols
