	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_base64_encode          ## -- Begin function mbedtls_base64_encode
	.p2align	4, 0x90
_mbedtls_base64_encode:                 ## @mbedtls_base64_encode
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r9
	testq	%r8, %r8
	je	LBB0_1
## %bb.2:
	movabsq	$-6148914691236517205, %rbx     ## imm = 0xAAAAAAAAAAAAAAAB
	movq	%r8, %rax
	mulq	%rbx
	shrq	%rdx
	imulq	%r8, %rbx
	movabsq	$6148914691236517205, %r10      ## imm = 0x5555555555555555
	xorl	%eax, %eax
	cmpq	%r10, %rbx
	seta	%al
	addq	%rdx, %rax
	movq	_BASE64_SIZE_T_MAX@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %r10
	leal	-1(%r10), %r11d
	leal	2(%r10), %ebx
	testl	%r11d, %r11d
	cmovnsl	%r11d, %ebx
	sarl	$2, %ebx
	movslq	%ebx, %rbx
	cmpq	%rbx, %rax
	jbe	LBB0_5
## %bb.3:
	movq	%r10, (%r9)
	jmp	LBB0_4
LBB0_1:
	movq	$0, (%r9)
	jmp	LBB0_20
LBB0_5:
	leaq	1(,%rax,4), %rax
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	cmpq	%rsi, %rax
	ja	LBB0_7
## %bb.8:
	cmpq	$3, %r8
	jae	LBB0_10
## %bb.9:
	xorl	%r12d, %r12d
	movq	%rdi, %r14
	cmpq	%r8, %r12
	jb	LBB0_14
	jmp	LBB0_19
LBB0_7:
	movq	%rax, (%r9)
LBB0_4:
	movq	_MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_21
LBB0_10:
	leaq	(%rdx,%rdx,2), %r10
	xorl	%r12d, %r12d
	movq	_base64_enc_map@GOTPCREL(%rip), %r11
	movq	%rdi, %r14
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%rcx,%r12), %edx
	movzbl	1(%rcx,%r12), %esi
	movzbl	2(%rcx,%r12), %r13d
	movq	(%r11), %r15
	movl	%edx, %eax
	andl	$-4, %eax
	movzbl	(%r15,%rax,2), %eax
	movb	%al, (%r14)
	movq	(%r11), %rax
	shll	$4, %edx
	movq	%rsi, %rbx
	shrq	$4, %rbx
	andl	$48, %edx
	orq	%rbx, %rdx
	movzbl	(%rax,%rdx,8), %eax
	movb	%al, 1(%r14)
	movq	(%r11), %rax
	movq	%r13, %rdx
	shrq	$6, %rdx
	andl	$15, %esi
	leaq	(%rdx,%rsi,4), %rdx
	movzbl	(%rax,%rdx,8), %eax
	movb	%al, 2(%r14)
	movq	(%r11), %rax
	andl	$63, %r13d
	movzbl	(%rax,%r13,8), %eax
	movb	%al, 3(%r14)
	addq	$4, %r14
	addq	$3, %r12
	cmpq	%r10, %r12
	jb	LBB0_11
## %bb.12:
	addq	%r12, %rcx
	cmpq	%r8, %r12
	jae	LBB0_19
LBB0_14:
	movzbl	(%rcx), %esi
	incq	%r12
	xorl	%r10d, %r10d
	cmpq	%r8, %r12
	jae	LBB0_16
## %bb.15:
	movzbl	1(%rcx), %r10d
LBB0_16:
	movl	%esi, %eax
	andl	$-4, %eax
	movq	_base64_enc_map@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movb	(%rdx,%rax,2), %al
	shll	$4, %esi
	movl	%r10d, %edx
	shrq	$4, %rdx
	andl	$48, %esi
	orq	%rdx, %rsi
	movb	%al, (%r14)
	movq	(%rcx), %rax
	movb	(%rax,%rsi,8), %al
	movb	%al, 1(%r14)
	movb	$61, %bl
	cmpq	%r8, %r12
	jae	LBB0_18
## %bb.17:
	movq	(%rcx), %rax
	shll	$2, %r10d
	andl	$60, %r10d
	movb	(%rax,%r10,8), %bl
LBB0_18:
	movb	%bl, 2(%r14)
	movb	$61, 3(%r14)
	addq	$4, %r14
LBB0_19:
	movq	%r14, %rax
	subq	%rdi, %rax
	movq	%rax, (%r9)
	movb	$0, (%r14)
LBB0_20:
	xorl	%eax, %eax
LBB0_21:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BASE64_SIZE_T_MAX,4,2          ## @BASE64_SIZE_T_MAX
	.comm	_MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL,4,2 ## @MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL
	.comm	_base64_enc_map,8,3             ## @base64_enc_map
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_base64_encode          ; -- Begin function mbedtls_base64_encode
	.p2align	2
_mbedtls_base64_encode:                 ; @mbedtls_base64_encode
	.cfi_startproc
; %bb.0:
	cbz	x4, LBB0_7
; %bb.1:
	mov	x8, #-6148914691236517206
	movk	x8, #43691
	umulh	x8, x4, x8
	lsr	x9, x8, #1
	add	x8, x9, x9, lsl #1
	cmp	x4, x8
	cinc	x8, x9, ne
Lloh0:
	adrp	x10, _BASE64_SIZE_T_MAX@GOTPAGE
Lloh1:
	ldr	x10, [x10, _BASE64_SIZE_T_MAX@GOTPAGEOFF]
Lloh2:
	ldrsw	x10, [x10]
	sub	w11, w10, #1
	add	w12, w10, #2
	cmp	w11, #0
	csel	w11, w12, w11, lt
	asr	w11, w11, #2
	cmp	x8, w11, sxtw
	b.hi	LBB0_6
; %bb.2:
	mov	w10, #1
	bfi	x10, x8, #2, #62
	cbz	x0, LBB0_6
; %bb.3:
	cmp	x10, x1
	b.hi	LBB0_6
; %bb.4:
	cmp	x4, #3
	b.hs	LBB0_8
; %bb.5:
	mov	x8, #0
	mov	x9, x0
	cmp	x8, x4
	b.lo	LBB0_11
	b	LBB0_17
LBB0_6:
	str	x10, [x2]
Lloh3:
	adrp	x8, _MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ret
LBB0_7:
	str	xzr, [x2]
	mov	w0, #0
	ret
LBB0_8:
	mov	x8, #0
Lloh6:
	adrp	x10, _base64_enc_map@GOTPAGE
Lloh7:
	ldr	x10, [x10, _base64_enc_map@GOTPAGEOFF]
	mov	x12, x0
	add	x11, x9, x9, lsl #1
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x9, x3, x8
	ldrb	w13, [x9]
	ldrb	w14, [x9, #1]
	ldrb	w9, [x9, #2]
	ldr	x15, [x10]
	lsl	w16, w13, #1
	and	x16, x16, #0x1f8
	ldr	x15, [x15, x16]
	strb	w15, [x12]
	ldr	x15, [x10]
	lsl	w13, w13, #4
	and	x13, x13, #0x30
	orr	x13, x13, x14, lsr #4
	ldr	x13, [x15, x13, lsl #3]
	strb	w13, [x12, #1]
	ldr	x13, [x10]
	lsl	w14, w14, #2
	and	x14, x14, #0x3c
	orr	x14, x14, x9, lsr #6
	ldr	x13, [x13, x14, lsl #3]
	strb	w13, [x12, #2]
	ldr	x13, [x10]
	and	x9, x9, #0x3f
	ldr	x13, [x13, x9, lsl #3]
	add	x9, x12, #4
	strb	w13, [x12, #3]
	add	x8, x8, #3
	mov	x12, x9
	cmp	x8, x11
	b.lo	LBB0_9
; %bb.10:
	add	x3, x3, x8
	cmp	x8, x4
	b.hs	LBB0_17
LBB0_11:
	ldrb	w11, [x3]
	add	x8, x8, #1
	cmp	x8, x4
	b.hs	LBB0_13
; %bb.12:
	ldrb	w10, [x3, #1]
	b	LBB0_14
LBB0_13:
	mov	w10, #0
LBB0_14:
Lloh8:
	adrp	x12, _base64_enc_map@GOTPAGE
Lloh9:
	ldr	x12, [x12, _base64_enc_map@GOTPAGEOFF]
	ldr	x13, [x12]
	lsl	w14, w11, #1
	and	x14, x14, #0x1f8
	ldr	x13, [x13, x14]
	strb	w13, [x9]
	ldr	x13, [x12]
	lsl	w11, w11, #4
	mov	w14, w10
	and	x11, x11, #0x30
	orr	x11, x11, x14, lsr #4
	ldr	x11, [x13, x11, lsl #3]
	strb	w11, [x9, #1]
	mov	w11, #61
	mov	w13, #61
	cmp	x8, x4
	b.hs	LBB0_16
; %bb.15:
	ldr	x8, [x12]
	ubfiz	w10, w10, #2, #4
	ldr	x13, [x8, w10, uxtw #3]
LBB0_16:
	strb	w13, [x9, #2]
	strb	w11, [x9, #3]
	add	x9, x9, #4
LBB0_17:
	sub	x10, x9, x0
	str	x10, [x2]
	strb	wzr, [x9]
	mov	w0, #0
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_BASE64_SIZE_T_MAX,4,2          ; @BASE64_SIZE_T_MAX
	.comm	_MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL,4,2 ; @MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL
	.comm	_base64_enc_map,8,3             ; @base64_enc_map
.subsections_via_symbols
