	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function inv_check_and_setup_chip
_inv_check_and_setup_chip:              ## @inv_check_and_setup_chip
	.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
	movq	%rdi, %r14
	movq	_hw_info@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	(%rdi), %rcx
	shlq	$4, %rcx
	leaq	(%rax,%rcx), %rdx
	movq	%rdx, 24(%rdi)
	movq	8(%rax,%rcx), %rax
	movq	%rax, 8(%rdi)
	movl	16(%rdi), %edi
	movq	_INV_MPU6050_REG_WHOAMI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.1:
	movl	-44(%rbp), %ecx
	movq	24(%r14), %rax
	cmpl	(%rax), %ecx
	je	LBB0_9
## %bb.2:
	movq	_INV_NUM_PARTS@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_3
## %bb.4:
	movq	(%r15), %rdx
	shlq	$4, %rax
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	(%rdx,%rbx), %ecx
	je	LBB0_6
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	addq	$16, %rbx
	incl	%r13d
	cmpq	%rbx, %rax
	jne	LBB0_5
	jmp	LBB0_8
LBB0_3:
	xorl	%r13d, %r13d
	cmpl	%eax, %r13d
	jge	LBB0_8
LBB0_9:
	movl	16(%r14), %edi
	movq	8(%r14), %rax
	movl	(%rax), %esi
	movq	_INV_MPU6050_BIT_H_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.10:
	movq	_INV_MPU6050_POWER_UP_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_inv_mpu6050_set_power_itg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.11:
	movq	_INV_MPU6050_BIT_PWR_ACCL_STBY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_inv_mpu6050_switch_engine
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.12:
	movq	_INV_MPU6050_BIT_PWR_GYRO_STBY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_inv_mpu6050_switch_engine
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_13
LBB0_14:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_inv_mpu6050_set_power_itg
	jmp	LBB0_15
LBB0_6:
	movl	16(%r14), %edi
	callq	_regmap_get_device
	movl	-44(%rbp), %edx
	movq	(%r15), %rcx
	movl	4(%rcx,%rbx), %ecx
	movq	24(%r14), %rsi
	movl	(%rsi), %r8d
	movl	4(%rsi), %r9d
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_warn
	movl	(%r12), %eax
	cmpl	%eax, %r13d
	jl	LBB0_9
LBB0_8:
	movl	16(%r14), %edi
	callq	_regmap_get_device
	movl	-44(%rbp), %edx
	movq	24(%r14), %rsi
	movl	(%rsi), %ecx
	movl	4(%rsi), %r8d
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_inv_mpu6050_set_power_itg
	movl	%eax, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_hw_info,8,3                    ## @hw_info
	.comm	_INV_MPU6050_REG_WHOAMI,4,2     ## @INV_MPU6050_REG_WHOAMI
	.comm	_INV_NUM_PARTS,4,2              ## @INV_NUM_PARTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"whoami mismatch got %#02x (%s)expected %#02hhx (%s)\n"

L_.str.1:                               ## @.str.1
	.asciz	"invalid whoami %#02x expected %#02hhx (%s)\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_INV_MPU6050_BIT_H_RESET,4,2    ## @INV_MPU6050_BIT_H_RESET
	.comm	_INV_MPU6050_POWER_UP_TIME,4,2  ## @INV_MPU6050_POWER_UP_TIME
	.comm	_INV_MPU6050_BIT_PWR_ACCL_STBY,4,2 ## @INV_MPU6050_BIT_PWR_ACCL_STBY
	.comm	_INV_MPU6050_BIT_PWR_GYRO_STBY,4,2 ## @INV_MPU6050_BIT_PWR_GYRO_STBY
	.no_dead_strip	_inv_check_and_setup_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function inv_check_and_setup_chip
_inv_check_and_setup_chip:              ; @inv_check_and_setup_chip
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
Lloh0:
	adrp	x21, _hw_info@GOTPAGE
Lloh1:
	ldr	x21, [x21, _hw_info@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x9, [x0]
	add	x8, x8, x9, lsl #4
	str	x8, [x0, #24]
	ldr	x8, [x8, #8]
	str	x8, [x0, #8]
	ldr	w0, [x0, #16]
Lloh2:
	adrp	x8, _INV_MPU6050_REG_WHOAMI@GOTPAGE
Lloh3:
	ldr	x8, [x8, _INV_MPU6050_REG_WHOAMI@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	mov	x20, x0
	cbnz	w0, LBB0_14
; %bb.1:
	ldr	w8, [sp, #12]
	ldr	x9, [x19, #24]
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_7
; %bb.2:
Lloh5:
	adrp	x22, _INV_NUM_PARTS@GOTPAGE
Lloh6:
	ldr	x22, [x22, _INV_NUM_PARTS@GOTPAGEOFF]
	ldr	w10, [x22]
	cmp	w10, #1
	b.lt	LBB0_6
; %bb.3:
	mov	w20, #0
	mov	x23, #0
	ldr	x9, [x21]
	lsl	x10, x10, #4
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9, x23]
	cmp	w8, w11
	b.eq	LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #16
	add	w20, w20, #1
	cmp	x10, x23
	b.ne	LBB0_4
	b	LBB0_13
LBB0_6:
	mov	w20, #0
	cmp	w20, w10
	b.ge	LBB0_13
LBB0_7:
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _INV_MPU6050_BIT_H_RESET@GOTPAGE
Lloh8:
	ldr	x8, [x8, _INV_MPU6050_BIT_H_RESET@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	bl	_regmap_write
	mov	x20, x0
	cbnz	w0, LBB0_14
; %bb.8:
Lloh10:
	adrp	x8, _INV_MPU6050_POWER_UP_TIME@GOTPAGE
Lloh11:
	ldr	x8, [x8, _INV_MPU6050_POWER_UP_TIME@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_msleep
	mov	x0, x19
	mov	w1, #1
	bl	_inv_mpu6050_set_power_itg
	mov	x20, x0
	cbnz	w0, LBB0_14
; %bb.9:
Lloh13:
	adrp	x8, _INV_MPU6050_BIT_PWR_ACCL_STBY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _INV_MPU6050_BIT_PWR_ACCL_STBY@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_inv_mpu6050_switch_engine
	mov	x20, x0
	cbnz	w0, LBB0_11
; %bb.10:
Lloh16:
	adrp	x8, _INV_MPU6050_BIT_PWR_GYRO_STBY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _INV_MPU6050_BIT_PWR_GYRO_STBY@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_inv_mpu6050_switch_engine
	mov	x20, x0
	cbz	w0, LBB0_15
LBB0_11:
	mov	x0, x19
	mov	w1, #0
	bl	_inv_mpu6050_set_power_itg
	b	LBB0_14
LBB0_12:
	ldr	w0, [x19, #16]
	bl	_regmap_get_device
	ldr	w2, [sp, #12]
	ldr	x8, [x21]
	add	x8, x8, x23
	ldr	w3, [x8, #4]
	ldr	x8, [x19, #24]
	ldp	w4, w5, [x8]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	ldr	w10, [x22]
	cmp	w20, w10
	b.lt	LBB0_7
LBB0_13:
	ldr	w0, [x19, #16]
	bl	_regmap_get_device
	ldr	w2, [sp, #12]
	ldr	x8, [x19, #24]
	ldp	w3, w4, [x8]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_15:
	mov	x0, x19
	mov	w1, #0
	bl	_inv_mpu6050_set_power_itg
	mov	x20, x0
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_hw_info,8,3                    ; @hw_info
	.comm	_INV_MPU6050_REG_WHOAMI,4,2     ; @INV_MPU6050_REG_WHOAMI
	.comm	_INV_NUM_PARTS,4,2              ; @INV_NUM_PARTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"whoami mismatch got %#02x (%s)expected %#02hhx (%s)\n"

l_.str.1:                               ; @.str.1
	.asciz	"invalid whoami %#02x expected %#02hhx (%s)\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_INV_MPU6050_BIT_H_RESET,4,2    ; @INV_MPU6050_BIT_H_RESET
	.comm	_INV_MPU6050_POWER_UP_TIME,4,2  ; @INV_MPU6050_POWER_UP_TIME
	.comm	_INV_MPU6050_BIT_PWR_ACCL_STBY,4,2 ; @INV_MPU6050_BIT_PWR_ACCL_STBY
	.comm	_INV_MPU6050_BIT_PWR_GYRO_STBY,4,2 ; @INV_MPU6050_BIT_PWR_GYRO_STBY
	.no_dead_strip	_inv_check_and_setup_chip
.subsections_via_symbols
