	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sctp_calc_rwnd                 ## -- Begin function sctp_calc_rwnd
	.p2align	4, 0x90
_sctp_calc_rwnd:                        ## @sctp_calc_rwnd
	.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
	xorl	%r14d, %r14d
	cmpq	$0, 16(%rdi)
	je	LBB0_6
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	8(%rsi), %rsi
	testq	%rsi, %rsi
	sete	%al
	cmpl	$0, (%rbx)
	setg	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_KASSERT
	movq	24(%rbx), %rsi
	testq	%rsi, %rsi
	sete	%al
	cmpl	$0, 16(%rbx)
	setg	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_KASSERT
	cmpq	$0, (%r15)
	jne	LBB0_4
## %bb.2:
	cmpl	$0, (%rbx)
	jne	LBB0_4
## %bb.3:
	cmpl	$0, 16(%rbx)
	je	LBB0_7
LBB0_4:
	movq	16(%r15), %rsi
	movq	%r15, %rdi
	callq	_sctp_sbspace
	movq	_MSIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	imull	(%rbx), %esi
	addl	8(%rbx), %esi
	movl	%eax, %edi
	callq	_sctp_sbspace_sub
	movl	(%r12), %esi
	imull	16(%rbx), %esi
	addl	24(%rbx), %esi
	movl	%eax, %edi
	callq	_sctp_sbspace_sub
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	8(%r15), %esi
	movl	%eax, %edi
	callq	_sctp_sbspace_sub
	cmpl	8(%r15), %eax
	movl	$1, %r14d
	cmovgel	%eax, %r14d
LBB0_6:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	16(%r15), %rdi
	callq	_SCTP_SB_LIMIT_RCV
	movq	_SCTP_MINIMAL_RWND@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_max                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SCTP_MINIMAL_RWND,4,2          ## @SCTP_MINIMAL_RWND
	.comm	_MSIZE,4,2                      ## @MSIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sctp_calc_rwnd                 ; -- Begin function sctp_calc_rwnd
	.p2align	2
_sctp_calc_rwnd:                        ; @sctp_calc_rwnd
	.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
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_6
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x1]
	ldr	x1, [x1, #8]
	cmp	w8, #0
	ccmp	x1, #0, #4, le
	cset	w0, eq
	bl	_KASSERT
	ldr	w8, [x20, #16]
	ldr	x1, [x20, #24]
	cmp	w8, #0
	ccmp	x1, #0, #4, le
	cset	w0, eq
	bl	_KASSERT
	ldr	x8, [x19]
	cbnz	x8, LBB0_4
; %bb.2:
	ldr	w8, [x20]
	cbnz	w8, LBB0_4
; %bb.3:
	ldr	w8, [x20, #16]
	cbz	w8, LBB0_8
LBB0_4:
	ldr	x1, [x19, #16]
	mov	x0, x19
	bl	_sctp_sbspace
	ldr	w8, [x20, #8]
	ldr	w9, [x20]
Lloh0:
	adrp	x21, _MSIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MSIZE@GOTPAGEOFF]
	ldr	w10, [x21]
	madd	w1, w10, w9, w8
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_sctp_sbspace_sub
	ldr	w8, [x20, #24]
	ldr	w9, [x20, #16]
	ldr	w10, [x21]
	madd	w1, w10, w9, w8
	bl	_sctp_sbspace_sub
	cbz	w0, LBB0_7
; %bb.5:
	ldr	w1, [x19, #8]
	bl	_sctp_sbspace_sub
	ldr	w8, [x19, #8]
	cmp	w0, w8
	csinc	w0, w0, wzr, ge
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	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
LBB0_8:
	ldr	x0, [x19, #16]
	bl	_SCTP_SB_LIMIT_RCV
Lloh2:
	adrp	x8, _SCTP_MINIMAL_RWND@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SCTP_MINIMAL_RWND@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	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
	b	_max
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_SCTP_MINIMAL_RWND,4,2          ; @SCTP_MINIMAL_RWND
	.comm	_MSIZE,4,2                      ; @MSIZE
.subsections_via_symbols
