	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __mei_cl_disconnect
___mei_cl_disconnect:                   ## @__mei_cl_disconnect
	.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	16(%rdi), %r15
	movq	_MEI_FILE_DISCONNECTING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rdi)
	movq	_MEI_FOP_DISCONNECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_mei_cl_enqueue_ctrl_wr_cb
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_mei_hbuf_acquire
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_mei_cl_send_disconnect
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_cl_err
	movq	%r12, %rdi
	callq	_mei_cl_set_disconnected
	jmp	LBB0_11
LBB0_5:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	12(%r12), %r13d
	movq	(%r12), %rax
	movq	_MEI_FILE_DISCONNECT_REPLY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%cl
	movq	_MEI_FILE_DISCONNECTED@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %ebx
	movq	_MEI_CL_CONNECT_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mei_secs_to_jiffies
	movl	%r13d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_wait_event_timeout
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	8(%r12), %ebx
	movq	(%r12), %rax
	movq	_MEI_FILE_DISCONNECT_REPLY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.6:
	movq	_MEI_FILE_DISCONNECTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.7:
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_cl_dbg
	movq	_ETIME@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_8:
	subl	(%rax), %ebx
LBB0_9:
	movq	%r12, %rdi
	callq	_mei_cl_set_disconnected
	testl	%ebx, %ebx
	jne	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_cl_dbg
	xorl	%ebx, %ebx
LBB0_11:
	movq	%r14, %rdi
	callq	_mei_io_cb_free
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MEI_FILE_DISCONNECTING,8,3     ## @MEI_FILE_DISCONNECTING
	.comm	_MEI_FOP_DISCONNECT,4,2         ## @MEI_FOP_DISCONNECT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to disconnect.\n"

	.comm	_MEI_FILE_DISCONNECT_REPLY,8,3  ## @MEI_FILE_DISCONNECT_REPLY
	.comm	_MEI_FILE_DISCONNECTED,8,3      ## @MEI_FILE_DISCONNECTED
	.comm	_MEI_CL_CONNECT_TIMEOUT,4,2     ## @MEI_CL_CONNECT_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"timeout on disconnect from FW client.\n"

	.comm	_ETIME,4,2                      ## @ETIME
L_.str.2:                               ## @.str.2
	.asciz	"successfully disconnected from FW client.\n"

	.no_dead_strip	___mei_cl_disconnect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __mei_cl_disconnect
___mei_cl_disconnect:                   ; @__mei_cl_disconnect
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _MEI_FILE_DISCONNECTING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MEI_FILE_DISCONNECTING@GOTPAGEOFF]
	ldr	x21, [x0, #16]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x0]
Lloh3:
	adrp	x8, _MEI_FOP_DISCONNECT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MEI_FOP_DISCONNECT@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w1, #0
	mov	x3, #0
	bl	_mei_cl_enqueue_ctrl_wr_cb
	mov	x20, x0
	cbz	x0, LBB0_4
; %bb.1:
	mov	x0, x21
	bl	_mei_hbuf_acquire
	cbz	x0, LBB0_5
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_mei_cl_send_disconnect
	cbz	w0, LBB0_5
; %bb.3:
	mov	x22, x0
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	mov	x1, x19
	bl	_cl_err
	mov	x0, x19
	bl	_mei_cl_set_disconnected
	b	LBB0_11
LBB0_4:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	mov	x0, x21
	bl	_mutex_unlock
	ldr	w22, [x19, #12]
	ldr	x8, [x19]
Lloh10:
	adrp	x24, _MEI_FILE_DISCONNECT_REPLY@GOTPAGE
Lloh11:
	ldr	x24, [x24, _MEI_FILE_DISCONNECT_REPLY@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
Lloh12:
	adrp	x25, _MEI_FILE_DISCONNECTED@GOTPAGE
Lloh13:
	ldr	x25, [x25, _MEI_FILE_DISCONNECTED@GOTPAGEOFF]
	ldr	x9, [x25]
	ccmp	x8, x9, #4, ne
	cset	w23, eq
Lloh14:
	adrp	x8, _MEI_CL_CONNECT_TIMEOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MEI_CL_CONNECT_TIMEOUT@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_mei_secs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_timeout
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x19]
	ldr	x9, [x24]
	ldr	x10, [x25]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_7
; %bb.6:
	ldr	w22, [x19, #8]
	b	LBB0_9
LBB0_7:
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x1, x19
	bl	_cl_dbg
Lloh19:
	adrp	x8, _ETIME@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_9:
	mov	x0, x19
	bl	_mei_cl_set_disconnected
	cbnz	w22, LBB0_11
; %bb.10:
Lloh21:
	adrp	x2, l_.str.2@PAGE
Lloh22:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x1, x19
	bl	_cl_dbg
LBB0_11:
	mov	x0, x20
	bl	_mei_io_cb_free
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MEI_FILE_DISCONNECTING,8,3     ; @MEI_FILE_DISCONNECTING
	.comm	_MEI_FOP_DISCONNECT,4,2         ; @MEI_FOP_DISCONNECT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to disconnect.\n"

	.comm	_MEI_FILE_DISCONNECT_REPLY,8,3  ; @MEI_FILE_DISCONNECT_REPLY
	.comm	_MEI_FILE_DISCONNECTED,8,3      ; @MEI_FILE_DISCONNECTED
	.comm	_MEI_CL_CONNECT_TIMEOUT,4,2     ; @MEI_CL_CONNECT_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"timeout on disconnect from FW client.\n"

	.comm	_ETIME,4,2                      ; @ETIME
l_.str.2:                               ; @.str.2
	.asciz	"successfully disconnected from FW client.\n"

	.no_dead_strip	___mei_cl_disconnect
.subsections_via_symbols
