	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sky2_open
_sky2_open:                             ## @sky2_open
	.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, %r14
	callq	_netdev_priv
	movq	%rax, %rbx
	movq	8(%rax), %r15
	movl	(%rax), %r13d
	movq	%r14, %rdi
	callq	_netif_carrier_off
	movq	%rbx, %rdi
	callq	_sky2_alloc_buffers
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_1
LBB0_4:
	movq	%rbx, %rdi
	callq	_sky2_free_buffers
	jmp	LBB0_5
LBB0_1:
	cmpl	$1, (%r15)
	jne	LBB0_3
## %bb.2:
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_sky2_setup_irq
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_4
LBB0_3:
	movq	%rbx, %rdi
	callq	_sky2_hw_up
	movq	_B0_IMSK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_sky2_read32
	movq	8(%r15), %rcx
	movq	_CHIP_ID_YUKON_OPT@GOTPCREL(%rip), %r8
	movq	_CHIP_ID_YUKON_OP_2@GOTPCREL(%rip), %rdx
	xorl	%r12d, %r12d
	cmpq	(%rdx), %rcx
	movq	_CHIP_ID_YUKON_PRM@GOTPCREL(%rip), %rdi
	movq	_Y2_IS_PHY_QLNK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movl	$0, %edx
	cmovel	%esi, %edx
	cmpq	(%rdi), %rcx
	cmovel	%esi, %edx
	cmpq	(%r8), %rcx
	cmovel	%esi, %edx
	orl	%eax, %edx
	movq	_portirq_msk@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	orl	(%rax,%r13,4), %edx
	movq	_B0_IMSK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_sky2_write32
	movq	_B0_IMSK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_sky2_read32
	movq	_ifup@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_netif_info
LBB0_5:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_B0_IMSK,4,2                    ## @B0_IMSK
	.comm	_CHIP_ID_YUKON_OPT,8,3          ## @CHIP_ID_YUKON_OPT
	.comm	_CHIP_ID_YUKON_PRM,8,3          ## @CHIP_ID_YUKON_PRM
	.comm	_CHIP_ID_YUKON_OP_2,8,3         ## @CHIP_ID_YUKON_OP_2
	.comm	_Y2_IS_PHY_QLNK,4,2             ## @Y2_IS_PHY_QLNK
	.comm	_portirq_msk,8,3                ## @portirq_msk
	.comm	_ifup,4,2                       ## @ifup
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"enabling interface\n"

	.no_dead_strip	_sky2_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sky2_open
_sky2_open:                             ; @sky2_open
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	bl	_netdev_priv
	mov	x20, x0
	ldr	x21, [x0, #8]
	ldr	w23, [x0]
	mov	x0, x19
	bl	_netif_carrier_off
	mov	x0, x20
	bl	_sky2_alloc_buffers
	mov	x22, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x20
	bl	_sky2_free_buffers
	b	LBB0_5
LBB0_2:
	ldr	w8, [x21]
	cmp	w8, #1
	b.ne	LBB0_4
; %bb.3:
	ldr	w1, [x19]
	mov	x0, x21
	bl	_sky2_setup_irq
	mov	x22, x0
	cbnz	w0, LBB0_1
LBB0_4:
	mov	x0, x20
	bl	_sky2_hw_up
Lloh0:
	adrp	x22, _B0_IMSK@GOTPAGE
Lloh1:
	ldr	x22, [x22, _B0_IMSK@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_sky2_read32
	ldr	x8, [x21, #8]
Lloh2:
	adrp	x9, _CHIP_ID_YUKON_OPT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CHIP_ID_YUKON_OPT@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x10, _CHIP_ID_YUKON_PRM@GOTPAGE
Lloh6:
	ldr	x10, [x10, _CHIP_ID_YUKON_PRM@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
Lloh8:
	adrp	x11, _CHIP_ID_YUKON_OP_2@GOTPAGE
Lloh9:
	ldr	x11, [x11, _CHIP_ID_YUKON_OP_2@GOTPAGEOFF]
Lloh10:
	ldr	x11, [x11]
	cmp	x8, x11
	ccmp	x8, x10, #4, ne
	ccmp	x8, x9, #4, ne
Lloh11:
	adrp	x8, _Y2_IS_PHY_QLNK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _Y2_IS_PHY_QLNK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	csel	w8, w8, wzr, eq
Lloh14:
	adrp	x9, _portirq_msk@GOTPAGE
Lloh15:
	ldr	x9, [x9, _portirq_msk@GOTPAGEOFF]
	orr	w8, w8, w0
Lloh16:
	ldr	x9, [x9]
	ldr	w9, [x9, x23, lsl #2]
	orr	w2, w8, w9
	ldr	w1, [x22]
	mov	x0, x21
	bl	_sky2_write32
	ldr	w1, [x22]
	mov	x0, x21
	bl	_sky2_read32
Lloh17:
	adrp	x8, _ifup@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ifup@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x3, l_.str@PAGE
Lloh21:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_netif_info
	mov	w22, #0
LBB0_5:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_B0_IMSK,4,2                    ; @B0_IMSK
	.comm	_CHIP_ID_YUKON_OPT,8,3          ; @CHIP_ID_YUKON_OPT
	.comm	_CHIP_ID_YUKON_PRM,8,3          ; @CHIP_ID_YUKON_PRM
	.comm	_CHIP_ID_YUKON_OP_2,8,3         ; @CHIP_ID_YUKON_OP_2
	.comm	_Y2_IS_PHY_QLNK,4,2             ; @Y2_IS_PHY_QLNK
	.comm	_portirq_msk,8,3                ; @portirq_msk
	.comm	_ifup,4,2                       ; @ifup
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"enabling interface\n"

	.no_dead_strip	_sky2_open
.subsections_via_symbols
