	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_str_16
_add_str_16:                            ## @add_str_16
	.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	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	8(%rdx), %r13
	movq	%r13, %rbx
	testq	%r13, %r13
	je	LBB0_2
## %bb.1:
	movq	(%r12), %rbx
LBB0_2:
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.3:
	cmpq	$65536, %rbx                    ## imm = 0x10000
	jb	LBB0_6
## %bb.4:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_5
LBB0_6:
	movl	(%r15), %edi
	callq	_ntohl
	movslq	%eax, %rdi
	leaq	(%rbx,%rdi), %rcx
	movq	_BODYSIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rcx
	jbe	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	movq	%r15, %rdi
	callq	_generr
	movl	$-1, %eax
	jmp	LBB0_10
LBB0_8:
	addq	8(%r15), %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movq	%rcx, %r13
	callq	_memcpy
	movl	%r13d, %edi
	callq	_htonl
	movl	%eax, (%r15)
LBB0_9:
	movq	%rbx, %rdi
	callq	_htons
	movl	%eax, (%r14)
	movq	%r12, %rdi
	callq	_free_str
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Field too long"

	.comm	_BODYSIZE,4,2                   ## @BODYSIZE
L_.str.1:                               ## @.str.1
	.asciz	"Message too long"

	.no_dead_strip	_add_str_16
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_str_16
_add_str_16:                            ; @add_str_16
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x1
	ldp	x8, x23, [x2]
	cmp	x23, #0
	csel	x22, xzr, x8, eq
	cbz	x22, LBB0_7
; %bb.1:
	mov	x21, x0
	cmp	x22, #16, lsl #12               ; =65536
	b.lo	LBB0_3
; %bb.2:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_5
LBB0_3:
	ldr	w0, [x21]
	bl	_ntohl
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
Lloh2:
	adrp	x9, _BODYSIZE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _BODYSIZE@GOTPAGEOFF]
Lloh4:
	ldrsw	x9, [x9]
	add	x24, x22, x8
	cmp	x24, x9
	b.ls	LBB0_6
; %bb.4:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_5:
	mov	x0, x21
	bl	_generr
	mov	w0, #-1
	b	LBB0_8
LBB0_6:
	ldr	x9, [x21, #8]
	add	x0, x9, x8
	mov	x1, x23
	mov	x2, x22
	bl	_memcpy
	mov	x0, x24
	bl	_htonl
	str	w0, [x21]
LBB0_7:
	mov	x0, x22
	bl	_htons
	str	w0, [x20]
	mov	x0, x19
	bl	_free_str
	mov	w0, #0
LBB0_8:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Field too long"

	.comm	_BODYSIZE,4,2                   ; @BODYSIZE
l_.str.1:                               ; @.str.1
	.asciz	"Message too long"

	.no_dead_strip	_add_str_16
.subsections_via_symbols
