	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_freopen                        ## -- Begin function freopen
	.p2align	4, 0x90
_freopen:                               ## @freopen
	.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	%rdx, %rbx
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	___parse_mode
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_fflush
	movl	(%rbx), %edi
	callq	_close
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	$438, %edx                      ## imm = 0x1B6
	callq	_open
	movl	%eax, (%rbx)
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.3:
	movl	$0, 4(%rbx)
	jmp	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
LBB0_4:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	___FILE_CAN_READ,4,2            ## @__FILE_CAN_READ
	.comm	___FILE_CAN_WRITE,4,2           ## @__FILE_CAN_WRITE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_freopen                        ; -- Begin function freopen
	.p2align	2
_freopen:                               ; @freopen
	.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, x2
	cbz	x2, LBB0_3
; %bb.1:
	mov	x20, x0
	mov	x0, x1
	bl	___parse_mode
	mov	x21, x0
	mov	x0, x19
	bl	_fflush
	ldr	w0, [x19]
	bl	_close
	mov	x0, x20
	mov	x1, x21
	mov	w2, #438
	bl	_open
	str	w0, [x19]
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.2:
	str	wzr, [x19, #4]
	b	LBB0_4
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w8, w8
Lloh3:
	adrp	x9, _errno@GOTPAGE
Lloh4:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh5:
	str	w8, [x9]
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	___FILE_CAN_READ,4,2            ; @__FILE_CAN_READ
	.comm	___FILE_CAN_WRITE,4,2           ; @__FILE_CAN_WRITE
.subsections_via_symbols
