	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dtrace_freopen                 ## -- Begin function dtrace_freopen
	.p2align	4, 0x90
_dtrace_freopen:                        ## @dtrace_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %eax
	movq	%rcx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	16(%rbp), %r9
	movq	24(%rbp), %rcx
	movq	(%rdx), %r13
	movq	%rcx, (%rsp)
	movq	%r8, %rcx
	movl	%eax, %r8d
	callq	_dtrace_sprintf
	movl	%eax, %r14d
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.1:
	cmpl	$-1, %r14d
	je	LBB0_11
## %bb.2:
	cmpq	$0, (%r13)
	je	LBB0_6
## %bb.3:
	movq	8(%r13), %rdi
	movq	_DT_FREOPEN_RESTORE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_4
LBB0_6:
	movq	(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %rbx
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_fclose
LBB0_10:
	movq	%rbx, 16(%r12)
	jmp	LBB0_11
LBB0_7:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	movq	%rax, %rdi
	callq	_strlen
	movq	%rax, %rbx
	movq	(%r12), %rdi
	callq	_strlen
	addl	%eax, %ebx
	addl	$80, %ebx
	movl	%ebx, %edi
	callq	_alloca
	movq	%rax, %r13
	movq	(%r12), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, %r8
	xorl	%eax, %eax
	callq	_snprintf
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_dt_handle_liberr
	testl	%eax, %eax
	cmovnel	%eax, %r14d
	jmp	LBB0_11
LBB0_4:
	movq	(%r12), %rdi
	movl	(%rbx), %esi
	callq	_strcmp
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_assert
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.5:
	callq	_fclose
	movq	$0, 16(%r12)
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DT_FREOPEN_RESTORE,4,2         ## @DT_FREOPEN_RESTORE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"a"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"couldn't freopen() \"%s\": %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dtrace_freopen                 ; -- Begin function dtrace_freopen
	.p2align	2
_dtrace_freopen:                        ; @dtrace_freopen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x21, x3
	mov	x22, x1
	mov	x20, x0
	ldr	x23, [x2]
	mov	x3, x4
	mov	x4, x5
	mov	x5, x6
	mov	x6, x7
	bl	_dtrace_sprintf
	mov	x19, x0
	cbz	x22, LBB0_11
; %bb.1:
	cmn	w19, #1
	b.eq	LBB0_11
; %bb.2:
	ldr	x8, [x23]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	x0, [x23, #8]
Lloh0:
	adrp	x22, _DT_FREOPEN_RESTORE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DT_FREOPEN_RESTORE@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_strcmp
	cbz	x0, LBB0_9
LBB0_4:
	ldr	x0, [x20]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_8
; %bb.5:
	mov	x22, x0
	ldr	x0, [x20, #16]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_fclose
LBB0_7:
	str	x22, [x20, #16]
	b	LBB0_11
LBB0_8:
Lloh4:
	adrp	x24, _errno@GOTPAGE
Lloh5:
	ldr	x24, [x24, _errno@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_strerror
	bl	_strlen
	mov	x22, x0
	ldr	x0, [x20]
	bl	_strlen
	add	w8, w0, w22
	add	w22, w8, #80
	mov	x0, x22
	bl	_alloca
	mov	x23, x0
	ldr	x25, [x20]
	ldr	w0, [x24]
	bl	_strerror
	stp	x25, x0, [sp]
Lloh6:
	adrp	x2, l_.str.1@PAGE
Lloh7:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x23
	mov	x1, x22
	bl	_snprintf
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_dt_handle_liberr
	cmp	w0, #0
	csel	w19, w19, w0, eq
	b	LBB0_11
LBB0_9:
	ldr	x0, [x20]
	ldr	w1, [x22]
	bl	_strcmp
	cmp	x0, #0
	cset	w0, eq
	bl	_assert
	ldr	x0, [x20, #16]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_fclose
	str	xzr, [x20, #16]
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DT_FREOPEN_RESTORE,4,2         ; @DT_FREOPEN_RESTORE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"a"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"couldn't freopen() \"%s\": %s"

.subsections_via_symbols
