	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function st_lsm6dsx_shub_check_wai
_st_lsm6dsx_shub_check_wai:             ## @st_lsm6dsx_shub_check_wai
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	4(%rax), %esi
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_ST_LSM6DSX_SLV_ADDR
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	(%r12), %rax
	movq	_ST_LSM6DSX_ID_ACC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_iio_priv
	movq	%rax, %r13
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_13
## %bb.1:
	xorl	%r14d, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r14
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r14
	jge	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	movl	(%rdi,%r14,4), %eax
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	addl	%eax, %eax
	incl	%eax
	movl	%eax, -60(%rbp)
	movl	8(%rbx), %eax
	movl	%eax, -56(%rbp)
	movl	$1, -52(%rbp)
	movq	%r12, %rdi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	leaq	-60(%rbp), %rdx
	movl	$12, %ecx
	callq	_st_lsm6dsx_shub_write_reg
	testl	%eax, %eax
	js	LBB0_15
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_st_lsm6dsx_shub_master_enable
	testl	%eax, %eax
	js	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	callq	_st_lsm6dsx_shub_wait_complete
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movq	%r12, %rdi
	leaq	-68(%rbp), %rdx
	movl	$4, %ecx
	callq	_st_lsm6dsx_shub_read_reg
	movl	%eax, %r15d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_st_lsm6dsx_shub_master_enable
	testl	%r15d, %r15d
	js	LBB0_16
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-68(%rbp), %eax
	cmpl	12(%rbx), %eax
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx), %rdi
	jmp	LBB0_2
LBB0_9:
	xorl	%r14d, %r14d
	jmp	LBB0_13
LBB0_12:
	movq	(%rbx), %rax
	movl	(%rax,%r14,4), %eax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movb	$1, %r14b
LBB0_13:
	leaq	-60(%rbp), %rbx
	xorl	%r13d, %r13d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	movq	%r12, %rdi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rdx
	movl	$12, %ecx
	callq	_st_lsm6dsx_shub_write_reg
	testl	%eax, %eax
	js	LBB0_15
## %bb.14:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	testb	%r14b, %r14b
	cmovnel	%r13d, %r15d
	jmp	LBB0_16
LBB0_15:
	movl	%eax, %r15d
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_18
## %bb.17:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ST_LSM6DSX_ID_ACC,8,3          ## @ST_LSM6DSX_ID_ACC
	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_st_lsm6dsx_shub_check_wai
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function st_lsm6dsx_shub_check_wai
_st_lsm6dsx_shub_check_wai:             ; @st_lsm6dsx_shub_check_wai
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x25, [x0, #8]
	ldr	w1, [x25, #4]
	mov	w0, #0
	bl	_ST_LSM6DSX_SLV_ADDR
	mov	x20, x0
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _ST_LSM6DSX_ID_ACC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ST_LSM6DSX_ID_ACC@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	w0, [x8, x9, lsl #2]
	bl	_iio_priv
	mov	x23, x0
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x26, #0
	mov	w27, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x26, x26, #1
	bl	_ARRAY_SIZE
	cmp	x26, w0, sxtw
	b.ge	LBB0_9
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x22]
	ldr	w8, [x0, x26, lsl #2]
	cbz	w8, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w9, #1
	ldr	w10, [x22, #8]
	bfi	w9, w8, #1, #31
	stp	w9, w10, [sp, #12]
	str	w27, [sp, #20]
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x20
	mov	w3, #12
	bl	_st_lsm6dsx_shub_write_reg
	tbnz	w0, #31, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x23
	mov	w1, #1
	bl	_st_lsm6dsx_shub_master_enable
	tbnz	w0, #31, LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_st_lsm6dsx_shub_wait_complete
	ldr	w1, [x25]
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #4
	bl	_st_lsm6dsx_shub_read_reg
	mov	x24, x0
	mov	x0, x23
	mov	w1, #0
	bl	_st_lsm6dsx_shub_master_enable
	tbnz	w24, #31, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #8]
	ldr	w9, [x22, #12]
	cmp	w8, w9
	b.eq	LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x22]
	b	LBB0_2
LBB0_9:
	mov	w21, #0
LBB0_10:
	add	x0, sp, #12
	mov	w1, #0
	mov	w2, #12
	bl	_memset
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x20
	mov	w3, #12
	bl	_st_lsm6dsx_shub_write_reg
	tbnz	w0, #31, LBB0_12
; %bb.11:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w21, #0
	csneg	w24, wzr, w8, ne
	b	LBB0_13
LBB0_12:
	mov	x24, x0
LBB0_13:
	ldr	x8, [sp, #24]
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_16
; %bb.14:
	mov	x0, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_15:
	ldr	x8, [x22]
	ldr	w8, [x8, x26, lsl #2]
	str	w8, [x21]
	mov	w21, #1
	b	LBB0_10
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ST_LSM6DSX_ID_ACC,8,3          ; @ST_LSM6DSX_ID_ACC
	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_st_lsm6dsx_shub_check_wai
.subsections_via_symbols
