	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tc3589x_chip_init
_tc3589x_chip_init:                     ## @tc3589x_chip_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	_TC3589x_MANFCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_tc3589x_reg_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	movq	_TC3589x_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_tc3589x_reg_read
	testl	%eax, %eax
	js	LBB0_5
## %bb.2:
	movq	_TC3589x_MANFCODE_MAGIC@GOTPCREL(%rip), %rcx
	movl	(%r14), %edi
	cmpl	(%rcx), %ebx
	jne	LBB0_3
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_dev_info
	movq	_TC3589x_RSTCTRL@GOTPCREL(%rip), %rax
	movq	_TC3589x_RSTCTRL_TIMRST@GOTPCREL(%rip), %rcx
	movq	_TC3589x_RSTCTRL_ROTRST@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	(%rax), %esi
	movq	_TC3589x_RSTCTRL_KBDRST@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_tc3589x_reg_write
	testl	%eax, %eax
	js	LBB0_5
## %bb.7:
	movq	_TC3589x_RSTINTCLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_tc3589x_reg_write              ## TAILCALL
LBB0_5:
	movl	%eax, %ebx
	jmp	LBB0_6
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TC3589x_MANFCODE,4,2           ## @TC3589x_MANFCODE
	.comm	_TC3589x_VERSION,4,2            ## @TC3589x_VERSION
	.comm	_TC3589x_MANFCODE_MAGIC,4,2     ## @TC3589x_MANFCODE_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown manufacturer: %#x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"manufacturer: %#x, version: %#x\n"

	.comm	_TC3589x_RSTCTRL,4,2            ## @TC3589x_RSTCTRL
	.comm	_TC3589x_RSTCTRL_TIMRST,4,2     ## @TC3589x_RSTCTRL_TIMRST
	.comm	_TC3589x_RSTCTRL_ROTRST,4,2     ## @TC3589x_RSTCTRL_ROTRST
	.comm	_TC3589x_RSTCTRL_KBDRST,4,2     ## @TC3589x_RSTCTRL_KBDRST
	.comm	_TC3589x_RSTINTCLR,4,2          ## @TC3589x_RSTINTCLR
	.no_dead_strip	_tc3589x_chip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tc3589x_chip_init
_tc3589x_chip_init:                     ; @tc3589x_chip_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _TC3589x_MANFCODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TC3589x_MANFCODE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_tc3589x_reg_read
	mov	x20, x0
	tbnz	w0, #31, LBB0_8
; %bb.1:
Lloh3:
	adrp	x8, _TC3589x_VERSION@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TC3589x_VERSION@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tc3589x_reg_read
	mov	x3, x0
	tbnz	w0, #31, LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _TC3589x_MANFCODE_MAGIC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TC3589x_MANFCODE_MAGIC@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w0, [x19]
	cmp	w20, w8
	b.ne	LBB0_6
; %bb.3:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_info
Lloh11:
	adrp	x8, _TC3589x_RSTCTRL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TC3589x_RSTCTRL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _TC3589x_RSTCTRL_TIMRST@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TC3589x_RSTCTRL_TIMRST@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _TC3589x_RSTCTRL_ROTRST@GOTPAGE
Lloh18:
	ldr	x9, [x9, _TC3589x_RSTCTRL_ROTRST@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh20:
	adrp	x9, _TC3589x_RSTCTRL_KBDRST@GOTPAGE
Lloh21:
	ldr	x9, [x9, _TC3589x_RSTCTRL_KBDRST@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_tc3589x_reg_write
	tbnz	w0, #31, LBB0_7
; %bb.4:
Lloh23:
	adrp	x8, _TC3589x_RSTINTCLR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _TC3589x_RSTINTCLR@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_tc3589x_reg_write
LBB0_5:
	mov	x20, x3
	b	LBB0_8
LBB0_6:
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_8
LBB0_7:
	mov	x20, x0
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_TC3589x_MANFCODE,4,2           ; @TC3589x_MANFCODE
	.comm	_TC3589x_VERSION,4,2            ; @TC3589x_VERSION
	.comm	_TC3589x_MANFCODE_MAGIC,4,2     ; @TC3589x_MANFCODE_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown manufacturer: %#x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"manufacturer: %#x, version: %#x\n"

	.comm	_TC3589x_RSTCTRL,4,2            ; @TC3589x_RSTCTRL
	.comm	_TC3589x_RSTCTRL_TIMRST,4,2     ; @TC3589x_RSTCTRL_TIMRST
	.comm	_TC3589x_RSTCTRL_ROTRST,4,2     ; @TC3589x_RSTCTRL_ROTRST
	.comm	_TC3589x_RSTCTRL_KBDRST,4,2     ; @TC3589x_RSTCTRL_KBDRST
	.comm	_TC3589x_RSTINTCLR,4,2          ; @TC3589x_RSTINTCLR
	.no_dead_strip	_tc3589x_chip_init
.subsections_via_symbols
