	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_h2o_base64_encode              ## -- Begin function h2o_base64_encode
	.p2align	4, 0x90
_h2o_base64_encode:                     ## @h2o_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
	testl	%ecx, %ecx
	leaq	L_.str(%rip), %rax
	leaq	L_.str.1(%rip), %r8
	cmoveq	%rax, %r8
	movq	%rdi, %rax
	cmpq	$3, %rdx
	jb	LBB0_2
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %r10d
	movl	4(%rsi), %r9d
	shll	$16, %r10d
	shll	$8, %r9d
	orl	%r10d, %r9d
	movl	8(%rsi), %r10d
	orl	%r10d, %r9d
	movl	%r9d, %r11d
	sarl	$18, %r11d
	movslq	%r11d, %r11
	movzbl	(%r8,%r11), %r11d
	movb	%r11b, (%rax)
	movl	%r9d, %r11d
	shrl	$12, %r11d
	andl	$63, %r11d
	movzbl	(%r8,%r11), %r11d
	movb	%r11b, 1(%rax)
	shrl	$6, %r9d
	andl	$63, %r9d
	movzbl	(%r8,%r9), %r9d
	movb	%r9b, 2(%rax)
	andl	$63, %r10d
	movzbl	(%r8,%r10), %r9d
	movb	%r9b, 3(%rax)
	addq	$4, %rax
	addq	$12, %rsi
	addq	$-3, %rdx
	cmpq	$2, %rdx
	ja	LBB0_1
LBB0_2:
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.3:
	movl	(%rsi), %r9d
	shll	$16, %r9d
	movl	%r9d, %r10d
	sarl	$18, %r10d
	movslq	%r10d, %r10
	movb	(%r8,%r10), %r10b
	movb	%r10b, (%rax)
	cmpq	$2, %rdx
	jne	LBB0_6
## %bb.4:
	movl	4(%rsi), %r10d
	movl	%r10d, %esi
	shll	$8, %esi
	orl	%r9d, %esi
	shrl	$12, %esi
	andl	$63, %esi
	andl	$15, %r10d
	movb	(%r8,%rsi), %dl
	movb	%dl, 1(%rax)
	movb	(%r8,%r10,4), %dl
	movb	%dl, 2(%rax)
	testl	%ecx, %ecx
	je	LBB0_9
## %bb.5:
	addq	$3, %rax
	jmp	LBB0_10
LBB0_6:
	shrl	$12, %r9d
	andl	$48, %r9d
	movb	(%r8,%r9), %dl
	movb	%dl, 1(%rax)
	testl	%ecx, %ecx
	je	LBB0_8
## %bb.7:
	addq	$2, %rax
	jmp	LBB0_10
LBB0_8:
	movb	$61, 2(%rax)
LBB0_9:
	movb	$61, 3(%rax)
	addq	$4, %rax
LBB0_10:
	movb	$0, (%rax)
	subq	%rdi, %rax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

L_.str.1:                               ## @.str.1
	.asciz	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_h2o_base64_encode              ; -- Begin function h2o_base64_encode
	.p2align	2
_h2o_base64_encode:                     ; @h2o_base64_encode
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, l_.str.1@PAGE
Lloh1:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh2:
	adrp	x9, l_.str@PAGE
Lloh3:
	add	x9, x9, l_.str@PAGEOFF
	cmp	w3, #0
	csel	x8, x9, x8, eq
	cmp	x2, #3
	b.lo	LBB0_4
; %bb.1:
	mov	x10, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w9, w11, [x1]
	lsl	w11, w11, #8
	orr	w9, w11, w9, lsl #16
	ldr	w11, [x1, #8]
	orr	x9, x9, x11
	asr	w12, w9, #18
	ldrb	w12, [x8, w12, sxtw]
	ubfx	x13, x9, #12, #6
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
	strb	w12, [x10]
	ldrb	w12, [x8, x13]
	strb	w12, [x10, #1]
	ubfx	x9, x9, #6, #6
	ldrb	w9, [x8, x9]
	strb	w9, [x10, #2]
	and	x9, x11, #0x3f
	ldrb	w11, [x8, x9]
	add	x9, x10, #4
	strb	w11, [x10, #3]
	add	x1, x1, #12
	sub	x2, x2, #3
	mov	x10, x9
	cmp	x2, #2
	b.hi	LBB0_2
; %bb.3:
	cbnz	x2, LBB0_5
	b	LBB0_12
LBB0_4:
	mov	x9, x0
	cbz	x2, LBB0_12
LBB0_5:
	ldr	w11, [x1]
	lsl	w10, w11, #16
	sbfx	w11, w11, #2, #14
	ldrb	w11, [x8, w11, sxtw]
	strb	w11, [x9]
	cmp	x2, #2
	b.ne	LBB0_8
; %bb.6:
	ldr	w11, [x1, #4]
	orr	w10, w10, w11, lsl #8
	ubfx	x10, x10, #12, #6
	ldrb	w10, [x8, x10]
	strb	w10, [x9, #1]
	lsl	w10, w11, #2
	and	x10, x10, #0x3c
	ldrb	w8, [x8, x10]
	strb	w8, [x9, #2]
	cbz	w3, LBB0_11
; %bb.7:
	add	x9, x9, #3
	b	LBB0_12
LBB0_8:
	lsr	w10, w10, #12
	and	x10, x10, #0x30
	ldrb	w8, [x8, x10]
	strb	w8, [x9, #1]
	cbz	w3, LBB0_10
; %bb.9:
	add	x9, x9, #2
	b	LBB0_12
LBB0_10:
	mov	w8, #61
	strb	w8, [x9, #2]
LBB0_11:
	mov	w8, #61
	strb	w8, [x9, #3]
	add	x9, x9, #4
LBB0_12:
	strb	wzr, [x9]
	sub	x0, x9, x0
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

l_.str.1:                               ; @.str.1
	.asciz	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"

.subsections_via_symbols
