	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_av_base64_encode               ## -- Begin function av_base64_encode
	.p2align	4, 0x90
_av_base64_encode:                      ## @av_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	_UINT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	cmpl	%r15d, %ecx
	jle	LBB0_3
## %bb.1:
	movq	%rdx, %rbx
	movl	%esi, %r12d
	movq	%rdi, %r14
	movl	%r15d, %edi
	callq	_AV_BASE64_SIZE
	cmpl	%r12d, %eax
	jle	LBB0_4
LBB0_3:
	xorl	%r14d, %r14d
	jmp	LBB0_22
LBB0_4:
	cmpl	$4, %r15d
	jl	LBB0_8
## %bb.5:
	leaq	_av_base64_encode.b64(%rip), %r13
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %r14d
	movq	%rbx, %rdi
	callq	_AV_RB32
                                        ## kill: def $eax killed $eax def $rax
	addq	$12, %rbx
	leal	-3(%r14), %r15d
	movl	%eax, %ecx
	shrq	$26, %rcx
	movzbl	(%rcx,%r13), %ecx
	movb	%cl, (%r12)
	movl	%eax, %ecx
	shrl	$20, %ecx
	andl	$63, %ecx
	movzbl	(%rcx,%r13), %ecx
	movb	%cl, 1(%r12)
	movl	%eax, %ecx
	shrl	$14, %ecx
	andl	$63, %ecx
	movzbl	(%rcx,%r13), %ecx
	movb	%cl, 2(%r12)
	shrl	$8, %eax
	andl	$63, %eax
	movzbl	(%rax,%r13), %eax
	movb	%al, 3(%r12)
	addq	$4, %r12
	cmpl	$6, %r14d
	ja	LBB0_6
## %bb.7:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_8:
	movq	%r14, %r12
	testl	%r15d, %r15d
	je	LBB0_19
LBB0_9:
	leal	-1(%r15), %eax
	cmpl	$3, %eax
	jae	LBB0_11
## %bb.10:
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_11:
	movl	%r15d, %ecx
	andl	$-4, %ecx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	shll	$8, %eax
	addl	(%rbx), %eax
	shll	$8, %eax
	addl	4(%rbx), %eax
	shll	$8, %eax
	addl	8(%rbx), %eax
	shll	$8, %eax
	addl	12(%rbx), %eax
	addq	$16, %rbx
	addl	$-4, %ecx
	jne	LBB0_12
LBB0_13:
	testb	$3, %r15b
	je	LBB0_16
## %bb.14:
	movl	%r15d, %ecx
	andl	$3, %ecx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	shll	$8, %eax
	addl	(%rbx,%rdx,4), %eax
	incq	%rdx
	cmpl	%edx, %ecx
	jne	LBB0_15
LBB0_16:
	shll	$3, %r15d
	testl	%r15d, %r15d
	jle	LBB0_19
## %bb.17:
	shll	$6, %eax
	leaq	_av_base64_encode.b64(%rip), %rdx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, %esi
	movl	%r15d, %ecx
	shrl	%cl, %esi
	andl	$63, %esi
	movzbl	(%rsi,%rdx), %ecx
	movb	%cl, (%r12)
	incq	%r12
	leal	-6(%r15), %ecx
	cmpl	$6, %r15d
	movl	%ecx, %r15d
	ja	LBB0_18
LBB0_19:
	movl	%r12d, %eax
	subl	%r14d, %eax
	testb	$3, %al
	je	LBB0_21
## %bb.20:
	movl	%r12d, %eax
	notl	%eax
	leal	(%r14,%rax), %ebx
	andl	$3, %ebx
	leaq	1(%rbx), %rdx
	movq	%r12, %rdi
	movl	$61, %esi
	callq	_memset
	addq	%rbx, %r12
	incq	%r12
LBB0_21:
	movb	$0, (%r12)
LBB0_22:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
	.p2align	4                               ## @av_base64_encode.b64
_av_base64_encode.b64:
	.asciz	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

	.comm	_UINT_MAX,4,2                   ## @UINT_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_av_base64_encode               ; -- Begin function av_base64_encode
	.p2align	2
_av_base64_encode:                      ; @av_base64_encode
	.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
Lloh0:
	adrp	x8, _UINT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UINT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	cmp	w3, w8, asr #2
	b.ge	LBB0_2
; %bb.1:
	mov	x22, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	mov	x0, x3
	bl	_AV_BASE64_SIZE
	cmp	w0, w20
	b.le	LBB0_3
LBB0_2:
	mov	x19, #0
	b	LBB0_20
LBB0_3:
	cmp	w22, #4
	b.lt	LBB0_6
; %bb.4:
Lloh3:
	adrp	x20, _av_base64_encode.b64@PAGE
Lloh4:
	add	x20, x20, _av_base64_encode.b64@PAGEOFF
	mov	x23, x19
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x24, x22
	mov	x0, x21
	bl	_AV_RB32
                                        ; kill: def $w0 killed $w0 def $x0
	add	x21, x21, #12
	sub	w22, w22, #3
	mov	w8, w0
	lsr	x8, x8, #26
	ldrb	w8, [x20, x8]
	strb	w8, [x23]
	ubfx	x8, x0, #20, #6
	ldrb	w8, [x20, x8]
	strb	w8, [x23, #1]
	ubfx	x8, x0, #14, #6
	ldrb	w8, [x20, x8]
	strb	w8, [x23, #2]
	ubfx	x8, x0, #8, #6
	ldrb	w8, [x20, x8]
	add	x11, x23, #4
	strb	w8, [x23, #3]
	mov	x23, x11
	cmp	w24, #6
	b.hi	LBB0_5
	b	LBB0_7
LBB0_6:
	mov	x11, x19
	mov	x20, x19
	cbz	w22, LBB0_17
LBB0_7:
	mov	w8, #0
	mov	x9, x22
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x21], #4
	add	w8, w10, w8, lsl #8
	subs	w9, w9, #1
	b.ne	LBB0_8
; %bb.9:
	lsl	w12, w22, #3
	cmp	w12, #1
	b.lt	LBB0_12
; %bb.10:
	lsl	w8, w8, #6
	mov	w9, #5
	orr	w9, w12, w9
	mov	w10, #6
	cmp	w12, #6
	csel	w10, w12, w10, lo
	sub	w10, w9, w10
Lloh5:
	adrp	x9, _av_base64_encode.b64@PAGE
Lloh6:
	add	x9, x9, _av_base64_encode.b64@PAGEOFF
	cmp	w10, #18
	b.hs	LBB0_13
; %bb.11:
	mov	x10, x12
	mov	x20, x11
	b	LBB0_16
LBB0_12:
	mov	x20, x11
	b	LBB0_17
LBB0_13:
	mov	w13, #43691
	movk	w13, #43690, lsl #16
	umull	x10, w10, w13
	lsr	x10, x10, #34
	add	w13, w10, #1
	and	x14, x13, #0x7ffffffc
	mov	w10, #-6
	madd	w10, w14, w10, w12
	add	x20, x11, x14
	add	x11, x11, #3
	mov	x15, x14
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	sub	w16, w12, #6
	sub	w17, w12, #12
	sub	w0, w12, #18
	lsr	w1, w8, w12
	lsr	w16, w8, w16
	lsr	w17, w8, w17
	lsr	w0, w8, w0
	and	x1, x1, #0x3f
	and	x16, x16, #0x3f
	and	x17, x17, #0x3f
	ldrb	w1, [x9, x1]
	ldrb	w16, [x9, x16]
	and	x0, x0, #0x3f
	ldrb	w17, [x9, x17]
	ldrb	w0, [x9, x0]
	sturb	w1, [x11, #-3]
	sturb	w16, [x11, #-2]
	sturb	w17, [x11, #-1]
	strb	w0, [x11], #4
	sub	w12, w12, #24
	subs	x15, x15, #4
	b.ne	LBB0_14
; %bb.15:
	cmp	x14, x13
	b.eq	LBB0_17
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	lsr	w11, w8, w10
	and	x11, x11, #0x3f
	ldrb	w11, [x9, x11]
	strb	w11, [x20], #1
	subs	w10, w10, #6
	b.hi	LBB0_16
LBB0_17:
	sub	w8, w20, w19
	tst	x8, #0x3
	b.eq	LBB0_19
; %bb.18:
	mvn	w8, w20
	add	w8, w8, w19
	and	x8, x8, #0x3
	add	x21, x8, #1
	mov	x0, x20
	mov	w1, #61
	mov	x2, x21
	bl	_memset
	add	x20, x20, x21
LBB0_19:
	strb	wzr, [x20]
LBB0_20:
	mov	x0, x19
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
_av_base64_encode.b64:                  ; @av_base64_encode.b64
	.asciz	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

	.comm	_UINT_MAX,4,2                   ; @UINT_MAX
.subsections_via_symbols
