	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_com20020_check                 ## -- Begin function com20020_check
	.p2align	4, 0x90
_com20020_check:                        ## @com20020_check
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %r14d
	callq	_netdev_priv
	movq	%rax, %rbx
	movq	_RESETtime@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mdelay
	movl	4(%rbx), %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_2
## %bb.1:
	movl	8(%rbx), %eax
	addl	%eax, %eax
LBB0_2:
	movl	%eax, (%rbx)
	shll	$4, %ecx
	orl	$8, %ecx
	movl	%ecx, 12(%rbx)
	movq	_P1MODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	movq	_SUB_SETUP1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SET_SUBADR
	movl	(%rbx), %edi
	movq	__XREG@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_outb
	cmpl	$0, 4(%rbx)
	je	LBB0_4
## %bb.3:
	movq	_SUB_SETUP2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SET_SUBADR
	movl	12(%rbx), %edi
	movl	(%r15), %esi
	callq	_outb
	movl	$1, %edi
	callq	_mdelay
	movq	__COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_outb
LBB0_4:
	movl	20(%rbx), %eax
	movl	24(%rbx), %ecx
	shll	$3, %eax
	shll	$2, %ecx
	orl	%eax, %ecx
	orl	$33, %ecx
	movl	%ecx, 16(%rbx)
	movq	_BUS_ALIGN@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	leal	(,%rax,8), %esi
	subl	%eax, %esi
	addl	%r14d, %esi
	movl	$66, %edi
	callq	_outb
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ASTATUS
	movl	%eax, %ecx
	andl	$153, %ecx
	movq	_NORXflag@GOTPCREL(%rip), %rdx
	movq	_TXFREEflag@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %esi
	movq	_RESETflag@GOTPCREL(%rip), %rdx
	orl	(%rdx), %esi
	cmpl	%esi, %ecx
	jne	LBB0_5
## %bb.6:
	movq	_D_INIT_REASONS@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_BUGMSG
	movq	__CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$57, %edi
	callq	_outb
	movl	(%r15), %eax
	leal	(%r14,%rax,8), %edi
	callq	_inb
	movl	(%r15), %ecx
	leal	(,%rcx,8), %esi
	subl	%ecx, %esi
	addl	%r14d, %esi
	movl	%eax, %edi
	callq	_outb
	movq	_CFLAGScmd@GOTPCREL(%rip), %rax
	movq	_RESETclear@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_CONFIGclear@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	callq	_ACOMMAND
	xorl	%eax, %eax
	callq	_ASTATUS
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	callq	_BUGMSG
	movq	_RDDATAflag@GOTPCREL(%rip), %rax
	movq	_AUTOINCflag@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	__ADDR_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_outb
	movq	__ADDR_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_outb
	movq	__MEMDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_inb
	movq	_TESTvalue@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_9
## %bb.7:
	movq	_D_NORMAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edx
	callq	_BUGMSG
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_5:
	movq	_D_NORMAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_BUGMSG
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_8:
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ARCRESET0,4,2                  ## @ARCRESET0
	.comm	_RESETtime,4,2                  ## @RESETtime
	.comm	_P1MODE,4,2                     ## @P1MODE
	.comm	_SUB_SETUP1,4,2                 ## @SUB_SETUP1
	.comm	__XREG,4,2                      ## @_XREG
	.comm	_SUB_SETUP2,4,2                 ## @SUB_SETUP2
	.comm	__COMMAND,4,2                   ## @_COMMAND
	.comm	_SETCONF,4,2                    ## @SETCONF
	.comm	_BUS_ALIGN,4,2                  ## @BUS_ALIGN
	.comm	_NORXflag,4,2                   ## @NORXflag
	.comm	_TXFREEflag,4,2                 ## @TXFREEflag
	.comm	_RESETflag,4,2                  ## @RESETflag
	.comm	_D_NORMAL,4,2                   ## @D_NORMAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"status invalid (%Xh).\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_D_INIT_REASONS,4,2             ## @D_INIT_REASONS
L_.str.1:                               ## @.str.1
	.asciz	"status after reset: %X\n"

	.comm	__CONFIG,4,2                    ## @_CONFIG
	.comm	_CFLAGScmd,4,2                  ## @CFLAGScmd
	.comm	_RESETclear,4,2                 ## @RESETclear
	.comm	_CONFIGclear,4,2                ## @CONFIGclear
L_.str.2:                               ## @.str.2
	.asciz	"status after reset acknowledged: %X\n"

	.comm	_RDDATAflag,4,2                 ## @RDDATAflag
	.comm	_AUTOINCflag,4,2                ## @AUTOINCflag
	.comm	__ADDR_HI,4,2                   ## @_ADDR_HI
	.comm	__ADDR_LO,4,2                   ## @_ADDR_LO
	.comm	__MEMDATA,4,2                   ## @_MEMDATA
	.comm	_TESTvalue,4,2                  ## @TESTvalue
L_.str.3:                               ## @.str.3
	.asciz	"Signature byte not found (%02Xh != D1h).\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_com20020_check                 ; -- Begin function com20020_check
	.p2align	2
_com20020_check:                        ; @com20020_check
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w20, [x0]
	bl	_netdev_priv
	mov	x19, x0
Lloh0:
	adrp	x8, _RESETtime@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RESETtime@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_mdelay
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_2
; %bb.1:
	mov	w9, #0
	b	LBB0_3
LBB0_2:
	ldr	w9, [x19, #8]
	lsl	w9, w9, #1
LBB0_3:
	str	w9, [x19]
	mov	w10, #8
	bfi	w10, w8, #4, #28
	str	w10, [x19, #12]
Lloh3:
	adrp	x8, _P1MODE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _P1MODE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	orr	w8, w8, w9
	str	w8, [x19]
Lloh6:
	adrp	x8, _SUB_SETUP1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SUB_SETUP1@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_SET_SUBADR
	ldr	w0, [x19]
Lloh9:
	adrp	x21, __XREG@GOTPAGE
Lloh10:
	ldr	x21, [x21, __XREG@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_outb
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_5
; %bb.4:
Lloh11:
	adrp	x8, _SUB_SETUP2@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SUB_SETUP2@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_SET_SUBADR
	ldr	w0, [x19, #12]
	ldr	w1, [x21]
	bl	_outb
	mov	w0, #1
	bl	_mdelay
Lloh14:
	adrp	x8, __COMMAND@GOTPAGE
Lloh15:
	ldr	x8, [x8, __COMMAND@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_outb
LBB0_5:
	ldp	w8, w9, [x19, #20]
	lsl	w8, w8, #3
	orr	w8, w8, w9, lsl #2
	mov	w9, #33
	orr	w8, w8, w9
	str	w8, [x19, #16]
Lloh17:
	adrp	x19, _BUS_ALIGN@GOTPAGE
Lloh18:
	ldr	x19, [x19, _BUS_ALIGN@GOTPAGEOFF]
	ldr	w8, [x19]
	lsl	w9, w8, #3
	sub	w8, w9, w8
	add	w1, w8, w20
	mov	w0, #66
	bl	_outb
	bl	_ASTATUS
	mov	x2, x0
	mov	w8, #153
	and	w8, w0, w8
Lloh19:
	adrp	x9, _NORXflag@GOTPAGE
Lloh20:
	ldr	x9, [x9, _NORXflag@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
Lloh22:
	adrp	x10, _TXFREEflag@GOTPAGE
Lloh23:
	ldr	x10, [x10, _TXFREEflag@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh25:
	adrp	x10, _RESETflag@GOTPAGE
Lloh26:
	ldr	x10, [x10, _RESETflag@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
	orr	w9, w9, w10
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.6:
Lloh28:
	adrp	x21, _D_INIT_REASONS@GOTPAGE
Lloh29:
	ldr	x21, [x21, _D_INIT_REASONS@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh30:
	adrp	x1, l_.str.1@PAGE
Lloh31:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_BUGMSG
Lloh32:
	adrp	x8, __CONFIG@GOTPAGE
Lloh33:
	ldr	x8, [x8, __CONFIG@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	mov	w0, #57
	bl	_outb
	ldr	w8, [x19]
	add	w0, w20, w8, lsl #3
	bl	_inb
	ldr	w8, [x19]
	lsl	w9, w8, #3
	sub	w8, w9, w8
	add	w1, w8, w20
	bl	_outb
Lloh35:
	adrp	x8, _CFLAGScmd@GOTPAGE
Lloh36:
	ldr	x8, [x8, _CFLAGScmd@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
Lloh38:
	adrp	x9, _RESETclear@GOTPAGE
Lloh39:
	ldr	x9, [x9, _RESETclear@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh41:
	adrp	x9, _CONFIGclear@GOTPAGE
Lloh42:
	ldr	x9, [x9, _CONFIGclear@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	orr	w0, w8, w9
	bl	_ACOMMAND
	bl	_ASTATUS
	mov	x2, x0
	ldr	w0, [x21]
Lloh44:
	adrp	x1, l_.str.2@PAGE
Lloh45:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_BUGMSG
Lloh46:
	adrp	x8, _RDDATAflag@GOTPAGE
Lloh47:
	ldr	x8, [x8, _RDDATAflag@GOTPAGEOFF]
Lloh48:
	adrp	x9, _AUTOINCflag@GOTPAGE
Lloh49:
	ldr	x9, [x9, _AUTOINCflag@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
Lloh51:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh52:
	adrp	x8, __ADDR_HI@GOTPAGE
Lloh53:
	ldr	x8, [x8, __ADDR_HI@GOTPAGEOFF]
Lloh54:
	ldr	w1, [x8]
	bl	_outb
Lloh55:
	adrp	x8, __ADDR_LO@GOTPAGE
Lloh56:
	ldr	x8, [x8, __ADDR_LO@GOTPAGEOFF]
Lloh57:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_outb
Lloh58:
	adrp	x8, __MEMDATA@GOTPAGE
Lloh59:
	ldr	x8, [x8, __MEMDATA@GOTPAGEOFF]
Lloh60:
	ldr	w0, [x8]
	bl	_inb
	mov	x2, x0
	mov	w0, #0
Lloh61:
	adrp	x8, _TESTvalue@GOTPAGE
Lloh62:
	ldr	x8, [x8, _TESTvalue@GOTPAGEOFF]
Lloh63:
	ldr	w8, [x8]
	cmp	w2, w8
	b.eq	LBB0_10
; %bb.7:
Lloh64:
	adrp	x8, _D_NORMAL@GOTPAGE
Lloh65:
	ldr	x8, [x8, _D_NORMAL@GOTPAGEOFF]
Lloh66:
	ldr	w0, [x8]
Lloh67:
	adrp	x1, l_.str.3@PAGE
Lloh68:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh69:
	adrp	x8, _D_NORMAL@GOTPAGE
Lloh70:
	ldr	x8, [x8, _D_NORMAL@GOTPAGEOFF]
Lloh71:
	ldr	w0, [x8]
Lloh72:
	adrp	x1, l_.str@PAGE
Lloh73:
	add	x1, x1, l_.str@PAGEOFF
LBB0_9:
	bl	_BUGMSG
Lloh74:
	adrp	x8, _ENODEV@GOTPAGE
Lloh75:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh76:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh50
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpAdd	Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.cfi_endproc
                                        ; -- End function
	.comm	_ARCRESET0,4,2                  ; @ARCRESET0
	.comm	_RESETtime,4,2                  ; @RESETtime
	.comm	_P1MODE,4,2                     ; @P1MODE
	.comm	_SUB_SETUP1,4,2                 ; @SUB_SETUP1
	.comm	__XREG,4,2                      ; @_XREG
	.comm	_SUB_SETUP2,4,2                 ; @SUB_SETUP2
	.comm	__COMMAND,4,2                   ; @_COMMAND
	.comm	_SETCONF,4,2                    ; @SETCONF
	.comm	_BUS_ALIGN,4,2                  ; @BUS_ALIGN
	.comm	_NORXflag,4,2                   ; @NORXflag
	.comm	_TXFREEflag,4,2                 ; @TXFREEflag
	.comm	_RESETflag,4,2                  ; @RESETflag
	.comm	_D_NORMAL,4,2                   ; @D_NORMAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"status invalid (%Xh).\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_D_INIT_REASONS,4,2             ; @D_INIT_REASONS
l_.str.1:                               ; @.str.1
	.asciz	"status after reset: %X\n"

	.comm	__CONFIG,4,2                    ; @_CONFIG
	.comm	_CFLAGScmd,4,2                  ; @CFLAGScmd
	.comm	_RESETclear,4,2                 ; @RESETclear
	.comm	_CONFIGclear,4,2                ; @CONFIGclear
l_.str.2:                               ; @.str.2
	.asciz	"status after reset acknowledged: %X\n"

	.comm	_RDDATAflag,4,2                 ; @RDDATAflag
	.comm	_AUTOINCflag,4,2                ; @AUTOINCflag
	.comm	__ADDR_HI,4,2                   ; @_ADDR_HI
	.comm	__ADDR_LO,4,2                   ; @_ADDR_LO
	.comm	__MEMDATA,4,2                   ; @_MEMDATA
	.comm	_TESTvalue,4,2                  ; @TESTvalue
l_.str.3:                               ; @.str.3
	.asciz	"Signature byte not found (%02Xh != D1h).\n"

.subsections_via_symbols
