	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ena_com_dev_reset              ## -- Begin function ena_com_dev_reset
	.p2align	4, 0x90
_ena_com_dev_reset:                     ## @ena_com_dev_reset
	.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
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	_ENA_REGS_DEV_STS_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ena_com_reg_bar_read32
	movl	%eax, %ebx
	movq	_ENA_REGS_CAPS_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_ena_com_reg_bar_read32
	movl	%eax, %r14d
	movq	_ENA_MMIO_READ_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	sete	%cl
	cmpl	%eax, %r14d
	sete	%al
	orb	%cl, %al
	movzbl	%al, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ETIME@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_2:
	movq	_ENA_REGS_DEV_STS_READY_MASK@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_3
## %bb.6:
	movq	_ENA_REGS_CAPS_RESET_TIMEOUT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	%r14d, %r12d
	movq	_ENA_REGS_CAPS_RESET_TIMEOUT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r12d
	testl	%r12d, %r12d
	je	LBB0_7
## %bb.8:
	movq	_ENA_REGS_DEV_CTL_DEV_RESET_MASK@GOTPCREL(%rip), %rax
	movq	_ENA_REGS_DEV_CTL_RESET_REASON_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r15d
	movq	_ENA_REGS_DEV_CTL_RESET_REASON_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r15d
	orl	(%rax), %r15d
	movq	_ENA_REGS_DEV_CTL_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r13), %rsi
	movl	%r15d, %edi
	callq	_writel
	movq	%r13, %rdi
	callq	_ena_com_mmio_reg_read_request_write_dev_addr
	movq	_ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_wait_for_reset_state
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_16
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
LBB0_4:
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_ENA_REGS_DEV_CTL_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r13), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	%r13, %rdi
	movl	%r12d, %esi
	xorl	%edx, %edx
	callq	_wait_for_reset_state
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_16
LBB0_12:
	movq	_ENA_REGS_CAPS_ADMIN_CMD_TO_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	movq	_ENA_REGS_CAPS_ADMIN_CMD_TO_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r14d
	testl	%r14d, %r14d
	je	LBB0_14
## %bb.13:
	imull	$100000, %r14d, %eax            ## imm = 0x186A0
	jmp	LBB0_15
LBB0_14:
	movq	_ADMIN_CMD_TIMEOUT_US@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_15:
	movl	%eax, (%r13)
	xorl	%ebx, %ebx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_ENA_REGS_DEV_STS_OFF,4,2       ## @ENA_REGS_DEV_STS_OFF
	.comm	_ENA_REGS_CAPS_OFF,4,2          ## @ENA_REGS_CAPS_OFF
	.comm	_ENA_MMIO_READ_TIMEOUT,4,2      ## @ENA_MMIO_READ_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reg read32 timeout occurred\n"

	.comm	_ETIME,4,2                      ## @ETIME
	.comm	_ENA_REGS_DEV_STS_READY_MASK,4,2 ## @ENA_REGS_DEV_STS_READY_MASK
L_.str.1:                               ## @.str.1
	.asciz	"Device isn't ready, can't reset device\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENA_REGS_CAPS_RESET_TIMEOUT_MASK,4,2 ## @ENA_REGS_CAPS_RESET_TIMEOUT_MASK
	.comm	_ENA_REGS_CAPS_RESET_TIMEOUT_SHIFT,4,2 ## @ENA_REGS_CAPS_RESET_TIMEOUT_SHIFT
L_.str.2:                               ## @.str.2
	.asciz	"Invalid timeout value\n"

	.comm	_ENA_REGS_DEV_CTL_DEV_RESET_MASK,4,2 ## @ENA_REGS_DEV_CTL_DEV_RESET_MASK
	.comm	_ENA_REGS_DEV_CTL_RESET_REASON_SHIFT,4,2 ## @ENA_REGS_DEV_CTL_RESET_REASON_SHIFT
	.comm	_ENA_REGS_DEV_CTL_RESET_REASON_MASK,4,2 ## @ENA_REGS_DEV_CTL_RESET_REASON_MASK
	.comm	_ENA_REGS_DEV_CTL_OFF,8,3       ## @ENA_REGS_DEV_CTL_OFF
	.comm	_ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK,4,2 ## @ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK
L_.str.3:                               ## @.str.3
	.asciz	"Reset indication didn't turn on\n"

L_.str.4:                               ## @.str.4
	.asciz	"Reset indication didn't turn off\n"

	.comm	_ENA_REGS_CAPS_ADMIN_CMD_TO_MASK,4,2 ## @ENA_REGS_CAPS_ADMIN_CMD_TO_MASK
	.comm	_ENA_REGS_CAPS_ADMIN_CMD_TO_SHIFT,4,2 ## @ENA_REGS_CAPS_ADMIN_CMD_TO_SHIFT
	.comm	_ADMIN_CMD_TIMEOUT_US,4,2       ## @ADMIN_CMD_TIMEOUT_US
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ena_com_dev_reset              ; -- Begin function ena_com_dev_reset
	.p2align	2
_ena_com_dev_reset:                     ; @ena_com_dev_reset
	.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, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ENA_REGS_DEV_STS_OFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENA_REGS_DEV_STS_OFF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_ena_com_reg_bar_read32
	mov	x22, x0
Lloh3:
	adrp	x8, _ENA_REGS_CAPS_OFF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENA_REGS_CAPS_OFF@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ena_com_reg_bar_read32
	mov	x20, x0
Lloh6:
	adrp	x8, _ENA_MMIO_READ_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENA_MMIO_READ_TIMEOUT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w22, w8
	ccmp	w0, w8, #4, ne
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh11:
	adrp	x8, _ETIME@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
	b	LBB0_9
LBB0_2:
Lloh13:
	adrp	x8, _ENA_REGS_DEV_STS_READY_MASK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENA_REGS_DEV_STS_READY_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_6
; %bb.3:
Lloh16:
	adrp	x8, _ENA_REGS_CAPS_RESET_TIMEOUT_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENA_REGS_CAPS_RESET_TIMEOUT_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	and	w8, w8, w20
Lloh19:
	adrp	x9, _ENA_REGS_CAPS_RESET_TIMEOUT_SHIFT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _ENA_REGS_CAPS_RESET_TIMEOUT_SHIFT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	asr	w22, w8, w9
	cbz	w22, LBB0_7
; %bb.4:
Lloh22:
	adrp	x8, _ENA_REGS_DEV_CTL_DEV_RESET_MASK@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENA_REGS_DEV_CTL_DEV_RESET_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _ENA_REGS_DEV_CTL_RESET_REASON_SHIFT@GOTPAGE
Lloh26:
	ldr	x9, [x9, _ENA_REGS_DEV_CTL_RESET_REASON_SHIFT@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	lsl	w9, w21, w9
Lloh28:
	adrp	x10, _ENA_REGS_DEV_CTL_RESET_REASON_MASK@GOTPAGE
Lloh29:
	ldr	x10, [x10, _ENA_REGS_DEV_CTL_RESET_REASON_MASK@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	and	w9, w9, w10
	orr	w0, w9, w8
	ldr	x8, [x19, #8]
Lloh31:
	adrp	x23, _ENA_REGS_DEV_CTL_OFF@GOTPAGE
Lloh32:
	ldr	x23, [x23, _ENA_REGS_DEV_CTL_OFF@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	bl	_ena_com_mmio_reg_read_request_write_dev_addr
Lloh33:
	adrp	x8, _ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK@GOTPAGEOFF]
Lloh35:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_wait_for_reset_state
	cbz	w0, LBB0_11
; %bb.5:
	mov	x21, x0
Lloh36:
	adrp	x0, l_.str.3@PAGE
Lloh37:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
	b	LBB0_10
LBB0_6:
Lloh38:
	adrp	x0, l_.str.1@PAGE
Lloh39:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh40:
	adrp	x0, l_.str.2@PAGE
Lloh41:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_8:
	bl	_pr_err
Lloh42:
	adrp	x8, _EINVAL@GOTPAGE
Lloh43:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x21
	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
LBB0_11:
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	mov	x1, x22
	mov	w2, #0
	bl	_wait_for_reset_state
	cbz	w0, LBB0_13
; %bb.12:
	mov	x21, x0
Lloh44:
	adrp	x0, l_.str.4@PAGE
Lloh45:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_err
	b	LBB0_10
LBB0_13:
Lloh46:
	adrp	x8, _ENA_REGS_CAPS_ADMIN_CMD_TO_MASK@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ENA_REGS_CAPS_ADMIN_CMD_TO_MASK@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	and	w8, w8, w20
Lloh49:
	adrp	x9, _ENA_REGS_CAPS_ADMIN_CMD_TO_SHIFT@GOTPAGE
Lloh50:
	ldr	x9, [x9, _ENA_REGS_CAPS_ADMIN_CMD_TO_SHIFT@GOTPAGEOFF]
Lloh51:
	ldr	w9, [x9]
	mov	w21, #0
	asr	w8, w8, w9
	cbz	w8, LBB0_15
; %bb.14:
	mov	w9, #34464
	movk	w9, #1, lsl #16
	mul	w8, w8, w9
	b	LBB0_16
LBB0_15:
Lloh52:
	adrp	x8, _ADMIN_CMD_TIMEOUT_US@GOTPAGE
Lloh53:
	ldr	x8, [x8, _ADMIN_CMD_TIMEOUT_US@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
LBB0_16:
	str	w8, [x19]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_ENA_REGS_DEV_STS_OFF,4,2       ; @ENA_REGS_DEV_STS_OFF
	.comm	_ENA_REGS_CAPS_OFF,4,2          ; @ENA_REGS_CAPS_OFF
	.comm	_ENA_MMIO_READ_TIMEOUT,4,2      ; @ENA_MMIO_READ_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reg read32 timeout occurred\n"

	.comm	_ETIME,4,2                      ; @ETIME
	.comm	_ENA_REGS_DEV_STS_READY_MASK,4,2 ; @ENA_REGS_DEV_STS_READY_MASK
l_.str.1:                               ; @.str.1
	.asciz	"Device isn't ready, can't reset device\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENA_REGS_CAPS_RESET_TIMEOUT_MASK,4,2 ; @ENA_REGS_CAPS_RESET_TIMEOUT_MASK
	.comm	_ENA_REGS_CAPS_RESET_TIMEOUT_SHIFT,4,2 ; @ENA_REGS_CAPS_RESET_TIMEOUT_SHIFT
l_.str.2:                               ; @.str.2
	.asciz	"Invalid timeout value\n"

	.comm	_ENA_REGS_DEV_CTL_DEV_RESET_MASK,4,2 ; @ENA_REGS_DEV_CTL_DEV_RESET_MASK
	.comm	_ENA_REGS_DEV_CTL_RESET_REASON_SHIFT,4,2 ; @ENA_REGS_DEV_CTL_RESET_REASON_SHIFT
	.comm	_ENA_REGS_DEV_CTL_RESET_REASON_MASK,4,2 ; @ENA_REGS_DEV_CTL_RESET_REASON_MASK
	.comm	_ENA_REGS_DEV_CTL_OFF,8,3       ; @ENA_REGS_DEV_CTL_OFF
	.comm	_ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK,4,2 ; @ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK
l_.str.3:                               ; @.str.3
	.asciz	"Reset indication didn't turn on\n"

l_.str.4:                               ; @.str.4
	.asciz	"Reset indication didn't turn off\n"

	.comm	_ENA_REGS_CAPS_ADMIN_CMD_TO_MASK,4,2 ; @ENA_REGS_CAPS_ADMIN_CMD_TO_MASK
	.comm	_ENA_REGS_CAPS_ADMIN_CMD_TO_SHIFT,4,2 ; @ENA_REGS_CAPS_ADMIN_CMD_TO_SHIFT
	.comm	_ADMIN_CMD_TIMEOUT_US,4,2       ; @ADMIN_CMD_TIMEOUT_US
.subsections_via_symbols
