	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ionic_port_reset               ## -- Begin function ionic_port_reset
	.p2align	4, 0x90
_ionic_port_reset:                      ## @ionic_port_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r14d, %r14d
	cmpq	$0, 16(%rdi)
	je	LBB0_3
## %bb.1:
	movq	%rdi, %rbx
	leaq	8(%rdi), %r15
	leaq	4(%rdi), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_ionic_dev_cmd_port_reset
	movq	_DEVCMD_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ionic_dev_cmd_wait
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	(%rbx), %edi
	movl	24(%rbx), %esi
	movq	16(%rbx), %rdx
	movq	8(%rbx), %rcx
	callq	_dma_free_coherent
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rbx)
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.2:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movl	%r15d, %r14d
LBB0_3:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEVCMD_TIMEOUT,4,2             ## @DEVCMD_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to reset port\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ionic_port_reset               ; -- Begin function ionic_port_reset
	.p2align	2
_ionic_port_reset:                      ; @ionic_port_reset
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x19, x0
	add	x20, x0, #8
	add	x21, x0, #4
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x20
	bl	_ionic_dev_cmd_port_reset
Lloh0:
	adrp	x8, _DEVCMD_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEVCMD_TIMEOUT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ionic_dev_cmd_wait
	mov	x20, x0
	mov	x0, x21
	bl	_mutex_unlock
	ldr	w0, [x19]
	ldr	w1, [x19, #24]
	ldp	x3, x2, [x19, #8]
	bl	_dma_free_coherent
	stp	xzr, xzr, [x19, #8]
	cbz	w20, LBB0_4
; %bb.2:
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_4
LBB0_3:
	mov	w20, #0
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DEVCMD_TIMEOUT,4,2             ; @DEVCMD_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to reset port\n"

.subsections_via_symbols
