	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function clear_port
_clear_port:                            ## @clear_port
	.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
	movl	$4120, %eax                     ## imm = 0x1018
	callq	____chkstk_darwin
	subq	%rax, %rsp
	popq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	-4144(%rbp), %rdi
	movl	$4096, %esi                     ## imm = 0x1000
	callq	___bzero
	movq	_clear_errors@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movq	_clear_counts@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	je	LBB0_3
## %bb.1:
	movq	_IB_PM_PC_XMIT_WAIT_SUP@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	movl	(%rdx), %edx
	andl	%ebx, %edx
	setne	%sil
	shll	$16, %esi
	orl	$4095, %esi                     ## imm = 0xFFF
	xorl	%edx, %edx
	testq	%rcx, %rcx
	cmovnel	%esi, %edx
	leal	61440(%rdx), %ecx
	testq	%rax, %rax
	cmovel	%edx, %ecx
	movq	_ibd_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_IB_GSI_PORT_COUNTERS@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_ibmad_port@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	leaq	-4144(%rbp), %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_performance_reset_via
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_3:
	cmpq	$0, (%r13)
	je	LBB0_6
## %bb.4:
	movq	_details@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movl	%ebx, -4148(%rbp)               ## 4-byte Spill
	leaq	-4144(%rbp), %r13
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$1024, %edx                     ## imm = 0x400
	callq	_memset
	movl	%r15d, %ebx
	movq	_ibd_timeout@GOTPCREL(%rip), %r15
	movl	(%r15), %r8d
	movq	_IB_GSI_PORT_XMIT_DISCARD_DETAILS@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_ibmad_port@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	movl	$15, %ecx
	callq	_performance_reset_via
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$1024, %edx                     ## imm = 0x400
	callq	_memset
	movl	(%r15), %r8d
	movl	%ebx, %r15d
	movq	_IB_GSI_PORT_RCV_ERROR_DETAILS@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_ibmad_port@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	%r13, %rdi
	movl	-4148(%rbp), %ebx               ## 4-byte Reload
	movq	%r12, %rsi
	movl	%r15d, %edx
	movl	$63, %ecx
	callq	_performance_reset_via
LBB0_6:
	movq	_clear_counts@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.7:
	movq	_IB_PM_EXT_WIDTH_SUPPORTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_IB_PM_EXT_WIDTH_NOIETF_SUP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	testl	%ebx, %ecx
	je	LBB0_10
## %bb.8:
	testl	%ebx, %eax
	movl	$15, %eax
	movl	$255, %ecx
	cmovel	%eax, %ecx
	movq	_ibd_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_ibmad_port@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-4144(%rbp), %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_reset_pc_ext
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_portid2str
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movq	%r14, %rdx
	movq	%rax, %rcx
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_fprintf
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	addq	$4120, %rsp                     ## imm = 0x1018
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_clear_errors,8,3               ## @clear_errors
	.comm	_IB_PM_PC_XMIT_WAIT_SUP,4,2     ## @IB_PM_PC_XMIT_WAIT_SUP
	.comm	_clear_counts,8,3               ## @clear_counts
	.comm	_ibd_timeout,4,2                ## @ibd_timeout
	.comm	_IB_GSI_PORT_COUNTERS,4,2       ## @IB_GSI_PORT_COUNTERS
	.comm	_ibmad_port,4,2                 ## @ibmad_port
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to reset errors %s port %d\n"

	.comm	_details,8,3                    ## @details
	.comm	_IB_GSI_PORT_XMIT_DISCARD_DETAILS,4,2 ## @IB_GSI_PORT_XMIT_DISCARD_DETAILS
	.comm	_IB_GSI_PORT_RCV_ERROR_DETAILS,4,2 ## @IB_GSI_PORT_RCV_ERROR_DETAILS
	.comm	_IB_PM_EXT_WIDTH_SUPPORTED,4,2  ## @IB_PM_EXT_WIDTH_SUPPORTED
	.comm	_IB_PM_EXT_WIDTH_NOIETF_SUP,4,2 ## @IB_PM_EXT_WIDTH_NOIETF_SUP
L_.str.1:                               ## @.str.1
	.asciz	"Failed to reset extended data counters %s, %s port %d\n"

	.no_dead_strip	_clear_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function clear_port
_clear_port:                            ; @clear_port
	.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
	mov	w9, #4128
Lloh0:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh1:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #1, lsl #12             ; =4096
	sub	sp, sp, #32
	mov	x20, x3
	mov	x19, x2
	mov	x22, x1
	mov	x21, x0
Lloh2:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	add	x0, sp, #24
	mov	w1, #4096
	bl	_bzero
Lloh5:
	adrp	x26, _clear_errors@GOTPAGE
Lloh6:
	ldr	x26, [x26, _clear_errors@GOTPAGEOFF]
	ldr	x9, [x26]
Lloh7:
	adrp	x25, _clear_counts@GOTPAGE
Lloh8:
	ldr	x25, [x25, _clear_counts@GOTPAGEOFF]
	ldr	x8, [x25]
Lloh9:
	adrp	x23, _ibd_timeout@GOTPAGE
Lloh10:
	ldr	x23, [x23, _ibd_timeout@GOTPAGEOFF]
Lloh11:
	adrp	x24, _ibmad_port@GOTPAGE
Lloh12:
	ldr	x24, [x24, _ibmad_port@GOTPAGEOFF]
	orr	x10, x8, x9
	cbz	x10, LBB0_3
; %bb.1:
Lloh13:
	adrp	x10, _IB_PM_PC_XMIT_WAIT_SUP@GOTPAGE
Lloh14:
	ldr	x10, [x10, _IB_PM_PC_XMIT_WAIT_SUP@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	tst	w10, w22
	mov	w10, #4095
	movk	w10, #1, lsl #16
	mov	w11, #4095
	csel	w10, w11, w10, eq
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	orr	w10, w9, #0xf000
	cmp	x8, #0
	csel	w3, w9, w10, eq
	ldr	w4, [x23]
Lloh16:
	adrp	x8, _IB_GSI_PORT_COUNTERS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IB_GSI_PORT_COUNTERS@GOTPAGEOFF]
Lloh18:
	ldr	w5, [x8]
	ldr	w6, [x24]
	add	x0, sp, #24
	mov	x1, x21
	mov	x2, x20
	bl	_performance_reset_via
	cbnz	w0, LBB0_3
; %bb.2:
Lloh19:
	adrp	x8, _stderr@GOTPAGE
Lloh20:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	str	x20, [sp]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_fprintf
LBB0_3:
	ldr	x8, [x26]
Lloh24:
	adrp	x9, _details@GOTPAGE
Lloh25:
	ldr	x9, [x9, _details@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, #0
	ccmp	x9, #0, #4, ne
	b.eq	LBB0_5
; %bb.4:
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #1024
	bl	_memset
	ldr	w4, [x23]
Lloh27:
	adrp	x8, _IB_GSI_PORT_XMIT_DISCARD_DETAILS@GOTPAGE
Lloh28:
	ldr	x8, [x8, _IB_GSI_PORT_XMIT_DISCARD_DETAILS@GOTPAGEOFF]
Lloh29:
	ldr	w5, [x8]
	ldr	w6, [x24]
	add	x0, sp, #24
	mov	x1, x21
	mov	x2, x20
	mov	w3, #15
	bl	_performance_reset_via
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #1024
	bl	_memset
	ldr	w4, [x23]
Lloh30:
	adrp	x8, _IB_GSI_PORT_RCV_ERROR_DETAILS@GOTPAGE
Lloh31:
	ldr	x8, [x8, _IB_GSI_PORT_RCV_ERROR_DETAILS@GOTPAGEOFF]
Lloh32:
	ldr	w5, [x8]
	ldr	w6, [x24]
	add	x0, sp, #24
	mov	x1, x21
	mov	x2, x20
	mov	w3, #63
	bl	_performance_reset_via
LBB0_5:
	ldr	x8, [x25]
	cbz	x8, LBB0_9
; %bb.6:
Lloh33:
	adrp	x8, _IB_PM_EXT_WIDTH_SUPPORTED@GOTPAGE
Lloh34:
	ldr	x8, [x8, _IB_PM_EXT_WIDTH_SUPPORTED@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _IB_PM_EXT_WIDTH_NOIETF_SUP@GOTPAGE
Lloh37:
	ldr	x9, [x9, _IB_PM_EXT_WIDTH_NOIETF_SUP@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w9, w9, w8
	tst	w9, w22
	b.eq	LBB0_9
; %bb.7:
	tst	w8, w22
	mov	w8, #255
	mov	w9, #15
	csel	w3, w9, w8, eq
	ldr	w4, [x23]
	ldr	w5, [x24]
	add	x0, sp, #24
	mov	x1, x21
	mov	x2, x20
	bl	_reset_pc_ext
	cbnz	w0, LBB0_9
; %bb.8:
Lloh39:
	adrp	x8, _stderr@GOTPAGE
Lloh40:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh41:
	ldr	w22, [x8]
	mov	x0, x21
	bl	_portid2str
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	stp	x0, x20, [sp]
Lloh42:
	adrp	x1, l_.str.1@PAGE
Lloh43:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x19
	bl	_fprintf
LBB0_9:
	ldur	x8, [x29, #-88]
Lloh44:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh45:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh46:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	add	sp, sp, #1, lsl #12             ; =4096
	add	sp, sp, #32
	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:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_clear_errors,8,3               ; @clear_errors
	.comm	_IB_PM_PC_XMIT_WAIT_SUP,4,2     ; @IB_PM_PC_XMIT_WAIT_SUP
	.comm	_clear_counts,8,3               ; @clear_counts
	.comm	_ibd_timeout,4,2                ; @ibd_timeout
	.comm	_IB_GSI_PORT_COUNTERS,4,2       ; @IB_GSI_PORT_COUNTERS
	.comm	_ibmad_port,4,2                 ; @ibmad_port
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to reset errors %s port %d\n"

	.comm	_details,8,3                    ; @details
	.comm	_IB_GSI_PORT_XMIT_DISCARD_DETAILS,4,2 ; @IB_GSI_PORT_XMIT_DISCARD_DETAILS
	.comm	_IB_GSI_PORT_RCV_ERROR_DETAILS,4,2 ; @IB_GSI_PORT_RCV_ERROR_DETAILS
	.comm	_IB_PM_EXT_WIDTH_SUPPORTED,4,2  ; @IB_PM_EXT_WIDTH_SUPPORTED
	.comm	_IB_PM_EXT_WIDTH_NOIETF_SUP,4,2 ; @IB_PM_EXT_WIDTH_NOIETF_SUP
l_.str.1:                               ; @.str.1
	.asciz	"Failed to reset extended data counters %s, %s port %d\n"

	.no_dead_strip	_clear_port
.subsections_via_symbols
