	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function base64_encode
_base64_encode:                         ## @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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	2(,%rsi,4), %rax
	movabsq	$-6148914691236517205, %rcx     ## imm = 0xAAAAAAAAAAAAAAAB
	mulq	%rcx
	shrq	%rdx
	leaq	1(%rdx), %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	cmpq	$3, %r14
	jb	LBB0_3
## %bb.4:
	leaq	_base64_encode.digits(%rip), %r8
	movq	%rax, %r9
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movsbl	(%rbx), %edx
	movl	%edx, %edi
	shll	$16, %edi
	movsbl	1(%rbx), %ecx
	shll	$8, %ecx
	movl	%ecx, %esi
	andl	$61440, %esi                    ## imm = 0xF000
	orl	%edi, %esi
	movzbl	2(%rbx), %edi
	orl	%edi, %ecx
	addq	$3, %rbx
	addq	$-3, %r14
	shrl	$2, %edx
	andl	$63, %edx
	movzbl	(%rdx,%r8), %edx
	movb	%dl, (%r9)
	shrl	$12, %esi
	andl	$63, %esi
	movzbl	(%rsi,%r8), %edx
	movb	%dl, 1(%r9)
	shrl	$6, %ecx
	andl	$63, %ecx
	movzbl	(%rcx,%r8), %ecx
	movb	%cl, 2(%r9)
	andl	$63, %edi
	movzbl	(%rdi,%r8), %ecx
	movb	%cl, 3(%r9)
	addq	$4, %r9
	cmpq	$2, %r14
	ja	LBB0_5
## %bb.6:
	cmpq	$2, %r14
	je	LBB0_9
LBB0_7:
	cmpq	$1, %r14
	jne	LBB0_10
## %bb.8:
	movsbl	(%rbx), %ecx
	movl	%ecx, %edx
	shrl	$2, %edx
	andl	$63, %edx
	leaq	_base64_encode.digits(%rip), %rsi
	movb	(%rdx,%rsi), %dl
	movb	%dl, (%r9)
	shll	$4, %ecx
	andl	$48, %ecx
	movb	(%rcx,%rsi), %cl
	movb	%cl, 1(%r9)
	addq	$2, %r9
	jmp	LBB0_10
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_3:
	movq	%rax, %r9
	cmpq	$2, %r14
	jne	LBB0_7
LBB0_9:
	movsbl	(%rbx), %ecx
	movl	%ecx, %esi
	shll	$16, %esi
	movsbl	1(%rbx), %edx
	movl	%edx, %edi
	shll	$8, %edi
	andl	$61440, %edi                    ## imm = 0xF000
	orl	%esi, %edi
	shrl	$2, %ecx
	andl	$63, %ecx
	leaq	_base64_encode.digits(%rip), %rsi
	movb	(%rcx,%rsi), %cl
	movb	%cl, (%r9)
	shrl	$12, %edi
	andl	$63, %edi
	movb	(%rdi,%rsi), %cl
	movb	%cl, 1(%r9)
	andl	$15, %edx
	movb	(%rsi,%rdx,4), %cl
	movb	%cl, 2(%r9)
	addq	$3, %r9
LBB0_10:
	movb	$0, (%r9)
LBB0_11:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @base64_encode.digits
_base64_encode.digits:
	.ascii	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

	.no_dead_strip	_base64_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function base64_encode
_base64_encode:                         ; @base64_encode
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	mov	w8, #2
	bfi	x8, x1, #2, #62
	mov	x9, #-6148914691236517206
	movk	x9, #43691
	umulh	x8, x8, x9
	lsr	x8, x8, #1
	add	x0, x8, #1
	bl	_malloc
	cbz	x0, LBB0_11
; %bb.1:
Lloh0:
	adrp	x8, _base64_encode.digits@PAGE
Lloh1:
	add	x8, x8, _base64_encode.digits@PAGEOFF
	cmp	x20, #3
	b.lo	LBB0_7
; %bb.2:
	mov	x10, x0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldrsb	w9, [x19]
	ldrsb	w11, [x19, #1]
	lsl	w12, w11, #8
	and	w12, w12, #0xf000
	bfi	w12, w9, #16, #16
	ldrb	w13, [x19, #2]
	and	x14, x13, #0x3f
                                        ; kill: def $w13 killed $w13 killed $x13 def $x13
	bfi	w13, w11, #8, #24
	add	x19, x19, #3
	sub	x20, x20, #3
	ubfx	x9, x9, #2, #6
	ldrb	w9, [x8, x9]
	ubfx	x11, x12, #12, #6
	ldrb	w11, [x8, x11]
	strb	w9, [x10]
	strb	w11, [x10, #1]
	ubfx	x9, x13, #6, #6
	ldrb	w9, [x8, x9]
	strb	w9, [x10, #2]
	ldrb	w11, [x8, x14]
	add	x9, x10, #4
	strb	w11, [x10, #3]
	mov	x10, x9
	cmp	x20, #2
	b.hi	LBB0_3
; %bb.4:
	cmp	x20, #2
	b.eq	LBB0_8
LBB0_5:
	cmp	x20, #1
	b.ne	LBB0_10
; %bb.6:
	ldrsb	w11, [x19]
	ubfx	x10, x11, #2, #6
	ldrb	w12, [x8, x10]
	mov	x10, x9
	strb	w12, [x10], #1
	ubfiz	w11, w11, #4, #2
	mov	w12, #2
	b	LBB0_9
LBB0_7:
	mov	x9, x0
	cmp	x20, #2
	b.ne	LBB0_5
LBB0_8:
	ldrsb	w10, [x19]
	ldrsb	w11, [x19, #1]
	lsl	w12, w11, #8
	and	w12, w12, #0xf000
	bfi	w12, w10, #16, #16
	ubfx	x10, x10, #2, #6
	ldrb	w10, [x8, x10]
	strb	w10, [x9]
	ubfx	x10, x12, #12, #6
	ldrb	w12, [x8, x10]
	add	x10, x9, #2
	strb	w12, [x9, #1]
	ubfiz	w11, w11, #2, #4
	mov	w12, #3
LBB0_9:
	ldrb	w8, [x8, w11, uxtw]
	add	x9, x9, x12
	strb	w8, [x10]
LBB0_10:
	strb	wzr, [x9]
LBB0_11:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_base64_encode.digits:                  ; @base64_encode.digits
	.ascii	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

	.no_dead_strip	_base64_encode
.subsections_via_symbols
