	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hw_init
_hw_init:                               ## @hw_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_BUS_SPEED_125_MHZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_KS884X_BUS_CTRL_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_writew
	movq	_KS884X_CHIP_ID_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_readw
	movl	%eax, %edx
	movq	_KS884X_REVISION_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	%edx, %esi
	movq	_KS884X_REVISION_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %esi
	movq	_KS884X_CHIP_ID_MASK_41@GOTPCREL(%rip), %rax
	andl	(%rax), %edx
	movq	_REG_CHIP_ID_41@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	jne	LBB0_1
## %bb.4:
	movl	$1, %eax
	cmpl	$2, %esi
	jge	LBB0_6
## %bb.5:
	movq	_SMALL_PACKET_TX_BUG@GOTPCREL(%rip), %rcx
	movl	(%rbx), %edx
	orl	(%rcx), %edx
	movl	%edx, (%rbx)
	movq	_HALF_DUPLEX_SIGNAL_BUG@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	%edx, (%rbx)
	jmp	LBB0_6
LBB0_1:
	movq	_REG_CHIP_ID_42@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	%edx, (%rcx)
	jne	LBB0_6
## %bb.2:
	movl	$2, %eax
	cmpl	$1, %esi
	jg	LBB0_6
## %bb.3:
	movq	_SMALL_PACKET_TX_BUG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%rbx)
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUS_SPEED_125_MHZ,4,2          ## @BUS_SPEED_125_MHZ
	.comm	_KS884X_BUS_CTRL_OFFSET,8,3     ## @KS884X_BUS_CTRL_OFFSET
	.comm	_KS884X_CHIP_ID_OFFSET,8,3      ## @KS884X_CHIP_ID_OFFSET
	.comm	_KS884X_REVISION_MASK,4,2       ## @KS884X_REVISION_MASK
	.comm	_KS884X_REVISION_SHIFT,4,2      ## @KS884X_REVISION_SHIFT
	.comm	_KS884X_CHIP_ID_MASK_41,4,2     ## @KS884X_CHIP_ID_MASK_41
	.comm	_REG_CHIP_ID_41,4,2             ## @REG_CHIP_ID_41
	.comm	_REG_CHIP_ID_42,4,2             ## @REG_CHIP_ID_42
	.comm	_SMALL_PACKET_TX_BUG,4,2        ## @SMALL_PACKET_TX_BUG
	.comm	_HALF_DUPLEX_SIGNAL_BUG,4,2     ## @HALF_DUPLEX_SIGNAL_BUG
	.no_dead_strip	_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hw_init
_hw_init:                               ; @hw_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, _BUS_SPEED_125_MHZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BUS_SPEED_125_MHZ@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _KS884X_BUS_CTRL_OFFSET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _KS884X_BUS_CTRL_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _KS884X_CHIP_ID_OFFSET@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KS884X_CHIP_ID_OFFSET@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readw
Lloh9:
	adrp	x8, _KS884X_REVISION_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KS884X_REVISION_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh12:
	adrp	x9, _KS884X_REVISION_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _KS884X_REVISION_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh15:
	adrp	x9, _KS884X_CHIP_ID_MASK_41@GOTPAGE
Lloh16:
	ldr	x9, [x9, _KS884X_CHIP_ID_MASK_41@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	and	w9, w9, w0
Lloh18:
	adrp	x10, _REG_CHIP_ID_41@GOTPAGE
Lloh19:
	ldr	x10, [x10, _REG_CHIP_ID_41@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	cmp	w10, w9
	b.ne	LBB0_4
; %bb.1:
	cmp	w8, #2
	b.ge	LBB0_3
; %bb.2:
Lloh21:
	adrp	x8, _SMALL_PACKET_TX_BUG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SMALL_PACKET_TX_BUG@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh24:
	adrp	x9, _HALF_DUPLEX_SIGNAL_BUG@GOTPAGE
Lloh25:
	ldr	x9, [x9, _HALF_DUPLEX_SIGNAL_BUG@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_3:
	mov	w0, #1
	b	LBB0_9
LBB0_4:
Lloh27:
	adrp	x10, _REG_CHIP_ID_42@GOTPAGE
Lloh28:
	ldr	x10, [x10, _REG_CHIP_ID_42@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	cmp	w10, w9
	b.ne	LBB0_8
; %bb.5:
	cmp	w8, #1
	b.gt	LBB0_7
; %bb.6:
Lloh30:
	adrp	x8, _SMALL_PACKET_TX_BUG@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SMALL_PACKET_TX_BUG@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_7:
	mov	w0, #2
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_BUS_SPEED_125_MHZ,4,2          ; @BUS_SPEED_125_MHZ
	.comm	_KS884X_BUS_CTRL_OFFSET,8,3     ; @KS884X_BUS_CTRL_OFFSET
	.comm	_KS884X_CHIP_ID_OFFSET,8,3      ; @KS884X_CHIP_ID_OFFSET
	.comm	_KS884X_REVISION_MASK,4,2       ; @KS884X_REVISION_MASK
	.comm	_KS884X_REVISION_SHIFT,4,2      ; @KS884X_REVISION_SHIFT
	.comm	_KS884X_CHIP_ID_MASK_41,4,2     ; @KS884X_CHIP_ID_MASK_41
	.comm	_REG_CHIP_ID_41,4,2             ; @REG_CHIP_ID_41
	.comm	_REG_CHIP_ID_42,4,2             ; @REG_CHIP_ID_42
	.comm	_SMALL_PACKET_TX_BUG,4,2        ; @SMALL_PACKET_TX_BUG
	.comm	_HALF_DUPLEX_SIGNAL_BUG,4,2     ; @HALF_DUPLEX_SIGNAL_BUG
	.no_dead_strip	_hw_init
.subsections_via_symbols
