	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gre_update_hdr                 ## -- Begin function gre_update_hdr
	.p2align	4, 0x90
_gre_update_hdr:                        ## @gre_update_hdr
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	_SA_XLOCKED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_gre_ioctl_sx@GOTPCREL(%rip), %rdi
	callq	_sx_assert
	movq	8(%r14), %r12
	movq	_GRE_ENABLE_CSUM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.2:
	movq	_GRE_FLAGS_CP@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	addl	$8, 4(%rbx)
	movl	$0, (%r12)
	addq	$4, %r12
	jmp	LBB0_3
LBB0_1:
	xorl	%r15d, %r15d
LBB0_3:
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	movq	_GRE_FLAGS_KP@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	addl	$4, 4(%rbx)
	callq	_htonl
	movl	%eax, (%r12)
	addq	$4, %r12
LBB0_5:
	movq	_GRE_ENABLE_SEQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_7
## %bb.6:
	movq	_GRE_FLAGS_SP@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	addl	$4, 4(%rbx)
	movl	$0, (%r12)
	jmp	LBB0_8
LBB0_7:
	movq	$0, 16(%rbx)
LBB0_8:
	movl	%r15d, %edi
	callq	_htons
	movl	%eax, (%r14)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gre_ioctl_sx,4,2               ## @gre_ioctl_sx
	.comm	_SA_XLOCKED,4,2                 ## @SA_XLOCKED
	.comm	_GRE_ENABLE_CSUM,4,2            ## @GRE_ENABLE_CSUM
	.comm	_GRE_FLAGS_CP,4,2               ## @GRE_FLAGS_CP
	.comm	_GRE_FLAGS_KP,4,2               ## @GRE_FLAGS_KP
	.comm	_GRE_ENABLE_SEQ,4,2             ## @GRE_ENABLE_SEQ
	.comm	_GRE_FLAGS_SP,4,2               ## @GRE_FLAGS_SP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gre_update_hdr                 ; -- Begin function gre_update_hdr
	.p2align	2
_gre_update_hdr:                        ; @gre_update_hdr
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _SA_XLOCKED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SA_XLOCKED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, _gre_ioctl_sx@GOTPAGE
Lloh4:
	ldr	x0, [x0, _gre_ioctl_sx@GOTPAGEOFF]
	bl	_sx_assert
	ldr	x22, [x19, #8]
	ldr	w8, [x20]
Lloh5:
	adrp	x9, _GRE_ENABLE_CSUM@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GRE_ENABLE_CSUM@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.1:
Lloh8:
	adrp	x8, _GRE_FLAGS_CP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GRE_FLAGS_CP@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
	ldr	w8, [x20, #4]
	add	w8, w8, #8
	str	w8, [x20, #4]
	str	wzr, [x22], #4
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_3
LBB0_2:
Lloh11:
	adrp	x8, _GRE_FLAGS_KP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GRE_FLAGS_KP@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	orr	w21, w8, w21
	ldr	w8, [x20, #4]
	add	w8, w8, #4
	str	w8, [x20, #4]
	bl	_htonl
	str	w0, [x22], #4
LBB0_3:
	ldr	w8, [x20]
Lloh14:
	adrp	x9, _GRE_ENABLE_SEQ@GOTPAGE
Lloh15:
	ldr	x9, [x9, _GRE_ENABLE_SEQ@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
Lloh17:
	adrp	x8, _GRE_FLAGS_SP@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GRE_FLAGS_SP@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	orr	w21, w8, w21
	ldr	w8, [x20, #4]
	add	w8, w8, #4
	str	w8, [x20, #4]
	str	wzr, [x22]
	b	LBB0_7
LBB0_5:
	mov	w21, #0
	ldr	x0, [x20, #8]
	cbnz	x0, LBB0_2
	b	LBB0_3
LBB0_6:
	str	xzr, [x20, #16]
LBB0_7:
	mov	x0, x21
	bl	_htons
	str	w0, [x19]
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_gre_ioctl_sx,4,2               ; @gre_ioctl_sx
	.comm	_SA_XLOCKED,4,2                 ; @SA_XLOCKED
	.comm	_GRE_ENABLE_CSUM,4,2            ; @GRE_ENABLE_CSUM
	.comm	_GRE_FLAGS_CP,4,2               ; @GRE_FLAGS_CP
	.comm	_GRE_FLAGS_KP,4,2               ; @GRE_FLAGS_KP
	.comm	_GRE_ENABLE_SEQ,4,2             ; @GRE_ENABLE_SEQ
	.comm	_GRE_FLAGS_SP,4,2               ; @GRE_FLAGS_SP
.subsections_via_symbols
