	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_inet6_option_next              ## -- Begin function inet6_option_next
	.p2align	4, 0x90
_inet6_option_next:                     ## @inet6_option_next
	.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
	movq	(%rdi), %rax
	movq	_IPPROTO_IPV6@GOTPCREL(%rip), %rcx
	movl	$-1, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	16(%rdi), %edi
	callq	_is_ipv6_hopopts
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movl	16(%rbx), %edi
	callq	_is_ipv6_dstopts
	testl	%eax, %eax
	je	LBB0_12
LBB0_3:
	movq	8(%rbx), %r12
	movl	$4, %edi
	callq	_CMSG_SPACE
	cmpq	%rax, %r12
	jl	LBB0_12
## %bb.4:
	movq	%rbx, %rdi
	callq	_CMSG_DATA
	movq	%rax, %r12
	movl	(%rax), %eax
	leal	8(,%rax,8), %r13d
	movq	8(%rbx), %rbx
	movl	%r13d, %edi
	callq	_CMSG_SPACE
	cmpq	%rax, %rbx
	jl	LBB0_12
## %bb.5:
	movslq	%r13d, %rax
	leaq	(%r12,%rax,4), %rbx
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.7:
	movq	%rbx, %rsi
	callq	_ip6optlen
	testl	%eax, %eax
	je	LBB0_12
## %bb.8:
	movslq	%eax, %r12
	shlq	$2, %r12
	addq	(%r14), %r12
	jmp	LBB0_9
LBB0_6:
	addq	$4, %r12
LBB0_9:
	movq	%r12, (%r14)
	cmpq	%rbx, %r12
	jae	LBB0_10
## %bb.11:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ip6optlen
	xorl	%r15d, %r15d
	cmpl	$1, %eax
	sbbl	%r15d, %r15d
	jmp	LBB0_12
LBB0_10:
	movq	$0, (%r14)
LBB0_12:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IPPROTO_IPV6,8,3               ## @IPPROTO_IPV6
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_inet6_option_next              ; -- Begin function inet6_option_next
	.p2align	2
_inet6_option_next:                     ; @inet6_option_next
	.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]
Lloh0:
	adrp	x9, _IPPROTO_IPV6@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IPPROTO_IPV6@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #16]
	bl	_is_ipv6_hopopts
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w0, [x20, #16]
	bl	_is_ipv6_dstopts
	cbz	w0, LBB0_12
LBB0_3:
	ldr	x21, [x20, #8]
	mov	w0, #4
	bl	_CMSG_SPACE
	cmp	x21, x0
	b.lt	LBB0_12
; %bb.4:
	mov	x0, x20
	bl	_CMSG_DATA
	mov	x21, x0
	ldr	w8, [x0]
	lsl	w8, w8, #3
	add	w22, w8, #8
	ldr	x20, [x20, #8]
	mov	x0, x22
	bl	_CMSG_SPACE
	cmp	x20, x0
	b.lt	LBB0_12
; %bb.5:
	add	x20, x21, w22, sxtw #2
	ldr	x0, [x19]
	cbz	x0, LBB0_8
; %bb.6:
	mov	x1, x20
	bl	_ip6optlen
	cbz	w0, LBB0_12
; %bb.7:
	ldr	x8, [x19]
	add	x0, x8, w0, sxtw #2
	b	LBB0_9
LBB0_8:
	add	x0, x21, #4
LBB0_9:
	str	x0, [x19]
	cmp	x0, x20
	b.hs	LBB0_11
; %bb.10:
	mov	x1, x20
	bl	_ip6optlen
	cmp	w0, #0
	csetm	w0, eq
	b	LBB0_13
LBB0_11:
	str	xzr, [x19]
LBB0_12:
	mov	w0, #-1
LBB0_13:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_IPPROTO_IPV6,8,3               ; @IPPROTO_IPV6
.subsections_via_symbols
