	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bindresvport_sa                ## -- Begin function bindresvport_sa
	.p2align	4, 0x90
_bindresvport_sa:                       ## @bindresvport_sa
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	%rsi, %r15
	movl	(%rsi), %ebx
	jmp	LBB0_4
LBB0_2:
	leaq	-48(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	$4, -44(%rbp)
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	_getsockname
	cmpl	$-1, %eax
	je	LBB0_20
## %bb.3:
	movl	-48(%rbp), %ebx
	movl	-44(%rbp), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_memset
LBB0_4:
	movq	_AF_INET@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_7
## %bb.5:
	movq	_AF_INET6@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_7
## %bb.6:
	movq	_EPFNOSUPPORT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movl	$-1, %eax
	jmp	LBB0_22
LBB0_7:
	movl	$8, -44(%rbp)
	movl	%ebx, (%r15)
	movq	(%r15), %rdi
	callq	_ntohs
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movq	_NPORTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_arc4random_uniform
	movq	%rax, %rbx
	movq	_STARTPORT@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
LBB0_9:
	movq	_NPORTS@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_20
## %bb.10:
	xorl	%r13d, %r13d
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	_STARTPORT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
LBB0_12:                                ##   in Loop: Header=BB0_13 Depth=1
	incl	%r13d
	cmpl	(%r12), %r13d
	jge	LBB0_22
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_htons
	movq	%rax, (%r15)
	movl	-44(%rbp), %edx
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	_bind
	testl	%eax, %eax
	je	LBB0_21
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	jns	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_EADDRINUSE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_22
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	_ENDPORT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rbx
	jge	LBB0_11
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=1
	incq	%rbx
	jmp	LBB0_12
LBB0_20:
	movl	$-1, %eax
	jmp	LBB0_22
LBB0_21:
	xorl	%eax, %eax
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_AF_INET6,4,2                   ## @AF_INET6
	.comm	_EPFNOSUPPORT,8,3               ## @EPFNOSUPPORT
	.comm	_errno,8,3                      ## @errno
	.comm	_NPORTS,4,2                     ## @NPORTS
	.comm	_STARTPORT,8,3                  ## @STARTPORT
	.comm	_EADDRINUSE,8,3                 ## @EADDRINUSE
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_ENDPORT,8,3                    ## @ENDPORT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bindresvport_sa                ; -- Begin function bindresvport_sa
	.p2align	2
_bindresvport_sa:                       ; @bindresvport_sa
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	cbz	x1, LBB0_2
; %bb.1:
	mov	x20, x1
	ldr	w21, [x1]
	b	LBB0_4
LBB0_2:
	mov	w20, #4
	add	x0, sp, #8
	mov	w2, #4
	bl	_memset
	str	w20, [sp, #4]
	add	x1, sp, #8
	add	x2, sp, #4
	mov	x0, x19
	bl	_getsockname
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.3:
	add	x20, sp, #8
	ldp	w2, w21, [sp, #4]
	add	x0, sp, #8
	mov	w1, #0
	bl	_memset
LBB0_4:
Lloh0:
	adrp	x8, _AF_INET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AF_INET@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _AF_INET6@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AF_INET6@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	b.ne	LBB0_13
; %bb.5:
	mov	w8, #8
	str	w8, [sp, #4]
	str	w21, [x20]
	ldr	x0, [x20]
	bl	_ntohs
	mov	x21, x0
Lloh6:
	adrp	x22, _NPORTS@GOTPAGE
Lloh7:
	ldr	x22, [x22, _NPORTS@GOTPAGEOFF]
Lloh8:
	adrp	x23, _STARTPORT@GOTPAGE
Lloh9:
	ldr	x23, [x23, _STARTPORT@GOTPAGEOFF]
	cbnz	x0, LBB0_7
; %bb.6:
	ldr	w0, [x22]
	bl	_arc4random_uniform
	ldr	x8, [x23]
	add	x21, x8, x0
LBB0_7:
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.8:
	mov	w24, #0
Lloh10:
	adrp	x25, _errno@GOTPAGE
Lloh11:
	ldr	x25, [x25, _errno@GOTPAGEOFF]
Lloh12:
	adrp	x26, _EADDRINUSE@GOTPAGE
Lloh13:
	ldr	x26, [x26, _EADDRINUSE@GOTPAGEOFF]
Lloh14:
	adrp	x27, _EINVAL@GOTPAGE
Lloh15:
	ldr	x27, [x27, _EINVAL@GOTPAGEOFF]
Lloh16:
	adrp	x28, _ENDPORT@GOTPAGE
Lloh17:
	ldr	x28, [x28, _ENDPORT@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x28]
	ldr	x9, [x23]
	cmp	x21, x8
	csinc	x21, x9, x21, ge
	add	w24, w24, #1
	ldr	w8, [x22]
	cmp	w24, w8
	b.ge	LBB0_15
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_htons
	str	x0, [x20]
	ldr	w2, [sp, #4]
	mov	x0, x19
	mov	x1, x20
	bl	_bind
	cbz	w0, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	tbz	w0, #31, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x25]
	ldr	x9, [x26]
	ldr	x10, [x27]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.eq	LBB0_9
	b	LBB0_15
LBB0_13:
Lloh18:
	adrp	x8, _EPFNOSUPPORT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EPFNOSUPPORT@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
Lloh21:
	adrp	x9, _errno@GOTPAGE
Lloh22:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh23:
	str	x8, [x9]
LBB0_14:
	mov	w0, #-1
LBB0_15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_AF_INET6,4,2                   ; @AF_INET6
	.comm	_EPFNOSUPPORT,8,3               ; @EPFNOSUPPORT
	.comm	_errno,8,3                      ; @errno
	.comm	_NPORTS,4,2                     ; @NPORTS
	.comm	_STARTPORT,8,3                  ; @STARTPORT
	.comm	_EADDRINUSE,8,3                 ; @EADDRINUSE
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_ENDPORT,8,3                    ; @ENDPORT
.subsections_via_symbols
