	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ak8974_detect
_ak8974_detect:                         ## @ak8974_detect
	.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	$88, %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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	24(%rdi), %edi
	movq	_AK8974_WHOAMI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-120(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_1
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	-120(%rbp), %edx
	cmpl	$130, %edx
	je	LBB0_10
## %bb.2:
	cmpl	$129, %edx
	je	LBB0_3
## %bb.4:
	cmpl	$128, %edx
	jne	LBB0_9
## %bb.5:
	leaq	L_.str.1(%rip), %r15
	jmp	LBB0_6
LBB0_10:
	movq	16(%r14), %rdi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	leaq	L_.str.3(%rip), %r15
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str(%rip), %r15
LBB0_6:
	movl	24(%r14), %edi
	movq	_AMI305_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-116(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.7:
	andl	$127, -116(%rbp)
	movq	_AMI305_SN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-112(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ak8974_get_u16_val
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.8:
	leaq	-112(%rbp), %rdi
	movl	$4, %esi
	callq	_add_device_randomness
	movq	16(%r14), %rdi
	movl	-116(%rbp), %ecx
	movl	-112(%rbp), %r8d
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_dev_info
LBB0_11:
	movq	%r15, (%r14)
	movl	-120(%rbp), %eax
	movl	%eax, 8(%r14)
	xorl	%ebx, %ebx
	cmpl	$128, %eax
	jne	LBB0_13
## %bb.12:
	movq	_AMI306_FINEOUTPUT_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-96(%rbp), %rdx
	movq	%r14, %rdi
	movl	$36, %ecx
	callq	_ak8974_read_calib_data
	movq	_AMI306_OFFZERO_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-108(%rbp), %rdx
	movq	%r14, %rdi
	movl	$12, %ecx
	callq	_ak8974_read_calib_data
	movl	-108(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %r12d
	andl	$127, %r12d
	movl	-96(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %r13d
	movl	-84(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %r15d
	movl	-72(%rbp), %edi
	callq	_le16_to_cpu
	movzbl	%al, %r10d
	movl	%eax, %r11d
	shrl	$8, %r11d
	movq	16(%r14), %rdi
	leaq	L_.str.6(%rip), %rsi
	xorl	%ebx, %ebx
	movl	$88, %edx
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	movl	%r13d, %r9d
	xorl	%eax, %eax
	pushq	%r11
	pushq	$89
	pushq	%r10
	pushq	$90
	callq	_dev_info
	addq	$32, %rsp
	movl	-104(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %r12d
	andl	$127, %r12d
	movl	-92(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %r15d
	movl	-80(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %r13d
	movl	-68(%rbp), %edi
	callq	_le16_to_cpu
	movzbl	%al, %r10d
	movl	%eax, %r11d
	shrl	$8, %r11d
	movq	16(%r14), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	$89, %edx
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	movl	%r15d, %r9d
	xorl	%eax, %eax
	pushq	%r11
	pushq	$88
	pushq	%r10
	pushq	$90
	callq	_dev_info
	addq	$32, %rsp
	movl	-100(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %r12d
	andl	$127, %r12d
	movl	-88(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %r15d
	movl	-76(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %r13d
	movl	-64(%rbp), %edi
	callq	_le16_to_cpu
	movzbl	%al, %r10d
	movl	%eax, %r11d
	shrl	$8, %r11d
	movq	16(%r14), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	$90, %edx
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	movl	%r15d, %r9d
	xorl	%eax, %eax
	pushq	%r11
	pushq	$88
	pushq	%r10
	pushq	$89
	callq	_dev_info
	addq	$32, %rsp
	jmp	LBB0_13
LBB0_9:
	movq	16(%r14), %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AK8974_WHOAMI,4,2              ## @AK8974_WHOAMI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ami305"

L_.str.1:                               ## @.str.1
	.asciz	"ami306"

	.comm	_AMI305_VER,4,2                 ## @AMI305_VER
	.comm	_AMI305_SN,4,2                  ## @AMI305_SN
L_.str.2:                               ## @.str.2
	.asciz	"detected %s, FW ver %02x, S/N: %04x\n"

L_.str.3:                               ## @.str.3
	.asciz	"ak8974"

L_.str.4:                               ## @.str.4
	.asciz	"detected AK8974\n"

L_.str.5:                               ## @.str.5
	.asciz	"unsupported device (%02x) "

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_AMI306_FINEOUTPUT_X,4,2        ## @AMI306_FINEOUTPUT_X
	.comm	_AMI306_OFFZERO_X,4,2           ## @AMI306_OFFZERO_X
L_.str.6:                               ## @.str.6
	.asciz	"factory calibration for axis %c: offz=%u sens=%u fine=%u pga%c=%u pga%c=%u\n"

	.no_dead_strip	_ak8974_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ak8974_detect
_ak8974_detect:                         ; @ak8974_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	x26, x25, [sp, #144]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	w0, [x0, #24]
Lloh3:
	adrp	x8, _AK8974_WHOAMI@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AK8974_WHOAMI@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #84
	bl	_regmap_read
	cbz	w0, LBB0_3
LBB0_1:
	ldur	x8, [x29, #-72]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.2:
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
LBB0_3:
	ldr	w2, [sp, #84]
	cmp	w2, #130
	b.eq	LBB0_7
; %bb.4:
	cmp	w2, #129
	b.eq	LBB0_8
; %bb.5:
	cmp	w2, #128
	b.ne	LBB0_15
; %bb.6:
Lloh9:
	adrp	x20, l_.str.1@PAGE
Lloh10:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_7:
	ldr	x0, [x19, #16]
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_info
Lloh13:
	adrp	x20, l_.str.3@PAGE
Lloh14:
	add	x20, x20, l_.str.3@PAGEOFF
	b	LBB0_12
LBB0_8:
Lloh15:
	adrp	x20, l_.str@PAGE
Lloh16:
	add	x20, x20, l_.str@PAGEOFF
LBB0_9:
	ldr	w0, [x19, #24]
Lloh17:
	adrp	x8, _AMI305_VER@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AMI305_VER@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	add	x2, sp, #80
	bl	_regmap_read
	cbnz	w0, LBB0_1
; %bb.10:
	ldr	w8, [sp, #80]
	and	w8, w8, #0x7f
	str	w8, [sp, #80]
Lloh20:
	adrp	x8, _AMI305_SN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AMI305_SN@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	add	x2, sp, #76
	mov	x0, x19
	bl	_ak8974_get_u16_val
	cbnz	w0, LBB0_1
; %bb.11:
	add	x0, sp, #76
	mov	w1, #4
	bl	_add_device_randomness
	ldr	x0, [x19, #16]
	ldp	w9, w8, [sp, #76]
	stp	x8, x9, [sp, #8]
	str	x20, [sp]
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_info
LBB0_12:
	str	x20, [x19]
	ldr	w8, [sp, #84]
	str	w8, [x19, #8]
	cmp	w8, #128
	b.ne	LBB0_14
; %bb.13:
Lloh25:
	adrp	x8, _AMI306_FINEOUTPUT_X@GOTPAGE
Lloh26:
	ldr	x8, [x8, _AMI306_FINEOUTPUT_X@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	add	x2, sp, #100
	mov	x0, x19
	mov	w3, #36
	bl	_ak8974_read_calib_data
Lloh28:
	adrp	x8, _AMI306_OFFZERO_X@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AMI306_OFFZERO_X@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	add	x2, sp, #88
	mov	x0, x19
	mov	w3, #12
	bl	_ak8974_read_calib_data
	ldr	w0, [sp, #88]
	bl	_le16_to_cpu
	and	w22, w0, #0x7f
	ldr	w0, [sp, #100]
	bl	_le16_to_cpu
	mov	x20, x0
	ldr	w0, [sp, #112]
	bl	_le16_to_cpu
	mov	x21, x0
	ldr	w0, [sp, #124]
	bl	_le16_to_cpu
	lsr	w8, w0, #8
	and	w9, w0, #0xff
	ldr	x0, [x19, #16]
	mov	w23, #89
	stp	x23, x8, [sp, #48]
	mov	w24, #90
	stp	x24, x9, [sp, #32]
	stp	x21, x20, [sp, #16]
	mov	w25, #88
Lloh31:
	adrp	x20, l_.str.6@PAGE
Lloh32:
	add	x20, x20, l_.str.6@PAGEOFF
	stp	x25, x22, [sp]
	mov	x1, x20
	bl	_dev_info
	ldr	w0, [sp, #92]
	bl	_le16_to_cpu
	and	w26, w0, #0x7f
	ldr	w0, [sp, #104]
	bl	_le16_to_cpu
	mov	x21, x0
	ldr	w0, [sp, #116]
	bl	_le16_to_cpu
	mov	x22, x0
	ldr	w0, [sp, #128]
	bl	_le16_to_cpu
	lsr	w8, w0, #8
	and	w9, w0, #0xff
	ldr	x0, [x19, #16]
	stp	x25, x8, [sp, #48]
	stp	x24, x9, [sp, #32]
	stp	x22, x21, [sp, #16]
	stp	x23, x26, [sp]
	mov	x1, x20
	bl	_dev_info
	ldr	w0, [sp, #96]
	bl	_le16_to_cpu
	and	w26, w0, #0x7f
	ldr	w0, [sp, #108]
	bl	_le16_to_cpu
	mov	x21, x0
	ldr	w0, [sp, #120]
	bl	_le16_to_cpu
	mov	x22, x0
	ldr	w0, [sp, #132]
	bl	_le16_to_cpu
	lsr	w8, w0, #8
	and	w9, w0, #0xff
	ldr	x0, [x19, #16]
	stp	x25, x8, [sp, #48]
	stp	x23, x9, [sp, #32]
	stp	x22, x21, [sp, #16]
	stp	x24, x26, [sp]
	mov	x1, x20
	bl	_dev_info
LBB0_14:
	mov	w0, #0
	b	LBB0_1
LBB0_15:
	ldr	x0, [x19, #16]
Lloh33:
	adrp	x1, l_.str.5@PAGE
Lloh34:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
Lloh35:
	adrp	x8, _ENODEV@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_1
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_AK8974_WHOAMI,4,2              ; @AK8974_WHOAMI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ami305"

l_.str.1:                               ; @.str.1
	.asciz	"ami306"

	.comm	_AMI305_VER,4,2                 ; @AMI305_VER
	.comm	_AMI305_SN,4,2                  ; @AMI305_SN
l_.str.2:                               ; @.str.2
	.asciz	"detected %s, FW ver %02x, S/N: %04x\n"

l_.str.3:                               ; @.str.3
	.asciz	"ak8974"

l_.str.4:                               ; @.str.4
	.asciz	"detected AK8974\n"

l_.str.5:                               ; @.str.5
	.asciz	"unsupported device (%02x) "

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_AMI306_FINEOUTPUT_X,4,2        ; @AMI306_FINEOUTPUT_X
	.comm	_AMI306_OFFZERO_X,4,2           ; @AMI306_OFFZERO_X
l_.str.6:                               ; @.str.6
	.asciz	"factory calibration for axis %c: offz=%u sens=%u fine=%u pga%c=%u pga%c=%u\n"

	.no_dead_strip	_ak8974_detect
.subsections_via_symbols
