	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_kod_db                   ## -- Begin function write_kod_db
	.p2align	4, 0x90
_write_kod_db:                          ## @write_kod_db
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_kod_db_file@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_1
LBB0_13:
	movq	_kod_db_cnt@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_16
## %bb.14:
	xorl	%ebx, %ebx
	movq	_kod_db@GOTPCREL(%rip), %r12
	leaq	L_.str.3(%rip), %r14
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	movq	8(%rax), %rdx
	movl	(%rax), %r8d
	movl	4(%rax), %ecx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_fprintf
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_15
LBB0_16:
	movq	%r13, %rdi
	callq	_fflush
	movq	%r13, %rdi
	callq	_fclose
	movq	_TRUE@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_1:
	movq	(%r12), %r14
	cmpb	$0, (%r14)
	je	LBB0_11
## %bb.2:
	movq	_S_IRUSR@GOTPCREL(%rip), %rax
	movq	_S_IWUSR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	orl	(%rax), %r15d
	movq	_S_IXUSR@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_S_IRGRP@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_S_IXGRP@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_S_IROTH@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_S_IXOTH@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	leaq	1(%r14), %rdi
	movq	_DIR_SEP@GOTPCREL(%rip), %r13
	movsbl	(%r13), %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movq	%rax, %rbx
	movq	_EEXIST@GOTPCREL(%rip), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movzbl	(%r13), %eax
	movb	%al, (%rbx)
	incq	%rbx
	movsbl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_strchr
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_8
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movb	$0, (%rbx)
	movq	(%r12), %rdi
	movl	%r15d, %esi
	callq	_mkdir
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	(%r14), %rax
	je	LBB0_7
## %bb.6:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r12), %rdx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_12
LBB0_8:
	movq	(%r12), %r14
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_fopen
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_13
## %bb.10:
	movq	(%r12), %r14
LBB0_11:
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdx
LBB0_12:
	callq	_msyslog
	movq	_FALSE@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_kod_db_file,8,3                ## @kod_db_file
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w"

	.comm	_S_IRUSR,4,2                    ## @S_IRUSR
	.comm	_S_IWUSR,4,2                    ## @S_IWUSR
	.comm	_S_IXUSR,4,2                    ## @S_IXUSR
	.comm	_S_IRGRP,4,2                    ## @S_IRGRP
	.comm	_S_IXGRP,4,2                    ## @S_IXGRP
	.comm	_S_IROTH,4,2                    ## @S_IROTH
	.comm	_S_IXOTH,4,2                    ## @S_IXOTH
	.comm	_DIR_SEP,1,0                    ## @DIR_SEP
	.comm	_errno,8,3                      ## @errno
	.comm	_EEXIST,8,3                     ## @EEXIST
	.comm	_LOG_ERR,4,2                    ## @LOG_ERR
L_.str.1:                               ## @.str.1
	.asciz	"mkdir(%s) failed: %m"

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_LOG_WARNING,4,2                ## @LOG_WARNING
L_.str.2:                               ## @.str.2
	.asciz	"Can't open KOD db file %s for writing: %m"

	.comm	_kod_db_cnt,4,2                 ## @kod_db_cnt
L_.str.3:                               ## @.str.3
	.asciz	"%16.16llx %s %s\n"

	.comm	_kod_db,8,3                     ## @kod_db
	.comm	_TRUE,4,2                       ## @TRUE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_kod_db                   ; -- Begin function write_kod_db
	.p2align	2
_write_kod_db:                          ; @write_kod_db
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x21, _kod_db_file@GOTPAGE
Lloh1:
	ldr	x21, [x21, _kod_db_file@GOTPAGEOFF]
	ldr	x0, [x21]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	mov	x19, x0
	cbz	x0, LBB0_5
LBB0_1:
Lloh4:
	adrp	x21, _kod_db_cnt@GOTPAGE
Lloh5:
	ldr	x21, [x21, _kod_db_cnt@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x22, #0
Lloh6:
	adrp	x23, _kod_db@GOTPAGE
Lloh7:
	ldr	x23, [x23, _kod_db@GOTPAGEOFF]
Lloh8:
	adrp	x20, l_.str.3@PAGE
Lloh9:
	add	x20, x20, l_.str.3@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	ldr	x8, [x8, x22, lsl #3]
	ldr	x2, [x8, #8]
	ldp	w4, w3, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_fprintf
	add	x22, x22, #1
	ldrsw	x8, [x21]
	cmp	x22, x8
	b.lt	LBB0_3
LBB0_4:
	mov	x0, x19
	bl	_fflush
	mov	x0, x19
	bl	_fclose
Lloh10:
	adrp	x8, _TRUE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_17
LBB0_5:
	ldr	x19, [x21]
	ldrb	w8, [x19]
	cbz	w8, LBB0_15
; %bb.6:
Lloh12:
	adrp	x8, _S_IRUSR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _S_IRUSR@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
Lloh15:
	adrp	x8, _S_IWUSR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _S_IWUSR@GOTPAGEOFF]
Lloh17:
	adrp	x9, _S_IXUSR@GOTPAGE
Lloh18:
	ldr	x9, [x9, _S_IXUSR@GOTPAGEOFF]
Lloh19:
	ldr	w25, [x8]
Lloh20:
	ldr	w24, [x9]
Lloh21:
	adrp	x8, _S_IRGRP@GOTPAGE
Lloh22:
	ldr	x8, [x8, _S_IRGRP@GOTPAGEOFF]
Lloh23:
	adrp	x9, _S_IXGRP@GOTPAGE
Lloh24:
	ldr	x9, [x9, _S_IXGRP@GOTPAGEOFF]
Lloh25:
	ldr	w27, [x8]
Lloh26:
	ldr	w26, [x9]
Lloh27:
	adrp	x8, _S_IROTH@GOTPAGE
Lloh28:
	ldr	x8, [x8, _S_IROTH@GOTPAGEOFF]
Lloh29:
	adrp	x9, _S_IXOTH@GOTPAGE
Lloh30:
	ldr	x9, [x9, _S_IXOTH@GOTPAGEOFF]
Lloh31:
	ldr	w23, [x8]
Lloh32:
	ldr	w28, [x9]
	add	x0, x19, #1
Lloh33:
	adrp	x22, _DIR_SEP@GOTPAGE
Lloh34:
	ldr	x22, [x22, _DIR_SEP@GOTPAGEOFF]
	ldrsb	w1, [x22]
	bl	_strchr
	cbz	x0, LBB0_13
; %bb.7:
	mov	x20, x0
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	orr	w8, w25, w8
	orr	w8, w8, w24
	orr	w8, w8, w27
	orr	w8, w8, w26
	orr	w8, w8, w23
	orr	w19, w8, w28
Lloh35:
	adrp	x23, _errno@GOTPAGE
Lloh36:
	ldr	x23, [x23, _errno@GOTPAGEOFF]
Lloh37:
	adrp	x24, _EEXIST@GOTPAGE
Lloh38:
	ldr	x24, [x24, _EEXIST@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldrb	w8, [x22]
	strb	w8, [x20], #1
	ldrsb	w1, [x22]
	mov	x0, x20
	bl	_strchr
	mov	x20, x0
	cbz	x0, LBB0_12
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	strb	wzr, [x20]
	ldr	x0, [x21]
	mov	x1, x19
	bl	_mkdir
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x23]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.11:
Lloh39:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh40:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
	ldr	x2, [x21]
Lloh42:
	adrp	x1, l_.str.1@PAGE
Lloh43:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_16
LBB0_12:
	ldr	x19, [x21]
LBB0_13:
Lloh44:
	adrp	x1, l_.str@PAGE
Lloh45:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_fopen
	mov	x19, x0
	cbnz	x0, LBB0_1
; %bb.14:
	ldr	x19, [x21]
LBB0_15:
Lloh46:
	adrp	x8, _LOG_WARNING@GOTPAGE
Lloh47:
	ldr	x8, [x8, _LOG_WARNING@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
Lloh49:
	adrp	x1, l_.str.2@PAGE
Lloh50:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
LBB0_16:
	bl	_msyslog
Lloh51:
	adrp	x8, _FALSE@GOTPAGE
Lloh52:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_17:
	ldr	w0, [x8]
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh31
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh25
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_kod_db_file,8,3                ; @kod_db_file
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w"

	.comm	_S_IRUSR,4,2                    ; @S_IRUSR
	.comm	_S_IWUSR,4,2                    ; @S_IWUSR
	.comm	_S_IXUSR,4,2                    ; @S_IXUSR
	.comm	_S_IRGRP,4,2                    ; @S_IRGRP
	.comm	_S_IXGRP,4,2                    ; @S_IXGRP
	.comm	_S_IROTH,4,2                    ; @S_IROTH
	.comm	_S_IXOTH,4,2                    ; @S_IXOTH
	.comm	_DIR_SEP,1,0                    ; @DIR_SEP
	.comm	_errno,8,3                      ; @errno
	.comm	_EEXIST,8,3                     ; @EEXIST
	.comm	_LOG_ERR,4,2                    ; @LOG_ERR
l_.str.1:                               ; @.str.1
	.asciz	"mkdir(%s) failed: %m"

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_LOG_WARNING,4,2                ; @LOG_WARNING
l_.str.2:                               ; @.str.2
	.asciz	"Can't open KOD db file %s for writing: %m"

	.comm	_kod_db_cnt,4,2                 ; @kod_db_cnt
l_.str.3:                               ; @.str.3
	.asciz	"%16.16llx %s %s\n"

	.comm	_kod_db,8,3                     ; @kod_db
	.comm	_TRUE,4,2                       ; @TRUE
.subsections_via_symbols
