	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bmc150_magn_init
_bmc150_magn_init:                      ## @bmc150_magn_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_BMC150_MAGN_POWER_MODE_SUSPEND@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	xorl	%edx, %edx
	callq	_bmc150_magn_set_power_mode
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	4(%r14), %edi
	movq	_BMC150_MAGN_REG_CHIP_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	-52(%rbp), %edx
	movq	_BMC150_MAGN_CHIP_ID_VAL@GOTPCREL(%rip), %rax
	movl	(%r14), %edi
	cmpl	(%rax), %edx
	jne	LBB0_5
## %bb.6:
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	movq	_bmc150_magn_presets_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_BMC150_MAGN_DEFAULT_PRESET@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	(%rax,%rcx,4), %r15d
	movl	4(%rax,%rcx,4), %r12d
	movl	8(%rax,%rcx,4), %r13d
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_bmc150_magn_set_odr
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	movl	4(%r14), %ebx
	movq	_BMC150_MAGN_REG_REP_XY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%r13d, %edi
	callq	_BMC150_MAGN_REPXY_TO_REGVAL
	movl	%ebx, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_9
## %bb.12:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	4(%r14), %r12d
	movq	_BMC150_MAGN_REG_REP_Z@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, %r13d
	callq	_BMC150_MAGN_REPZ_TO_REGVAL
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.14:
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r13d, %edx
	movl	%r15d, %ecx
	callq	_bmc150_magn_set_max_odr
	testl	%eax, %eax
	js	LBB0_15
## %bb.16:
	movq	_BMC150_MAGN_POWER_MODE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_bmc150_magn_set_power_mode
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jns	LBB0_20
## %bb.17:
	movl	%eax, %r15d
	movl	(%r14), %edi
	leaq	L_.str.7(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movl	%r15d, %ebx
	jmp	LBB0_18
LBB0_1:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_20
LBB0_3:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_19
LBB0_5:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_7:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%r15d, %edx
	jmp	LBB0_11
LBB0_9:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_10
LBB0_13:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.6(%rip), %rsi
LBB0_10:
	movl	%r13d, %edx
LBB0_11:
	xorl	%eax, %eax
	callq	_dev_err
LBB0_18:
	movq	_BMC150_MAGN_POWER_MODE_SUSPEND@GOTPCREL(%rip), %r15
LBB0_19:
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_bmc150_magn_set_power_mode
LBB0_20:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	%eax, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_BMC150_MAGN_POWER_MODE_SUSPEND,4,2 ## @BMC150_MAGN_POWER_MODE_SUSPEND
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to bring up device from suspend mode\n"

	.comm	_BMC150_MAGN_REG_CHIP_ID,4,2    ## @BMC150_MAGN_REG_CHIP_ID
L_.str.1:                               ## @.str.1
	.asciz	"Failed reading chip id\n"

	.comm	_BMC150_MAGN_CHIP_ID_VAL,4,2    ## @BMC150_MAGN_CHIP_ID_VAL
L_.str.2:                               ## @.str.2
	.asciz	"Invalid chip id 0x%x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.3:                               ## @.str.3
	.asciz	"Chip id %x\n"

	.comm	_bmc150_magn_presets_table,8,3  ## @bmc150_magn_presets_table
	.comm	_BMC150_MAGN_DEFAULT_PRESET,8,3 ## @BMC150_MAGN_DEFAULT_PRESET
L_.str.4:                               ## @.str.4
	.asciz	"Failed to set ODR to %d\n"

	.comm	_BMC150_MAGN_REG_REP_XY,4,2     ## @BMC150_MAGN_REG_REP_XY
L_.str.5:                               ## @.str.5
	.asciz	"Failed to set REP XY to %d\n"

	.comm	_BMC150_MAGN_REG_REP_Z,4,2      ## @BMC150_MAGN_REG_REP_Z
L_.str.6:                               ## @.str.6
	.asciz	"Failed to set REP Z to %d\n"

	.comm	_BMC150_MAGN_POWER_MODE_NORMAL,4,2 ## @BMC150_MAGN_POWER_MODE_NORMAL
L_.str.7:                               ## @.str.7
	.asciz	"Failed to power on device\n"

	.no_dead_strip	_bmc150_magn_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bmc150_magn_init
_bmc150_magn_init:                      ; @bmc150_magn_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
Lloh0:
	adrp	x25, _BMC150_MAGN_POWER_MODE_SUSPEND@GOTPAGE
Lloh1:
	ldr	x25, [x25, _BMC150_MAGN_POWER_MODE_SUSPEND@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	w2, #0
	bl	_bmc150_magn_set_power_mode
	tbnz	w0, #31, LBB0_9
; %bb.1:
	ldr	w0, [x19, #4]
Lloh2:
	adrp	x8, _BMC150_MAGN_REG_CHIP_ID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BMC150_MAGN_REG_CHIP_ID@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_10
; %bb.2:
	ldr	w2, [sp, #12]
Lloh5:
	adrp	x8, _BMC150_MAGN_CHIP_ID_VAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BMC150_MAGN_CHIP_ID_VAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w0, [x19]
	cmp	w2, w8
	b.ne	LBB0_11
; %bb.3:
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_dev_dbg
Lloh10:
	adrp	x8, _bmc150_magn_presets_table@GOTPAGE
Lloh11:
	ldr	x8, [x8, _bmc150_magn_presets_table@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
Lloh13:
	adrp	x9, _BMC150_MAGN_DEFAULT_PRESET@GOTPAGE
Lloh14:
	ldr	x9, [x9, _BMC150_MAGN_DEFAULT_PRESET@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	mov	w10, #12
	madd	x8, x9, x10, x8
	ldp	w21, w22, [x8]
	ldr	w23, [x8, #8]
	mov	x0, x19
	mov	x1, x21
	bl	_bmc150_magn_set_odr
	tbnz	w0, #31, LBB0_12
; %bb.4:
	ldr	w20, [x19, #4]
Lloh16:
	adrp	x8, _BMC150_MAGN_REG_REP_XY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BMC150_MAGN_REG_REP_XY@GOTPAGEOFF]
Lloh18:
	ldr	w24, [x8]
	mov	x0, x23
	bl	_BMC150_MAGN_REPXY_TO_REGVAL
	mov	x2, x0
	mov	x0, x20
	mov	x1, x24
	bl	_regmap_write
	tbnz	w0, #31, LBB0_13
; %bb.5:
	ldr	w20, [x19, #4]
Lloh19:
	adrp	x8, _BMC150_MAGN_REG_REP_Z@GOTPAGE
Lloh20:
	ldr	x8, [x8, _BMC150_MAGN_REG_REP_Z@GOTPAGEOFF]
Lloh21:
	ldr	w24, [x8]
	mov	x0, x22
	bl	_BMC150_MAGN_REPZ_TO_REGVAL
	mov	x2, x0
	mov	x0, x20
	mov	x1, x24
	bl	_regmap_write
	tbnz	w0, #31, LBB0_14
; %bb.6:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	bl	_bmc150_magn_set_max_odr
	tbnz	w0, #31, LBB0_15
; %bb.7:
Lloh22:
	adrp	x8, _BMC150_MAGN_POWER_MODE_NORMAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BMC150_MAGN_POWER_MODE_NORMAL@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_bmc150_magn_set_power_mode
	tbnz	w0, #31, LBB0_16
; %bb.8:
	mov	w20, #0
	b	LBB0_19
LBB0_9:
	mov	x20, x0
	ldr	w0, [x19]
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_19
LBB0_10:
	mov	x20, x0
	ldr	w0, [x19]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_11:
	str	x2, [sp]
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh31:
	adrp	x8, _ENODEV@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_18
LBB0_12:
	mov	x20, x0
	ldr	w0, [x19]
	str	x21, [sp]
Lloh34:
	adrp	x1, l_.str.4@PAGE
Lloh35:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_13:
	mov	x20, x0
	ldr	w0, [x19]
	str	x23, [sp]
Lloh36:
	adrp	x1, l_.str.5@PAGE
Lloh37:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_17
LBB0_14:
	mov	x20, x0
	ldr	w0, [x19]
	str	x22, [sp]
Lloh38:
	adrp	x1, l_.str.6@PAGE
Lloh39:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_17
LBB0_15:
	mov	x20, x0
	b	LBB0_18
LBB0_16:
	mov	x20, x0
	ldr	w0, [x19]
Lloh40:
	adrp	x1, l_.str.7@PAGE
Lloh41:
	add	x1, x1, l_.str.7@PAGEOFF
LBB0_17:
	bl	_dev_err
LBB0_18:
	ldr	w1, [x25]
	mov	x0, x19
	mov	w2, #1
	bl	_bmc150_magn_set_power_mode
LBB0_19:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_BMC150_MAGN_POWER_MODE_SUSPEND,4,2 ; @BMC150_MAGN_POWER_MODE_SUSPEND
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to bring up device from suspend mode\n"

	.comm	_BMC150_MAGN_REG_CHIP_ID,4,2    ; @BMC150_MAGN_REG_CHIP_ID
l_.str.1:                               ; @.str.1
	.asciz	"Failed reading chip id\n"

	.comm	_BMC150_MAGN_CHIP_ID_VAL,4,2    ; @BMC150_MAGN_CHIP_ID_VAL
l_.str.2:                               ; @.str.2
	.asciz	"Invalid chip id 0x%x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.3:                               ; @.str.3
	.asciz	"Chip id %x\n"

	.comm	_bmc150_magn_presets_table,8,3  ; @bmc150_magn_presets_table
	.comm	_BMC150_MAGN_DEFAULT_PRESET,8,3 ; @BMC150_MAGN_DEFAULT_PRESET
l_.str.4:                               ; @.str.4
	.asciz	"Failed to set ODR to %d\n"

	.comm	_BMC150_MAGN_REG_REP_XY,4,2     ; @BMC150_MAGN_REG_REP_XY
l_.str.5:                               ; @.str.5
	.asciz	"Failed to set REP XY to %d\n"

	.comm	_BMC150_MAGN_REG_REP_Z,4,2      ; @BMC150_MAGN_REG_REP_Z
l_.str.6:                               ; @.str.6
	.asciz	"Failed to set REP Z to %d\n"

	.comm	_BMC150_MAGN_POWER_MODE_NORMAL,4,2 ; @BMC150_MAGN_POWER_MODE_NORMAL
l_.str.7:                               ; @.str.7
	.asciz	"Failed to power on device\n"

	.no_dead_strip	_bmc150_magn_init
.subsections_via_symbols
