	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mei_reset                      ## -- Begin function mei_reset
	.p2align	4, 0x90
_mei_reset:                             ## @mei_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
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	(%rdi), %r14d
	movq	_MEI_DEV_INITIALIZING@GOTPCREL(%rip), %rax
	movq	_MEI_DEV_DISABLED@GOTPCREL(%rip), %r13
	movq	_MEI_DEV_POWER_DOWN@GOTPCREL(%rip), %rbx
	cmpl	(%rax), %r14d
	je	LBB0_5
## %bb.1:
	cmpl	(%r13), %r14d
	je	LBB0_5
## %bb.2:
	cmpl	(%rbx), %r14d
	je	LBB0_5
## %bb.3:
	movq	_MEI_DEV_POWER_UP@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_5
## %bb.4:
	movq	%rsp, %r13
	movq	_MEI_FW_STATUS_STR_SZ@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	(%rbx), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_mei_fw_status_str
	movl	16(%r12), %ebx
	movl	%r14d, %edi
	callq	_mei_dev_state_str
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	movq	%r15, %rcx
	movq	_MEI_DEV_POWER_DOWN@GOTPCREL(%rip), %rbx
	callq	_dev_warn
	movq	%r13, %rsp
	movq	_MEI_DEV_DISABLED@GOTPCREL(%rip), %r13
LBB0_5:
	movq	%r12, %rdi
	callq	_mei_clear_interrupts
	movq	%r12, %rdi
	callq	_mei_hbm_idle
	movl	(%rbx), %r15d
	movq	_MEI_DEV_RESETTING@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_mei_set_devstate
	movq	8(%r12), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%r12)
	movq	_MEI_MAX_CONSEC_RESET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_6
## %bb.7:
	xorl	%esi, %esi
	cmpl	%r15d, %r14d
	setne	%sil
	movq	%r12, %rdi
	callq	_mei_hw_reset
	movl	%eax, %r15d
	movq	_MEI_DEV_INITIALIZING@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_10
## %bb.8:
	movq	_MEI_DEV_POWER_UP@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_10
## %bb.9:
	movq	%r12, %rdi
	callq	_mei_cl_all_disconnect
LBB0_10:
	movq	%r12, %rdi
	callq	_mei_hbm_reset
	movl	20(%r12), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.11:
	movl	16(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_16:
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_20
LBB0_6:
	movl	16(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_err
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_mei_set_devstate
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_20:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_22
## %bb.21:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_MEI_DEV_POWER_DOWN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_14
## %bb.13:
	movl	16(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_mei_set_devstate
	xorl	%r15d, %r15d
	jmp	LBB0_20
LBB0_14:
	movq	%r12, %rdi
	callq	_mei_hw_start
	movl	16(%r12), %edi
	testl	%eax, %eax
	je	LBB0_17
## %bb.15:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_16
LBB0_17:
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_dbg
	movq	_MEI_DEV_INIT_CLIENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_mei_set_devstate
	movq	%r12, %rdi
	callq	_mei_hbm_start_req
	testl	%eax, %eax
	je	LBB0_18
## %bb.19:
	movl	%eax, %r15d
	movl	16(%r12), %edi
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_mei_set_devstate
	jmp	LBB0_20
LBB0_18:
	xorl	%r15d, %r15d
	jmp	LBB0_20
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MEI_DEV_INITIALIZING,4,2       ## @MEI_DEV_INITIALIZING
	.comm	_MEI_DEV_DISABLED,4,2           ## @MEI_DEV_DISABLED
	.comm	_MEI_DEV_POWER_DOWN,4,2         ## @MEI_DEV_POWER_DOWN
	.comm	_MEI_DEV_POWER_UP,4,2           ## @MEI_DEV_POWER_UP
	.comm	_MEI_FW_STATUS_STR_SZ,4,2       ## @MEI_FW_STATUS_STR_SZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unexpected reset: dev_state = %s fw status = %s\n"

	.comm	_MEI_DEV_RESETTING,4,2          ## @MEI_DEV_RESETTING
	.comm	_MEI_MAX_CONSEC_RESET,8,3       ## @MEI_MAX_CONSEC_RESET
L_.str.1:                               ## @.str.1
	.asciz	"reset: reached maximal consecutive resets: disabling the device\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.2:                               ## @.str.2
	.asciz	"hw_reset failed ret = %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"powering down: end of reset\n"

L_.str.4:                               ## @.str.4
	.asciz	"hw_start failed ret = %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"link is established start sending messages.\n"

	.comm	_MEI_DEV_INIT_CLIENTS,4,2       ## @MEI_DEV_INIT_CLIENTS
L_.str.6:                               ## @.str.6
	.asciz	"hbm_start failed ret = %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mei_reset                      ; -- Begin function mei_reset
	.p2align	2
_mei_reset:                             ; @mei_reset
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	w20, [x0]
Lloh3:
	adrp	x25, _MEI_DEV_INITIALIZING@GOTPAGE
Lloh4:
	ldr	x25, [x25, _MEI_DEV_INITIALIZING@GOTPAGEOFF]
Lloh5:
	adrp	x23, _MEI_DEV_DISABLED@GOTPAGE
Lloh6:
	ldr	x23, [x23, _MEI_DEV_DISABLED@GOTPAGEOFF]
	ldr	w8, [x25]
	ldr	w9, [x23]
Lloh7:
	adrp	x24, _MEI_DEV_POWER_DOWN@GOTPAGE
Lloh8:
	ldr	x24, [x24, _MEI_DEV_POWER_DOWN@GOTPAGEOFF]
Lloh9:
	adrp	x26, _MEI_DEV_POWER_UP@GOTPAGE
Lloh10:
	ldr	x26, [x26, _MEI_DEV_POWER_UP@GOTPAGEOFF]
	ldr	w10, [x24]
	ldr	w11, [x26]
	cmp	w20, w8
	ccmp	w20, w9, #4, ne
	ccmp	w20, w10, #4, ne
	ccmp	w20, w11, #4, ne
	b.eq	LBB0_2
; %bb.1:
	mov	x27, sp
Lloh11:
	adrp	x12, _MEI_FW_STATUS_STR_SZ@GOTPAGE
Lloh12:
	ldr	x12, [x12, _MEI_FW_STATUS_STR_SZ@GOTPAGEOFF]
	ldr	w8, [x12]
	mov	x9, x8
Lloh13:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh14:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldr	w2, [x12]
	mov	x0, x19
	mov	x1, x21
	bl	_mei_fw_status_str
	ldr	w22, [x19, #16]
	mov	x0, x20
	bl	_mei_dev_state_str
	mov	x2, x0
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x3, x21
	bl	_dev_warn
	mov	sp, x27
LBB0_2:
	mov	x0, x19
	bl	_mei_clear_interrupts
	mov	x0, x19
	bl	_mei_hbm_idle
	ldr	w21, [x24]
Lloh17:
	adrp	x22, _MEI_DEV_RESETTING@GOTPAGE
Lloh18:
	ldr	x22, [x22, _MEI_DEV_RESETTING@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_mei_set_devstate
	ldr	x8, [x19, #8]
	add	x9, x8, #1
	str	x9, [x19, #8]
Lloh19:
	adrp	x9, _MEI_MAX_CONSEC_RESET@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MEI_MAX_CONSEC_RESET@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_8
; %bb.3:
	cmp	w20, w21
	cset	w1, ne
	mov	x0, x19
	bl	_mei_hw_reset
	mov	x21, x0
	ldr	w8, [x25]
	cmp	w20, w8
	b.eq	LBB0_6
; %bb.4:
	ldr	w8, [x26]
	cmp	w20, w8
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_mei_cl_all_disconnect
LBB0_6:
	mov	x0, x19
	bl	_mei_hbm_reset
	ldr	w0, [x19, #20]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	cbz	w21, LBB0_11
; %bb.7:
	ldr	w0, [x19, #16]
	str	x21, [sp, #-16]!
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	add	sp, sp, #16
	b	LBB0_9
LBB0_8:
	ldr	w0, [x19, #16]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	w1, [x23]
	mov	x0, x19
	bl	_mei_set_devstate
Lloh26:
	adrp	x8, _ENODEV@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	ldur	x8, [x29, #-88]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.10:
	mov	x0, x21
	sub	sp, x29, #80
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldr	w8, [x24]
	cmp	w20, w8
	b.ne	LBB0_13
; %bb.12:
	ldr	w0, [x19, #16]
Lloh32:
	adrp	x1, l_.str.3@PAGE
Lloh33:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	ldr	w1, [x23]
	mov	x0, x19
	bl	_mei_set_devstate
	mov	w21, #0
	b	LBB0_9
LBB0_13:
	mov	x0, x19
	bl	_mei_hw_start
	mov	x21, x0
	ldr	w0, [x19, #16]
	cbz	w21, LBB0_15
; %bb.14:
	str	x21, [sp, #-16]!
Lloh34:
	adrp	x1, l_.str.4@PAGE
Lloh35:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
	add	sp, sp, #16
	b	LBB0_17
LBB0_15:
Lloh36:
	adrp	x1, l_.str.5@PAGE
Lloh37:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_dbg
Lloh38:
	adrp	x8, _MEI_DEV_INIT_CLIENTS@GOTPAGE
Lloh39:
	ldr	x8, [x8, _MEI_DEV_INIT_CLIENTS@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mei_set_devstate
	mov	x0, x19
	bl	_mei_hbm_start_req
	mov	x21, x0
	cbz	w0, LBB0_9
; %bb.16:
	ldr	w0, [x19, #16]
	str	x21, [sp, #-16]!
Lloh41:
	adrp	x1, l_.str.6@PAGE
Lloh42:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_dev_err
	add	sp, sp, #16
	ldr	w1, [x22]
	mov	x0, x19
	bl	_mei_set_devstate
LBB0_17:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	b	LBB0_9
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_MEI_DEV_INITIALIZING,4,2       ; @MEI_DEV_INITIALIZING
	.comm	_MEI_DEV_DISABLED,4,2           ; @MEI_DEV_DISABLED
	.comm	_MEI_DEV_POWER_DOWN,4,2         ; @MEI_DEV_POWER_DOWN
	.comm	_MEI_DEV_POWER_UP,4,2           ; @MEI_DEV_POWER_UP
	.comm	_MEI_FW_STATUS_STR_SZ,4,2       ; @MEI_FW_STATUS_STR_SZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unexpected reset: dev_state = %s fw status = %s\n"

	.comm	_MEI_DEV_RESETTING,4,2          ; @MEI_DEV_RESETTING
	.comm	_MEI_MAX_CONSEC_RESET,8,3       ; @MEI_MAX_CONSEC_RESET
l_.str.1:                               ; @.str.1
	.asciz	"reset: reached maximal consecutive resets: disabling the device\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.2:                               ; @.str.2
	.asciz	"hw_reset failed ret = %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"powering down: end of reset\n"

l_.str.4:                               ; @.str.4
	.asciz	"hw_start failed ret = %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"link is established start sending messages.\n"

	.comm	_MEI_DEV_INIT_CLIENTS,4,2       ; @MEI_DEV_INIT_CLIENTS
l_.str.6:                               ; @.str.6
	.asciz	"hbm_start failed ret = %d\n"

.subsections_via_symbols
