	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tipc_reg_add_port              ## -- Begin function tipc_reg_add_port
	.p2align	4, 0x90
_tipc_reg_add_port:                     ## @tipc_reg_add_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	_MAX_USERID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jbe	LBB0_4
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_4:
	movq	_tipc_mode@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_TIPC_NOT_RUNNING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.5:
	movq	_users@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	je	LBB0_6
## %bb.7:
	movq	%rdi, %rbx
	movq	_reg_lock@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_spin_lock_bh
	movq	(%rbx), %rsi
	addq	$8, %rbx
	shlq	$2, %rsi
	addq	(%r12), %rsi
	movq	%rbx, %rdi
	callq	_list_add
	movq	%r15, %rdi
	callq	_spin_unlock_bh
	jmp	LBB0_8
LBB0_6:
	movq	_ENOPROTOOPT@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_USERID,8,3                 ## @MAX_USERID
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_tipc_mode,8,3                  ## @tipc_mode
	.comm	_TIPC_NOT_RUNNING,8,3           ## @TIPC_NOT_RUNNING
	.comm	_users,8,3                      ## @users
	.comm	_ENOPROTOOPT,4,2                ## @ENOPROTOOPT
	.comm	_reg_lock,4,2                   ## @reg_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tipc_reg_add_port              ; -- Begin function tipc_reg_add_port
	.p2align	2
_tipc_reg_add_port:                     ; @tipc_reg_add_port
	.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]
	cbz	x8, LBB0_7
; %bb.1:
Lloh0:
	adrp	x9, _MAX_USERID@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MAX_USERID@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ls	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh5:
	adrp	x8, _tipc_mode@GOTPAGE
Lloh6:
	ldr	x8, [x8, _tipc_mode@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
Lloh8:
	adrp	x9, _TIPC_NOT_RUNNING@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TIPC_NOT_RUNNING@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
Lloh11:
	adrp	x21, _users@GOTPAGE
Lloh12:
	ldr	x21, [x21, _users@GOTPAGEOFF]
	ldr	x10, [x21]
	cmp	x8, x9
	ccmp	x10, #0, #4, ne
	b.ne	LBB0_6
; %bb.4:
Lloh13:
	adrp	x8, _ENOPROTOOPT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOPROTOOPT@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_6:
	mov	x19, x0
Lloh15:
	adrp	x20, _reg_lock@GOTPAGE
Lloh16:
	ldr	x20, [x20, _reg_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_spin_lock_bh
	ldr	x8, [x21]
	ldr	x9, [x19], #8
	add	x1, x8, x9, lsl #2
	mov	x0, x19
	bl	_list_add
	mov	x0, x20
	bl	_spin_unlock_bh
LBB0_7:
	mov	w0, #0
LBB0_8:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_USERID,8,3                 ; @MAX_USERID
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_tipc_mode,8,3                  ; @tipc_mode
	.comm	_TIPC_NOT_RUNNING,8,3           ; @TIPC_NOT_RUNNING
	.comm	_users,8,3                      ; @users
	.comm	_ENOPROTOOPT,4,2                ; @ENOPROTOOPT
	.comm	_reg_lock,4,2                   ; @reg_lock
.subsections_via_symbols
