	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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	$520, %rsp                      ## imm = 0x208
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_NUM_OPENS@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movq	%rbx, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	testl	%ebx, %ebx
	jle	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	movq	_O_RDONLY@GOTPCREL(%rip), %r13
	leaq	L_.str(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_open
	movl	%eax, (%r12,%rbx,4)
	cmpl	$-1, %eax
	je	LBB0_20
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_3
	jmp	LBB0_5
LBB0_1:
	xorl	%ebx, %ebx
LBB0_5:
	movslq	%ebx, %rax
	movl	-4(%r12,%rax,4), %r14d
	movl	%r14d, %edi
	callq	_closefrom
	movl	%r14d, %edi
	callq	_close
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	_fail
LBB0_7:
	cmpl	$2, %ebx
	jl	LBB0_12
## %bb.8:
	decl	%ebx
	movl	%ebx, %ebx
	xorl	%r14d, %r14d
	leaq	-560(%rbp), %r13
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%r14
	cmpq	%r14, %rbx
	je	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%r14,4), %edi
	movq	%r13, %rsi
	movl	$512, %edx                      ## imm = 0x200
	callq	_read
	cmpl	$-1, %eax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	leaq	L_.str.2(%rip), %rdi
	callq	_fail
	jmp	LBB0_11
LBB0_12:
	movl	(%r12), %r13d
	movl	%r13d, %edi
	callq	_closefrom
	cmpl	$0, (%r15)
	jle	LBB0_18
## %bb.13:
	movl	$1, %ebx
	leaq	L_.str.3(%rip), %r14
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	callq	_close
	cmpl	$-1, %eax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r14, %rdi
	callq	_fail
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jge	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	(%r12,%rbx,4), %r13d
	incq	%rbx
	jmp	LBB0_14
LBB0_18:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.19:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	xorl	%edi, %edi
	callq	_exit
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NUM_OPENS,4,2                  ## @NUM_OPENS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/null"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
L_.str.1:                               ## @.str.1
	.asciz	"failed to close highest fd"

L_.str.2:                               ## @.str.2
	.asciz	"closed descriptors it should not have"

L_.str.3:                               ## @.str.3
	.asciz	"failed to close from lowest fd"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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 w27, -72
	.cfi_offset w28, -80
	sub	sp, sp, #528
	mov	x19, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x22, _NUM_OPENS@GOTPAGE
Lloh4:
	ldr	x22, [x22, _NUM_OPENS@GOTPAGEOFF]
	ldr	w12, [x22]
	lsl	x8, x12, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x23, x9, x8
	mov	sp, x23
	cmp	w12, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x24, #0
Lloh7:
	adrp	x21, _O_RDONLY@GOTPAGE
Lloh8:
	ldr	x21, [x21, _O_RDONLY@GOTPAGEOFF]
Lloh9:
	adrp	x20, l_.str@PAGE
Lloh10:
	add	x20, x20, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x20
	bl	_open
	str	w0, [x23, x24, lsl #2]
	cmn	w0, #1
	b.eq	LBB0_20
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x22]
	cmp	x24, x8
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w24, #0
LBB0_5:
	sub	w21, w24, #1
	ldr	w20, [x23, w21, sxtw #2]
	mov	x0, x20
	bl	_closefrom
	mov	x0, x20
	bl	_close
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.6:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_fail
LBB0_7:
	cmp	w24, #1
	b.le	LBB0_12
; %bb.8:
Lloh13:
	adrp	x20, l_.str.2@PAGE
Lloh14:
	add	x20, x20, l_.str.2@PAGEOFF
	mov	x24, x23
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x24, x24, #4
	subs	x21, x21, #1
	b.eq	LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24]
	add	x1, x19, #8
	mov	w2, #512
	bl	_read
	cmn	w0, #1
	b.ne	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x20
	bl	_fail
	b	LBB0_9
LBB0_12:
	ldr	w21, [x23]
	mov	x0, x21
	bl	_closefrom
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.13:
	mov	w24, #1
Lloh15:
	adrp	x20, l_.str.3@PAGE
Lloh16:
	add	x20, x20, l_.str.3@PAGEOFF
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_close
	cmn	w0, #1
	b.eq	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x20
	bl	_fail
LBB0_16:                                ;   in Loop: Header=BB0_14 Depth=1
	ldrsw	x8, [x22]
	cmp	x24, x8
	b.ge	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w21, [x23, x24, lsl #2]
	add	x24, x24, #1
	b	LBB0_14
LBB0_18:
	ldur	x8, [x29, #-72]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.19:
	mov	w0, #0
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_20:
	mov	w0, #0
	bl	_exit
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_NUM_OPENS,4,2                  ; @NUM_OPENS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/null"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
l_.str.1:                               ; @.str.1
	.asciz	"failed to close highest fd"

l_.str.2:                               ; @.str.2
	.asciz	"closed descriptors it should not have"

l_.str.3:                               ; @.str.3
	.asciz	"failed to close from lowest fd"

.subsections_via_symbols
