	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ip17xx_get_ports
_ip17xx_get_ports:                      ## @ip17xx_get_ports
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_get_state
	movq	(%r14), %rsi
	cmpq	(%rbx), %rsi
	jae	LBB0_1
## %bb.2:
	movq	%rax, %r10
	movq	_MAX_PORTS@GOTPCREL(%rip), %r8
	movl	(%r8), %ecx
	xorl	%eax, %eax
	movl	$0, %r11d
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.3:
	movq	8(%r10), %rdi
	movl	(%rdi,%rsi,4), %ebx
	xorl	%r11d, %r11d
	movq	_SWITCH_PORT_FLAG_TAGGED@GOTPCREL(%rip), %r9
	xorl	%esi, %esi
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%esi
	shrl	%ebx
	cmpl	%ecx, %esi
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	testb	$1, %bl
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r10), %ecx
	xorl	%edx, %edx
	btl	%esi, %ecx
	setb	%dl
	movq	16(%r14), %rdi
	movslq	%r11d, %r11
	movl	%esi, (%rdi,%r11,8)
	movzbl	(%r9), %ecx
	shll	%cl, %edx
	movl	%edx, 4(%rdi,%r11,8)
	incl	%r11d
	movl	(%r8), %ecx
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_7:
	movl	%r11d, 8(%r14)
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX_PORTS,4,2                  ## @MAX_PORTS
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ## @SWITCH_PORT_FLAG_TAGGED
	.no_dead_strip	_ip17xx_get_ports
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ip17xx_get_ports
_ip17xx_get_ports:                      ; @ip17xx_get_ports
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	bl	_get_state
	ldr	x11, [x19]
	ldr	x8, [x20]
	cmp	x11, x8
	b.hs	LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _MAX_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_PORTS@GOTPAGEOFF]
	ldr	w13, [x8]
	cmp	w13, #1
	b.lt	LBB0_7
; %bb.2:
	mov	w9, #0
	mov	w10, #0
	ldr	x12, [x0, #8]
	ldr	w11, [x12, x11, lsl #2]
Lloh2:
	adrp	x12, _SWITCH_PORT_FLAG_TAGGED@GOTPAGE
Lloh3:
	ldr	x12, [x12, _SWITCH_PORT_FLAG_TAGGED@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w10, w10, #1
	lsr	w11, w11, #1
	cmp	w10, w13
	b.ge	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	tbz	w11, #0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w13, [x0]
	lsr	w13, w13, w10
	and	w13, w13, #0x1
	ldr	x14, [x19, #16]
	add	x14, x14, w9, sxtw #3
	str	w10, [x14]
	ldr	w15, [x12]
	lsl	w13, w13, w15
	str	w13, [x14, #4]
	add	w9, w9, #1
	ldr	w13, [x8]
	b	LBB0_3
LBB0_6:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_7:
	mov	w9, #0
LBB0_8:
	mov	w0, #0
	str	w9, [x19, #8]
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX_PORTS,4,2                  ; @MAX_PORTS
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ; @SWITCH_PORT_FLAG_TAGGED
	.no_dead_strip	_ip17xx_get_ports
.subsections_via_symbols
