	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ena_restore_device
_ena_restore_device:                    ## @ena_restore_device
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	32(%rdi), %r14
	movq	40(%rdi), %r12
	movq	_ENA_FLAG_ONGOING_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	4(%rbx), %r15
	movq	%r15, %rsi
	callq	_set_bit
	movq	32(%rbx), %rsi
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rcx
	movq	%r12, %rdi
	callq	_ena_device_init
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_11
LBB0_2:
	movl	-52(%rbp), %eax
	movl	%eax, (%rbx)
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_ena_device_validate_params
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_5:
	movl	24(%rbx), %esi
	movq	%rbx, %rdi
	callq	_ena_enable_msix_and_set_admin_interrupts
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rsi
LBB0_4:
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_10:
	movq	%r12, %rdi
	callq	_ena_com_abort_admin_commands
	movq	%r12, %rdi
	callq	_ena_com_wait_for_abort_completion
	movq	%r12, %rdi
	callq	_ena_com_admin_destroy
	movq	_ENA_REGS_RESET_DRIVER_INVALID_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_ena_com_dev_reset
	movq	%r12, %rdi
	callq	_ena_com_mmio_reg_read_request_destroy
LBB0_11:
	movq	_ENA_FLAG_ONGOING_RESET@GOTPCREL(%rip), %rbx
	movq	_ENA_FLAG_DEVICE_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_clear_bit
	movl	(%rbx), %edi
	movq	%r15, %rsi
	callq	_clear_bit
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_15:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	cmpq	$0, 16(%rbx)
	je	LBB0_12
## %bb.8:
	movq	%rbx, %rdi
	callq	_ena_up
	testl	%eax, %eax
	je	LBB0_12
## %bb.9:
	movl	%eax, %r13d
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_ena_free_mgmnt_irq
	movq	%rbx, %rdi
	callq	_ena_disable_msix
	jmp	LBB0_10
LBB0_12:
	movq	_ENA_FLAG_DEVICE_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_set_bit
	movq	_ENA_FLAG_ONGOING_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_clear_bit
	movq	_ENA_FLAG_LINK_UP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movl	12(%rbx), %edi
	callq	_netif_carrier_on
LBB0_14:
	addq	$8, %rbx
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	_HZ@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	addq	(%rax), %rdi
	callq	_round_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_mod_timer
	movq	_version@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.4(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_ENA_FLAG_ONGOING_RESET,4,2     ## @ENA_FLAG_ONGOING_RESET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can not initialize device\n"

L_.str.1:                               ## @.str.1
	.asciz	"Validation of device parameters failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"Enable MSI-X failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to create I/O queues\n"

	.comm	_ENA_FLAG_DEVICE_RUNNING,4,2    ## @ENA_FLAG_DEVICE_RUNNING
	.comm	_ENA_FLAG_LINK_UP,4,2           ## @ENA_FLAG_LINK_UP
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_HZ,8,3                         ## @HZ
L_.str.4:                               ## @.str.4
	.asciz	"Device reset completed successfully, Driver info: %s\n"

	.comm	_version,4,2                    ## @version
	.comm	_ENA_REGS_RESET_DRIVER_INVALID_STATE,4,2 ## @ENA_REGS_RESET_DRIVER_INVALID_STATE
L_.str.5:                               ## @.str.5
	.asciz	"Reset attempt failed. Can not reset the device\n"

	.no_dead_strip	_ena_restore_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ena_restore_device
_ena_restore_device:                    ; @ena_restore_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x23, x0
	ldp	x19, x21, [x0, #32]
Lloh0:
	adrp	x24, _ENA_FLAG_ONGOING_RESET@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ENA_FLAG_ONGOING_RESET@GOTPAGEOFF]
	ldr	w0, [x24]
	add	x20, x23, #4
	mov	x1, x20
	bl	_set_bit
	ldr	x1, [x23, #32]
	add	x2, sp, #24
	add	x3, sp, #20
	mov	x0, x21
	bl	_ena_device_init
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_8
LBB0_2:
	ldr	w8, [sp, #20]
	str	w8, [x23]
	add	x1, sp, #24
	mov	x0, x23
	bl	_ena_device_validate_params
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
	ldr	w1, [x23, #24]
	mov	x0, x23
	bl	_ena_enable_msix_and_set_admin_interrupts
	cbz	w0, LBB0_10
; %bb.5:
	mov	x22, x0
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_dev_err
LBB0_7:
	mov	x0, x21
	bl	_ena_com_abort_admin_commands
	mov	x0, x21
	bl	_ena_com_wait_for_abort_completion
	mov	x0, x21
	bl	_ena_com_admin_destroy
Lloh8:
	adrp	x8, _ENA_REGS_RESET_DRIVER_INVALID_STATE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENA_REGS_RESET_DRIVER_INVALID_STATE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ena_com_dev_reset
	mov	x0, x21
	bl	_ena_com_mmio_reg_read_request_destroy
LBB0_8:
Lloh11:
	adrp	x8, _ENA_FLAG_DEVICE_RUNNING@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENA_FLAG_DEVICE_RUNNING@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_clear_bit
	ldr	w0, [x24]
	mov	x1, x20
	bl	_clear_bit
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_13
; %bb.11:
	mov	x0, x23
	bl	_ena_up
	cbz	w0, LBB0_13
; %bb.12:
	mov	x22, x0
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	x0, x23
	bl	_ena_free_mgmnt_irq
	mov	x0, x23
	bl	_ena_disable_msix
	b	LBB0_7
LBB0_13:
Lloh18:
	adrp	x8, _ENA_FLAG_DEVICE_RUNNING@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENA_FLAG_DEVICE_RUNNING@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
	ldr	w0, [x24]
	mov	x1, x20
	bl	_clear_bit
Lloh21:
	adrp	x8, _ENA_FLAG_LINK_UP@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENA_FLAG_LINK_UP@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
	cbz	x0, LBB0_15
; %bb.14:
	ldr	w0, [x23, #12]
	bl	_netif_carrier_on
LBB0_15:
Lloh24:
	adrp	x8, _jiffies@GOTPAGE
Lloh25:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
	add	x20, x23, #8
Lloh26:
	ldr	x8, [x8]
Lloh27:
	adrp	x9, _HZ@GOTPAGE
Lloh28:
	ldr	x9, [x9, _HZ@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_round_jiffies
	mov	x1, x0
	mov	x0, x20
	bl	_mod_timer
Lloh30:
	adrp	x8, _version@GOTPAGE
Lloh31:
	ldr	x8, [x8, _version@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh33:
	adrp	x1, l_.str.4@PAGE
Lloh34:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	w22, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ENA_FLAG_ONGOING_RESET,4,2     ; @ENA_FLAG_ONGOING_RESET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can not initialize device\n"

l_.str.1:                               ; @.str.1
	.asciz	"Validation of device parameters failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"Enable MSI-X failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to create I/O queues\n"

	.comm	_ENA_FLAG_DEVICE_RUNNING,4,2    ; @ENA_FLAG_DEVICE_RUNNING
	.comm	_ENA_FLAG_LINK_UP,4,2           ; @ENA_FLAG_LINK_UP
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_HZ,8,3                         ; @HZ
l_.str.4:                               ; @.str.4
	.asciz	"Device reset completed successfully, Driver info: %s\n"

	.comm	_version,4,2                    ; @version
	.comm	_ENA_REGS_RESET_DRIVER_INVALID_STATE,4,2 ; @ENA_REGS_RESET_DRIVER_INVALID_STATE
l_.str.5:                               ; @.str.5
	.asciz	"Reset attempt failed. Can not reset the device\n"

	.no_dead_strip	_ena_restore_device
.subsections_via_symbols
