	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t3_mc5_init                    ## -- Begin function t3_mc5_init
	.p2align	4, 0x90
_t3_mc5_init:                           ## @t3_mc5_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	%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
                                        ## kill: def $esi killed $esi def $rsi
	movl	(%rdi), %ebx
	testl	%ebx, %ebx
	je	LBB0_1
## %bb.2:
	movl	%ecx, %r14d
	movq	_MAX_ROUTES@GOTPCREL(%rip), %rax
	cmpl	%ecx, (%rax)
	jb	LBB0_4
## %bb.3:
	movl	%edx, %r13d
	leal	(%rsi,%r13), %eax
	addl	%r14d, %eax
	cmpl	%ebx, %eax
	jbe	LBB0_5
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_5:
	movq	%rdi, %r15
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_A_MC5_DB_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_t3_read_reg
	movq	_F_TMMODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	notl	%r12d
	andl	%eax, %r12d
	movq	8(%r15), %rax
	movq	_MC5_MODE_72_BIT@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_V_TMMODE
	movq	_F_TMRST@GOTPCREL(%rip), %rcx
	orl	%eax, %r12d
	orl	(%rcx), %r12d
	movq	_A_MC5_DB_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	movq	%rdi, %r12
	callq	_t3_write_reg
	movq	_A_MC5_DB_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_F_TMRDY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$1, %ecx
	movl	$500, %r8d                      ## imm = 0x1F4
	xorl	%r9d, %r9d
	callq	_t3_wait_op_done
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_CH_ERR
	movl	$-1, %ebx
	jmp	LBB0_13
LBB0_7:
	movq	_A_MC5_DB_ROUTING_TABLE_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subl	%r14d, %ebx
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_t3_write_reg
	movq	_A_MC5_DB_FILTER_TABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subl	%r13d, %ebx
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_t3_write_reg
	movq	_A_MC5_DB_SERVER_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_t3_write_reg
	movl	$1, 16(%r15)
	movq	_A_MC5_DB_DBGI_REQ_ADDR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_t3_write_reg
	movq	_A_MC5_DB_DBGI_REQ_ADDR2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_t3_write_reg
	movq	%r15, %rdi
	callq	_mc5_dbgi_mode_enable
	movl	20(%r15), %edx
	cmpl	$129, %edx
	je	LBB0_10
## %bb.8:
	cmpl	$128, %edx
	jne	LBB0_11
## %bb.9:
	movq	%r15, %rdi
	callq	_init_idt52100
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_10:
	movq	%r15, %rdi
	callq	_init_idt43102
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_CH_ERR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_12:
	movq	%r15, %rdi
	callq	_mc5_dbgi_mode_disable
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_ROUTES,4,2                 ## @MAX_ROUTES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_A_MC5_DB_CONFIG,4,2            ## @A_MC5_DB_CONFIG
	.comm	_F_TMMODE,4,2                   ## @F_TMMODE
	.comm	_MC5_MODE_72_BIT,8,3            ## @MC5_MODE_72_BIT
	.comm	_F_TMRST,4,2                    ## @F_TMRST
	.comm	_F_TMRDY,4,2                    ## @F_TMRDY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TCAM reset timed out\n"

	.comm	_A_MC5_DB_ROUTING_TABLE_INDEX,4,2 ## @A_MC5_DB_ROUTING_TABLE_INDEX
	.comm	_A_MC5_DB_FILTER_TABLE,4,2      ## @A_MC5_DB_FILTER_TABLE
	.comm	_A_MC5_DB_SERVER_INDEX,4,2      ## @A_MC5_DB_SERVER_INDEX
	.comm	_A_MC5_DB_DBGI_REQ_ADDR1,4,2    ## @A_MC5_DB_DBGI_REQ_ADDR1
	.comm	_A_MC5_DB_DBGI_REQ_ADDR2,4,2    ## @A_MC5_DB_DBGI_REQ_ADDR2
L_.str.1:                               ## @.str.1
	.asciz	"Unsupported TCAM type %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t3_mc5_init                    ; -- Begin function t3_mc5_init
	.p2align	2
_t3_mc5_init:                           ; @t3_mc5_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	w24, [x0]
	cbz	w24, LBB0_3
; %bb.1:
	mov	x23, x3
	mov	x22, x2
	mov	x21, x1
Lloh0:
	adrp	x8, _MAX_ROUTES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_ROUTES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w3
	add	w8, w2, w1
	add	w8, w8, w3
	ccmp	w8, w24, #2, hs
	b.ls	LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
LBB0_3:
	mov	w20, #0
	b	LBB0_12
LBB0_4:
	mov	x19, x0
	ldr	x20, [x0, #24]
Lloh6:
	adrp	x25, _A_MC5_DB_CONFIG@GOTPAGE
Lloh7:
	ldr	x25, [x25, _A_MC5_DB_CONFIG@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x20
	bl	_t3_read_reg
Lloh8:
	adrp	x8, _F_TMMODE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _F_TMMODE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	bic	w26, w0, w8
	ldr	x8, [x19, #8]
Lloh11:
	adrp	x9, _MC5_MODE_72_BIT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MC5_MODE_72_BIT@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_V_TMMODE
Lloh14:
	adrp	x8, _F_TMRST@GOTPAGE
Lloh15:
	ldr	x8, [x8, _F_TMRST@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	orr	w9, w0, w26
	orr	w2, w9, w8
	ldr	w1, [x25]
	mov	x0, x20
	bl	_t3_write_reg
	ldr	w1, [x25]
Lloh17:
	adrp	x8, _F_TMRDY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _F_TMRDY@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	w25, #1
	mov	x0, x20
	mov	w3, #1
	mov	w4, #500
	mov	w5, #0
	bl	_t3_wait_op_done
	cbz	x0, LBB0_6
; %bb.5:
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_CH_ERR
	mov	w20, #-1
	b	LBB0_12
LBB0_6:
Lloh22:
	adrp	x8, _A_MC5_DB_ROUTING_TABLE_INDEX@GOTPAGE
Lloh23:
	ldr	x8, [x8, _A_MC5_DB_ROUTING_TABLE_INDEX@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	sub	w23, w24, w23
	mov	x0, x20
	mov	x2, x23
	bl	_t3_write_reg
Lloh25:
	adrp	x8, _A_MC5_DB_FILTER_TABLE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _A_MC5_DB_FILTER_TABLE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	sub	w22, w23, w22
	mov	x0, x20
	mov	x2, x22
	bl	_t3_write_reg
Lloh28:
	adrp	x8, _A_MC5_DB_SERVER_INDEX@GOTPAGE
Lloh29:
	ldr	x8, [x8, _A_MC5_DB_SERVER_INDEX@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	sub	w2, w22, w21
	mov	x0, x20
	bl	_t3_write_reg
	str	w25, [x19, #16]
Lloh31:
	adrp	x8, _A_MC5_DB_DBGI_REQ_ADDR1@GOTPAGE
Lloh32:
	ldr	x8, [x8, _A_MC5_DB_DBGI_REQ_ADDR1@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_t3_write_reg
Lloh34:
	adrp	x8, _A_MC5_DB_DBGI_REQ_ADDR2@GOTPAGE
Lloh35:
	ldr	x8, [x8, _A_MC5_DB_DBGI_REQ_ADDR2@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_t3_write_reg
	mov	x0, x19
	bl	_mc5_dbgi_mode_enable
	ldr	w8, [x19, #20]
	cmp	w8, #129
	b.eq	LBB0_9
; %bb.7:
	cmp	w8, #128
	b.ne	LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_init_idt52100
	mov	x20, x0
	b	LBB0_11
LBB0_9:
	mov	x0, x19
	bl	_init_idt43102
	mov	x20, x0
	b	LBB0_11
LBB0_10:
	str	x8, [sp]
Lloh37:
	adrp	x1, l_.str.1@PAGE
Lloh38:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_CH_ERR
Lloh39:
	adrp	x8, _EINVAL@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_11:
	mov	x0, x19
	bl	_mc5_dbgi_mode_disable
LBB0_12:
	mov	x0, x20
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_ROUTES,4,2                 ; @MAX_ROUTES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_A_MC5_DB_CONFIG,4,2            ; @A_MC5_DB_CONFIG
	.comm	_F_TMMODE,4,2                   ; @F_TMMODE
	.comm	_MC5_MODE_72_BIT,8,3            ; @MC5_MODE_72_BIT
	.comm	_F_TMRST,4,2                    ; @F_TMRST
	.comm	_F_TMRDY,4,2                    ; @F_TMRDY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TCAM reset timed out\n"

	.comm	_A_MC5_DB_ROUTING_TABLE_INDEX,4,2 ; @A_MC5_DB_ROUTING_TABLE_INDEX
	.comm	_A_MC5_DB_FILTER_TABLE,4,2      ; @A_MC5_DB_FILTER_TABLE
	.comm	_A_MC5_DB_SERVER_INDEX,4,2      ; @A_MC5_DB_SERVER_INDEX
	.comm	_A_MC5_DB_DBGI_REQ_ADDR1,4,2    ; @A_MC5_DB_DBGI_REQ_ADDR1
	.comm	_A_MC5_DB_DBGI_REQ_ADDR2,4,2    ; @A_MC5_DB_DBGI_REQ_ADDR2
l_.str.1:                               ; @.str.1
	.asciz	"Unsupported TCAM type %d\n"

.subsections_via_symbols
