	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sort_ports_by_switch_load
_sort_ports_by_switch_load:             ## @sort_ports_by_switch_load
	.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, %r14
	movq	(%rdi), %rdi
	callq	_cl_qmap_count
	movl	%eax, %r15d
	leal	(,%r15,8), %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %r12
	movq	(%r14), %rdi
	callq	_cl_qmap_head
	movq	%rax, (%r12)
	movl	%r15d, %r13d
	cmpl	$2, %r15d
	jl	LBB0_4
## %bb.2:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rdi
	callq	_cl_qmap_next
	movq	%rax, (%r12,%rbx,8)
	incq	%rbx
	cmpq	%rbx, %r13
	jne	LBB0_3
LBB0_4:
	testl	%r15d, %r15d
	jle	LBB0_5
## %bb.6:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rdi
	callq	_sw_count_endport_links
	incq	%rbx
	cmpq	%rbx, %r13
	jne	LBB0_7
## %bb.8:
	movq	_compar_sw_load@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	$8, %edx
	callq	_qsort
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rdi
	movq	%r14, %rsi
	callq	_add_sw_endports_to_order_list
	incq	%rbx
	cmpq	%rbx, %r13
	jne	LBB0_9
	jmp	LBB0_10
LBB0_11:
	movl	8(%r14), %edi
	movq	_OSM_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_OSM_LOG                        ## TAILCALL
LBB0_5:
	movq	_compar_sw_load@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	$8, %edx
	callq	_qsort
LBB0_10:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_free                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_OSM_LOG_ERROR,4,2              ## @OSM_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ERR 3A0C: No memory, skip by switch load sorting.\n"

	.comm	_compar_sw_load,4,2             ## @compar_sw_load
	.no_dead_strip	_sort_ports_by_switch_load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sort_ports_by_switch_load
_sort_ports_by_switch_load:             ; @sort_ports_by_switch_load
	.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	x19, x0
	ldr	x0, [x0]
	bl	_cl_qmap_count
	mov	x21, x0
	lsl	w0, w0, #3
	bl	_malloc
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	ldr	x0, [x19]
	bl	_cl_qmap_head
	str	x0, [x20]
	mov	w22, w21
	cmp	w21, #1
	b.le	LBB0_4
; %bb.2:
	add	x23, x20, #8
	sub	x24, x22, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	bl	_cl_qmap_next
	str	x0, [x23], #8
	subs	x24, x24, #1
	b.ne	LBB0_3
LBB0_4:
	cmp	w21, #1
	b.lt	LBB0_10
; %bb.5:
	mov	x23, #0
	lsl	x24, x22, #3
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20, x23]
	bl	_sw_count_endport_links
	add	x23, x23, #8
	cmp	x24, x23
	b.ne	LBB0_6
; %bb.7:
Lloh0:
	adrp	x8, _compar_sw_load@GOTPAGE
Lloh1:
	ldr	x8, [x8, _compar_sw_load@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #8
	bl	_qsort
	mov	x21, x20
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21], #8
	mov	x1, x19
	bl	_add_sw_endports_to_order_list
	subs	x22, x22, #1
	b.ne	LBB0_8
	b	LBB0_11
LBB0_9:
	ldr	w0, [x19, #8]
Lloh3:
	adrp	x8, _OSM_LOG_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OSM_LOG_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	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
	b	_OSM_LOG
LBB0_10:
Lloh8:
	adrp	x8, _compar_sw_load@GOTPAGE
Lloh9:
	ldr	x8, [x8, _compar_sw_load@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #8
	bl	_qsort
LBB0_11:
	mov	x0, x20
	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
	b	_free
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_OSM_LOG_ERROR,4,2              ; @OSM_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ERR 3A0C: No memory, skip by switch load sorting.\n"

	.comm	_compar_sw_load,4,2             ; @compar_sw_load
	.no_dead_strip	_sort_ports_by_switch_load
.subsections_via_symbols
