	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_ssl_write_certificate  ## -- Begin function mbedtls_ssl_write_certificate
	.p2align	4, 0x90
_mbedtls_ssl_write_certificate:         ## @mbedtls_ssl_write_certificate
	.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, %r14
	movq	48(%rdi), %rax
	movq	(%rax), %rbx
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movq	(%rbx), %rax
	movq	_MBEDTLS_KEY_EXCHANGE_PSK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.1:
	movq	_MBEDTLS_KEY_EXCHANGE_DHE_PSK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.2:
	movq	_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	movq	_MBEDTLS_KEY_EXCHANGE_ECJPAKE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_mbedtls_ssl_own_cert
	leaq	L_.str.2(%rip), %rsi
	movl	$3, %edi
	movq	%rax, %rdx
	callq	_MBEDTLS_SSL_DEBUG_CRT
	movq	%r14, %rdi
	callq	_mbedtls_ssl_own_cert
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r15
	movl	$7, %edi
	movq	_MBEDTLS_SSL_MAX_CONTENT_LEN@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rbx
	movslq	(%r12), %rsi
	movq	%rsi, %rax
	subq	%rdi, %rax
	addq	$-3, %rax
	cmpq	%rax, %rbx
	ja	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rbx, %rax
	shrq	$16, %rax
	movq	24(%r14), %rcx
	movb	%al, (%rcx,%rdi)
	movq	24(%r14), %rax
	movb	%bh, 1(%rdi,%rax)
	movq	24(%r14), %rax
	movb	%bl, 2(%rdi,%rax)
	movq	%rdi, %r13
	addq	$3, %rdi
	addq	24(%r14), %rdi
	movl	16(%r15), %esi
	movq	%rbx, %rdx
	callq	_memcpy
	movq	%r13, %rdi
	leaq	(%rbx,%r13), %rdi
	addq	$3, %rdi
	movq	(%r15), %r15
	testq	%r15, %r15
	jne	LBB0_8
	jmp	LBB0_11
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	incl	32(%r14)
	jmp	LBB0_14
LBB0_6:
	movl	$7, %edi
LBB0_11:
	leaq	-7(%rdi), %rax
	movq	%rax, %rcx
	shrq	$16, %rcx
	movq	24(%r14), %rdx
	movb	%cl, 4(%rdx)
	movq	24(%r14), %rcx
	movb	%ah, 5(%rcx)
	movq	24(%r14), %rcx
	movb	%al, 6(%rcx)
	movl	%edi, 16(%r14)
	movq	_MBEDTLS_SSL_MSG_HANDSHAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r14)
	movq	_MBEDTLS_SSL_HS_CERTIFICATE@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movq	24(%r14), %rcx
	movb	%al, (%rcx)
	incl	32(%r14)
	movq	%r14, %rdi
	callq	_mbedtls_ssl_write_record
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	callq	_MBEDTLS_SSL_DEBUG_RET
	jmp	LBB0_15
LBB0_9:
	movl	$1, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movq	_MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_15
LBB0_13:
	leaq	L_.str.5(%rip), %rsi
	movl	$2, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
LBB0_14:
	xorl	%ebx, %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE,4,2 ## @MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"=> write certificate"

	.comm	_MBEDTLS_KEY_EXCHANGE_PSK,8,3   ## @MBEDTLS_KEY_EXCHANGE_PSK
	.comm	_MBEDTLS_KEY_EXCHANGE_DHE_PSK,8,3 ## @MBEDTLS_KEY_EXCHANGE_DHE_PSK
	.comm	_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,8,3 ## @MBEDTLS_KEY_EXCHANGE_ECDHE_PSK
	.comm	_MBEDTLS_KEY_EXCHANGE_ECJPAKE,8,3 ## @MBEDTLS_KEY_EXCHANGE_ECJPAKE
L_.str.1:                               ## @.str.1
	.asciz	"<= skip write certificate"

L_.str.2:                               ## @.str.2
	.asciz	"own certificate"

	.comm	_MBEDTLS_SSL_MAX_CONTENT_LEN,4,2 ## @MBEDTLS_SSL_MAX_CONTENT_LEN
	.comm	_MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE,4,2 ## @MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE
	.comm	_MBEDTLS_SSL_MSG_HANDSHAKE,4,2  ## @MBEDTLS_SSL_MSG_HANDSHAKE
	.comm	_MBEDTLS_SSL_HS_CERTIFICATE,1,0 ## @MBEDTLS_SSL_HS_CERTIFICATE
L_.str.4:                               ## @.str.4
	.asciz	"mbedtls_ssl_write_record"

L_.str.5:                               ## @.str.5
	.asciz	"<= write certificate"

	.comm	_MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED,4,2 ## @MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED
	.comm	_MBEDTLS_SSL_ALERT_LEVEL_WARNING,1,0 ## @MBEDTLS_SSL_ALERT_LEVEL_WARNING
	.comm	_MBEDTLS_SSL_ALERT_MSG_NO_CERT,1,0 ## @MBEDTLS_SSL_ALERT_MSG_NO_CERT
	.comm	_MBEDTLS_SSL_IS_CLIENT,8,3      ## @MBEDTLS_SSL_IS_CLIENT
	.comm	_MBEDTLS_SSL_IS_SERVER,8,3      ## @MBEDTLS_SSL_IS_SERVER
	.comm	_MBEDTLS_SSL_MINOR_VERSION_0,8,3 ## @MBEDTLS_SSL_MINOR_VERSION_0
	.comm	_MBEDTLS_SSL_MSG_ALERT,4,2      ## @MBEDTLS_SSL_MSG_ALERT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_ssl_write_certificate  ; -- Begin function mbedtls_ssl_write_certificate
	.p2align	2
_mbedtls_ssl_write_certificate:         ; @mbedtls_ssl_write_certificate
	.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, x0
	ldr	x8, [x0, #48]
	ldr	x20, [x8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_MBEDTLS_SSL_DEBUG_MSG
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _MBEDTLS_KEY_EXCHANGE_PSK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MBEDTLS_KEY_EXCHANGE_PSK@GOTPAGEOFF]
Lloh4:
	adrp	x10, _MBEDTLS_KEY_EXCHANGE_DHE_PSK@GOTPAGE
Lloh5:
	ldr	x10, [x10, _MBEDTLS_KEY_EXCHANGE_DHE_PSK@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
Lloh7:
	ldr	x10, [x10]
Lloh8:
	adrp	x11, _MBEDTLS_KEY_EXCHANGE_ECDHE_PSK@GOTPAGE
Lloh9:
	ldr	x11, [x11, _MBEDTLS_KEY_EXCHANGE_ECDHE_PSK@GOTPAGEOFF]
Lloh10:
	adrp	x12, _MBEDTLS_KEY_EXCHANGE_ECJPAKE@GOTPAGE
Lloh11:
	ldr	x12, [x12, _MBEDTLS_KEY_EXCHANGE_ECJPAKE@GOTPAGEOFF]
Lloh12:
	ldr	x11, [x11]
Lloh13:
	ldr	x12, [x12]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	ccmp	x8, x12, #4, ne
	b.ne	LBB0_2
; %bb.1:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #2
	bl	_MBEDTLS_SSL_DEBUG_MSG
	mov	w20, #0
	ldr	w8, [x19, #32]
	add	w8, w8, #1
	str	w8, [x19, #32]
	b	LBB0_11
LBB0_2:
	mov	x0, x19
	bl	_mbedtls_ssl_own_cert
	mov	x2, x0
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #3
	bl	_MBEDTLS_SSL_DEBUG_CRT
	mov	x0, x19
	bl	_mbedtls_ssl_own_cert
	cbz	x0, LBB0_6
; %bb.3:
	mov	x20, x0
	mov	w8, #7
Lloh18:
	adrp	x22, _MBEDTLS_SSL_MAX_CONTENT_LEN@GOTPAGE
Lloh19:
	ldr	x22, [x22, _MBEDTLS_SSL_MAX_CONTENT_LEN@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x21, [x20, #8]
	ldrsw	x1, [x22]
	sub	x9, x1, x8
	sub	x9, x9, #3
	cmp	x21, x9
	b.hi	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	lsr	x9, x21, #16
	ldr	x10, [x19, #24]
	strb	w9, [x10, x8]
	lsr	x9, x21, #8
	ldr	x10, [x19, #24]
	add	x10, x8, x10
	strb	w9, [x10, #1]
	ldr	x9, [x19, #24]
	add	x9, x8, x9
	strb	w21, [x9, #2]
	add	x23, x8, #3
	ldr	x8, [x19, #24]
	add	x0, x8, x23
	ldr	w1, [x20, #16]
	mov	x2, x21
	bl	_memcpy
	add	x8, x21, x23
	ldr	x20, [x20]
	cbnz	x20, LBB0_4
	b	LBB0_7
LBB0_6:
	mov	w8, #7
LBB0_7:
	sub	x9, x8, #7
	lsr	x10, x9, #16
	ldr	x11, [x19, #24]
	strb	w10, [x11, #4]
	lsr	x10, x9, #8
	ldr	x11, [x19, #24]
	strb	w10, [x11, #5]
	ldr	x10, [x19, #24]
	strb	w9, [x10, #6]
	str	w8, [x19, #16]
Lloh20:
	adrp	x8, _MBEDTLS_SSL_MSG_HANDSHAKE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MBEDTLS_SSL_MSG_HANDSHAKE@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	str	w8, [x19, #36]
Lloh23:
	adrp	x8, _MBEDTLS_SSL_HS_CERTIFICATE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MBEDTLS_SSL_HS_CERTIFICATE@GOTPAGEOFF]
	ldrb	w8, [x8]
	ldr	x9, [x19, #24]
	strb	w8, [x9]
	ldr	w8, [x19, #32]
	add	w8, w8, #1
	str	w8, [x19, #32]
	mov	x0, x19
	bl	_mbedtls_ssl_write_record
	mov	x20, x0
	cbz	w0, LBB0_10
; %bb.8:
Lloh25:
	adrp	x1, l_.str.4@PAGE
Lloh26:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_MBEDTLS_SSL_DEBUG_RET
	b	LBB0_11
LBB0_9:
	mov	w0, #1
	bl	_MBEDTLS_SSL_DEBUG_MSG
Lloh27:
	adrp	x8, _MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE@GOTPAGEOFF]
Lloh29:
	ldr	w20, [x8]
	b	LBB0_11
LBB0_10:
Lloh30:
	adrp	x1, l_.str.5@PAGE
Lloh31:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #2
	bl	_MBEDTLS_SSL_DEBUG_MSG
LBB0_11:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE,4,2 ; @MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"=> write certificate"

	.comm	_MBEDTLS_KEY_EXCHANGE_PSK,8,3   ; @MBEDTLS_KEY_EXCHANGE_PSK
	.comm	_MBEDTLS_KEY_EXCHANGE_DHE_PSK,8,3 ; @MBEDTLS_KEY_EXCHANGE_DHE_PSK
	.comm	_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,8,3 ; @MBEDTLS_KEY_EXCHANGE_ECDHE_PSK
	.comm	_MBEDTLS_KEY_EXCHANGE_ECJPAKE,8,3 ; @MBEDTLS_KEY_EXCHANGE_ECJPAKE
l_.str.1:                               ; @.str.1
	.asciz	"<= skip write certificate"

l_.str.2:                               ; @.str.2
	.asciz	"own certificate"

	.comm	_MBEDTLS_SSL_MAX_CONTENT_LEN,4,2 ; @MBEDTLS_SSL_MAX_CONTENT_LEN
	.comm	_MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE,4,2 ; @MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE
	.comm	_MBEDTLS_SSL_MSG_HANDSHAKE,4,2  ; @MBEDTLS_SSL_MSG_HANDSHAKE
	.comm	_MBEDTLS_SSL_HS_CERTIFICATE,1,0 ; @MBEDTLS_SSL_HS_CERTIFICATE
l_.str.4:                               ; @.str.4
	.asciz	"mbedtls_ssl_write_record"

l_.str.5:                               ; @.str.5
	.asciz	"<= write certificate"

	.comm	_MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED,4,2 ; @MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED
	.comm	_MBEDTLS_SSL_ALERT_LEVEL_WARNING,1,0 ; @MBEDTLS_SSL_ALERT_LEVEL_WARNING
	.comm	_MBEDTLS_SSL_ALERT_MSG_NO_CERT,1,0 ; @MBEDTLS_SSL_ALERT_MSG_NO_CERT
	.comm	_MBEDTLS_SSL_IS_CLIENT,8,3      ; @MBEDTLS_SSL_IS_CLIENT
	.comm	_MBEDTLS_SSL_IS_SERVER,8,3      ; @MBEDTLS_SSL_IS_SERVER
	.comm	_MBEDTLS_SSL_MINOR_VERSION_0,8,3 ; @MBEDTLS_SSL_MINOR_VERSION_0
	.comm	_MBEDTLS_SSL_MSG_ALERT,4,2      ; @MBEDTLS_SSL_MSG_ALERT
.subsections_via_symbols
