	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bmc150_magn_compensate_z
_bmc150_magn_compensate_z:              ## @bmc150_magn_compensate_z
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movl	16(%rdi), %edi
	callq	_le16_to_cpu
	movq	%rax, %r13
	movl	12(%r12), %edi
	callq	_le16_to_cpu
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	8(%r12), %edi
	callq	_le16_to_cpu
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	4(%r12), %edi
	callq	_le16_to_cpu
	movq	%rax, %r15
	movl	(%r12), %edi
	callq	_le16_to_cpu
	movq	_BMC150_MAGN_Z_OVERFLOW_VAL@GOTPCREL(%rip), %rcx
	cmpq	%rbx, (%rcx)
	jne	LBB0_2
## %bb.1:
	movq	_S32_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_5
LBB0_2:
	subl	%eax, %ebx
	shll	$15, %ebx
	movl	%r14d, %eax
	subl	%r13d, %eax
	imull	%r15d, %eax
	sarl	$2, %eax
	subl	%eax, %ebx
	movslq	%ebx, %rax
	movslq	-48(%rbp), %rcx                 ## 4-byte Folded Reload
	imulq	%r14, %rcx
	addq	%rcx, %rcx
	addq	$32768, %rcx                    ## imm = 0x8000
	sarq	$16, %rcx
	addq	-56(%rbp), %rcx                 ## 8-byte Folded Reload
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_3
## %bb.4:
	cqto
	idivq	%rcx
	jmp	LBB0_5
LBB0_3:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BMC150_MAGN_Z_OVERFLOW_VAL,8,3 ## @BMC150_MAGN_Z_OVERFLOW_VAL
	.comm	_S32_MIN,4,2                    ## @S32_MIN
	.no_dead_strip	_bmc150_magn_compensate_z
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bmc150_magn_compensate_z
_bmc150_magn_compensate_z:              ; @bmc150_magn_compensate_z
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	mov	x20, x1
	mov	x25, x0
	ldr	w0, [x0, #16]
	bl	_le16_to_cpu
	mov	x21, x0
	ldr	w0, [x25, #12]
	bl	_le16_to_cpu
	mov	x22, x0
	ldr	w0, [x25, #8]
	bl	_le16_to_cpu
	mov	x23, x0
	ldr	w0, [x25, #4]
	bl	_le16_to_cpu
	mov	x24, x0
	ldr	w0, [x25]
	bl	_le16_to_cpu
Lloh0:
	adrp	x8, _BMC150_MAGN_Z_OVERFLOW_VAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BMC150_MAGN_Z_OVERFLOW_VAL@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _S32_MIN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _S32_MIN@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_3
LBB0_2:
	sub	w8, w20, w0
	lsl	w8, w8, #15
	sub	w9, w19, w21
	mul	w9, w24, w9
	sub	w8, w8, w9, asr #2
	sxtw	x8, w8
	sxtw	x9, w22
	mul	x9, x19, x9
	lsl	x9, x9, #1
	add	x9, x9, #8, lsl #12             ; =32768
	add	x9, x23, x9, asr #16
	sdiv	x0, x8, x9
LBB0_3:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_BMC150_MAGN_Z_OVERFLOW_VAL,8,3 ; @BMC150_MAGN_Z_OVERFLOW_VAL
	.comm	_S32_MIN,4,2                    ; @S32_MIN
	.no_dead_strip	_bmc150_magn_compensate_z
.subsections_via_symbols
