	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pn_sock_get_port               ## -- Begin function pn_sock_get_port
	.p2align	4, 0x90
_pn_sock_get_port:                      ## @pn_sock_get_port
	.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
	movl	%esi, %r12d
	movq	%rdi, %rbx
	callq	_sock_net
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_pn_sk
	movq	%rax, %r14
	leaq	-40(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	_AF_PHONET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	_port_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_is_locked
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	testl	%r12d, %r12d
	je	LBB0_1
## %bb.8:
	movzwl	%r12w, %esi
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_pn_sockaddr_set_port
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_pn_find_sock_by_sa
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	movq	%rax, %rdi
	callq	_sock_put
	jmp	LBB0_10
LBB0_1:
	leaq	-48(%rbp), %rdi
	leaq	-44(%rbp), %rsi
	callq	_phonet_get_local_port_range
	movl	-48(%rbp), %ebx
	movl	-44(%rbp), %eax
	cmpl	%eax, %ebx
	jle	LBB0_2
LBB0_10:
	movq	_EADDRINUSE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_2:
	movl	_pn_sock_get_port.port_cur(%rip), %ecx
	leal	1(%rcx), %edx
	cmpl	%eax, %ecx
	movl	%ebx, %eax
	cmovll	%edx, %eax
	cmpl	%ebx, %edx
	cmovll	%ebx, %eax
	movl	%eax, _pn_sock_get_port.port_cur(%rip)
	movzwl	%ax, %esi
	leaq	-40(%rbp), %r12
	movq	%r12, %rdi
	callq	_pn_sockaddr_set_port
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_pn_find_sock_by_sa
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	decl	%ebx
	leaq	-40(%rbp), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rdi
	callq	_sock_put
	movl	-44(%rbp), %eax
	incl	%ebx
	cmpl	%eax, %ebx
	jge	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-48(%rbp), %ecx
	movl	_pn_sock_get_port.port_cur(%rip), %edx
	leal	1(%rdx), %esi
	cmpl	%eax, %edx
	movl	%ecx, %eax
	cmovll	%esi, %eax
	cmpl	%ecx, %esi
	cmovll	%ecx, %eax
	movl	%eax, _pn_sock_get_port.port_cur(%rip)
	movzwl	%ax, %esi
	movq	%r12, %rdi
	callq	_pn_sockaddr_set_port
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_pn_find_sock_by_sa
	testq	%rax, %rax
	jne	LBB0_4
LBB0_6:
	movzwl	_pn_sock_get_port.port_cur(%rip), %r12d
LBB0_7:
	movl	(%r14), %edi
	callq	_pn_addr
	movzwl	%r12w, %esi
	movl	%eax, %edi
	callq	_pn_object
	movl	%eax, (%r14)
	xorl	%eax, %eax
LBB0_11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_pn_sock_get_port.port_cur,4,2 ## @pn_sock_get_port.port_cur
	.comm	_AF_PHONET,4,2                  ## @AF_PHONET
	.comm	_port_mutex,4,2                 ## @port_mutex
	.comm	_EADDRINUSE,4,2                 ## @EADDRINUSE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pn_sock_get_port               ; -- Begin function pn_sock_get_port
	.p2align	2
_pn_sock_get_port:                      ; @pn_sock_get_port
	.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	x21, x1
	mov	x19, x0
	bl	_sock_net
	mov	x20, x0
	mov	x0, x19
	bl	_pn_sk
	mov	x19, x0
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #4
	bl	_memset
Lloh0:
	adrp	x8, _AF_PHONET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AF_PHONET@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #8]
Lloh3:
	adrp	x0, _port_mutex@GOTPAGE
Lloh4:
	ldr	x0, [x0, _port_mutex@GOTPAGEOFF]
	bl	_mutex_is_locked
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	cbz	w21, LBB0_3
; %bb.1:
	add	x0, sp, #8
	mov	x1, x21
	bl	_pn_sockaddr_set_port
	add	x1, sp, #8
	mov	x0, x20
	bl	_pn_find_sock_by_sa
	cbz	x0, LBB0_10
; %bb.2:
	bl	_sock_put
	b	LBB0_4
LBB0_3:
	add	x0, sp, #4
	mov	x1, sp
	bl	_phonet_get_local_port_range
	ldp	w8, w22, [sp]
	cmp	w22, w8
	b.le	LBB0_5
LBB0_4:
Lloh5:
	adrp	x8, _EADDRINUSE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EADDRINUSE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_5:
	adrp	x21, _pn_sock_get_port.port_cur@PAGE
	ldr	w9, [x21, _pn_sock_get_port.port_cur@PAGEOFF]
	add	w10, w9, #1
	cmp	w9, w8
	ccmp	w10, w22, #8, lt
	csinc	w8, w22, w9, lt
	str	w8, [x21, _pn_sock_get_port.port_cur@PAGEOFF]
	and	w1, w8, #0xffff
	add	x0, sp, #8
	bl	_pn_sockaddr_set_port
	add	x1, sp, #8
	mov	x0, x20
	bl	_pn_find_sock_by_sa
	cbz	x0, LBB0_9
; %bb.6:
	sub	w22, w22, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	bl	_sock_put
	ldr	w8, [sp]
	add	w22, w22, #1
	cmp	w22, w8
	b.ge	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w9, [sp, #4]
	ldr	w10, [x21, _pn_sock_get_port.port_cur@PAGEOFF]
	add	w11, w10, #1
	cmp	w10, w8
	ccmp	w11, w9, #8, lt
	csinc	w8, w9, w10, lt
	str	w8, [x21, _pn_sock_get_port.port_cur@PAGEOFF]
	and	w1, w8, #0xffff
	add	x0, sp, #8
	bl	_pn_sockaddr_set_port
	add	x1, sp, #8
	mov	x0, x20
	bl	_pn_find_sock_by_sa
	cbnz	x0, LBB0_7
LBB0_9:
	ldr	w21, [x21, _pn_sock_get_port.port_cur@PAGEOFF]
LBB0_10:
	ldr	w0, [x19]
	bl	_pn_addr
	and	w1, w21, #0xffff
	bl	_pn_object
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19]
LBB0_11:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_pn_sock_get_port.port_cur,4,2 ; @pn_sock_get_port.port_cur
	.comm	_AF_PHONET,4,2                  ; @AF_PHONET
	.comm	_port_mutex,4,2                 ; @port_mutex
	.comm	_EADDRINUSE,4,2                 ; @EADDRINUSE
.subsections_via_symbols
