	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hx509_pem_write                ## -- Begin function hx509_pem_write
	.p2align	4, 0x90
_hx509_pem_write:                       ## @hx509_pem_write
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movq	%r8, %r13
	movq	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rsi, %rdx
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	leaq	L_.str(%rip), %rsi
	movq	%rcx, %rdi
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	callq	_print_pem_stamp
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	leaq	L_.str.1(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdx
	movq	8(%rbx), %rcx
	cmpq	$0, 16(%rbx)
	leaq	L_.str.2(%rip), %r8
	leaq	L_.str.3(%rip), %rax
	cmoveq	%rax, %r8
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_2
LBB0_3:
	testq	%r15, %r15
	je	LBB0_8
## %bb.4:
	leaq	-56(%rbp), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$54, %r15
	movl	$54, %ebx
	cmovbq	%r15, %rbx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_base64_encode
	testq	%rax, %rax
	js	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rdx
	movq	%r12, %rdi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	addq	%rbx, %r13
	movq	-56(%rbp), %rdi
	callq	_free
	subq	%rbx, %r15
	jne	LBB0_5
LBB0_8:
	leaq	L_.str.6(%rip), %rsi
	movq	%r12, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_print_pem_stamp
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	leaq	L_.str.4(%rip), %rcx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%esi, %esi
	callq	_hx509_set_error_string
	movl	(%rbx), %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BEGIN"

L_.str.1:                               ## @.str.1
	.asciz	"%s: %s\n%s"

L_.str.2:                               ## @.str.2
	.space	1

L_.str.3:                               ## @.str.3
	.asciz	"\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.4:                               ## @.str.4
	.asciz	"malloc - out of memory"

L_.str.5:                               ## @.str.5
	.asciz	"%s\n"

L_.str.6:                               ## @.str.6
	.asciz	"END"

	.comm	_ENCODE_LINE_LENGTH,8,3         ## @ENCODE_LINE_LENGTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hx509_pem_write                ; -- Begin function hx509_pem_write
	.p2align	2
_hx509_pem_write:                       ; @hx509_pem_write
	.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	x22, x5
	mov	x23, x4
	mov	x21, x3
	mov	x24, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x3
	mov	x2, x20
	bl	_print_pem_stamp
	cbz	x24, LBB0_3
; %bb.1:
Lloh2:
	adrp	x26, l_.str.2@PAGE
Lloh3:
	add	x26, x26, l_.str.2@PAGEOFF
Lloh4:
	adrp	x27, l_.str.3@PAGE
Lloh5:
	add	x27, x27, l_.str.3@PAGEOFF
Lloh6:
	adrp	x25, l_.str.1@PAGE
Lloh7:
	add	x25, x25, l_.str.1@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x2, x8, [x24]
	ldr	x9, [x24, #16]
	cmp	x9, #0
	csel	x9, x27, x26, eq
	stp	x8, x9, [sp]
	mov	x0, x21
	mov	x1, x25
	bl	_fprintf
	ldr	x24, [x24, #16]
	cbnz	x24, LBB0_2
LBB0_3:
	cbz	x22, LBB0_7
; %bb.4:
	mov	w26, #54
Lloh8:
	adrp	x24, l_.str.5@PAGE
Lloh9:
	add	x24, x24, l_.str.5@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x22, #54
	csel	x25, x22, x26, lo
	add	x2, sp, #24
	mov	x0, x23
	mov	x1, x25
	bl	_base64_encode
	tbnz	x0, #63, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	sub	x22, x22, x25
	ldr	x2, [sp, #24]
	mov	x0, x21
	mov	x1, x24
	bl	_fprintf
	add	x23, x23, x25
	ldr	x0, [sp, #24]
	bl	_free
	cbnz	x22, LBB0_5
LBB0_7:
Lloh10:
	adrp	x1, l_.str.6@PAGE
Lloh11:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_print_pem_stamp
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh12:
	adrp	x20, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x20, [x20, _ENOMEM@GOTPAGEOFF]
	ldr	w2, [x20]
Lloh14:
	adrp	x3, l_.str.4@PAGE
Lloh15:
	add	x3, x3, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_hx509_set_error_string
	ldr	w0, [x20]
LBB0_9:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BEGIN"

l_.str.1:                               ; @.str.1
	.asciz	"%s: %s\n%s"

l_.str.2:                               ; @.str.2
	.space	1

l_.str.3:                               ; @.str.3
	.asciz	"\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.4:                               ; @.str.4
	.asciz	"malloc - out of memory"

l_.str.5:                               ; @.str.5
	.asciz	"%s\n"

l_.str.6:                               ; @.str.6
	.asciz	"END"

	.comm	_ENCODE_LINE_LENGTH,8,3         ; @ENCODE_LINE_LENGTH
.subsections_via_symbols
