	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_base64_encode                  ## -- Begin function base64_encode
	.p2align	4, 0x90
_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	leaq	12(,%rsi,4), %rax
	movabsq	$-6148914691236517205, %rcx     ## imm = 0xAAAAAAAAAAAAAAAB
	mulq	%rcx
	shrq	%rdx
	leaq	1(%rdx), %rdi
	callq	_malloc
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	leaq	1(%r15), %r8
	movl	$1, %esi
	leaq	_base64_encode.base64(%rip), %r9
	movq	%rax, %rcx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movb	%r10b, 3(%rcx)
	addq	$4, %rcx
	addq	$3, %rsi
	cmpq	%r15, %rdi
	jae	LBB0_12
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	-1(%r14,%rsi), %ebx
	shll	$8, %ebx
	cmpq	%r15, %rsi
	jae	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movzbl	(%r14,%rsi), %edi
	orl	%edi, %ebx
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	leaq	1(%rsi), %rdi
	shll	$8, %ebx
	cmpq	%r15, %rdi
	jae	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movzbl	1(%r14,%rsi), %edi
	orl	%edi, %ebx
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	leaq	2(%rsi), %rdi
	movl	%ebx, %edx
	shrl	$18, %edx
	movzbl	(%rdx,%r9), %edx
	movb	%dl, (%rcx)
	movl	%ebx, %edx
	shrl	$12, %edx
	andl	$63, %edx
	movzbl	(%rdx,%r9), %edx
	movb	%dl, 1(%rcx)
	movb	$61, %r10b
	movb	$61, %dl
	cmpq	%r8, %rdi
	ja	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %edx
	shrl	$6, %edx
	andl	$63, %edx
	movzbl	(%rdx,%r9), %edx
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movb	%dl, 2(%rcx)
	cmpq	%r15, %rdi
	ja	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	andl	$63, %ebx
	movzbl	(%rbx,%r9), %r10d
	jmp	LBB0_11
LBB0_1:
	movq	%rax, %rcx
LBB0_12:
	movb	$0, (%rcx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
	.p2align	4                               ## @base64_encode.base64
_base64_encode.base64:
	.asciz	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_base64_encode                  ; -- Begin function base64_encode
	.p2align	2
_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	x19, x1
	mov	x20, x0
	lsl	x8, x1, #2
	add	x8, x8, #12
	mov	x9, #-6148914691236517206
	movk	x9, #43691
	umulh	x8, x8, x9
	lsr	x8, x8, #1
	add	x0, x8, #1
	bl	_malloc
	cbz	x19, LBB0_13
; %bb.1:
	mov	x8, #0
	add	x9, x19, #1
	add	x10, x20, #2
	mov	x12, x0
Lloh0:
	adrp	x11, _base64_encode.base64@PAGE
Lloh1:
	add	x11, x11, _base64_encode.base64@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
                                        ; kill: def $w13 killed $w13 killed $x13 def $x13
	and	x13, x13, #0x3f
	ldrb	w14, [x11, x13]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x13, x12, #4
	strb	w14, [x12, #3]
	mov	x12, x13
	cmp	x8, x19
	b.hs	LBB0_14
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x15, x8, #1
	add	x14, x10, x8
	ldurb	w13, [x14, #-2]
	lsl	w13, w13, #8
	cmp	x15, x19
	b.hs	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldurb	w14, [x14, #-1]
	orr	w13, w13, w14
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x14, x8, #2
	lsl	w13, w13, #8
	cmp	x14, x19
	b.hs	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldrb	w14, [x10, x8]
	orr	w13, w13, w14
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, #3
	lsr	w14, w13, #18
	ldrb	w14, [x11, w14, uxtw]
	strb	w14, [x12]
	ubfx	x14, x13, #12, #6
	ldrb	w14, [x11, x14]
	strb	w14, [x12, #1]
	cmp	x8, x9
	b.ls	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w14, #61
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x14, x13
	ubfx	x14, x14, #6, #6
	ldrb	w14, [x11, x14]
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	strb	w14, [x12, #2]
	cmp	x8, x19
	b.ls	LBB0_2
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w14, #61
	b	LBB0_3
LBB0_13:
	mov	x13, x0
LBB0_14:
	strb	wzr, [x13]
	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,__cstring,cstring_literals
_base64_encode.base64:                  ; @base64_encode.base64
	.asciz	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

.subsections_via_symbols
