	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cal_fopen
_cal_fopen:                             ## @cal_fopen
	.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	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	cmpb	$0, (%rax)
	je	LBB0_2
## %bb.4:
	movq	%rax, %rdi
	callq	_chdir
	testq	%rax, %rax
	je	LBB0_5
## %bb.13:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
LBB0_3:
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_warnx
LBB0_12:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_calendarHomes@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_nitems
	testl	%eax, %eax
	je	LBB0_11
## %bb.6:
	xorl	%ebx, %ebx
	leaq	L_.str.3(%rip), %r14
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movq	(%r12), %rdi
	callq	_nitems
	movl	%eax, %eax
	cmpq	%rax, %rbx
	jae	LBB0_11
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_chdir
	testq	%rax, %rax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%rax, %r13
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r13d, %r13d
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_warnx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HOME"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot get home directory"

L_.str.2:                               ## @.str.2
	.asciz	"Cannot enter home directory"

	.comm	_calendarHomes,8,3              ## @calendarHomes
L_.str.3:                               ## @.str.3
	.asciz	"r"

L_.str.4:                               ## @.str.4
	.asciz	"can't open calendar file \"%s\""

	.no_dead_strip	_cal_fopen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cal_fopen
_cal_fopen:                             ; @cal_fopen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_4
; %bb.1:
	ldrb	w8, [x0]
	cbz	w8, LBB0_4
; %bb.2:
	bl	_chdir
	cbz	x0, LBB0_7
; %bb.3:
Lloh2:
	adrp	x0, l_.str.2@PAGE
Lloh3:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_4:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_5:
	bl	_warnx
	mov	x0, #0
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_7:
Lloh6:
	adrp	x21, _calendarHomes@GOTPAGE
Lloh7:
	ldr	x21, [x21, _calendarHomes@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_nitems
	cbz	w0, LBB0_12
; %bb.8:
	mov	x22, #0
Lloh8:
	adrp	x20, l_.str.3@PAGE
Lloh9:
	add	x20, x20, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x22, x22, #1
	ldr	x0, [x21]
	bl	_nitems
	cmp	x22, w0, uxtw
	b.hs	LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	x0, [x8, x22, lsl #3]
	bl	_chdir
	cbnz	x0, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_fopen
	cbz	x0, LBB0_9
	b	LBB0_6
LBB0_12:
	str	x19, [sp]
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HOME"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot get home directory"

l_.str.2:                               ; @.str.2
	.asciz	"Cannot enter home directory"

	.comm	_calendarHomes,8,3              ; @calendarHomes
l_.str.3:                               ; @.str.3
	.asciz	"r"

l_.str.4:                               ; @.str.4
	.asciz	"can't open calendar file \"%s\""

	.no_dead_strip	_cal_fopen
.subsections_via_symbols
