	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rm3100_read_mag
_rm3100_read_mag:                       ## @rm3100_read_mag
	.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	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r15
	callq	_mutex_lock
	movq	_RM3100_REG_POLL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leal	4(%r12), %edi
	callq	_BIT
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	movq	%r13, %rdi
	callq	_rm3100_wait_measurement
	testl	%eax, %eax
	js	LBB0_3
## %bb.2:
	movq	_RM3100_REG_MX2@GOTPCREL(%rip), %rax
	leal	(%r12,%r12,2), %ecx
	movslq	%ecx, %rsi
	addq	(%rax), %rsi
	leaq	-60(%rbp), %rdx
	movq	%r15, %rdi
	movl	$3, %ecx
	callq	_regmap_bulk_read
	testl	%eax, %eax
	js	LBB0_3
## %bb.6:
	movq	%r13, %rdi
	callq	_mutex_unlock
	movl	-60(%rbp), %eax
	movl	-56(%rbp), %edi
	shll	$16, %eax
	shll	$8, %edi
	orl	%eax, %edi
	orl	-52(%rbp), %edi
	movl	$23, %esi
	callq	_sign_extend32
	movl	%eax, (%r14)
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_4
LBB0_3:
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_7
## %bb.5:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RM3100_REG_POLL,4,2            ## @RM3100_REG_POLL
	.comm	_RM3100_REG_MX2,8,3             ## @RM3100_REG_MX2
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.no_dead_strip	_rm3100_read_mag
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rm3100_read_mag
_rm3100_read_mag:                       ; @rm3100_read_mag
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x2
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x21, [x0, #8]
	bl	_mutex_lock
Lloh3:
	adrp	x8, _RM3100_REG_POLL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RM3100_REG_POLL@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	add	w0, w23, #4
	bl	_BIT
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_regmap_write
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x0, x20
	bl	_rm3100_wait_measurement
	tbnz	w0, #31, LBB0_4
; %bb.2:
Lloh6:
	adrp	x8, _RM3100_REG_MX2@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RM3100_REG_MX2@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	add	w9, w23, w23, lsl #1
	add	x1, x8, w9, sxtw
	add	x2, sp, #12
	mov	x0, x21
	mov	w3, #3
	bl	_regmap_bulk_read
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_mutex_unlock
	ldp	w8, w9, [sp, #12]
	lsl	w9, w9, #8
	orr	w8, w9, w8, lsl #16
	ldr	w9, [sp, #20]
	orr	w0, w8, w9
	mov	w1, #23
	bl	_sign_extend32
	str	w0, [x19]
Lloh9:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
	b	LBB0_5
LBB0_4:
	mov	x22, x0
	mov	x0, x20
	bl	_mutex_unlock
LBB0_5:
	ldr	x8, [sp, #24]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x22
	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
	add	sp, sp, #96
	ret
LBB0_7:
	bl	___stack_chk_fail
	.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
	.cfi_endproc
                                        ; -- End function
	.comm	_RM3100_REG_POLL,4,2            ; @RM3100_REG_POLL
	.comm	_RM3100_REG_MX2,8,3             ; @RM3100_REG_MX2
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.no_dead_strip	_rm3100_read_mag
.subsections_via_symbols
