	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function typhoon_open
_typhoon_open:                          ## @typhoon_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_typhoon_request_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_1
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_WaitSleep@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_typhoon_wakeup
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movq	_typhoon_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IRQF_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r14), %edi
	movl	4(%r14), %ecx
	movq	%r14, %r8
	callq	_request_irq
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	%r15, %r12
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_napi_enable
	movq	%r15, %rdi
	callq	_typhoon_start_runtime
	testl	%eax, %eax
	js	LBB0_6
## %bb.12:
	movq	%r14, %rdi
	callq	_netif_start_queue
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_2:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
	jmp	LBB0_7
LBB0_4:
	movl	%eax, %ebx
	jmp	LBB0_7
LBB0_6:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_napi_disable
	movl	(%r14), %edi
	movq	%r14, %rsi
	callq	_free_irq
LBB0_7:
	movq	_TYPHOON_STATUS_WAITING_FOR_HOST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_typhoon_boot_3XP
	testq	%rax, %rax
	js	LBB0_8
## %bb.9:
	movq	_PCI_D3hot@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_typhoon_sleep
	testq	%rax, %rax
	jns	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
	movl	(%r15), %edi
	movq	_NoWait@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_typhoon_reset
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_WaitSleep,4,2                  ## @WaitSleep
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to wakeup device\n"

	.comm	_typhoon_interrupt,4,2          ## @typhoon_interrupt
	.comm	_IRQF_SHARED,4,2                ## @IRQF_SHARED
	.comm	_TYPHOON_STATUS_WAITING_FOR_HOST,4,2 ## @TYPHOON_STATUS_WAITING_FOR_HOST
L_.str.1:                               ## @.str.1
	.asciz	"unable to reboot into sleep img\n"

	.comm	_NoWait,4,2                     ## @NoWait
	.comm	_PCI_D3hot,4,2                  ## @PCI_D3hot
L_.str.2:                               ## @.str.2
	.asciz	"unable to go back to sleep\n"

	.no_dead_strip	_typhoon_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function typhoon_open
_typhoon_open:                          ; @typhoon_open
	.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
	mov	x19, x0
	bl	_netdev_priv
	mov	x20, x0
	bl	_typhoon_request_firmware
	mov	x21, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x21
	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
LBB0_2:
Lloh0:
	adrp	x8, _WaitSleep@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WaitSleep@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_typhoon_wakeup
	tbnz	w0, #31, LBB0_6
; %bb.3:
Lloh3:
	adrp	x8, _typhoon_interrupt@GOTPAGE
Lloh4:
	ldr	x8, [x8, _typhoon_interrupt@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _IRQF_SHARED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IRQF_SHARED@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	ldp	w0, w3, [x19]
	mov	x4, x19
	bl	_request_irq
	tbnz	w0, #31, LBB0_7
; %bb.4:
	add	x22, x20, #4
	mov	x0, x22
	bl	_napi_enable
	mov	x0, x20
	bl	_typhoon_start_runtime
	tbnz	w0, #31, LBB0_8
; %bb.5:
	mov	x0, x19
	bl	_netif_start_queue
	mov	w21, #0
	b	LBB0_1
LBB0_6:
	mov	x21, x0
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
	b	LBB0_9
LBB0_7:
	mov	x21, x0
	b	LBB0_9
LBB0_8:
	mov	x21, x0
	mov	x0, x22
	bl	_napi_disable
	ldr	w0, [x19]
	mov	x1, x19
	bl	_free_irq
LBB0_9:
Lloh11:
	adrp	x8, _TYPHOON_STATUS_WAITING_FOR_HOST@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TYPHOON_STATUS_WAITING_FOR_HOST@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_typhoon_boot_3XP
	tbnz	x0, #63, LBB0_12
; %bb.10:
Lloh14:
	adrp	x8, _PCI_D3hot@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PCI_D3hot@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_typhoon_sleep
	tbz	x0, #63, LBB0_1
; %bb.11:
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
	b	LBB0_1
LBB0_12:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
	ldr	w0, [x20]
Lloh21:
	adrp	x8, _NoWait@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NoWait@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	bl	_typhoon_reset
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_WaitSleep,4,2                  ; @WaitSleep
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to wakeup device\n"

	.comm	_typhoon_interrupt,4,2          ; @typhoon_interrupt
	.comm	_IRQF_SHARED,4,2                ; @IRQF_SHARED
	.comm	_TYPHOON_STATUS_WAITING_FOR_HOST,4,2 ; @TYPHOON_STATUS_WAITING_FOR_HOST
l_.str.1:                               ; @.str.1
	.asciz	"unable to reboot into sleep img\n"

	.comm	_NoWait,4,2                     ; @NoWait
	.comm	_PCI_D3hot,4,2                  ; @PCI_D3hot
l_.str.2:                               ; @.str.2
	.asciz	"unable to go back to sleep\n"

	.no_dead_strip	_typhoon_open
.subsections_via_symbols
