	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_ssl_ticket_write       ## -- Begin function mbedtls_ssl_ticket_write
	.p2align	4, 0x90
_mbedtls_ssl_ticket_write:              ## @mbedtls_ssl_ticket_write
	.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	$0, (%r8)
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movq	%rdi, %r12
	cmpq	$0, (%rdi)
	je	LBB0_4
## %bb.2:
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rcx, %rax
	subq	%rdx, %rax
	cmpq	$33, %rax
	jg	LBB0_7
## %bb.3:
	movq	_MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_4:
	movq	_MBEDTLS_ERR_SSL_BAD_INPUT_DATA@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
LBB0_6:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r9, %r13
	movq	%r8, %r15
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_ssl_ticket_update_keys
	testl	%eax, %eax
	jne	LBB0_6
## %bb.8:
	leaq	4(%r14), %rcx
	movq	32(%r12), %rdx
	movq	8(%r12), %rsi
	movl	24(%r12), %eax
	movl	%eax, (%r13)
	movq	%rcx, %r13
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	4(%rdx,%rsi,8), %esi
	movq	%r14, %rdi
	movl	$4, %edx
	callq	_memcpy
	movl	20(%r12), %edi
	movq	%r13, %rsi
	movl	$12, %edx
	callq	*(%r12)
	testl	%eax, %eax
	jne	LBB0_6
## %bb.9:
	leaq	18(%r14), %r12
	subl	%r12d, %ebx
	leaq	-48(%rbp), %rcx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_ssl_save_session
	testl	%eax, %eax
	jne	LBB0_6
## %bb.10:
	movq	-48(%rbp), %rbx
	cmpq	$65535, %rbx                    ## imm = 0xFFFF
	ja	LBB0_6
## %bb.11:
	movl	%ebx, %eax
	rolw	$8, %ax
	movw	%ax, 16(%r14)
	leaq	(%r12,%rbx), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rcx,%rdx,8), %rdi
	subq	$8, %rsp
	leaq	-80(%rbp), %r10
	movq	%r13, %rsi
	movl	$12, %edx
	movq	%r14, %rcx
	movl	$18, %r8d
	movq	%r12, %r9
	pushq	$16
	pushq	%rax
	pushq	%r10
	pushq	%r12
	pushq	%rbx
	callq	_mbedtls_cipher_auth_encrypt
	addq	$48, %rsp
	testl	%eax, %eax
	jne	LBB0_6
## %bb.12:
	movq	-80(%rbp), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	addq	$34, %rax
	movq	%rax, (%r15)
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_14:
	movq	_MBEDTLS_ERR_SSL_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_SSL_BAD_INPUT_DATA,4,2 ## @MBEDTLS_ERR_SSL_BAD_INPUT_DATA
	.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_ticket_write       ; -- Begin function mbedtls_ssl_ticket_write
	.p2align	2
_mbedtls_ssl_ticket_write:              ; @mbedtls_ssl_ticket_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	str	xzr, [x4]
	cbz	x0, LBB0_4
; %bb.1:
	mov	x24, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_4
; %bb.2:
	mov	x23, x3
	mov	x20, x2
	sub	x8, x3, x2
	cmp	x8, #33
	b.gt	LBB0_7
; %bb.3:
Lloh0:
	adrp	x8, _MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x8, _MBEDTLS_ERR_SSL_BAD_INPUT_DATA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_BAD_INPUT_DATA@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_7:
	mov	x25, x5
	mov	x19, x4
	mov	x22, x1
	mov	x0, x24
	bl	_ssl_ticket_update_keys
	cbnz	w0, LBB0_6
; %bb.8:
	add	x21, x20, #4
	ldr	x26, [x24, #32]
	ldr	x27, [x24, #8]
	ldr	w8, [x24, #24]
	str	w8, [x25]
	add	x8, x26, x27, lsl #3
	ldr	w1, [x8, #4]
	mov	x0, x20
	mov	w2, #4
	bl	_memcpy
	ldr	x8, [x24]
	ldr	w0, [x24, #20]
	mov	x1, x21
	mov	w2, #12
	blr	x8
	cbnz	w0, LBB0_6
; %bb.9:
	add	x24, x20, #18
	sub	w2, w23, w24
	add	x3, sp, #40
	mov	x0, x22
	mov	x1, x24
	bl	_ssl_save_session
	cbnz	w0, LBB0_6
; %bb.10:
	ldr	x6, [sp, #40]
	lsr	x8, x6, #16
	cbnz	x8, LBB0_6
; %bb.11:
	rev	w8, w6
	lsr	w8, w8, #16
	strh	w8, [x20, #16]
	add	x8, x24, x6
	add	x0, x26, x27, lsl #3
	mov	w9, #16
	str	w9, [sp, #16]
	add	x9, sp, #32
	stp	x9, x8, [sp]
	mov	x1, x21
	mov	w2, #12
	mov	x3, x20
	mov	w4, #18
	mov	x5, x24
	mov	x7, x24
	bl	_mbedtls_cipher_auth_encrypt
	cbnz	w0, LBB0_6
; %bb.12:
	ldp	x8, x9, [sp, #32]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.13:
	mov	w0, #0
	add	x8, x8, #34
	str	x8, [x19]
	b	LBB0_6
LBB0_14:
Lloh4:
	adrp	x8, _MBEDTLS_ERR_SSL_INTERNAL_ERROR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_INTERNAL_ERROR@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_ERR_SSL_BAD_INPUT_DATA,4,2 ; @MBEDTLS_ERR_SSL_BAD_INPUT_DATA
	.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
