	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bmi160_chip_init
_bmi160_chip_init:                      ## @bmi160_chip_init
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %r15
	movl	(%rdi), %edi
	callq	_regmap_get_device
	movq	%rax, %r14
	movl	(%r15), %edi
	movq	_BMI160_REG_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BMI160_CMD_SOFTRESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_1
LBB0_9:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_BMI160_SOFTRESET_USLEEP@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	1(%rdi), %rsi
	callq	_usleep_range
	testl	%r12d, %r12d
	je	LBB0_3
## %bb.2:
	movl	(%r15), %edi
	movq	_BMI160_REG_DUMMY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
LBB0_3:
	movl	(%r15), %edi
	movq	_BMI160_REG_CHIP_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_5:
	movl	-36(%rbp), %edx
	movq	_BMI160_CHIP_ID_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jne	LBB0_6
## %bb.7:
	movq	_BMI160_ACCEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_bmi160_set_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movq	_BMI160_GYRO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_bmi160_set_mode
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_BMI160_REG_CMD,4,2             ## @BMI160_REG_CMD
	.comm	_BMI160_CMD_SOFTRESET,4,2       ## @BMI160_CMD_SOFTRESET
	.comm	_BMI160_SOFTRESET_USLEEP,8,3    ## @BMI160_SOFTRESET_USLEEP
	.comm	_BMI160_REG_DUMMY,4,2           ## @BMI160_REG_DUMMY
	.comm	_BMI160_REG_CHIP_ID,4,2         ## @BMI160_REG_CHIP_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading chip id\n"

	.comm	_BMI160_CHIP_ID_VAL,4,2         ## @BMI160_CHIP_ID_VAL
L_.str.1:                               ## @.str.1
	.asciz	"Wrong chip id, got %x expected %x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_BMI160_ACCEL,4,2               ## @BMI160_ACCEL
	.comm	_BMI160_GYRO,4,2                ## @BMI160_GYRO
	.no_dead_strip	_bmi160_chip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bmi160_chip_init
_bmi160_chip_init:                      ; @bmi160_chip_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_regmap_get_device
	mov	x20, x0
	ldr	w0, [x19]
Lloh0:
	adrp	x8, _BMI160_REG_CMD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BMI160_REG_CMD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _BMI160_CMD_SOFTRESET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BMI160_CMD_SOFTRESET@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_regmap_write
	mov	x21, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
LBB0_2:
Lloh6:
	adrp	x8, _BMI160_SOFTRESET_USLEEP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BMI160_SOFTRESET_USLEEP@GOTPAGEOFF]
Lloh8:
	ldr	x0, [x8]
	add	x1, x0, #1
	bl	_usleep_range
	cbz	w22, LBB0_4
; %bb.3:
	ldr	w0, [x19]
Lloh9:
	adrp	x8, _BMI160_REG_DUMMY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BMI160_REG_DUMMY@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, sp, #28
	bl	_regmap_read
	mov	x21, x0
	cbnz	w0, LBB0_1
LBB0_4:
	ldr	w0, [x19]
Lloh12:
	adrp	x8, _BMI160_REG_CHIP_ID@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BMI160_REG_CHIP_ID@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x2, sp, #28
	bl	_regmap_read
	cbz	w0, LBB0_6
; %bb.5:
	mov	x21, x0
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_1
LBB0_6:
	ldr	w8, [sp, #28]
Lloh17:
	adrp	x9, _BMI160_CHIP_ID_VAL@GOTPAGE
Lloh18:
	ldr	x9, [x9, _BMI160_CHIP_ID_VAL@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.7:
Lloh20:
	adrp	x8, _BMI160_ACCEL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BMI160_ACCEL@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_bmi160_set_mode
	mov	x21, x0
	cbnz	w0, LBB0_1
; %bb.8:
Lloh23:
	adrp	x8, _BMI160_GYRO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BMI160_GYRO@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_bmi160_set_mode
	mov	x21, x0
	b	LBB0_1
LBB0_9:
	stp	x8, x9, [sp]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh28:
	adrp	x8, _ENODEV@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_BMI160_REG_CMD,4,2             ; @BMI160_REG_CMD
	.comm	_BMI160_CMD_SOFTRESET,4,2       ; @BMI160_CMD_SOFTRESET
	.comm	_BMI160_SOFTRESET_USLEEP,8,3    ; @BMI160_SOFTRESET_USLEEP
	.comm	_BMI160_REG_DUMMY,4,2           ; @BMI160_REG_DUMMY
	.comm	_BMI160_REG_CHIP_ID,4,2         ; @BMI160_REG_CHIP_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading chip id\n"

	.comm	_BMI160_CHIP_ID_VAL,4,2         ; @BMI160_CHIP_ID_VAL
l_.str.1:                               ; @.str.1
	.asciz	"Wrong chip id, got %x expected %x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_BMI160_ACCEL,4,2               ; @BMI160_ACCEL
	.comm	_BMI160_GYRO,4,2                ; @BMI160_GYRO
	.no_dead_strip	_bmi160_chip_init
.subsections_via_symbols
