	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_efa_com_dev_reset              ## -- Begin function efa_com_dev_reset
	.p2align	4, 0x90
_efa_com_dev_reset:                     ## @efa_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, %r12d
	movq	%rdi, %r15
	movq	_EFA_REGS_DEV_STS_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_efa_com_reg_read32
	movl	%eax, %ebx
	movq	_EFA_REGS_CAPS_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_efa_com_reg_read32
	movl	%eax, %r14d
	movq	_EFA_REGS_DEV_STS_READY_MASK@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_1
## %bb.3:
	movq	_EFA_REGS_CAPS_RESET_TIMEOUT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	andl	%r14d, %r13d
	movq	_EFA_REGS_CAPS_RESET_TIMEOUT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r13d
	testl	%r13d, %r13d
	je	LBB0_4
## %bb.5:
	movq	_EFA_REGS_DEV_CTL_DEV_RESET_MASK@GOTPCREL(%rip), %rax
	movq	_EFA_REGS_DEV_CTL_RESET_REASON_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r12d
	movq	_EFA_REGS_DEV_CTL_RESET_REASON_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r12d
	orl	(%rax), %r12d
	movq	_EFA_REGS_DEV_CTL_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	movl	%r12d, %edi
	callq	_writel
	movq	%r15, %rdi
	callq	_efa_com_mmio_reg_read_resp_addr_init
	movq	_EFA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_wait_for_reset_state
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	movl	4(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_ibdev_err
	jmp	LBB0_13
LBB0_1:
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movl	4(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	callq	_ibdev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_EFA_REGS_DEV_CTL_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	%r15, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	callq	_wait_for_reset_state
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	movl	4(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_ibdev_err
	jmp	LBB0_13
LBB0_9:
	movq	_EFA_REGS_CAPS_ADMIN_CMD_TO_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	movq	_EFA_REGS_CAPS_ADMIN_CMD_TO_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r14d
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.10:
	imull	$100000, %r14d, %eax            ## imm = 0x186A0
	jmp	LBB0_12
LBB0_11:
	movq	_ADMIN_CMD_TIMEOUT_US@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_12:
	movl	%eax, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EFA_REGS_DEV_STS_OFF,4,2       ## @EFA_REGS_DEV_STS_OFF
	.comm	_EFA_REGS_CAPS_OFF,4,2          ## @EFA_REGS_CAPS_OFF
	.comm	_EFA_REGS_DEV_STS_READY_MASK,4,2 ## @EFA_REGS_DEV_STS_READY_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Device isn't ready, can't reset device\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EFA_REGS_CAPS_RESET_TIMEOUT_MASK,4,2 ## @EFA_REGS_CAPS_RESET_TIMEOUT_MASK
	.comm	_EFA_REGS_CAPS_RESET_TIMEOUT_SHIFT,4,2 ## @EFA_REGS_CAPS_RESET_TIMEOUT_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"Invalid timeout value\n"

	.comm	_EFA_REGS_DEV_CTL_DEV_RESET_MASK,4,2 ## @EFA_REGS_DEV_CTL_DEV_RESET_MASK
	.comm	_EFA_REGS_DEV_CTL_RESET_REASON_SHIFT,4,2 ## @EFA_REGS_DEV_CTL_RESET_REASON_SHIFT
	.comm	_EFA_REGS_DEV_CTL_RESET_REASON_MASK,4,2 ## @EFA_REGS_DEV_CTL_RESET_REASON_MASK
	.comm	_EFA_REGS_DEV_CTL_OFF,8,3       ## @EFA_REGS_DEV_CTL_OFF
	.comm	_EFA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK,4,2 ## @EFA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK
L_.str.2:                               ## @.str.2
	.asciz	"Reset indication didn't turn on\n"

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

	.comm	_EFA_REGS_CAPS_ADMIN_CMD_TO_MASK,4,2 ## @EFA_REGS_CAPS_ADMIN_CMD_TO_MASK
	.comm	_EFA_REGS_CAPS_ADMIN_CMD_TO_SHIFT,4,2 ## @EFA_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	_efa_com_dev_reset              ; -- Begin function efa_com_dev_reset
	.p2align	2
_efa_com_dev_reset:                     ; @efa_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	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _EFA_REGS_DEV_STS_OFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EFA_REGS_DEV_STS_OFF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_efa_com_reg_read32
	mov	x21, x0
Lloh3:
	adrp	x8, _EFA_REGS_CAPS_OFF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EFA_REGS_CAPS_OFF@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_efa_com_reg_read32
Lloh6:
	adrp	x8, _EFA_REGS_DEV_STS_READY_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EFA_REGS_DEV_STS_READY_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_4
; %bb.1:
	mov	x20, x0
Lloh9:
	adrp	x8, _EFA_REGS_CAPS_RESET_TIMEOUT_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EFA_REGS_CAPS_RESET_TIMEOUT_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh12:
	adrp	x9, _EFA_REGS_CAPS_RESET_TIMEOUT_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EFA_REGS_CAPS_RESET_TIMEOUT_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	asr	w21, w8, w9
	cbz	w21, LBB0_5
; %bb.2:
Lloh15:
	adrp	x8, _EFA_REGS_DEV_CTL_DEV_RESET_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EFA_REGS_DEV_CTL_DEV_RESET_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _EFA_REGS_DEV_CTL_RESET_REASON_SHIFT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _EFA_REGS_DEV_CTL_RESET_REASON_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	lsl	w9, w22, w9
Lloh21:
	adrp	x10, _EFA_REGS_DEV_CTL_RESET_REASON_MASK@GOTPAGE
Lloh22:
	ldr	x10, [x10, _EFA_REGS_DEV_CTL_RESET_REASON_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	and	w9, w9, w10
	orr	w0, w9, w8
	ldr	x8, [x19, #8]
Lloh24:
	adrp	x23, _EFA_REGS_DEV_CTL_OFF@GOTPAGE
Lloh25:
	ldr	x23, [x23, _EFA_REGS_DEV_CTL_OFF@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	bl	_efa_com_mmio_reg_read_resp_addr_init
Lloh26:
	adrp	x8, _EFA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EFA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_wait_for_reset_state
	cbz	w0, LBB0_8
; %bb.3:
	mov	x22, x0
	ldr	w0, [x19, #4]
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_ibdev_err
	b	LBB0_7
LBB0_4:
	ldr	w0, [x19, #4]
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19, #4]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	bl	_ibdev_err
Lloh35:
	adrp	x8, _EINVAL@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_7:
	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
LBB0_8:
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	mov	x1, x21
	mov	w2, #0
	bl	_wait_for_reset_state
	cbz	w0, LBB0_10
; %bb.9:
	mov	x22, x0
	ldr	w0, [x19, #4]
Lloh38:
	adrp	x1, l_.str.3@PAGE
Lloh39:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_ibdev_err
	b	LBB0_7
LBB0_10:
Lloh40:
	adrp	x8, _EFA_REGS_CAPS_ADMIN_CMD_TO_MASK@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EFA_REGS_CAPS_ADMIN_CMD_TO_MASK@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	and	w8, w8, w20
Lloh43:
	adrp	x9, _EFA_REGS_CAPS_ADMIN_CMD_TO_SHIFT@GOTPAGE
Lloh44:
	ldr	x9, [x9, _EFA_REGS_CAPS_ADMIN_CMD_TO_SHIFT@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x9]
	mov	w22, #0
	asr	w8, w8, w9
	cbz	w8, LBB0_12
; %bb.11:
	mov	w9, #34464
	movk	w9, #1, lsl #16
	mul	w8, w8, w9
	b	LBB0_13
LBB0_12:
Lloh46:
	adrp	x8, _ADMIN_CMD_TIMEOUT_US@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ADMIN_CMD_TIMEOUT_US@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
LBB0_13:
	str	w8, [x19]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_EFA_REGS_DEV_STS_OFF,4,2       ; @EFA_REGS_DEV_STS_OFF
	.comm	_EFA_REGS_CAPS_OFF,4,2          ; @EFA_REGS_CAPS_OFF
	.comm	_EFA_REGS_DEV_STS_READY_MASK,4,2 ; @EFA_REGS_DEV_STS_READY_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Device isn't ready, can't reset device\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EFA_REGS_CAPS_RESET_TIMEOUT_MASK,4,2 ; @EFA_REGS_CAPS_RESET_TIMEOUT_MASK
	.comm	_EFA_REGS_CAPS_RESET_TIMEOUT_SHIFT,4,2 ; @EFA_REGS_CAPS_RESET_TIMEOUT_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"Invalid timeout value\n"

	.comm	_EFA_REGS_DEV_CTL_DEV_RESET_MASK,4,2 ; @EFA_REGS_DEV_CTL_DEV_RESET_MASK
	.comm	_EFA_REGS_DEV_CTL_RESET_REASON_SHIFT,4,2 ; @EFA_REGS_DEV_CTL_RESET_REASON_SHIFT
	.comm	_EFA_REGS_DEV_CTL_RESET_REASON_MASK,4,2 ; @EFA_REGS_DEV_CTL_RESET_REASON_MASK
	.comm	_EFA_REGS_DEV_CTL_OFF,8,3       ; @EFA_REGS_DEV_CTL_OFF
	.comm	_EFA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK,4,2 ; @EFA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK
l_.str.2:                               ; @.str.2
	.asciz	"Reset indication didn't turn on\n"

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

	.comm	_EFA_REGS_CAPS_ADMIN_CMD_TO_MASK,4,2 ; @EFA_REGS_CAPS_ADMIN_CMD_TO_MASK
	.comm	_EFA_REGS_CAPS_ADMIN_CMD_TO_SHIFT,4,2 ; @EFA_REGS_CAPS_ADMIN_CMD_TO_SHIFT
	.comm	_ADMIN_CMD_TIMEOUT_US,4,2       ; @ADMIN_CMD_TIMEOUT_US
.subsections_via_symbols
