	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bmc150_magn_write_raw
_bmc150_magn_write_raw:                 ## @bmc150_magn_write_raw
	.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	%r8, %rbx
	movl	%edx, %r14d
	movq	%rsi, %r13
	callq	_iio_priv
	movq	%rax, %r12
	movq	%rax, %r15
	cmpq	$132, %rbx
	je	LBB0_4
## %bb.1:
	cmpq	$131, %rbx
	jne	LBB0_14
## %bb.2:
	cmpl	%r14d, (%r15)
	jl	LBB0_14
## %bb.3:
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_bmc150_magn_set_odr
	jmp	LBB0_11
LBB0_4:
	movl	(%r13), %eax
	leal	-129(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_5
## %bb.9:
	leal	-512(%r14), %eax
	cmpl	$-512, %eax                     ## imm = 0xFE00
	jbe	LBB0_14
## %bb.10:
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_bmc150_magn_set_max_odr
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movl	8(%r15), %r15d
	movq	_BMC150_MAGN_REG_REP_XY@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_BMC150_MAGN_REG_REP_DATAMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r14d, %edi
	callq	_BMC150_MAGN_REPXY_TO_REGVAL
	jmp	LBB0_13
LBB0_5:
	cmpl	$128, %eax
	jne	LBB0_14
## %bb.6:
	leal	-257(%r14), %eax
	cmpl	$-257, %eax                     ## imm = 0xFEFF
	ja	LBB0_7
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_7:
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_bmc150_magn_set_max_odr
	testl	%eax, %eax
	js	LBB0_11
## %bb.8:
	movl	8(%r15), %r15d
	movq	_BMC150_MAGN_REG_REP_Z@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_BMC150_MAGN_REG_REP_DATAMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r14d, %edi
	callq	_BMC150_MAGN_REPZ_TO_REGVAL
LBB0_13:
	movl	%r15d, %edi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_regmap_update_bits
LBB0_11:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BMC150_MAGN_REG_REP_XY,4,2     ## @BMC150_MAGN_REG_REP_XY
	.comm	_BMC150_MAGN_REG_REP_DATAMASK,4,2 ## @BMC150_MAGN_REG_REP_DATAMASK
	.comm	_BMC150_MAGN_REG_REP_Z,4,2      ## @BMC150_MAGN_REG_REP_Z
	.no_dead_strip	_bmc150_magn_write_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bmc150_magn_write_raw
_bmc150_magn_write_raw:                 ; @bmc150_magn_write_raw
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x4
	mov	x19, x2
	mov	x22, x1
	bl	_iio_priv
	mov	x20, x0
	cmp	x21, #132
	b.eq	LBB0_4
; %bb.1:
	cmp	x21, #131
	b.ne	LBB0_10
; %bb.2:
	ldr	w8, [x20]
	cmp	w8, w19
	b.lt	LBB0_10
; %bb.3:
	add	x21, x20, #4
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x19
	bl	_bmc150_magn_set_odr
	mov	x19, x0
	mov	x0, x21
	b	LBB0_15
LBB0_4:
	ldr	w8, [x22]
	sub	w9, w8, #129
	cmp	w9, #2
	b.hs	LBB0_8
; %bb.5:
	sub	w8, w19, #512
	cmn	w8, #512
	b.ls	LBB0_10
; %bb.6:
	add	x22, x20, #4
	mov	x0, x22
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	mov	w3, #0
	bl	_bmc150_magn_set_max_odr
	tbnz	w0, #31, LBB0_17
; %bb.7:
	ldr	w20, [x20, #8]
Lloh0:
	adrp	x8, _BMC150_MAGN_REG_REP_XY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BMC150_MAGN_REG_REP_XY@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x8, _BMC150_MAGN_REG_REP_DATAMASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BMC150_MAGN_REG_REP_DATAMASK@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	mov	x0, x19
	bl	_BMC150_MAGN_REPXY_TO_REGVAL
	b	LBB0_14
LBB0_8:
	cmp	w8, #128
	b.ne	LBB0_10
; %bb.9:
	sub	w8, w19, #257
	cmn	w8, #257
	b.hi	LBB0_12
LBB0_10:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_11:
	mov	x0, x21
	b	LBB0_16
LBB0_12:
	add	x22, x20, #4
	mov	x0, x22
	bl	_mutex_lock
	mov	x0, x20
	mov	w1, #0
	mov	x2, x19
	mov	w3, #0
	bl	_bmc150_magn_set_max_odr
	tbnz	w0, #31, LBB0_17
; %bb.13:
	ldr	w20, [x20, #8]
Lloh9:
	adrp	x8, _BMC150_MAGN_REG_REP_Z@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BMC150_MAGN_REG_REP_Z@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
Lloh12:
	adrp	x8, _BMC150_MAGN_REG_REP_DATAMASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BMC150_MAGN_REG_REP_DATAMASK@GOTPAGEOFF]
Lloh14:
	ldr	w23, [x8]
	mov	x0, x19
	bl	_BMC150_MAGN_REPZ_TO_REGVAL
LBB0_14:
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_regmap_update_bits
	mov	x19, x0
	mov	x0, x22
LBB0_15:
	bl	_mutex_unlock
	mov	x0, x19
LBB0_16:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_17:
	mov	x21, x0
	mov	x0, x22
	bl	_mutex_unlock
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BMC150_MAGN_REG_REP_XY,4,2     ; @BMC150_MAGN_REG_REP_XY
	.comm	_BMC150_MAGN_REG_REP_DATAMASK,4,2 ; @BMC150_MAGN_REG_REP_DATAMASK
	.comm	_BMC150_MAGN_REG_REP_Z,4,2      ; @BMC150_MAGN_REG_REP_Z
	.no_dead_strip	_bmc150_magn_write_raw
.subsections_via_symbols
