	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bmg160_chip_init
_bmg160_chip_init:                      ## @bmg160_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
	movq	%rdi, %r15
	movl	8(%rdi), %edi
	callq	_regmap_get_device
	movq	%rax, %r14
	movl	8(%r15), %edi
	movq	_BMG160_GYRO_REG_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BMG160_GYRO_RESET_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_write
	movl	$30000, %edi                    ## imm = 0x7530
	movl	$30700, %esi                    ## imm = 0x77EC
	callq	_usleep_range
	movl	8(%r15), %edi
	movq	_BMG160_REG_CHIP_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_9
## %bb.1:
	movl	-36(%rbp), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_dbg
	movl	-36(%rbp), %edx
	movq	_BMG160_CHIP_ID_VAL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_11
## %bb.2:
	movq	_BMG160_MODE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bmg160_set_mode
	testl	%eax, %eax
	js	LBB0_13
## %bb.3:
	movl	$500, %edi                      ## imm = 0x1F4
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_usleep_range
	movq	_BMG160_DEF_BW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bmg160_set_bw
	testl	%eax, %eax
	js	LBB0_13
## %bb.4:
	movl	8(%r15), %edi
	movq	_BMG160_REG_RANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BMG160_RANGE_500DPS@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_15
## %bb.5:
	movl	(%r12), %eax
	movl	%eax, (%r15)
	movl	8(%r15), %edi
	movq	_BMG160_REG_SLOPE_THRES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_16
## %bb.6:
	movl	-36(%rbp), %eax
	movl	%eax, 4(%r15)
	movl	8(%r15), %edi
	movq	_BMG160_REG_INT_EN_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BMG160_INT1_BIT_OD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_17
## %bb.7:
	movl	8(%r15), %edi
	movq	_BMG160_REG_INT_RST_LATCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BMG160_INT_MODE_LATCH_INT@GOTPCREL(%rip), %rax
	movq	_BMG160_INT_MODE_LATCH_RESET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	callq	_regmap_write
	testl	%eax, %eax
	jns	LBB0_14
## %bb.8:
	movl	%eax, %r15d
	leaq	L_.str.6(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movl	%r15d, %ebx
	jmp	LBB0_14
LBB0_9:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
LBB0_10:
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_11:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_13:
	movl	%eax, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_10
LBB0_16:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_10
LBB0_17:
	movl	%eax, %r12d
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movl	%r12d, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_BMG160_GYRO_REG_RESET,4,2      ## @BMG160_GYRO_REG_RESET
	.comm	_BMG160_GYRO_RESET_VAL,4,2      ## @BMG160_GYRO_RESET_VAL
	.comm	_BMG160_REG_CHIP_ID,4,2         ## @BMG160_REG_CHIP_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading reg_chip_id\n"

L_.str.1:                               ## @.str.1
	.asciz	"Chip Id %x\n"

	.comm	_BMG160_CHIP_ID_VAL,4,2         ## @BMG160_CHIP_ID_VAL
L_.str.2:                               ## @.str.2
	.asciz	"invalid chip %x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_BMG160_MODE_NORMAL,4,2         ## @BMG160_MODE_NORMAL
	.comm	_BMG160_DEF_BW,4,2              ## @BMG160_DEF_BW
	.comm	_BMG160_REG_RANGE,4,2           ## @BMG160_REG_RANGE
	.comm	_BMG160_RANGE_500DPS,4,2        ## @BMG160_RANGE_500DPS
L_.str.3:                               ## @.str.3
	.asciz	"Error writing reg_range\n"

	.comm	_BMG160_REG_SLOPE_THRES,4,2     ## @BMG160_REG_SLOPE_THRES
L_.str.4:                               ## @.str.4
	.asciz	"Error reading reg_slope_thres\n"

	.comm	_BMG160_REG_INT_EN_1,4,2        ## @BMG160_REG_INT_EN_1
	.comm	_BMG160_INT1_BIT_OD,4,2         ## @BMG160_INT1_BIT_OD
L_.str.5:                               ## @.str.5
	.asciz	"Error updating bits in reg_int_en_1\n"

	.comm	_BMG160_REG_INT_RST_LATCH,4,2   ## @BMG160_REG_INT_RST_LATCH
	.comm	_BMG160_INT_MODE_LATCH_INT,4,2  ## @BMG160_INT_MODE_LATCH_INT
	.comm	_BMG160_INT_MODE_LATCH_RESET,4,2 ## @BMG160_INT_MODE_LATCH_RESET
L_.str.6:                               ## @.str.6
	.asciz	"Error writing reg_motion_intr\n"

	.no_dead_strip	_bmg160_chip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bmg160_chip_init
_bmg160_chip_init:                      ; @bmg160_chip_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	ldr	w0, [x0, #8]
	bl	_regmap_get_device
	mov	x19, x0
	ldr	w0, [x20, #8]
Lloh0:
	adrp	x8, _BMG160_GYRO_REG_RESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BMG160_GYRO_REG_RESET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _BMG160_GYRO_RESET_VAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BMG160_GYRO_RESET_VAL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_regmap_write
	mov	w0, #30000
	mov	w1, #30700
	bl	_usleep_range
	ldr	w0, [x20, #8]
Lloh6:
	adrp	x8, _BMG160_REG_CHIP_ID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BMG160_REG_CHIP_ID@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_9
; %bb.1:
	ldr	w2, [sp, #12]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	ldr	w8, [sp, #12]
Lloh11:
	adrp	x9, _BMG160_CHIP_ID_VAL@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BMG160_CHIP_ID_VAL@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.2:
Lloh14:
	adrp	x8, _BMG160_MODE_NORMAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BMG160_MODE_NORMAL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_bmg160_set_mode
	tbnz	w0, #31, LBB0_12
; %bb.3:
	mov	w0, #500
	mov	w1, #1000
	bl	_usleep_range
Lloh17:
	adrp	x8, _BMG160_DEF_BW@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BMG160_DEF_BW@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_bmg160_set_bw
	tbnz	w0, #31, LBB0_12
; %bb.4:
	ldr	w0, [x20, #8]
Lloh20:
	adrp	x8, _BMG160_REG_RANGE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BMG160_REG_RANGE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x22, _BMG160_RANGE_500DPS@GOTPAGE
Lloh24:
	ldr	x22, [x22, _BMG160_RANGE_500DPS@GOTPAGEOFF]
	ldr	w2, [x22]
	bl	_regmap_write
	tbnz	w0, #31, LBB0_14
; %bb.5:
	ldr	w8, [x22]
	str	w8, [x20]
	ldr	w0, [x20, #8]
Lloh25:
	adrp	x8, _BMG160_REG_SLOPE_THRES@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BMG160_REG_SLOPE_THRES@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_15
; %bb.6:
	ldr	w8, [sp, #12]
	str	w8, [x20, #4]
	ldr	w0, [x20, #8]
Lloh28:
	adrp	x8, _BMG160_REG_INT_EN_1@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BMG160_REG_INT_EN_1@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
Lloh31:
	adrp	x8, _BMG160_INT1_BIT_OD@GOTPAGE
Lloh32:
	ldr	x8, [x8, _BMG160_INT1_BIT_OD@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_16
; %bb.7:
	ldr	w0, [x20, #8]
Lloh34:
	adrp	x8, _BMG160_REG_INT_RST_LATCH@GOTPAGE
Lloh35:
	ldr	x8, [x8, _BMG160_REG_INT_RST_LATCH@GOTPAGEOFF]
Lloh36:
	adrp	x9, _BMG160_INT_MODE_LATCH_INT@GOTPAGE
Lloh37:
	ldr	x9, [x9, _BMG160_INT_MODE_LATCH_INT@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
Lloh39:
	ldr	w8, [x9]
Lloh40:
	adrp	x9, _BMG160_INT_MODE_LATCH_RESET@GOTPAGE
Lloh41:
	ldr	x9, [x9, _BMG160_INT_MODE_LATCH_RESET@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	orr	w2, w9, w8
	bl	_regmap_write
	tbnz	w0, #31, LBB0_17
; %bb.8:
	mov	w21, #0
	b	LBB0_13
LBB0_9:
	mov	x21, x0
Lloh43:
	adrp	x1, l_.str@PAGE
Lloh44:
	add	x1, x1, l_.str@PAGEOFF
LBB0_10:
	mov	x0, x19
	bl	_dev_err
	b	LBB0_13
LBB0_11:
	str	x8, [sp]
Lloh45:
	adrp	x1, l_.str.2@PAGE
Lloh46:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh47:
	adrp	x8, _ENODEV@GOTPAGE
Lloh48:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_12:
	mov	x21, x0
LBB0_13:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_14:
	mov	x21, x0
Lloh50:
	adrp	x1, l_.str.3@PAGE
Lloh51:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_15:
	mov	x21, x0
Lloh52:
	adrp	x1, l_.str.4@PAGE
Lloh53:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_10
LBB0_16:
	mov	x21, x0
Lloh54:
	adrp	x1, l_.str.5@PAGE
Lloh55:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_10
LBB0_17:
	mov	x21, x0
Lloh56:
	adrp	x1, l_.str.6@PAGE
Lloh57:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh38
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_BMG160_GYRO_REG_RESET,4,2      ; @BMG160_GYRO_REG_RESET
	.comm	_BMG160_GYRO_RESET_VAL,4,2      ; @BMG160_GYRO_RESET_VAL
	.comm	_BMG160_REG_CHIP_ID,4,2         ; @BMG160_REG_CHIP_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading reg_chip_id\n"

l_.str.1:                               ; @.str.1
	.asciz	"Chip Id %x\n"

	.comm	_BMG160_CHIP_ID_VAL,4,2         ; @BMG160_CHIP_ID_VAL
l_.str.2:                               ; @.str.2
	.asciz	"invalid chip %x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_BMG160_MODE_NORMAL,4,2         ; @BMG160_MODE_NORMAL
	.comm	_BMG160_DEF_BW,4,2              ; @BMG160_DEF_BW
	.comm	_BMG160_REG_RANGE,4,2           ; @BMG160_REG_RANGE
	.comm	_BMG160_RANGE_500DPS,4,2        ; @BMG160_RANGE_500DPS
l_.str.3:                               ; @.str.3
	.asciz	"Error writing reg_range\n"

	.comm	_BMG160_REG_SLOPE_THRES,4,2     ; @BMG160_REG_SLOPE_THRES
l_.str.4:                               ; @.str.4
	.asciz	"Error reading reg_slope_thres\n"

	.comm	_BMG160_REG_INT_EN_1,4,2        ; @BMG160_REG_INT_EN_1
	.comm	_BMG160_INT1_BIT_OD,4,2         ; @BMG160_INT1_BIT_OD
l_.str.5:                               ; @.str.5
	.asciz	"Error updating bits in reg_int_en_1\n"

	.comm	_BMG160_REG_INT_RST_LATCH,4,2   ; @BMG160_REG_INT_RST_LATCH
	.comm	_BMG160_INT_MODE_LATCH_INT,4,2  ; @BMG160_INT_MODE_LATCH_INT
	.comm	_BMG160_INT_MODE_LATCH_RESET,4,2 ; @BMG160_INT_MODE_LATCH_RESET
l_.str.6:                               ; @.str.6
	.asciz	"Error writing reg_motion_intr\n"

	.no_dead_strip	_bmg160_chip_init
.subsections_via_symbols
