	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_st_sensors_set_fullscale_by_gain ## -- Begin function st_sensors_set_fullscale_by_gain
	.p2align	4, 0x90
_st_sensors_set_fullscale_by_gain:      ## @st_sensors_set_fullscale_by_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	callq	_iio_priv
	movq	_ST_SENSORS_FULLSCALE_AVL_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	testl	%esi, %esi
	jle	LBB0_1
## %bb.2:
	movq	(%rax), %rcx
	movq	(%rcx), %rdx
	leal	-1(%rsi), %r8d
	incq	%r8
	xorl	%edi, %edi
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rdi
	cmpq	%rdi, %rsi
	je	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdx,%rdi,8), %ecx
	cmpl	%ebx, %ecx
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.5:
	movq	%rdi, %r8
	jmp	LBB0_9
LBB0_1:
	xorl	%r8d, %r8d
LBB0_7:
	testl	%r15d, %r15d
	jle	LBB0_8
## %bb.10:
	negl	%r15d
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	(%rax), %rax
	movq	(%rax), %rdx
LBB0_9:
	movl	%r8d, %eax
	movl	4(%rdx,%rax,8), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_st_sensors_set_fullscale       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ST_SENSORS_FULLSCALE_AVL_MAX,4,2 ## @ST_SENSORS_FULLSCALE_AVL_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_st_sensors_set_fullscale_by_gain ; -- Begin function st_sensors_set_fullscale_by_gain
	.p2align	2
_st_sensors_set_fullscale_by_gain:      ; @st_sensors_set_fullscale_by_gain
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	bl	_iio_priv
Lloh3:
	adrp	x8, _ST_SENSORS_FULLSCALE_AVL_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ST_SENSORS_FULLSCALE_AVL_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x8]
	cmp	w10, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x11, #0
	ldr	x8, [x0]
	ldr	x9, [x8]
	sub	w8, w10, #1
	add	x8, x8, #1
	mov	x12, x9
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x12]
	cmp	w13, w20
	ccmp	w13, #0, #4, eq
	b.ne	LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x11, x11, #1
	add	x12, x12, #8
	cmp	x10, x11
	b.ne	LBB0_2
; %bb.4:
	cmp	w21, #0
	b.le	LBB0_7
LBB0_5:
	neg	w0, w21
	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
LBB0_6:
	mov	x8, #0
	cmp	w21, #0
	b.gt	LBB0_5
LBB0_7:
	ldr	x9, [x0]
	ldr	x9, [x9]
	b	LBB0_9
LBB0_8:
	mov	x8, x11
LBB0_9:
	add	x8, x9, w8, uxtw #3
	ldr	w1, [x8, #4]
	mov	x0, x19
	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	_st_sensors_set_fullscale
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ST_SENSORS_FULLSCALE_AVL_MAX,4,2 ; @ST_SENSORS_FULLSCALE_AVL_MAX
.subsections_via_symbols
