	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sw_cfg_port_based
_sw_cfg_port_based:                     ## @sw_cfg_port_based
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_PORT_BASED_PRIORITY_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	cmpl	%edx, %ebx
	cmovgel	%edx, %ebx
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movslq	%esi, %r15
	movl	%ebx, (%rax,%r15,4)
	movq	_KS8842_PORT_CTRL_1_OFFSET@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	leaq	-36(%rbp), %rcx
	movl	%r15d, %esi
	callq	_port_r16
	movq	_PORT_BASED_PRIORITY_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	-36(%rbp), %eax
	movq	_PORT_BASED_PRIORITY_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	orl	%eax, %ebx
	movl	%ebx, -36(%rbp)
	movl	(%r12), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %ecx
	callq	_port_w16
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PORT_BASED_PRIORITY_BASE,4,2   ## @PORT_BASED_PRIORITY_BASE
	.comm	_KS8842_PORT_CTRL_1_OFFSET,4,2  ## @KS8842_PORT_CTRL_1_OFFSET
	.comm	_PORT_BASED_PRIORITY_MASK,4,2   ## @PORT_BASED_PRIORITY_MASK
	.comm	_PORT_BASED_PRIORITY_SHIFT,4,2  ## @PORT_BASED_PRIORITY_SHIFT
	.no_dead_strip	_sw_cfg_port_based
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sw_cfg_port_based
_sw_cfg_port_based:                     ; @sw_cfg_port_based
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _PORT_BASED_PRIORITY_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PORT_BASED_PRIORITY_BASE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w2
	csel	w21, w8, w2, lt
	ldr	x8, [x0]
	ldr	x8, [x8]
	str	w21, [x8, w1, sxtw #2]
Lloh3:
	adrp	x22, _KS8842_PORT_CTRL_1_OFFSET@GOTPAGE
Lloh4:
	ldr	x22, [x22, _KS8842_PORT_CTRL_1_OFFSET@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x3, sp, #12
	bl	_port_r16
Lloh5:
	adrp	x8, _PORT_BASED_PRIORITY_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PORT_BASED_PRIORITY_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
Lloh8:
	adrp	x10, _PORT_BASED_PRIORITY_SHIFT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PORT_BASED_PRIORITY_SHIFT@GOTPAGEOFF]
	bic	w8, w9, w8
Lloh10:
	ldr	w9, [x10]
	lsl	w9, w21, w9
	orr	w3, w9, w8
	str	w3, [sp, #12]
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_port_w16
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PORT_BASED_PRIORITY_BASE,4,2   ; @PORT_BASED_PRIORITY_BASE
	.comm	_KS8842_PORT_CTRL_1_OFFSET,4,2  ; @KS8842_PORT_CTRL_1_OFFSET
	.comm	_PORT_BASED_PRIORITY_MASK,4,2   ; @PORT_BASED_PRIORITY_MASK
	.comm	_PORT_BASED_PRIORITY_SHIFT,4,2  ; @PORT_BASED_PRIORITY_SHIFT
	.no_dead_strip	_sw_cfg_port_based
.subsections_via_symbols
