	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_ssl_cookie_write       ## -- Begin function mbedtls_ssl_cookie_write
	.p2align	4, 0x90
_mbedtls_ssl_cookie_write:              ## @mbedtls_ssl_cookie_write
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%r8, %r9
	movq	%rcx, %r8
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.3:
	movq	%rdx, %r10
	movq	%rsi, %rdx
	movq	(%rsi), %rsi
	movq	%r10, %rax
	subq	%rsi, %rax
	movq	_COOKIE_LEN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jae	LBB0_6
## %bb.4:
	movq	_MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_2:
	movq	_MBEDTLS_ERR_SSL_BAD_INPUT_DATA@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	popq	%rbp
	retq
LBB0_6:
	movl	8(%rdi), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 8(%rdi)
	movl	%eax, %ecx
	shrl	$24, %ecx
	movb	%cl, (%rsi)
	movl	%eax, %ecx
	shrl	$16, %ecx
	movq	(%rdx), %rsi
	movb	%cl, 1(%rsi)
	movq	(%rdx), %rcx
	movb	%ah, 2(%rcx)
	movq	(%rdx), %rcx
	movb	%al, 3(%rcx)
	movq	(%rdx), %rsi
	leaq	4(%rsi), %rax
	movq	%rax, (%rdx)
	addq	$4, %rdi
	movq	%r10, %rcx
	popq	%rbp
	jmp	_ssl_cookie_hmac                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_SSL_BAD_INPUT_DATA,4,2 ## @MBEDTLS_ERR_SSL_BAD_INPUT_DATA
	.comm	_COOKIE_LEN,8,3                 ## @COOKIE_LEN
	.comm	_MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL,4,2 ## @MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL
	.comm	_MBEDTLS_ERR_SSL_INTERNAL_ERROR,4,2 ## @MBEDTLS_ERR_SSL_INTERNAL_ERROR
	.comm	_MBEDTLS_ERR_THREADING_MUTEX_ERROR,4,2 ## @MBEDTLS_ERR_THREADING_MUTEX_ERROR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_ssl_cookie_write       ; -- Begin function mbedtls_ssl_cookie_write
	.p2align	2
_mbedtls_ssl_cookie_write:              ; @mbedtls_ssl_cookie_write
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_4
; %bb.1:
	mov	x5, x4
	mov	x4, x3
	cbz	x3, LBB0_4
; %bb.2:
	mov	x3, x2
	mov	x2, x1
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _COOKIE_LEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _COOKIE_LEN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	sub	x10, x3, x8
	cmp	x10, x9
	b.hs	LBB0_5
; %bb.3:
Lloh3:
	adrp	x8, _MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ret
LBB0_4:
Lloh6:
	adrp	x8, _MBEDTLS_ERR_SSL_BAD_INPUT_DATA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_BAD_INPUT_DATA@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ret
LBB0_5:
	ldr	w9, [x0, #8]
	add	w10, w9, #1
	str	w10, [x0, #8]
	lsr	w10, w9, #24
	strb	w10, [x8]
	lsr	w8, w9, #16
	ldr	x10, [x2]
	strb	w8, [x10, #1]
	lsr	w8, w9, #8
	ldr	x10, [x2]
	strb	w8, [x10, #2]
	ldr	x8, [x2]
	strb	w9, [x8, #3]
	ldr	x1, [x2]
	add	x8, x1, #4
	str	x8, [x2]
	add	x0, x0, #4
	b	_ssl_cookie_hmac
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_ERR_SSL_BAD_INPUT_DATA,4,2 ; @MBEDTLS_ERR_SSL_BAD_INPUT_DATA
	.comm	_COOKIE_LEN,8,3                 ; @COOKIE_LEN
	.comm	_MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL,4,2 ; @MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL
	.comm	_MBEDTLS_ERR_SSL_INTERNAL_ERROR,4,2 ; @MBEDTLS_ERR_SSL_INTERNAL_ERROR
	.comm	_MBEDTLS_ERR_THREADING_MUTEX_ERROR,4,2 ; @MBEDTLS_ERR_THREADING_MUTEX_ERROR
.subsections_via_symbols
