	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ip17xx_set_ports
_ip17xx_set_ports:                      ## @ip17xx_set_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_get_state
	movq	(%r14), %r11
	cmpq	(%rbx), %r11
	jae	LBB0_9
## %bb.1:
	movq	16(%rax), %r8
	movl	$0, (%r8,%r11,4)
	movl	8(%r14), %r9d
	testl	%r9d, %r9d
	jle	LBB0_8
## %bb.2:
	movq	16(%r14), %r14
	movl	4(%rax), %r15d
	xorl	%edi, %edi
	movq	_SWITCH_PORT_FLAG_TAGGED@GOTPCREL(%rip), %r10
	xorl	%edx, %edx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	orl	%esi, %r15d
	notl	%esi
	andl	%esi, (%rax)
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rdx
	cmpq	%rdx, %r9
	je	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%r14,%rdx,8), %ecx
	movl	$1, %esi
	shll	%cl, %esi
	btsl	%ecx, %edi
	movl	%edi, (%r8,%r11,4)
	movl	4(%r14,%rdx,8), %ecx
	movl	(%r10), %ebx
	btl	%ebx, %ecx
	jae	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	orl	%esi, (%rax)
	notl	%esi
	andl	%esi, %r15d
	jmp	LBB0_6
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%r15d, 4(%rax)
LBB0_8:
	movq	8(%rax), %rcx
	movq	%rax, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*(%rcx)                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ## @SWITCH_PORT_FLAG_TAGGED
	.no_dead_strip	_ip17xx_set_ports
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ip17xx_set_ports
_ip17xx_set_ports:                      ; @ip17xx_set_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	x8, [x19]
	ldr	x9, [x20]
	cmp	x8, x9
	b.hs	LBB0_7
; %bb.1:
	ldr	x9, [x0, #16]
	str	wzr, [x9, x8, lsl #2]
	ldr	w10, [x19, #8]
	cmp	w10, #1
	b.lt	LBB0_9
; %bb.2:
	mov	w11, #0
	ldr	x13, [x19, #16]
	ldr	w12, [x0, #4]
	add	x13, x13, #4
	mov	w14, #1
Lloh0:
	adrp	x15, _SWITCH_PORT_FLAG_TAGGED@GOTPAGE
Lloh1:
	ldr	x15, [x15, _SWITCH_PORT_FLAG_TAGGED@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w17, [x0]
	bic	w17, w17, w16
	str	w17, [x0]
	orr	w12, w12, w16
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x13, x13, #8
	subs	x10, x10, #1
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w16, [x13, #-4]
	lsl	w16, w14, w16
	orr	w11, w11, w16
	str	w11, [x9, x8, lsl #2]
	ldr	w17, [x13]
	ldr	w1, [x15]
	lsr	w17, w17, w1
	tbz	w17, #0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w17, [x0]
	orr	w17, w17, w16
	str	w17, [x0]
	bic	w12, w12, w16
	b	LBB0_4
LBB0_7:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	str	w12, [x0, #4]
LBB0_9:
	ldr	x8, [x0, #8]
	ldr	x1, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	br	x1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ; @SWITCH_PORT_FLAG_TAGGED
	.no_dead_strip	_ip17xx_set_ports
.subsections_via_symbols
