	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sanitise_stdfd                 ## -- Begin function sanitise_stdfd
	.p2align	4, 0x90
_sanitise_stdfd:                        ## @sanitise_stdfd
	.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	__PATH_DEVNULL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.1:
	movl	%eax, %r14d
	movq	_STDERR_FILENO@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	cmpl	%eax, %r14d
	jge	LBB0_10
## %bb.2:
	movq	_F_GETFL@GOTPCREL(%rip), %r13
	movq	_EBADF@GOTPCREL(%rip), %r12
	movl	%r14d, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %eax
	cmpl	%eax, %ebx
	jge	LBB0_10
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	movl	(%r13), %esi
	movl	%ebx, %edi
	callq	_fcntl
	cmpl	$-1, %eax
	jne	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	(%r12), %rax
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_dup2
	cmpl	$-1, %eax
	jne	LBB0_9
## %bb.6:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_8
LBB0_10:
	cmpl	%eax, %r14d
	jle	LBB0_11
## %bb.12:
	movl	%r14d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_close                          ## TAILCALL
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_strerror
	leaq	L_.str(%rip), %rsi
LBB0_8:
	movl	%ebx, %edi
	movq	%rax, %rdx
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	__PATH_DEVNULL,4,2              ## @_PATH_DEVNULL
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't open /dev/null: %s\n"

	.comm	_errno,8,3                      ## @errno
	.comm	_STDERR_FILENO,4,2              ## @STDERR_FILENO
	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_EBADF,8,3                      ## @EBADF
L_.str.1:                               ## @.str.1
	.asciz	"dup2: %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sanitise_stdfd                 ; -- Begin function sanitise_stdfd
	.p2align	2
_sanitise_stdfd:                        ; @sanitise_stdfd
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x8, __PATH_DEVNULL@GOTPAGE
Lloh1:
	ldr	x8, [x8, __PATH_DEVNULL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.1:
	mov	x19, x0
Lloh6:
	adrp	x21, _STDERR_FILENO@GOTPAGE
Lloh7:
	ldr	x21, [x21, _STDERR_FILENO@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w0, w8
	b.ge	LBB0_8
; %bb.2:
Lloh8:
	adrp	x23, _F_GETFL@GOTPAGE
Lloh9:
	ldr	x23, [x23, _F_GETFL@GOTPAGEOFF]
Lloh10:
	adrp	x22, _errno@GOTPAGE
Lloh11:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
	mov	x20, x19
Lloh12:
	adrp	x24, _EBADF@GOTPAGE
Lloh13:
	ldr	x24, [x24, _EBADF@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x21]
	cmp	w20, w8
	b.ge	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	w20, w20, #1
	ldr	w1, [x23]
	mov	x0, x20
	bl	_fcntl
	cmn	w0, #1
	b.ne	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x22]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_dup2
	cmn	w0, #1
	b.ne	LBB0_3
; %bb.7:
Lloh14:
	adrp	x8, _stderr@GOTPAGE
Lloh15:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh16:
	ldr	w19, [x8]
	ldr	x0, [x22]
	bl	_strerror
	mov	x2, x0
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_8:
	cmp	w19, w8
	b.le	LBB0_10
; %bb.9:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_close
LBB0_10:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
Lloh19:
	adrp	x8, _stderr@GOTPAGE
Lloh20:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh21:
	ldr	w19, [x8]
Lloh22:
	adrp	x8, _errno@GOTPAGE
Lloh23:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh24:
	ldr	x0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
LBB0_12:
	mov	x0, x19
	bl	_fprintf
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	__PATH_DEVNULL,4,2              ; @_PATH_DEVNULL
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't open /dev/null: %s\n"

	.comm	_errno,8,3                      ; @errno
	.comm	_STDERR_FILENO,4,2              ; @STDERR_FILENO
	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_EBADF,8,3                      ; @EBADF
l_.str.1:                               ; @.str.1
	.asciz	"dup2: %s\n"

.subsections_via_symbols
