	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_WriteToDisk@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
LBB0_2:
	movq	_LC_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_setlocale
	xorl	%eax, %eax
	callq	_getpath
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_getargs
	movq	_Match@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_18
## %bb.3:
	xorl	%eax, %eax
	callq	_init_prob
	movq	_Short_only@GOTPCREL(%rip), %r15
	movq	_Long_only@GOTPCREL(%rip), %r14
	movq	_SLEN@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_get_fort
	cmpq	$0, (%r15)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%eax, %eax
	callq	_fortlen
	cmpq	(%rbx), %rax
	jg	LBB0_4
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpq	$0, (%r14)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%eax, %eax
	callq	_fortlen
	cmpq	(%rbx), %rax
	jle	LBB0_4
LBB0_8:
	movq	_Fortfile@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_display
	movq	_WriteToDisk@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_13
## %bb.9:
	movq	(%r14), %rax
	movl	12(%rax), %edi
	movl	$438, %esi                      ## imm = 0x1B6
	callq	_creat
	testl	%eax, %eax
	jns	LBB0_10
## %bb.19:
	movq	(%r14), %rax
	movl	12(%rax), %edi
	callq	_perror
	movl	$1, %edi
	callq	_exit
LBB0_18:
	xorl	%eax, %eax
	callq	_find_matches
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_exit
LBB0_10:
	movl	%eax, %ebx
	movq	_LOCK_EX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_flock
	movq	(%r14), %rsi
	addq	$8, %rsi
	movl	%ebx, %edi
	movl	$4, %edx
	callq	_write
	movq	(%r14), %rax
	cmpl	$0, 4(%rax)
	jne	LBB0_12
## %bb.11:
	movl	(%rax), %edi
	movl	$438, %esi                      ## imm = 0x1B6
	callq	_chmod
LBB0_12:
	movq	_LOCK_UN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_flock
LBB0_13:
	movq	_Wait@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_17
## %bb.14:
	movq	_Fort_len@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	testl	%eax, %eax
	jne	LBB0_16
## %bb.15:
	xorl	%eax, %eax
	callq	_fortlen
	movl	(%rbx), %eax
LBB0_16:
	movq	_CPERS@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movq	_MINW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movl	%eax, %edi
	callq	_sleep
LBB0_17:
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FORTUNE_SAVESTATE"

	.comm	_WriteToDisk,4,2                ## @WriteToDisk
	.comm	_LC_ALL,4,2                     ## @LC_ALL
L_.str.1:                               ## @.str.1
	.space	1

	.comm	_Match,8,3                      ## @Match
	.comm	_Short_only,8,3                 ## @Short_only
	.comm	_SLEN,8,3                       ## @SLEN
	.comm	_Long_only,8,3                  ## @Long_only
	.comm	_Fortfile,8,3                   ## @Fortfile
	.comm	_LOCK_EX,4,2                    ## @LOCK_EX
	.comm	_LOCK_UN,4,2                    ## @LOCK_UN
	.comm	_Wait,8,3                       ## @Wait
	.comm	_Fort_len,4,2                   ## @Fort_len
	.comm	_CPERS,4,2                      ## @CPERS
	.comm	_MINW,4,2                       ## @MINW
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _WriteToDisk@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WriteToDisk@GOTPAGEOFF]
	mov	w9, #1
Lloh4:
	str	w9, [x8]
LBB0_2:
Lloh5:
	adrp	x8, _LC_ALL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LC_ALL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_setlocale
	bl	_getpath
	mov	x0, x20
	mov	x1, x19
	bl	_getargs
Lloh10:
	adrp	x8, _Match@GOTPAGE
Lloh11:
	ldr	x8, [x8, _Match@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cbnz	x8, LBB0_11
; %bb.3:
	bl	_init_prob
Lloh13:
	adrp	x19, _Short_only@GOTPAGE
Lloh14:
	ldr	x19, [x19, _Short_only@GOTPAGEOFF]
Lloh15:
	adrp	x20, _Long_only@GOTPAGE
Lloh16:
	ldr	x20, [x20, _Long_only@GOTPAGEOFF]
Lloh17:
	adrp	x21, _SLEN@GOTPAGE
Lloh18:
	ldr	x21, [x21, _SLEN@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	bl	_get_fort
	ldr	x8, [x19]
	cbz	x8, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_fortlen
	ldr	x8, [x21]
	cmp	x0, x8
	b.gt	LBB0_4
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20]
	cbz	x8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_fortlen
	ldr	x8, [x21]
	cmp	x0, x8
	b.le	LBB0_4
LBB0_8:
Lloh19:
	adrp	x20, _Fortfile@GOTPAGE
Lloh20:
	ldr	x20, [x20, _Fortfile@GOTPAGEOFF]
	ldr	x0, [x20]
	bl	_display
Lloh21:
	adrp	x8, _WriteToDisk@GOTPAGE
Lloh22:
	ldr	x8, [x8, _WriteToDisk@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cbz	w8, LBB0_15
; %bb.9:
	ldr	x8, [x20]
	ldr	w0, [x8, #12]
	mov	w1, #438
	bl	_creat
	tbz	w0, #31, LBB0_12
; %bb.10:
	ldr	x8, [x20]
	ldr	w0, [x8, #12]
	bl	_perror
	mov	w0, #1
	bl	_exit
LBB0_11:
	bl	_find_matches
	cmp	x0, #0
	cset	w0, ne
	bl	_exit
LBB0_12:
	mov	x19, x0
Lloh24:
	adrp	x8, _LOCK_EX@GOTPAGE
Lloh25:
	ldr	x8, [x8, _LOCK_EX@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	bl	_flock
	ldr	x8, [x20]
	add	x1, x8, #8
	mov	x0, x19
	mov	w2, #4
	bl	_write
	ldr	x8, [x20]
	ldr	w9, [x8, #4]
	cbnz	w9, LBB0_14
; %bb.13:
	ldr	w0, [x8]
	mov	w1, #438
	bl	_chmod
LBB0_14:
Lloh27:
	adrp	x8, _LOCK_UN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _LOCK_UN@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_flock
LBB0_15:
Lloh30:
	adrp	x8, _Wait@GOTPAGE
Lloh31:
	ldr	x8, [x8, _Wait@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	cbz	x8, LBB0_19
; %bb.16:
Lloh33:
	adrp	x19, _Fort_len@GOTPAGE
Lloh34:
	ldr	x19, [x19, _Fort_len@GOTPAGEOFF]
	ldr	w8, [x19]
	cbnz	w8, LBB0_18
; %bb.17:
	bl	_fortlen
	ldr	w8, [x19]
LBB0_18:
Lloh35:
	adrp	x9, _CPERS@GOTPAGE
Lloh36:
	ldr	x9, [x9, _CPERS@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	sdiv	w0, w8, w9
Lloh38:
	adrp	x8, _MINW@GOTPAGE
Lloh39:
	ldr	x8, [x8, _MINW@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	bl	_max
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_sleep
LBB0_19:
	mov	w0, #0
	bl	_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FORTUNE_SAVESTATE"

	.comm	_WriteToDisk,4,2                ; @WriteToDisk
	.comm	_LC_ALL,4,2                     ; @LC_ALL
l_.str.1:                               ; @.str.1
	.space	1

	.comm	_Match,8,3                      ; @Match
	.comm	_Short_only,8,3                 ; @Short_only
	.comm	_SLEN,8,3                       ; @SLEN
	.comm	_Long_only,8,3                  ; @Long_only
	.comm	_Fortfile,8,3                   ; @Fortfile
	.comm	_LOCK_EX,4,2                    ; @LOCK_EX
	.comm	_LOCK_UN,4,2                    ; @LOCK_UN
	.comm	_Wait,8,3                       ; @Wait
	.comm	_Fort_len,4,2                   ; @Fort_len
	.comm	_CPERS,4,2                      ; @CPERS
	.comm	_MINW,4,2                       ; @MINW
.subsections_via_symbols
