	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_br_pem_encode                  ## -- Begin function br_pem_encode
	.p2align	4, 0x90
_br_pem_encode:                         ## @br_pem_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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r13d
	movq	%rdx, %rbx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	movq	%rcx, %rdi
	callq	_strlen
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_BR_PEM_LINE64@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	testl	%r13d, (%rcx)
	sete	%al
	leaq	(%rax,%rax,8), %rcx
	leaq	(%rbx,%rcx), %rax
	addq	$47, %rax
	orq	$48, %rcx
	movq	%rax, %rdx
	shrq	$32, %rdx
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rcx
	jmp	LBB0_3
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ecx
LBB0_3:
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	leaq	(%r14,%r14), %rsi
	leaq	2(%rbx), %rax
	movabsq	$-6148914691236517205, %rdx     ## imm = 0xAAAAAAAAAAAAAAAB
	mulq	%rdx
	andq	$-2, %rdx
	movq	_BR_PEM_CRLF@GOTPCREL(%rip), %r15
	leaq	2(%rcx), %rax
	xorl	%edi, %edi
	testl	%r13d, (%r15)
	cmovneq	%rax, %rdi
	leaq	(%rsi,%rdx,2), %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	addq	$32, %rax
	testq	%r12, %r12
	je	LBB0_28
## %bb.4:
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	leaq	(%r12,%rax), %rdi
	subq	%rbx, %rdi
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdx
	callq	_memmove
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	$11, %edx
	callq	_memcpy
	leaq	11(%r12), %rdi
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	movl	%r14d, %edx
	callq	_memcpy
	leaq	(%r12,%r14), %rdi
	addq	$11, %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	$5, %edx
	callq	_memcpy
	leaq	(%r12,%r14), %rbx
	addq	$16, %rbx
	testl	%r13d, (%r15)
	movq	%r15, %r12
	je	LBB0_6
## %bb.5:
	movb	$13, (%rbx)
	incq	%rbx
LBB0_6:
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	_BR_PEM_LINE64@GOTPCREL(%rip), %rcx
	movb	$10, (%rbx)
	incq	%rbx
	xorl	%eax, %eax
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	testl	%r13d, (%rcx)
	sete	%cl
	cmpq	$3, %rdx
	jb	LBB0_7
## %bb.8:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movb	%cl, %al
	leal	(%rax,%rax,2), %eax
	orl	$16, %eax
	movl	%eax, -92(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	$2, %r15d
	xorl	%r12d, %r12d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movb	$10, (%rcx)
	incq	%rcx
	xorl	%eax, %eax
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-120(%rbp), %r15                ## 8-byte Reload
	addq	$3, %r12
	addq	$3, %r15
	cmpq	%rdx, %r15
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	jae	LBB0_14
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%rsi,%r12), %edi
	movl	%edi, %r13d
	shll	$16, %r13d
	movzbl	1(%rsi,%r12), %ebx
	shll	$8, %ebx
	orl	%ebx, %r13d
	movq	%r15, -120(%rbp)                ## 8-byte Spill
	movzbl	(%rsi,%r15), %r14d
	orl	%r14d, %ebx
	shrl	$2, %edi
	callq	_b64char
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movb	%al, (%r15)
	shrl	$12, %r13d
	andl	$63, %r13d
	movl	%r13d, %edi
	callq	_b64char
	movb	%al, 1(%r15)
	shrl	$6, %ebx
	andl	$63, %ebx
	movl	%ebx, %edi
	callq	_b64char
	movb	%al, 2(%r15)
	andl	$63, %r14d
	movl	%r14d, %edi
	callq	_b64char
	leaq	4(%r15), %rcx
	movb	%al, 3(%r15)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	cmpl	-92(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	_BR_PEM_CRLF@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movb	$13, 4(%r15)
	addq	$5, %r15
	movq	%r15, %rcx
	jmp	LBB0_12
LBB0_7:
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	cmpq	%rdx, %r15
	jb	LBB0_16
	jmp	LBB0_21
LBB0_14:
	addq	$-2, %r15
	movq	_BR_PEM_CRLF@GOTPCREL(%rip), %r12
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	cmpq	%rdx, %r15
	jae	LBB0_21
LBB0_16:
	movzbl	(%rsi,%r15), %r14d
	shll	$16, %r14d
	incq	%r15
	cmpq	%rdx, %r15
	jae	LBB0_18
## %bb.17:
	movzbl	(%rsi,%r15), %eax
	shll	$8, %eax
	orl	%eax, %r14d
LBB0_18:
	movl	%r14d, %edi
	shrl	$18, %edi
	callq	_b64char
	movb	%al, (%rbx)
	movl	%r14d, %edi
	shrl	$12, %edi
	andl	$63, %edi
	callq	_b64char
	movb	%al, 1(%rbx)
	movb	$61, %al
	cmpq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	jae	LBB0_20
## %bb.19:
	shrl	$6, %r14d
	andl	$63, %r14d
	movl	%r14d, %edi
	callq	_b64char
LBB0_20:
	movb	%al, 2(%rbx)
	movb	$61, 3(%rbx)
	addq	$4, %rbx
	incl	%r13d
LBB0_21:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	testl	%r13d, %r13d
	je	LBB0_25
## %bb.22:
	testl	%r14d, (%r12)
	je	LBB0_24
## %bb.23:
	movb	$13, (%rbx)
	incq	%rbx
LBB0_24:
	movb	$10, (%rbx)
	incq	%rbx
LBB0_25:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movl	$9, %edx
	callq	_memcpy
	leaq	9(%rbx), %rdi
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	movl	%r15d, %edx
	callq	_memcpy
	leaq	(%rbx,%r15), %rdi
	addq	$9, %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	$5, %edx
	callq	_memcpy
	leaq	(%rbx,%r15), %rcx
	addq	$14, %rcx
	testl	%r14d, (%r12)
	je	LBB0_27
## %bb.26:
	movb	$13, (%rcx)
	incq	%rcx
LBB0_27:
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movw	$10, (%rcx)
LBB0_28:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BR_PEM_LINE64,4,2              ## @BR_PEM_LINE64
	.comm	_BR_PEM_CRLF,4,2                ## @BR_PEM_CRLF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-----BEGIN "

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

L_.str.2:                               ## @.str.2
	.asciz	"-----END "

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_br_pem_encode                  ; -- Begin function br_pem_encode
	.p2align	2
_br_pem_encode:                         ; @br_pem_encode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x4
	mov	x27, x3
	mov	x23, x2
	mov	x26, x1
	mov	x24, x0
	mov	x0, x3
	bl	_strlen
	mov	x21, x0
Lloh0:
	adrp	x20, _BR_PEM_LINE64@GOTPAGE
Lloh1:
	ldr	x20, [x20, _BR_PEM_LINE64@GOTPAGEOFF]
	ldr	w8, [x20]
	tst	w8, w19
	mov	w8, #47
	mov	w9, #56
	csel	x8, x9, x8, eq
	mov	w9, #48
	mov	w10, #57
	csel	x9, x10, x9, eq
	add	x8, x8, x23
	udiv	x8, x8, x9
	add	x9, x23, #2
	mov	x10, #-6148914691236517206
	movk	x10, #43691
	umulh	x9, x9, x10
	lsl	x9, x9, #1
	and	x9, x9, #0xfffffffffffffffc
Lloh2:
	adrp	x22, _BR_PEM_CRLF@GOTPAGE
Lloh3:
	ldr	x22, [x22, _BR_PEM_CRLF@GOTPAGEOFF]
	ldr	w10, [x22]
	add	x11, x8, #2
	tst	w10, w19
	csel	x10, xzr, x11, eq
	add	x9, x9, x0, lsl #1
	add	x8, x9, x8
	add	x8, x8, x10
	add	x0, x8, #32
	cbz	x24, LBB0_25
; %bb.1:
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	add	x8, x24, x0
	sub	x25, x8, x23
	mov	x0, x25
	mov	x1, x26
	mov	x2, x23
	bl	_memmove
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	mov	w2, #11
	bl	_memcpy
	add	x24, x24, #11
	mov	x0, x24
	mov	x1, x27
	mov	x2, x21
	bl	_memcpy
	add	x24, x24, x21
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x24
	mov	w2, #5
	bl	_memcpy
	add	x24, x24, #5
	ldr	w8, [x22]
	tst	w8, w19
	str	x21, [sp, #16]                  ; 8-byte Folded Spill
	b.eq	LBB0_3
; %bb.2:
	mov	w8, #13
	strb	w8, [x24], #1
LBB0_3:
	mov	w8, #10
	strb	w8, [x24], #1
	ldr	w8, [x20]
	tst	w8, w19
	mov	w8, #16
	mov	w9, #19
	csel	w22, w9, w8, eq
	cmp	x23, #3
	b.lo	LBB0_10
; %bb.4:
	str	x27, [sp]                       ; 8-byte Folded Spill
	str	w19, [sp, #28]                  ; 4-byte Folded Spill
	mov	w26, #0
	mov	x20, #0
	mov	w27, #2
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	w26, #0
	mov	w9, #10
	strb	w9, [x8], #1
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x24, x8
	add	x20, x20, #3
	add	x27, x27, #3
	cmp	x27, x23
	b.hs	LBB0_11
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x8, x25, x20
	ldrb	w9, [x8]
	ldrb	w8, [x8, #1]
	lsl	w21, w8, #8
	bfi	w21, w9, #16, #8
	ldrb	w19, [x25, x27]
	mov	x28, x19
	bfi	w28, w8, #8, #8
	lsr	w0, w9, #2
	bl	_b64char
	strb	w0, [x24]
	ubfx	w0, w21, #12, #6
	bl	_b64char
	strb	w0, [x24, #1]
	ubfx	w0, w28, #6, #6
	bl	_b64char
	strb	w0, [x24, #2]
	and	w0, w19, #0x3f
	bl	_b64char
	add	x8, x24, #4
	strb	w0, [x24, #3]
	add	w26, w26, #1
	cmp	w26, w22
	b.ne	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh8:
	adrp	x9, _BR_PEM_CRLF@GOTPAGE
Lloh9:
	ldr	x9, [x9, _BR_PEM_CRLF@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	ldr	w10, [sp, #28]                  ; 4-byte Folded Reload
	tst	w9, w10
	b.eq	LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x8, x24, #5
	mov	w9, #13
	strb	w9, [x24, #4]
	b	LBB0_5
LBB0_10:
	mov	x8, #0
	mov	w26, #0
	b	LBB0_12
LBB0_11:
	sub	x8, x27, #2
	ldr	w19, [sp, #28]                  ; 4-byte Folded Reload
	ldr	x27, [sp]                       ; 8-byte Folded Reload
LBB0_12:
	cmp	x8, x23
	ldr	x20, [sp, #16]                  ; 8-byte Folded Reload
Lloh11:
	adrp	x22, _BR_PEM_CRLF@GOTPAGE
Lloh12:
	ldr	x22, [x22, _BR_PEM_CRLF@GOTPAGEOFF]
	b.hs	LBB0_18
; %bb.13:
	mov	x28, x20
	ldrb	w9, [x25, x8]
	lsl	w20, w9, #16
	add	x21, x8, #1
	cmp	x21, x23
	b.hs	LBB0_15
; %bb.14:
	ldrb	w8, [x25, x21]
	orr	w20, w20, w8, lsl #8
LBB0_15:
	lsr	w0, w20, #18
	bl	_b64char
	strb	w0, [x24]
	ubfx	w0, w20, #12, #6
	bl	_b64char
	strb	w0, [x24, #1]
	mov	w25, #61
	mov	w0, #61
	cmp	x21, x23
	b.hs	LBB0_17
; %bb.16:
	ubfx	w0, w20, #6, #6
	bl	_b64char
LBB0_17:
	strb	w0, [x24, #2]
	strb	w25, [x24, #3]
	add	x24, x24, #4
	add	w26, w26, #1
	mov	x20, x28
LBB0_18:
	cbz	w26, LBB0_22
; %bb.19:
	ldr	w8, [x22]
	tst	w8, w19
	b.eq	LBB0_21
; %bb.20:
	mov	w8, #13
	strb	w8, [x24], #1
LBB0_21:
	mov	w8, #10
	strb	w8, [x24], #1
LBB0_22:
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x24
	mov	w2, #9
	bl	_memcpy
	add	x23, x24, #9
	mov	x0, x23
	mov	x1, x27
	mov	x2, x20
	bl	_memcpy
	add	x20, x23, x20
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	w2, #5
	bl	_memcpy
	add	x8, x20, #5
	ldr	w9, [x22]
	tst	w9, w19
	b.eq	LBB0_24
; %bb.23:
	mov	w9, #13
	strb	w9, [x8], #1
LBB0_24:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	w9, #10
	strh	w9, [x8]
LBB0_25:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_BR_PEM_LINE64,4,2              ; @BR_PEM_LINE64
	.comm	_BR_PEM_CRLF,4,2                ; @BR_PEM_CRLF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-----BEGIN "

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

l_.str.2:                               ; @.str.2
	.asciz	"-----END "

.subsections_via_symbols
