	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FS_FOpenFileByMode             ## -- Begin function FS_FOpenFileByMode
	.p2align	4, 0x90
_FS_FOpenFileByMode:                    ## @FS_FOpenFileByMode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
                                        ## kill: def $edx killed $edx def $rdx
	addl	$-128, %edx
	cmpl	$3, %edx
	ja	LBB0_6
## %bb.1:
	movq	%rsi, %rbx
	movq	_qfalse@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rdx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_2:
	callq	_FS_FOpenFileWrite
	jmp	LBB0_3
LBB0_6:
	movq	_ERR_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_Com_Error
	movl	$-1, %eax
	jmp	LBB0_13
LBB0_7:
	movq	_qtrue@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	callq	_FS_FOpenFileRead
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.8:
	movl	(%rbx), %ecx
	jmp	LBB0_9
LBB0_4:
	movq	_qtrue@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_5:
	callq	_FS_FOpenFileAppend
LBB0_3:
	movl	%eax, %ecx
	movl	%eax, (%rbx)
	xorl	%eax, %eax
	cmpl	$1, %ecx
	sbbl	%eax, %eax
LBB0_9:
	movq	_fsh@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	testl	%ecx, %ecx
	je	LBB0_10
## %bb.11:
	movslq	%ecx, %rcx
	movl	%eax, (%rdx,%rcx,8)
	movslq	(%rbx), %rcx
	jmp	LBB0_12
LBB0_10:
	xorl	%ecx, %ecx
LBB0_12:
	movl	%r14d, 4(%rdx,%rcx,8)
LBB0_13:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_7
	.long	L0_0_set_4
	.long	L0_0_set_5
	.end_data_region
                                        ## -- End function
	.comm	_qfalse,4,2                     ## @qfalse
	.comm	_qtrue,4,2                      ## @qtrue
	.comm	_ERR_FATAL,4,2                  ## @ERR_FATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FS_FOpenFileByMode: bad mode"

	.comm	_fsh,8,3                        ## @fsh
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FS_FOpenFileByMode             ; -- Begin function FS_FOpenFileByMode
	.p2align	2
_FS_FOpenFileByMode:                    ; @FS_FOpenFileByMode
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	sub	w8, w2, #128
	cmp	w8, #3
	b.hi	LBB0_3
; %bb.1:
	mov	x19, x1
Lloh0:
	adrp	x9, _qfalse@GOTPAGE
Lloh1:
	ldr	x9, [x9, _qfalse@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x9]
Lloh3:
	adrp	x9, lJTI0_0@PAGE
Lloh4:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	bl	_FS_FOpenFileWrite
	b	LBB0_8
LBB0_3:
Lloh5:
	adrp	x8, _ERR_FATAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERR_FATAL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_Com_Error
	mov	w0, #-1
	b	LBB0_13
LBB0_4:
Lloh10:
	adrp	x8, _qtrue@GOTPAGE
Lloh11:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_FS_FOpenFileRead
	cbz	x19, LBB0_13
; %bb.5:
	ldr	w8, [x19]
	b	LBB0_9
LBB0_6:
Lloh13:
	adrp	x8, _qtrue@GOTPAGE
Lloh14:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh15:
	ldr	w20, [x8]
LBB0_7:
	bl	_FS_FOpenFileAppend
LBB0_8:
	mov	x8, x0
	str	w0, [x19]
	cmp	w0, #0
	csetm	w0, eq
LBB0_9:
Lloh16:
	adrp	x9, _fsh@GOTPAGE
Lloh17:
	ldr	x9, [x9, _fsh@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cbz	w8, LBB0_11
; %bb.10:
	sbfiz	x8, x8, #3, #32
	str	w0, [x9, x8]
	ldrsw	x8, [x19]
	b	LBB0_12
LBB0_11:
	mov	x8, #0
LBB0_12:
	add	x8, x9, x8, lsl #3
	str	w20, [x8, #4]
LBB0_13:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
                                        ; -- End function
	.comm	_qfalse,4,2                     ; @qfalse
	.comm	_qtrue,4,2                      ; @qtrue
	.comm	_ERR_FATAL,4,2                  ; @ERR_FATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FS_FOpenFileByMode: bad mode"

	.comm	_fsh,8,3                        ; @fsh
.subsections_via_symbols
