	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function as3645a_detect
_as3645a_detect:                        ## @as3645a_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %r14
	movq	_AS_DESIGN_INFO_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_as3645a_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movl	%ebx, %edi
	callq	_AS_DESIGN_INFO_FACTORY
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_AS_DESIGN_INFO_MODEL
	movl	%eax, %r13d
	movq	_AS_VERSION_CONTROL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_as3645a_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	%ebx, %edi
	callq	_AS_VERSION_CONTROL_RFU
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_AS_VERSION_CONTROL_VERSION
	cmpl	$1, %r13d
	jne	LBB0_7
## %bb.6:
	testl	%r12d, %r12d
	jne	LBB0_7
## %bb.8:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %edx
	decl	%edx
	cmpl	$4, %edx
	ja	LBB0_9
## %bb.10:
	movslq	%edx, %rdx
	leaq	l_reltable.as3645a_detect(%rip), %rsi
	movslq	(%rsi,%rdx,4), %rdx
	addq	%rsi, %rdx
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_13
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_9:
	leaq	L_.str.8(%rip), %rdx
LBB0_11:
	leaq	L_.str.9(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %r8d
	callq	_dev_info
	movq	_AS_PASSWORD_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AS_PASSWORD_UNLOCK_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_as3645a_write
	testl	%eax, %eax
	js	LBB0_12
## %bb.14:
	movq	_AS_BOOST_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AS_BOOST_CURRENT_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_as3645a_write                  ## TAILCALL
LBB0_12:
	movl	%eax, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AS_DESIGN_INFO_REG,4,2         ## @AS_DESIGN_INFO_REG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't read design info reg\n"

	.comm	_AS_VERSION_CONTROL_REG,4,2     ## @AS_VERSION_CONTROL_REG
L_.str.1:                               ## @.str.1
	.asciz	"can't read version control reg\n"

L_.str.2:                               ## @.str.2
	.asciz	"AS3645A not detected (model %d rfu %d)\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.3:                               ## @.str.3
	.asciz	"AMS, Austria Micro Systems"

L_.str.4:                               ## @.str.4
	.asciz	"ADI, Analog Devices Inc."

L_.str.5:                               ## @.str.5
	.asciz	"NSC, National Semiconductor"

L_.str.6:                               ## @.str.6
	.asciz	"NXP"

L_.str.7:                               ## @.str.7
	.asciz	"TI, Texas Instrument"

L_.str.8:                               ## @.str.8
	.asciz	"Unknown"

L_.str.9:                               ## @.str.9
	.asciz	"Chip vendor: %s (%d) Version: %d\n"

	.comm	_AS_PASSWORD_REG,4,2            ## @AS_PASSWORD_REG
	.comm	_AS_PASSWORD_UNLOCK_VALUE,4,2   ## @AS_PASSWORD_UNLOCK_VALUE
	.comm	_AS_BOOST_REG,4,2               ## @AS_BOOST_REG
	.comm	_AS_BOOST_CURRENT_DISABLE,4,2   ## @AS_BOOST_CURRENT_DISABLE
	.no_dead_strip	_as3645a_detect
	.section	__TEXT,__const
	.p2align	2                               ## @reltable.as3645a_detect
l_reltable.as3645a_detect:
	.long	L_.str.3-l_reltable.as3645a_detect
	.long	L_.str.4-l_reltable.as3645a_detect
	.long	L_.str.5-l_reltable.as3645a_detect
	.long	L_.str.6-l_reltable.as3645a_detect
	.long	L_.str.7-l_reltable.as3645a_detect

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function as3645a_detect
_as3645a_detect:                        ; @as3645a_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldr	x20, [x0]
Lloh0:
	adrp	x8, _AS_DESIGN_INFO_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AS_DESIGN_INFO_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_as3645a_read
	mov	x22, x0
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x0, x22
	bl	_AS_DESIGN_INFO_FACTORY
	mov	x21, x0
	mov	x0, x22
	bl	_AS_DESIGN_INFO_MODEL
	mov	x23, x0
Lloh3:
	adrp	x8, _AS_VERSION_CONTROL_REG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AS_VERSION_CONTROL_REG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_as3645a_read
	mov	x22, x0
	tbnz	w0, #31, LBB0_5
; %bb.2:
	mov	x0, x22
	bl	_AS_VERSION_CONTROL_RFU
	mov	x24, x0
	mov	x0, x22
	bl	_AS_VERSION_CONTROL_VERSION
	cmp	w23, #1
	ccmp	w24, #0, #0, eq
	b.eq	LBB0_8
; %bb.3:
	stp	x23, x24, [sp]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_7
LBB0_4:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x20
	bl	_dev_err
LBB0_7:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
LBB0_8:
	mov	x4, x0
	sub	w8, w21, #1
	cmp	w8, #4
	b.hi	LBB0_10
; %bb.9:
Lloh15:
	adrp	x9, l_switch.table.as3645a_detect@PAGE
Lloh16:
	add	x9, x9, l_switch.table.as3645a_detect@PAGEOFF
	ldr	x2, [x9, w8, sxtw #3]
	b	LBB0_11
LBB0_10:
Lloh17:
	adrp	x2, l_.str.8@PAGE
Lloh18:
	add	x2, x2, l_.str.8@PAGEOFF
LBB0_11:
Lloh19:
	adrp	x1, l_.str.9@PAGE
Lloh20:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x20
	mov	x3, x21
	bl	_dev_info
Lloh21:
	adrp	x8, _AS_PASSWORD_REG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AS_PASSWORD_REG@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _AS_PASSWORD_UNLOCK_VALUE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AS_PASSWORD_UNLOCK_VALUE@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_as3645a_write
	tbnz	w0, #31, LBB0_13
; %bb.12:
Lloh27:
	adrp	x8, _AS_BOOST_REG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AS_BOOST_REG@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x8, _AS_BOOST_CURRENT_DISABLE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _AS_BOOST_CURRENT_DISABLE@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	mov	x0, x19
	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
	add	sp, sp, #80
	b	_as3645a_write
LBB0_13:
	mov	x22, x0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_AS_DESIGN_INFO_REG,4,2         ; @AS_DESIGN_INFO_REG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't read design info reg\n"

	.comm	_AS_VERSION_CONTROL_REG,4,2     ; @AS_VERSION_CONTROL_REG
l_.str.1:                               ; @.str.1
	.asciz	"can't read version control reg\n"

l_.str.2:                               ; @.str.2
	.asciz	"AS3645A not detected (model %d rfu %d)\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.3:                               ; @.str.3
	.asciz	"AMS, Austria Micro Systems"

l_.str.4:                               ; @.str.4
	.asciz	"ADI, Analog Devices Inc."

l_.str.5:                               ; @.str.5
	.asciz	"NSC, National Semiconductor"

l_.str.6:                               ; @.str.6
	.asciz	"NXP"

l_.str.7:                               ; @.str.7
	.asciz	"TI, Texas Instrument"

l_.str.8:                               ; @.str.8
	.asciz	"Unknown"

l_.str.9:                               ; @.str.9
	.asciz	"Chip vendor: %s (%d) Version: %d\n"

	.comm	_AS_PASSWORD_REG,4,2            ; @AS_PASSWORD_REG
	.comm	_AS_PASSWORD_UNLOCK_VALUE,4,2   ; @AS_PASSWORD_UNLOCK_VALUE
	.comm	_AS_BOOST_REG,4,2               ; @AS_BOOST_REG
	.comm	_AS_BOOST_CURRENT_DISABLE,4,2   ; @AS_BOOST_CURRENT_DISABLE
	.no_dead_strip	_as3645a_detect
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.as3645a_detect
l_switch.table.as3645a_detect:
	.quad	l_.str.3
	.quad	l_.str.4
	.quad	l_.str.5
	.quad	l_.str.6
	.quad	l_.str.7

.subsections_via_symbols
