	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_pem_key_file             ## -- Begin function write_pem_key_file
	.p2align	4, 0x90
_write_pem_key_file:                    ## @write_pem_key_file
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_gc_new
	movl	%eax, -48(%rbp)
	movl	$0, -40(%rbp)
	xorl	%eax, %eax
	callq	_clear_buf
	movl	%eax, -56(%rbp)
	xorl	%eax, %eax
	callq	_clear_buf
	movl	%eax, -32(%rbp)
	leaq	-40(%rbp), %rdi
	movl	$4, %esi
	callq	_rand_bytes
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	-56(%rbp), %rbx
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_buf_set_read
	leaq	-32(%rbp), %rsi
	leaq	-48(%rbp), %rcx
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_crypto_pem_encode
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	testq	%r14, %r14
	je	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	leaq	-32(%rbp), %rsi
	movq	%r14, %rdi
	callq	_buffer_write_file
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:
	movq	_M_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_9
LBB0_1:
	movq	_M_NONFATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_9
LBB0_6:
	leaq	-32(%rbp), %rdi
	callq	_BPTR
	leaq	L_.str.3(%rip), %rdi
	movq	%rax, %rsi
	callq	_printf
	jmp	LBB0_10
LBB0_3:
	movq	_M_WARN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_9:
	callq	_msg
LBB0_10:
	leaq	-40(%rbp), %rdi
	movl	$4, %esi
	callq	_secure_memzero
	leaq	-32(%rbp), %rdi
	callq	_buf_clear
	leaq	-48(%rbp), %rdi
	callq	_gc_free
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_M_NONFATAL,4,2                 ## @M_NONFATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ERROR: could not generate random key"

	.comm	_M_WARN,4,2                     ## @M_WARN
L_.str.1:                               ## @.str.1
	.asciz	"ERROR: could not PEM-encode key"

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

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

	.comm	_M_ERR,4,2                      ## @M_ERR
L_.str.4:                               ## @.str.4
	.asciz	"ERROR: could not write key file"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_pem_key_file             ; -- Begin function write_pem_key_file
	.p2align	2
_write_pem_key_file:                    ; @write_pem_key_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	bl	_gc_new
	str	w0, [sp, #24]
	str	wzr, [sp, #16]
	bl	_clear_buf
	str	w0, [sp, #8]
	bl	_clear_buf
	str	w0, [sp]
	add	x0, sp, #16
	mov	w1, #4
	bl	_rand_bytes
	cbz	w0, LBB0_6
; %bb.1:
	add	x0, sp, #8
	add	x1, sp, #16
	mov	w2, #4
	bl	_buf_set_read
	mov	x1, sp
	add	x2, sp, #8
	add	x3, sp, #24
	mov	x0, x20
	bl	_crypto_pem_encode
	cbz	w0, LBB0_8
; %bb.2:
	cbz	x19, LBB0_7
; %bb.3:
Lloh0:
	adrp	x1, l_.str.2@PAGE
Lloh1:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_7
; %bb.4:
	mov	x1, sp
	mov	x0, x19
	bl	_buffer_write_file
	cbnz	w0, LBB0_10
; %bb.5:
Lloh2:
	adrp	x8, _M_ERR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _M_ERR@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str.4@PAGE
Lloh6:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_9
LBB0_6:
Lloh7:
	adrp	x8, _M_NONFATAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _M_NONFATAL@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_9
LBB0_7:
	mov	x0, sp
	bl	_BPTR
	mov	x1, x0
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	b	LBB0_10
LBB0_8:
Lloh14:
	adrp	x8, _M_WARN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _M_WARN@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_9:
	bl	_msg
LBB0_10:
	add	x0, sp, #16
	mov	w1, #4
	bl	_secure_memzero
	mov	x0, sp
	bl	_buf_clear
	add	x0, sp, #24
	bl	_gc_free
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_M_NONFATAL,4,2                 ; @M_NONFATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ERROR: could not generate random key"

	.comm	_M_WARN,4,2                     ; @M_WARN
l_.str.1:                               ; @.str.1
	.asciz	"ERROR: could not PEM-encode key"

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

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

	.comm	_M_ERR,4,2                      ; @M_ERR
l_.str.4:                               ; @.str.4
	.asciz	"ERROR: could not write key file"

.subsections_via_symbols
