	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cas_open
_cas_open:                              ## @cas_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, %r15
	callq	_netdev_priv
	movq	%rax, %r12
	leaq	8(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r12), %r13d
	testl	%r13d, %r13d
	jne	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_cas_lock_all_save
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_cas_reset
	movl	$1, (%r12)
	movq	%r12, %rdi
	callq	_cas_unlock_all_restore
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_cas_tx_tiny_alloc
	testq	%rax, %rax
	js	LBB0_7
## %bb.3:
	movq	%r12, %rdi
	callq	_cas_alloc_rxds
	testq	%rax, %rax
	js	LBB0_6
## %bb.4:
	movq	%r12, %rdi
	callq	_cas_spare_init
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_cas_spare_recover
	movq	24(%r12), %rax
	movl	(%rax), %edi
	movq	_cas_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IRQF_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r15), %ecx
	movq	%r15, %r8
	callq	_request_irq
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	movl	16(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_netdev_err
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_cas_spare_free
	movq	%r12, %rdi
	callq	_cas_free_rxds
LBB0_6:
	movq	%r12, %rdi
	callq	_cas_tx_tiny_free
	jmp	LBB0_7
LBB0_8:
	xorl	%ebx, %ebx
	testl	%r13d, %r13d
	sete	%bl
	movq	%r12, %rdi
	callq	_cas_lock_all_save
	movq	%r12, %rdi
	callq	_cas_clean_rings
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_cas_init_hw
	movl	$1, 4(%r12)
	movq	%r12, %rdi
	callq	_cas_unlock_all_restore
	movq	%r15, %rdi
	callq	_netif_start_queue
	xorl	%ebx, %ebx
LBB0_7:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_cas_interrupt,4,2              ## @cas_interrupt
	.comm	_IRQF_SHARED,4,2                ## @IRQF_SHARED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to request irq !\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_cas_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cas_open
_cas_open:                              ; @cas_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	x21, x0
	bl	_netdev_priv
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	w23, [x20]
	cbnz	w23, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_cas_lock_all_save
	mov	x0, x20
	mov	w1, #0
	bl	_cas_reset
	mov	w8, #1
	str	w8, [x20]
	mov	x0, x20
	bl	_cas_unlock_all_restore
LBB0_2:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	mov	x0, x20
	bl	_cas_tx_tiny_alloc
	tbnz	x0, #63, LBB0_8
; %bb.3:
	mov	x0, x20
	bl	_cas_alloc_rxds
	tbnz	x0, #63, LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_cas_spare_init
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_cas_spare_recover
	ldr	x8, [x20, #24]
Lloh6:
	adrp	x9, _cas_interrupt@GOTPAGE
Lloh7:
	ldr	x9, [x9, _cas_interrupt@GOTPAGEOFF]
	ldr	w0, [x8]
Lloh8:
	ldr	w1, [x9]
Lloh9:
	adrp	x8, _IRQF_SHARED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IRQF_SHARED@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	ldr	w3, [x21]
	mov	x4, x21
	bl	_request_irq
	cbz	x0, LBB0_7
; %bb.5:
	ldr	w0, [x20, #16]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_err
Lloh14:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w22, w8
	mov	x0, x20
	bl	_cas_spare_free
	mov	x0, x20
	bl	_cas_free_rxds
LBB0_6:
	mov	x0, x20
	bl	_cas_tx_tiny_free
	b	LBB0_8
LBB0_7:
	cmp	w23, #0
	cset	w22, eq
	mov	x0, x20
	bl	_cas_lock_all_save
	mov	x0, x20
	bl	_cas_clean_rings
	mov	x0, x20
	mov	x1, x22
	bl	_cas_init_hw
	mov	w8, #1
	str	w8, [x20, #4]
	mov	x0, x20
	bl	_cas_unlock_all_restore
	mov	x0, x21
	bl	_netif_start_queue
	mov	w22, #0
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_cas_interrupt,4,2              ; @cas_interrupt
	.comm	_IRQF_SHARED,4,2                ; @IRQF_SHARED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to request irq !\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_cas_open
.subsections_via_symbols
