	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_pem_write_buffer       ## -- Begin function mbedtls_pem_write_buffer
	.p2align	4, 0x90
_mbedtls_pem_write_buffer:              ## @mbedtls_pem_write_buffer
	.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	%r9, %r12
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	-48(%rbp), %rdx
	xorl	%edi, %edi
	xorl	%esi, %esi
	movq	%r15, %rcx
	movq	%r13, %r8
	callq	_mbedtls_base64_encode
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_strlen
	movq	%rax, %rbx
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_strlen
	movq	-48(%rbp), %rsi
	movq	%rsi, %rcx
	shrq	$6, %rcx
	addq	%rbx, %rax
	addq	%rsi, %rax
	addq	%rcx, %rax
	incq	%rax
	cmpq	%r12, %rax
	jbe	LBB0_2
## %bb.1:
	movq	16(%rbp), %rcx
	movq	%rax, (%rcx)
	movq	_MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	movl	$1, %edi
	callq	_mbedtls_calloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r12
	movq	-48(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movq	%rax, %rdi
	movq	%r15, %rcx
	movq	%r13, %r8
	callq	_mbedtls_base64_encode
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mbedtls_free
	jmp	LBB0_11
LBB0_3:
	movq	_MBEDTLS_ERR_PEM_ALLOC_FAILED@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_6:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_strlen
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_memcpy
	movq	%rbx, %rdi
	callq	_strlen
	movq	%rax, %r14
	addq	%r15, %r14
	movq	-48(%rbp), %rbx
	testq	%rbx, %rbx
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_7
## %bb.8:
	movl	$64, %r13d
	movq	%r12, %r15
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$64, %rbx
	cmovaeq	%r13, %rbx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_memcpy
	movq	-48(%rbp), %rax
	addq	%rbx, %r15
	subq	%rbx, %rax
	movq	%rax, -48(%rbp)
	leaq	1(%r14,%rbx), %r12
	movb	$10, (%r14,%rbx)
	movq	%r12, %r14
	movq	%rax, %rbx
	jne	LBB0_9
	jmp	LBB0_10
LBB0_7:
	movq	%r14, %r12
LBB0_10:
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_strlen
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_memcpy
	movq	%rbx, %rdi
	callq	_strlen
	leaq	(%r12,%rax), %rcx
	movb	$0, (%r12,%rax)
	subq	-56(%rbp), %rcx                 ## 8-byte Folded Reload
	incq	%rcx
	movq	16(%rbp), %rax
	movq	%rcx, (%rax)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_mbedtls_free
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL,4,2 ## @MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL
	.comm	_MBEDTLS_ERR_PEM_ALLOC_FAILED,4,2 ## @MBEDTLS_ERR_PEM_ALLOC_FAILED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_pem_write_buffer       ; -- Begin function mbedtls_pem_write_buffer
	.p2align	2
_mbedtls_pem_write_buffer:              ; @mbedtls_pem_write_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x6
	mov	x22, x5
	mov	x20, x4
	mov	x24, x3
	mov	x25, x2
	mov	x21, x1
	mov	x23, x0
	add	x2, sp, #24
	mov	x0, #0
	mov	x1, #0
	mov	x3, x25
	mov	x4, x24
	bl	_mbedtls_base64_encode
	mov	x0, x23
	bl	_strlen
	mov	x26, x0
	mov	x0, x21
	bl	_strlen
	ldr	x1, [sp, #24]
	add	x8, x26, x0
	add	x8, x8, x1
	add	x8, x8, x1, lsr #6
	add	x8, x8, #1
	cmp	x8, x22
	b.ls	LBB0_2
; %bb.1:
	str	x8, [x19]
Lloh0:
	adrp	x8, _MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	b	LBB0_10
LBB0_2:
	mov	w0, #1
	bl	_mbedtls_calloc
	cbz	x0, LBB0_5
; %bb.3:
	mov	x22, x0
	ldr	x1, [sp, #24]
	add	x2, sp, #24
	mov	x3, x25
	mov	x4, x24
	bl	_mbedtls_base64_encode
	cbz	w0, LBB0_6
; %bb.4:
	mov	x24, x0
	mov	x0, x22
	bl	_mbedtls_free
	b	LBB0_10
LBB0_5:
Lloh3:
	adrp	x8, _MBEDTLS_ERR_PEM_ALLOC_FAILED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MBEDTLS_ERR_PEM_ALLOC_FAILED@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
	b	LBB0_10
LBB0_6:
	mov	x0, x23
	bl	_strlen
	stp	x23, x0, [sp]
	mov	x0, x20
	bl	_memcpy
	mov	x0, x23
	bl	_strlen
	add	x23, x20, x0
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_9
; %bb.7:
	mov	w24, #64
	mov	w25, #10
	mov	x26, x22
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x8, #64
	csel	x27, x8, x24, lo
	stp	x26, x27, [sp]
	mov	x0, x23
	bl	_memcpy
	ldr	x8, [sp, #24]
	add	x23, x23, x27
	add	x26, x26, x27
	strb	w25, [x23], #1
	subs	x8, x8, x27
	str	x8, [sp, #24]
	b.ne	LBB0_8
LBB0_9:
	mov	x0, x21
	bl	_strlen
	stp	x21, x0, [sp]
	mov	x0, x23
	bl	_memcpy
	mov	x0, x21
	bl	_strlen
	add	x8, x23, x0
	sub	x9, x8, x20
	strb	wzr, [x8]
	add	x8, x9, #1
	str	x8, [x19]
	mov	x0, x22
	bl	_mbedtls_free
	mov	w24, #0
LBB0_10:
	mov	x0, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL,4,2 ; @MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL
	.comm	_MBEDTLS_ERR_PEM_ALLOC_FAILED,4,2 ; @MBEDTLS_ERR_PEM_ALLOC_FAILED
.subsections_via_symbols
