	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_gen_krl
_do_gen_krl:                            ## @do_gen_krl
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	$0, -56(%rbp)
	movq	_identity_file@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	cmpb	$0, (%rdi)
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_fatal
	movq	_identity_file@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
LBB0_2:
	leaq	-72(%rbp), %rsi
	callq	_stat
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.3:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_ENOENT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	je	LBB0_5
## %bb.4:
	movq	_identity_file@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	callq	_strerror
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fatal
LBB0_5:
	testl	%r12d, %r12d
	je	LBB0_7
## %bb.6:
	movq	_identity_file@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_fatal
LBB0_7:
	movq	_ca_key_path@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	movl	%r12d, -64(%rbp)                ## 4-byte Spill
	je	LBB0_8
## %bb.9:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_tilde_expand_filename
	movq	%rax, %r15
	xorl	%r12d, %r12d
	leaq	-56(%rbp), %rsi
	movq	%rax, %rdi
	xorl	%edx, %edx
	callq	_sshkey_load_public
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %edi
	callq	_ssh_err
	leaq	L_.str.4(%rip), %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fatal
LBB0_13:
	movq	%r15, %rdi
	callq	_free
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_15
	jmp	LBB0_16
LBB0_8:
	xorl	%r12d, %r12d
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_16
LBB0_15:
	movq	_identity_file@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	-48(%rbp), %rsi
	callq	_load_krl
	jmp	LBB0_18
LBB0_10:
	movl	$1, %r12d
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_15
LBB0_16:
	xorl	%eax, %eax
	callq	_ssh_krl_init
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	jne	LBB0_18
## %bb.17:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_fatal
LBB0_18:
	movq	_cert_serial@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.19:
	movq	-48(%rbp), %rdi
	callq	_ssh_krl_set_version
LBB0_20:
	movq	_identity_comment@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_22
## %bb.21:
	movq	-48(%rbp), %rdi
	callq	_ssh_krl_set_comment
LBB0_22:
	testl	%r15d, %r15d
	jle	LBB0_25
## %bb.23:
	movl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%rbx,8), %rsi
	movq	-56(%rbp), %rcx
	movq	-48(%rbp), %r8
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_update_krl_from_file
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_24
LBB0_25:
	xorl	%eax, %eax
	callq	_sshbuf_new
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_27
## %bb.26:
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_fatal
LBB0_27:
	movq	-48(%rbp), %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ssh_krl_to_blob
	testq	%rax, %rax
	je	LBB0_29
## %bb.28:
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_fatal
LBB0_29:
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_identity_file@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_O_TRUNC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	$420, %edx                      ## imm = 0x1A4
	callq	_open
	movl	%eax, %r14d
	cmpl	$-1, %eax
	jne	LBB0_31
## %bb.30:
	movq	_identity_file@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_strerror
	leaq	L_.str.8(%rip), %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fatal
LBB0_31:
	movq	_vwrite@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r12, %rdi
	callq	_sshbuf_mutable_ptr
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_sshbuf_len
	movl	%r15d, %edi
	movl	%r14d, %esi
	movl	%ebx, %edx
	movq	%rax, %rcx
	callq	_atomicio
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_sshbuf_len
	cmpq	%rax, %rbx
	je	LBB0_33
## %bb.32:
	movq	_identity_file@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_strerror
	leaq	L_.str.9(%rip), %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fatal
LBB0_33:
	movl	%r14d, %edi
	callq	_close
	movq	%r12, %rdi
	callq	_sshbuf_free
	movq	-48(%rbp), %rdi
	callq	_ssh_krl_free
	movq	-56(%rbp), %rdi
	callq	_sshkey_free
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_identity_file,8,3              ## @identity_file
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"KRL generation requires an output file"

	.comm	_errno,8,3                      ## @errno
	.comm	_ENOENT,8,3                     ## @ENOENT
L_.str.1:                               ## @.str.1
	.asciz	"Cannot access KRL \"%s\": %s"

L_.str.2:                               ## @.str.2
	.asciz	"KRL \"%s\" does not exist"

	.comm	_ca_key_path,8,3                ## @ca_key_path
L_.str.3:                               ## @.str.3
	.asciz	"none"

L_.str.4:                               ## @.str.4
	.asciz	"Cannot load CA public key %s: %s"

L_.str.5:                               ## @.str.5
	.asciz	"couldn't create KRL"

	.comm	_cert_serial,8,3                ## @cert_serial
	.comm	_identity_comment,8,3           ## @identity_comment
L_.str.6:                               ## @.str.6
	.asciz	"sshbuf_new failed"

L_.str.7:                               ## @.str.7
	.asciz	"Couldn't generate KRL"

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
L_.str.8:                               ## @.str.8
	.asciz	"open %s: %s"

	.comm	_vwrite,4,2                     ## @vwrite
L_.str.9:                               ## @.str.9
	.asciz	"write %s: %s"

	.no_dead_strip	_do_gen_krl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_gen_krl
_do_gen_krl:                            ; @do_gen_krl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	str	xzr, [sp, #24]
Lloh0:
	adrp	x24, _identity_file@GOTPAGE
Lloh1:
	ldr	x24, [x24, _identity_file@GOTPAGEOFF]
	ldr	x0, [x24]
	ldrb	w8, [x0]
	cbnz	w8, LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fatal
	ldr	x0, [x24]
LBB0_2:
	add	x1, sp, #32
	bl	_stat
	cmn	w0, #1
	b.ne	LBB0_7
; %bb.3:
Lloh4:
	adrp	x8, _errno@GOTPAGE
Lloh5:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh6:
	ldr	x0, [x8]
Lloh7:
	adrp	x8, _ENOENT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_5
; %bb.4:
	ldr	x23, [x24]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x23, x0, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_fatal
LBB0_5:
	cbz	w22, LBB0_7
; %bb.6:
	ldr	x8, [x24]
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_fatal
LBB0_7:
Lloh14:
	adrp	x8, _ca_key_path@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ca_key_path@GOTPAGEOFF]
Lloh16:
	ldr	x23, [x8]
	cbz	x23, LBB0_12
; %bb.8:
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x23
	bl	_strcasecmp
	cbz	x0, LBB0_14
; %bb.9:
	ldr	w1, [x20]
	mov	x0, x23
	bl	_tilde_expand_filename
	mov	x23, x0
	add	x1, sp, #24
	mov	x2, #0
	bl	_sshkey_load_public
	cbz	w0, LBB0_11
; %bb.10:
	bl	_ssh_err
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x23, x0, [sp]
Lloh19:
	adrp	x0, l_.str.4@PAGE
Lloh20:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_fatal
LBB0_11:
	mov	x0, x23
	bl	_free
	mov	w23, #0
LBB0_12:
	cbz	w22, LBB0_15
LBB0_13:
	ldr	x0, [x24]
	add	x1, sp, #40
	bl	_load_krl
	b	LBB0_17
LBB0_14:
	mov	w23, #1
	cbnz	w22, LBB0_13
LBB0_15:
	bl	_ssh_krl_init
	str	x0, [sp, #40]
	cbnz	x0, LBB0_17
; %bb.16:
Lloh21:
	adrp	x0, l_.str.5@PAGE
Lloh22:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_fatal
LBB0_17:
Lloh23:
	adrp	x8, _cert_serial@GOTPAGE
Lloh24:
	ldr	x8, [x8, _cert_serial@GOTPAGEOFF]
Lloh25:
	ldr	x1, [x8]
	cbz	x1, LBB0_19
; %bb.18:
	ldr	x0, [sp, #40]
	bl	_ssh_krl_set_version
LBB0_19:
Lloh26:
	adrp	x8, _identity_comment@GOTPAGE
Lloh27:
	ldr	x8, [x8, _identity_comment@GOTPAGEOFF]
Lloh28:
	ldr	x1, [x8]
	cbz	x1, LBB0_21
; %bb.20:
	ldr	x0, [sp, #40]
	bl	_ssh_krl_set_comment
LBB0_21:
	cmp	w21, #1
	b.lt	LBB0_24
; %bb.22:
	mov	w21, w21
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x19], #8
	ldr	x3, [sp, #24]
	ldr	x4, [sp, #40]
	mov	x0, x20
	mov	x2, x23
	bl	_update_krl_from_file
	subs	x21, x21, #1
	b.ne	LBB0_23
LBB0_24:
	bl	_sshbuf_new
	mov	x19, x0
	cbnz	x0, LBB0_26
; %bb.25:
Lloh29:
	adrp	x0, l_.str.6@PAGE
Lloh30:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_fatal
LBB0_26:
	ldr	x0, [sp, #40]
	mov	x1, x19
	mov	x2, #0
	mov	w3, #0
	bl	_ssh_krl_to_blob
	cbz	x0, LBB0_28
; %bb.27:
Lloh31:
	adrp	x0, l_.str.7@PAGE
Lloh32:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_fatal
LBB0_28:
	ldr	x0, [x24]
Lloh33:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh34:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh37:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh39:
	adrp	x9, _O_TRUNC@GOTPAGE
Lloh40:
	ldr	x9, [x9, _O_TRUNC@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	w2, #420
	bl	_open
	mov	x20, x0
	cmn	w0, #1
	b.ne	LBB0_30
; %bb.29:
	ldr	x21, [x24]
Lloh42:
	adrp	x8, _errno@GOTPAGE
Lloh43:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh44:
	ldr	x0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x21, x0, [sp]
Lloh45:
	adrp	x0, l_.str.8@PAGE
Lloh46:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_fatal
LBB0_30:
Lloh47:
	adrp	x8, _vwrite@GOTPAGE
Lloh48:
	ldr	x8, [x8, _vwrite@GOTPAGEOFF]
Lloh49:
	ldr	w21, [x8]
	mov	x0, x19
	bl	_sshbuf_mutable_ptr
	mov	x22, x0
	mov	x0, x19
	bl	_sshbuf_len
	mov	x3, x0
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_atomicio
	mov	x21, x0
	mov	x0, x19
	bl	_sshbuf_len
	cmp	x21, x0
	b.eq	LBB0_32
; %bb.31:
	ldr	x21, [x24]
Lloh50:
	adrp	x8, _errno@GOTPAGE
Lloh51:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh52:
	ldr	x0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x21, x0, [sp]
Lloh53:
	adrp	x0, l_.str.9@PAGE
Lloh54:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_fatal
LBB0_32:
	mov	x0, x20
	bl	_close
	mov	x0, x19
	bl	_sshbuf_free
	ldr	x0, [sp, #40]
	bl	_ssh_krl_free
	ldr	x0, [sp, #24]
	bl	_sshkey_free
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_identity_file,8,3              ; @identity_file
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"KRL generation requires an output file"

	.comm	_errno,8,3                      ; @errno
	.comm	_ENOENT,8,3                     ; @ENOENT
l_.str.1:                               ; @.str.1
	.asciz	"Cannot access KRL \"%s\": %s"

l_.str.2:                               ; @.str.2
	.asciz	"KRL \"%s\" does not exist"

	.comm	_ca_key_path,8,3                ; @ca_key_path
l_.str.3:                               ; @.str.3
	.asciz	"none"

l_.str.4:                               ; @.str.4
	.asciz	"Cannot load CA public key %s: %s"

l_.str.5:                               ; @.str.5
	.asciz	"couldn't create KRL"

	.comm	_cert_serial,8,3                ; @cert_serial
	.comm	_identity_comment,8,3           ; @identity_comment
l_.str.6:                               ; @.str.6
	.asciz	"sshbuf_new failed"

l_.str.7:                               ; @.str.7
	.asciz	"Couldn't generate KRL"

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
l_.str.8:                               ; @.str.8
	.asciz	"open %s: %s"

	.comm	_vwrite,4,2                     ; @vwrite
l_.str.9:                               ; @.str.9
	.asciz	"write %s: %s"

	.no_dead_strip	_do_gen_krl
.subsections_via_symbols
