	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_switch_metric
_get_switch_metric:                     ## @get_switch_metric
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movq	16(%rdi), %rdi
	movslq	%esi, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rax), %r12d
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_OSM_LOG_ENTER
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_m_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	testq	%r12, %r12
	je	LBB0_29
## %bb.3:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	24(%rax), %r11
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rcx
	movl	%r12d, %edi
	andl	$-2, %edi
	xorl	%ebx, %ebx
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	cmpq	%r12, %rbx
	je	LBB0_29
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##     Child Loop BB0_11 Depth 2
                                        ##     Child Loop BB0_14 Depth 2
                                        ##       Child Loop BB0_17 Depth 3
                                        ##     Child Loop BB0_25 Depth 2
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	(%r11,%rbx,8), %rax
	movslq	(%rax), %rax
	movq	(%rcx,%rax,8), %r8
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_LARGE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%edi, %edi
	jle	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	-1(%rdi), %rax
	movl	%edi, %r9d
	andl	$3, %r9d
	cmpq	$3, %rax
	jae	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%esi, %esi
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%edi, %eax
	andl	$-4, %eax
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rcx,%rsi,8), %rdx
	movq	(%rdx), %rdx
	movl	%ebx, 4(%rdx)
	movq	8(%rcx,%rsi,8), %rdx
	movq	(%rdx), %rdx
	movl	%ebx, 4(%rdx)
	movq	16(%rcx,%rsi,8), %rdx
	movq	(%rdx), %rdx
	movl	%ebx, 4(%rdx)
	movq	24(%rcx,%rsi,8), %rdx
	movq	(%rdx), %rdx
	movl	%ebx, 4(%rdx)
	addq	$4, %rsi
	cmpq	%rsi, %rax
	jne	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	testq	%r9, %r9
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	leaq	(%rcx,%rsi,8), %rax
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rax,%rsi,8), %rdx
	movq	(%rdx), %rdx
	movl	%ebx, 4(%rdx)
	incq	%rsi
	cmpq	%rsi, %r9
	jne	LBB0_11
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r8), %rax
	movl	$0, 4(%rax)
	testl	%edi, %edi
	jle	LBB0_23
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	testl	%edi, %edi
	setle	%r10b
	xorl	%esi, %esi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_17 Depth 3
	movq	(%rcx,%rsi,8), %rdx
	movq	(%rdx), %r8
	cmpl	%ebx, 4(%r8)
	je	LBB0_21
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	movl	(%r8), %r12d
	testq	%r12, %r12
	je	LBB0_21
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=2
	movq	24(%r8), %r13
	xorl	%r15d, %r15d
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_17 Depth=3
	incq	%r15
	cmpq	%r15, %r12
	je	LBB0_21
LBB0_17:                                ##   Parent Loop BB0_4 Depth=1
                                        ##     Parent Loop BB0_14 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	(%r13,%r15,8), %rdx
	movslq	(%rdx), %rdx
	cmpl	%r14d, %edx
	je	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=3
	movq	(%rcx,%rdx,8), %rdx
	movl	4(%r8), %r9d
	incl	%r9d
	movq	(%rdx), %rdx
	cmpl	4(%rdx), %r9d
	jge	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=3
	movl	%r9d, 4(%rdx)
	incl	%eax
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_14 Depth=2
	incq	%rsi
	cmpq	%rdi, %rsi
	jne	LBB0_14
## %bb.22:                              ##   in Loop: Header=BB0_14 Depth=2
	testl	%eax, %eax
	sete	%dl
	orb	%r10b, %dl
	xorl	%esi, %esi
	movl	$0, %eax
	cmpb	$1, %dl
	jne	LBB0_14
LBB0_23:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	(%r15,%rbx,8), %rax
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	xorl	%edx, %edx
	cmpl	$1, %r12d
	je	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_25:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r11,%rdx,8), %rsi
	movslq	(%rsi), %rsi
	movq	(%rcx,%rsi,8), %rsi
	movq	(%rsi), %rsi
	movl	4(%rsi), %esi
	movl	%esi, (%rax,%rdx,4)
	movq	8(%r11,%rdx,8), %rsi
	movslq	(%rsi), %rsi
	movq	(%rcx,%rsi,8), %rsi
	movq	(%rsi), %rsi
	movl	4(%rsi), %esi
	movl	%esi, 4(%rax,%rdx,4)
	addq	$2, %rdx
	cmpq	%rdx, %rdi
	jne	LBB0_25
LBB0_26:                                ##   in Loop: Header=BB0_4 Depth=1
	testb	$1, %r12b
	je	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r11,%rdx,8), %rsi
	movslq	(%rsi), %rsi
	movq	(%rcx,%rsi,8), %rsi
	movq	(%rsi), %rsi
	movl	4(%rsi), %esi
	movl	%esi, (%rax,%rdx,4)
	jmp	LBB0_28
LBB0_29:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	leaq	16(%r14), %rcx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	movq	%r15, %rdx
	callq	_char_poly
	testq	%rax, %rax
	je	LBB0_30
## %bb.31:
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_m_free
	xorl	%r15d, %r15d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_32
LBB0_1:
	xorl	%r15d, %r15d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_32:
	movl	$-1, %ebx
	jmp	LBB0_33
LBB0_30:
	xorl	%ebx, %ebx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_33:
	movq	%r15, 8(%r14)
	callq	_OSM_LOG_EXIT
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LARGE,4,2                      ## @LARGE
	.no_dead_strip	_get_switch_metric
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_switch_metric
_get_switch_metric:                     ; @get_switch_metric
	.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	x23, x1
	mov	x22, x0
	ldp	x8, x19, [x0, #8]
	ldr	x8, [x8, w1, sxtw #3]
	ldr	x24, [x8]
	ldr	w21, [x24]
	mov	x0, x19
	bl	_OSM_LOG_ENTER
	mov	x0, x22
	mov	x1, x21
	bl	_m_alloc
	mov	x20, x0
	cbz	x0, LBB0_27
; %bb.1:
	cbz	w21, LBB0_25
; %bb.2:
	mov	x8, #0
	ldr	x9, [x24, #24]
	ldr	x10, [x22, #8]
	add	x11, x10, #16
Lloh0:
	adrp	x12, _LARGE@GOTPAGE
Lloh1:
	ldr	x12, [x12, _LARGE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_10 Depth 2
                                        ;     Child Loop BB0_13 Depth 2
                                        ;       Child Loop BB0_17 Depth 3
                                        ;     Child Loop BB0_23 Depth 2
	ldr	x13, [x9, x8, lsl #3]
	ldrsw	x13, [x13]
	ldr	x15, [x10, x13, lsl #3]
	ldr	w13, [x22]
	ldr	w14, [x12]
	cmp	w13, #1
	b.lt	LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w13, #4
	b.hs	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x16, #0
	b	LBB0_9
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	and	x16, x13, #0xfffffffc
	mov	x17, x16
	mov	x0, x11
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	x1, x2, [x0, #-16]
	ldp	x3, x4, [x0], #32
	ldr	x1, [x1]
	ldr	x2, [x2]
	ldr	x3, [x3]
	ldr	x4, [x4]
	str	w14, [x1, #4]
	str	w14, [x2, #4]
	str	w14, [x3, #4]
	str	w14, [x4, #4]
	subs	x17, x17, #4
	b.ne	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	x16, x13
	b.eq	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x17, x10, x16, lsl #3
	sub	x16, x13, x16
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x17], #8
	ldr	x0, [x0]
	str	w14, [x0, #4]
	subs	x16, x16, #1
	b.ne	LBB0_10
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x15, [x15]
	str	wzr, [x15, #4]
	cmp	w13, #1
	b.lt	LBB0_22
; %bb.12:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x15, #0
	mov	w17, #0
	cmp	w13, #1
	cset	w16, lt
LBB0_13:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_17 Depth 3
	ldr	x0, [x10, x15, lsl #3]
	ldr	x0, [x0]
	ldr	w1, [x0, #4]
	cmp	w1, w14
	b.eq	LBB0_20
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	ldr	w1, [x0]
	cbz	w1, LBB0_20
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=2
	ldr	x2, [x0, #24]
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=3
	add	x2, x2, #8
	subs	x1, x1, #1
	b.eq	LBB0_20
LBB0_17:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_13 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x3, [x2]
	ldrsw	x3, [x3]
	cmp	w3, w23
	b.eq	LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=3
	ldr	x4, [x10, x3, lsl #3]
	ldr	w3, [x0, #4]
	add	w3, w3, #1
	ldr	x4, [x4]
	ldr	w5, [x4, #4]
	cmp	w3, w5
	b.ge	LBB0_16
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=3
	str	w3, [x4, #4]
	add	w17, w17, #1
	b	LBB0_16
LBB0_20:                                ;   in Loop: Header=BB0_13 Depth=2
	add	x15, x15, #1
	cmp	x15, x13
	b.ne	LBB0_13
; %bb.21:                               ;   in Loop: Header=BB0_13 Depth=2
	mov	x15, #0
	cmp	w17, #0
	cset	w17, eq
	orr	w0, w17, w16
	mov	w17, #0
	cmp	w0, #1
	b.ne	LBB0_13
LBB0_22:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x13, [x20, x8, lsl #3]
	mov	x14, x21
	mov	x15, x9
LBB0_23:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x16, [x15], #8
	ldrsw	x16, [x16]
	ldr	x16, [x10, x16, lsl #3]
	ldr	x16, [x16]
	ldr	w16, [x16, #4]
	str	w16, [x13], #4
	subs	x14, x14, #1
	b.ne	LBB0_23
; %bb.24:                               ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x8, #1
	cmp	x8, x21
	b.ne	LBB0_3
LBB0_25:
	add	x3, x24, #16
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_char_poly
	cbz	x0, LBB0_28
; %bb.26:
	mov	x0, x20
	mov	x1, x21
	bl	_m_free
	mov	x20, #0
LBB0_27:
	mov	w21, #-1
	b	LBB0_29
LBB0_28:
	mov	w21, #0
LBB0_29:
	str	x20, [x24, #8]
	mov	x0, x19
	bl	_OSM_LOG_EXIT
	mov	x0, x21
	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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_LARGE,4,2                      ; @LARGE
	.no_dead_strip	_get_switch_metric
.subsections_via_symbols
