	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sctp_set_primary_addr          ## -- Begin function sctp_set_primary_addr
	.p2align	4, 0x90
_sctp_set_primary_addr:                 ## @sctp_set_primary_addr
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.1:
	testq	%rdx, %rdx
	jne	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_sctp_findnet
	movq	%rax, %rdx
LBB0_3:
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.5:
	movl	(%rdx), %eax
	movq	_SCTP_ADDR_UNCONFIRMED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	_SCTP_ADDR_REQ_PRIMARY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rdx)
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_4:
	movl	$-1, %ebx
	jmp	LBB0_12
LBB0_7:
	movq	%rdx, (%r14)
	movq	_SCTP_ADDR_PF@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_10
## %bb.8:
	movq	16(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_sctp_free_remote_addr
	movq	$0, 16(%r14)
LBB0_10:
	leaq	8(%r14), %r15
	movq	%r15, %rdi
	callq	_TAILQ_FIRST
	movq	(%r14), %rsi
	xorl	%ebx, %ebx
	cmpq	%rsi, %rax
	je	LBB0_12
## %bb.11:
	movq	_sctp_next@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%r15, %rdi
	callq	_TAILQ_REMOVE
	movq	(%r14), %rsi
	movl	(%r12), %edx
	movq	%r15, %rdi
	callq	_TAILQ_INSERT_HEAD
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SCTP_ADDR_UNCONFIRMED,4,2      ## @SCTP_ADDR_UNCONFIRMED
	.comm	_SCTP_ADDR_REQ_PRIMARY,4,2      ## @SCTP_ADDR_REQ_PRIMARY
	.comm	_SCTP_ADDR_PF,4,2               ## @SCTP_ADDR_PF
	.comm	_sctp_next,4,2                  ## @sctp_next
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sctp_set_primary_addr          ; -- Begin function sctp_set_primary_addr
	.p2align	2
_sctp_set_primary_addr:                 ; @sctp_set_primary_addr
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	cbz	x1, LBB0_3
; %bb.1:
	cbnz	x2, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_sctp_findnet
	mov	x2, x0
LBB0_3:
	cbz	x2, LBB0_6
; %bb.4:
	ldr	w8, [x2]
Lloh0:
	adrp	x9, _SCTP_ADDR_UNCONFIRMED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SCTP_ADDR_UNCONFIRMED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
	mov	w0, #0
Lloh3:
	adrp	x9, _SCTP_ADDR_REQ_PRIMARY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SCTP_ADDR_REQ_PRIMARY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x2]
	b	LBB0_13
LBB0_6:
	mov	w0, #-1
	b	LBB0_13
LBB0_7:
	str	x2, [x19]
Lloh6:
	adrp	x9, _SCTP_ADDR_PF@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SCTP_ADDR_PF@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_10
; %bb.8:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_sctp_free_remote_addr
	str	xzr, [x19, #16]
LBB0_10:
	add	x20, x19, #8
	mov	x0, x20
	bl	_TAILQ_FIRST
	ldr	x1, [x19]
	cmp	x0, x1
	b.eq	LBB0_12
; %bb.11:
Lloh9:
	adrp	x21, _sctp_next@GOTPAGE
Lloh10:
	ldr	x21, [x21, _sctp_next@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x20
	bl	_TAILQ_REMOVE
	ldr	x1, [x19]
	ldr	w2, [x21]
	mov	x0, x20
	bl	_TAILQ_INSERT_HEAD
LBB0_12:
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SCTP_ADDR_UNCONFIRMED,4,2      ; @SCTP_ADDR_UNCONFIRMED
	.comm	_SCTP_ADDR_REQ_PRIMARY,4,2      ; @SCTP_ADDR_REQ_PRIMARY
	.comm	_SCTP_ADDR_PF,4,2               ; @SCTP_ADDR_PF
	.comm	_sctp_next,4,2                  ; @sctp_next
.subsections_via_symbols
