	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vxlan_socket_mc_add_group
_vxlan_socket_mc_add_group:             ## @vxlan_socket_mc_add_group
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%ecx, -44(%rbp)
	callq	_VXLAN_SO_WLOCK
	movq	_VXLAN_SO_MC_MAX_GROUPS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	_AF_UNSPEC@GOTPCREL(%rip), %rdx
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%r13d
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r15
	movslq	%eax, %rcx
	addq	$24, %r12
	cmpq	%rcx, %r15
	jge	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %r14
	movq	16(%r14,%r12), %rcx
	cmpq	(%rdx), %rcx
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	addq	%r12, %r14
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_vxlan_sockaddr_mc_info_match
	testq	%rax, %rax
	jne	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_VXLAN_SO_MC_MAX_GROUPS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_AF_UNSPEC@GOTPCREL(%rip), %rdx
	jmp	LBB0_7
LBB0_8:
	movq	%rbx, %rdi
	callq	_VXLAN_SO_WUNLOCK
	testl	%r13d, %r13d
	je	LBB0_9
## %bb.10:
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movq	%rbx, %rdi
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_vxlan_socket_mc_join_group
	testl	%eax, %eax
	jne	LBB0_16
## %bb.11:
	movq	%rbx, %rdi
	callq	_VXLAN_SO_WLOCK
	movq	_VXLAN_SO_MC_MAX_GROUPS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_18
## %bb.12:
	movq	(%rbx), %r12
	movq	_AF_UNSPEC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	$16, %r12
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rcx, (%r12)
	je	LBB0_14
## %bb.17:                              ##   in Loop: Header=BB0_13 Depth=1
	incq	%r15
	addq	$24, %r12
	cmpq	%r15, %rax
	jne	LBB0_13
LBB0_18:
	movq	%rbx, %rdi
	callq	_VXLAN_SO_WUNLOCK
	movl	-44(%rbp), %ecx
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_vxlan_socket_mc_leave_group
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_MPASS
	jmp	LBB0_9
LBB0_1:
	movq	%rbx, %rdi
	callq	_VXLAN_SO_WUNLOCK
LBB0_9:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_16
LBB0_14:
	leaq	-16(%r12), %r14
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_vxlan_sockaddr_copy
	leaq	-8(%r12), %rdi
	leaq	-48(%rbp), %rsi
	callq	_vxlan_sockaddr_copy
	movl	-44(%rbp), %eax
	movl	%eax, -16(%r12)
LBB0_15:
	incl	4(%r14)
	movq	%rbx, %rdi
	callq	_VXLAN_SO_WUNLOCK
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	xorl	%eax, %eax
LBB0_16:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VXLAN_SO_MC_MAX_GROUPS,4,2     ## @VXLAN_SO_MC_MAX_GROUPS
	.comm	_AF_UNSPEC,8,3                  ## @AF_UNSPEC
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_vxlan_socket_mc_add_group
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vxlan_socket_mc_add_group
_vxlan_socket_mc_add_group:             ; @vxlan_socket_mc_add_group
	.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	x20, x4
	mov	x23, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	str	w3, [sp, #12]
	bl	_VXLAN_SO_WLOCK
Lloh0:
	adrp	x25, _VXLAN_SO_MC_MAX_GROUPS@GOTPAGE
Lloh1:
	ldr	x25, [x25, _VXLAN_SO_MC_MAX_GROUPS@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #0
	b.le	LBB0_14
; %bb.1:
	str	x20, [sp]                       ; 8-byte Folded Spill
	mov	x28, #0
	mov	x24, #0
	mov	w27, #0
Lloh2:
	adrp	x26, _AF_UNSPEC@GOTPAGE
Lloh3:
	ldr	x26, [x26, _AF_UNSPEC@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w27, w27, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	add	x28, x28, #24
	cmp	x24, w8, sxtw
	b.ge	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x20, [x19]
	add	x0, x20, x28
	ldr	x9, [x0, #16]
	ldr	x10, [x26]
	cmp	x9, x10
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x1, x21
	mov	x2, x22
	mov	x3, x23
	bl	_vxlan_sockaddr_mc_info_match
	cbnz	x0, LBB0_16
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x25]
	b	LBB0_3
LBB0_7:
	mov	x0, x19
	bl	_VXLAN_SO_WUNLOCK
	cbz	w27, LBB0_15
; %bb.8:
	add	x3, sp, #12
	add	x4, sp, #8
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_vxlan_socket_mc_join_group
	cbnz	w0, LBB0_18
; %bb.9:
	mov	x0, x19
	bl	_VXLAN_SO_WLOCK
	ldr	w11, [x25]
	cmp	w11, #1
	b.lt	LBB0_13
; %bb.10:
	mov	x8, #0
	mov	x24, #0
	ldr	x9, [x19]
	ldr	x10, [x26]
	add	x11, x11, x11, lsl #1
	lsl	x11, x11, #3
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	x22, x9, x8
	ldr	x12, [x22, #16]
	cmp	x12, x10
	b.eq	LBB0_19
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x24, x24, #1
	add	x8, x8, #24
	cmp	x11, x8
	b.ne	LBB0_11
LBB0_13:
	mov	x0, x19
	bl	_VXLAN_SO_WUNLOCK
	ldr	w3, [sp, #12]
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_vxlan_socket_mc_leave_group
	cmp	w0, #0
	cset	w0, eq
	bl	_MPASS
	b	LBB0_15
LBB0_14:
	mov	x0, x19
	bl	_VXLAN_SO_WUNLOCK
LBB0_15:
Lloh4:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	b	LBB0_18
LBB0_16:
	add	x22, x20, x28
LBB0_17:
	ldr	w8, [x22, #4]
	add	w8, w8, #1
	str	w8, [x22, #4]
	mov	x0, x19
	bl	_VXLAN_SO_WUNLOCK
	mov	w0, #0
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	str	w24, [x8]
LBB0_18:
	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
LBB0_19:
	add	x0, x22, #16
	mov	x1, x21
	bl	_vxlan_sockaddr_copy
	add	x0, x22, #8
	add	x1, sp, #8
	bl	_vxlan_sockaddr_copy
	ldr	w8, [sp, #12]
	str	w8, [x22]
	b	LBB0_17
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_VXLAN_SO_MC_MAX_GROUPS,4,2     ; @VXLAN_SO_MC_MAX_GROUPS
	.comm	_AF_UNSPEC,8,3                  ; @AF_UNSPEC
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_vxlan_socket_mc_add_group
.subsections_via_symbols
