	.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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	leaq	L_str(%rip), %rdi
	callq	_puts
	xorl	%eax, %eax
	callq	_devnull
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	$-1, %edx
	xorl	%eax, %eax
	callq	_fail
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
	callq	_ok
	xorl	%eax, %eax
	callq	_highest_fd
	cmpl	%eax, %ebx
	je	LBB0_4
## %bb.3:
	leaq	L_.str.3(%rip), %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_fail
LBB0_4:
	leaq	L_.str.3(%rip), %rdi
	callq	_ok
	leal	1(%rbx), %edi
	callq	_closefrom
	xorl	%eax, %eax
	callq	_highest_fd
	cmpl	%ebx, %eax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.5(%rip), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fail
LBB0_6:
	leaq	L_.str.5(%rip), %rdi
	callq	_ok
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_devnull
	xorl	%eax, %eax
	callq	_highest_fd
	addl	$16, %ebx
	cmpl	%ebx, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.7(%rip), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fail
LBB0_8:
	leaq	L_.str.7(%rip), %rdi
	callq	_ok
	movl	$11, %edi
	callq	_closefrom
	xorl	%eax, %eax
	callq	_highest_fd
	cmpl	$10, %eax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.5(%rip), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fail
LBB0_10:
	leaq	L_.str.5(%rip), %rdi
	callq	_ok
	movl	$6, %edi
	callq	_close
	testq	%rax, %rax
	js	LBB0_12
## %bb.11:
	movl	$8, %edi
	callq	_close
	testq	%rax, %rax
	jns	LBB0_13
LBB0_12:
	leaq	L_.str.8(%rip), %rdi
	callq	_fail_err
LBB0_13:
	leaq	L_.str.9(%rip), %rdi
	callq	_ok
	movl	$6, %edi
	callq	_close
	testq	%rax, %rax
	jne	LBB0_15
## %bb.14:
	leaq	L_.str.10(%rip), %rdi
	leaq	L_.str.11(%rip), %rsi
	xorl	%eax, %eax
	callq	_fail
LBB0_15:
	movq	_errno@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	_EBADF@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	je	LBB0_17
## %bb.16:
	leaq	L_.str.10(%rip), %rdi
	callq	_fail_err
LBB0_17:
	leaq	L_.str.10(%rip), %rdi
	callq	_ok
	movl	$8, %edi
	callq	_close
	testq	%rax, %rax
	jne	LBB0_19
## %bb.18:
	leaq	L_.str.12(%rip), %rdi
	leaq	L_.str.11(%rip), %rsi
	xorl	%eax, %eax
	callq	_fail
LBB0_19:
	movq	(%r14), %rax
	cmpq	(%rbx), %rax
	je	LBB0_21
## %bb.20:
	leaq	L_.str.12(%rip), %rdi
	callq	_fail_err
LBB0_21:
	leaq	L_.str.12(%rip), %rdi
	callq	_ok
	movl	$4, %edi
	callq	_closefrom
	xorl	%eax, %eax
	callq	_highest_fd
	cmpl	$3, %eax
	je	LBB0_23
## %bb.22:
	leaq	L_.str.5(%rip), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fail
LBB0_23:
	leaq	L_.str.5(%rip), %rdi
	callq	_ok
	xorl	%eax, %eax
	callq	_getpagesize
	movq	_PROT_READ@GOTPCREL(%rip), %rcx
	movq	_PROT_WRITE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_MAP_ANON@GOTPCREL(%rip), %rsi
	movq	_MAP_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rsi), %ecx
	xorl	%edi, %edi
	movl	%eax, %esi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, %rbx
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_25
## %bb.24:
	leaq	L_.str.13(%rip), %rdi
	callq	_fail_err
LBB0_25:
	leaq	L_.str.13(%rip), %rdi
	callq	_ok
	xorl	%eax, %eax
	callq	_fork
	testq	%rax, %rax
	js	LBB0_26
## %bb.27:
	jne	LBB0_31
## %bb.28:
	xorl	%edi, %edi
	callq	_closefrom
	xorl	%eax, %eax
	callq	_highest_fd
	testl	%eax, %eax
	js	LBB0_30
## %bb.29:
	leaq	L_.str.15(%rip), %rsi
	leaq	L_.str.6(%rip), %rdx
	movq	%rbx, %rdi
	movl	%eax, %ecx
	callq	_cfail
LBB0_30:
	leaq	L_.str.15(%rip), %rsi
	movq	%rbx, %rdi
	callq	_cok
	jmp	LBB0_31
LBB0_26:
	leaq	L_.str.14(%rip), %rdi
	callq	_fail_err
LBB0_31:
	xorl	%edi, %edi
	callq	_wait
	testq	%rax, %rax
	jns	LBB0_33
## %bb.32:
	leaq	L_.str.16(%rip), %rdi
	callq	_fail_err
LBB0_33:
	cmpq	$0, 16(%rbx)
	je	LBB0_35
## %bb.34:
	movq	(%rbx), %rdi
	movl	8(%rbx), %edx
	leaq	L_.str.17(%rip), %rsi
	xorl	%eax, %eax
	callq	_fail
LBB0_35:
	movq	(%rbx), %rdi
	callq	_ok
	xorl	%eax, %eax
	callq	_fork
	testq	%rax, %rax
	js	LBB0_36
## %bb.37:
	jne	LBB0_41
## %bb.38:
	movl	$-1, %edi
	callq	_closefrom
	xorl	%eax, %eax
	callq	_highest_fd
	testl	%eax, %eax
	js	LBB0_40
## %bb.39:
	leaq	L_.str.18(%rip), %rsi
	leaq	L_.str.6(%rip), %rdx
	movq	%rbx, %rdi
	movl	%eax, %ecx
	callq	_cfail
LBB0_40:
	leaq	L_.str.18(%rip), %rsi
	movq	%rbx, %rdi
	callq	_cok
	jmp	LBB0_41
LBB0_36:
	leaq	L_.str.14(%rip), %rdi
	callq	_fail_err
LBB0_41:
	xorl	%edi, %edi
	callq	_wait
	testq	%rax, %rax
	jns	LBB0_43
## %bb.42:
	leaq	L_.str.16(%rip), %rdi
	callq	_fail_err
LBB0_43:
	cmpq	$0, 16(%rbx)
	je	LBB0_45
## %bb.44:
	movq	(%rbx), %rdi
	movl	8(%rbx), %edx
	leaq	L_.str.17(%rip), %rsi
	xorl	%eax, %eax
	callq	_fail
LBB0_45:
	movq	(%rbx), %rdi
	callq	_ok
	movl	$1, %edi
	movl	$6, %esi
	callq	_dup2
	testq	%rax, %rax
	jns	LBB0_47
## %bb.46:
	leaq	L_.str.19(%rip), %rdi
	callq	_fail_err
LBB0_47:
	xorl	%eax, %eax
	callq	_highest_fd
	cmpl	$6, %eax
	je	LBB0_49
## %bb.48:
	leaq	L_.str.19(%rip), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fail
LBB0_49:
	leaq	L_.str.19(%rip), %rdi
	callq	_ok
	movl	$4, %edi
	callq	_closefrom
	xorl	%eax, %eax
	callq	_highest_fd
	cmpl	$3, %eax
	je	LBB0_51
## %bb.50:
	leaq	L_.str.5(%rip), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fail
LBB0_51:
	leaq	L_.str.5(%rip), %rdi
	callq	_ok
	movl	$32, %edi
	callq	_closefrom
	xorl	%eax, %eax
	callq	_highest_fd
	cmpl	$3, %eax
	je	LBB0_53
## %bb.52:
	leaq	L_.str.5(%rip), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fail
LBB0_53:
	leaq	L_.str.5(%rip), %rdi
	callq	_ok
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"open"

L_.str.2:                               ## @.str.2
	.asciz	"bad descriptor %d"

L_.str.3:                               ## @.str.3
	.asciz	"highest_fd"

L_.str.4:                               ## @.str.4
	.asciz	"bad descriptor %d != %d"

L_.str.5:                               ## @.str.5
	.asciz	"closefrom"

L_.str.6:                               ## @.str.6
	.asciz	"highest fd %d"

L_.str.7:                               ## @.str.7
	.asciz	"open 16"

L_.str.8:                               ## @.str.8
	.asciz	"close2 "

L_.str.9:                               ## @.str.9
	.asciz	"close 2"

L_.str.10:                              ## @.str.10
	.asciz	"close(6)"

L_.str.11:                              ## @.str.11
	.asciz	"did not fail"

	.comm	_errno,8,3                      ## @errno
	.comm	_EBADF,8,3                      ## @EBADF
L_.str.12:                              ## @.str.12
	.asciz	"close(8)"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_ANON,4,2                   ## @MAP_ANON
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.13:                              ## @.str.13
	.asciz	"mmap"

L_.str.14:                              ## @.str.14
	.asciz	"fork"

L_.str.15:                              ## @.str.15
	.asciz	"closefrom(0)"

L_.str.16:                              ## @.str.16
	.asciz	"wait"

L_.str.17:                              ## @.str.17
	.asciz	"%s"

L_.str.18:                              ## @.str.18
	.asciz	"closefrom(-1)"

L_.str.19:                              ## @.str.19
	.asciz	"dup2"

L_str:                                  ## @str
	.asciz	"1..15"

.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:
	sub	sp, sp, #48
	.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
Lloh0:
	adrp	x0, l_str@PAGE
Lloh1:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	bl	_devnull
	mov	x19, x0
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
	mov	w8, #-1
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fail
LBB0_2:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ok
	bl	_highest_fd
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w19, w0
	b.eq	LBB0_4
; %bb.3:
	stp	x19, x0, [sp]
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fail
LBB0_4:
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_ok
	add	w0, w19, #1
	bl	_closefrom
	bl	_highest_fd
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, w19
	b.eq	LBB0_6
; %bb.5:
	str	x0, [sp]
Lloh14:
	adrp	x0, l_.str.5@PAGE
Lloh15:
	add	x0, x0, l_.str.5@PAGEOFF
Lloh16:
	adrp	x1, l_.str.6@PAGE
Lloh17:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_fail
LBB0_6:
Lloh18:
	adrp	x0, l_.str.5@PAGE
Lloh19:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_ok
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_devnull
	bl	_highest_fd
                                        ; kill: def $w0 killed $w0 def $x0
	add	w8, w19, #16
	cmp	w0, w8
	b.eq	LBB0_8
; %bb.7:
	str	x0, [sp]
Lloh20:
	adrp	x0, l_.str.7@PAGE
Lloh21:
	add	x0, x0, l_.str.7@PAGEOFF
Lloh22:
	adrp	x1, l_.str.6@PAGE
Lloh23:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_fail
LBB0_8:
Lloh24:
	adrp	x0, l_.str.7@PAGE
Lloh25:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_ok
	mov	w0, #11
	bl	_closefrom
	bl	_highest_fd
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #10
	b.eq	LBB0_10
; %bb.9:
	str	x0, [sp]
Lloh26:
	adrp	x0, l_.str.5@PAGE
Lloh27:
	add	x0, x0, l_.str.5@PAGEOFF
Lloh28:
	adrp	x1, l_.str.6@PAGE
Lloh29:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_fail
LBB0_10:
Lloh30:
	adrp	x0, l_.str.5@PAGE
Lloh31:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_ok
	mov	w0, #6
	bl	_close
	tbnz	x0, #63, LBB0_12
; %bb.11:
	mov	w0, #8
	bl	_close
	tbz	x0, #63, LBB0_13
LBB0_12:
Lloh32:
	adrp	x0, l_.str.8@PAGE
Lloh33:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_fail_err
LBB0_13:
Lloh34:
	adrp	x0, l_.str.9@PAGE
Lloh35:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_ok
	mov	w0, #6
	bl	_close
	cbnz	x0, LBB0_15
; %bb.14:
Lloh36:
	adrp	x0, l_.str.10@PAGE
Lloh37:
	add	x0, x0, l_.str.10@PAGEOFF
Lloh38:
	adrp	x1, l_.str.11@PAGE
Lloh39:
	add	x1, x1, l_.str.11@PAGEOFF
	bl	_fail
LBB0_15:
Lloh40:
	adrp	x19, _errno@GOTPAGE
Lloh41:
	ldr	x19, [x19, _errno@GOTPAGEOFF]
	ldr	x8, [x19]
Lloh42:
	adrp	x20, _EBADF@GOTPAGE
Lloh43:
	ldr	x20, [x20, _EBADF@GOTPAGEOFF]
	ldr	x9, [x20]
	cmp	x8, x9
	b.eq	LBB0_17
; %bb.16:
Lloh44:
	adrp	x0, l_.str.10@PAGE
Lloh45:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_fail_err
LBB0_17:
Lloh46:
	adrp	x0, l_.str.10@PAGE
Lloh47:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_ok
	mov	w0, #8
	bl	_close
	cbnz	x0, LBB0_19
; %bb.18:
Lloh48:
	adrp	x0, l_.str.12@PAGE
Lloh49:
	add	x0, x0, l_.str.12@PAGEOFF
Lloh50:
	adrp	x1, l_.str.11@PAGE
Lloh51:
	add	x1, x1, l_.str.11@PAGEOFF
	bl	_fail
LBB0_19:
	ldr	x8, [x19]
	ldr	x9, [x20]
	cmp	x8, x9
	b.eq	LBB0_21
; %bb.20:
Lloh52:
	adrp	x0, l_.str.12@PAGE
Lloh53:
	add	x0, x0, l_.str.12@PAGEOFF
	bl	_fail_err
LBB0_21:
Lloh54:
	adrp	x0, l_.str.12@PAGE
Lloh55:
	add	x0, x0, l_.str.12@PAGEOFF
	bl	_ok
	mov	w0, #4
	bl	_closefrom
	bl	_highest_fd
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #3
	b.eq	LBB0_23
; %bb.22:
	str	x0, [sp]
Lloh56:
	adrp	x0, l_.str.5@PAGE
Lloh57:
	add	x0, x0, l_.str.5@PAGEOFF
Lloh58:
	adrp	x1, l_.str.6@PAGE
Lloh59:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_fail
LBB0_23:
Lloh60:
	adrp	x0, l_.str.5@PAGE
Lloh61:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_ok
	bl	_getpagesize
	mov	x1, x0
Lloh62:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh63:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh64:
	ldr	w8, [x8]
Lloh65:
	adrp	x9, _PROT_WRITE@GOTPAGE
Lloh66:
	ldr	x9, [x9, _PROT_WRITE@GOTPAGEOFF]
Lloh67:
	ldr	w9, [x9]
Lloh68:
	adrp	x10, _MAP_ANON@GOTPAGE
Lloh69:
	ldr	x10, [x10, _MAP_ANON@GOTPAGEOFF]
	orr	w2, w9, w8
Lloh70:
	ldr	w8, [x10]
Lloh71:
	adrp	x9, _MAP_SHARED@GOTPAGE
Lloh72:
	ldr	x9, [x9, _MAP_SHARED@GOTPAGEOFF]
Lloh73:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, #0
	mov	w4, #-1
	mov	w5, #0
	bl	_mmap
	mov	x19, x0
Lloh74:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh75:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh76:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_25
; %bb.24:
Lloh77:
	adrp	x0, l_.str.13@PAGE
Lloh78:
	add	x0, x0, l_.str.13@PAGEOFF
	bl	_fail_err
LBB0_25:
Lloh79:
	adrp	x0, l_.str.13@PAGE
Lloh80:
	add	x0, x0, l_.str.13@PAGEOFF
	bl	_ok
	bl	_fork
	tbnz	x0, #63, LBB0_30
; %bb.26:
	cbnz	x0, LBB0_31
; %bb.27:
	bl	_closefrom
	bl	_highest_fd
	tbnz	w0, #31, LBB0_29
; %bb.28:
	mov	x3, x0
Lloh81:
	adrp	x1, l_.str.15@PAGE
Lloh82:
	add	x1, x1, l_.str.15@PAGEOFF
Lloh83:
	adrp	x2, l_.str.6@PAGE
Lloh84:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_cfail
LBB0_29:
Lloh85:
	adrp	x1, l_.str.15@PAGE
Lloh86:
	add	x1, x1, l_.str.15@PAGEOFF
	mov	x0, x19
	bl	_cok
	b	LBB0_31
LBB0_30:
Lloh87:
	adrp	x0, l_.str.14@PAGE
Lloh88:
	add	x0, x0, l_.str.14@PAGEOFF
	bl	_fail_err
LBB0_31:
	mov	x0, #0
	bl	_wait
	tbz	x0, #63, LBB0_33
; %bb.32:
Lloh89:
	adrp	x0, l_.str.16@PAGE
Lloh90:
	add	x0, x0, l_.str.16@PAGEOFF
	bl	_fail_err
LBB0_33:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_35
; %bb.34:
	ldr	x0, [x19]
	ldr	w8, [x19, #8]
	str	x8, [sp]
Lloh91:
	adrp	x1, l_.str.17@PAGE
Lloh92:
	add	x1, x1, l_.str.17@PAGEOFF
	bl	_fail
LBB0_35:
	ldr	x0, [x19]
	bl	_ok
	bl	_fork
	tbnz	x0, #63, LBB0_40
; %bb.36:
	cbnz	x0, LBB0_41
; %bb.37:
	mov	w0, #-1
	bl	_closefrom
	bl	_highest_fd
	tbnz	w0, #31, LBB0_39
; %bb.38:
	mov	x3, x0
Lloh93:
	adrp	x1, l_.str.18@PAGE
Lloh94:
	add	x1, x1, l_.str.18@PAGEOFF
Lloh95:
	adrp	x2, l_.str.6@PAGE
Lloh96:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_cfail
LBB0_39:
Lloh97:
	adrp	x1, l_.str.18@PAGE
Lloh98:
	add	x1, x1, l_.str.18@PAGEOFF
	mov	x0, x19
	bl	_cok
	b	LBB0_41
LBB0_40:
Lloh99:
	adrp	x0, l_.str.14@PAGE
Lloh100:
	add	x0, x0, l_.str.14@PAGEOFF
	bl	_fail_err
LBB0_41:
	mov	x0, #0
	bl	_wait
	tbz	x0, #63, LBB0_43
; %bb.42:
Lloh101:
	adrp	x0, l_.str.16@PAGE
Lloh102:
	add	x0, x0, l_.str.16@PAGEOFF
	bl	_fail_err
LBB0_43:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_45
; %bb.44:
	ldr	x0, [x19]
	ldr	w8, [x19, #8]
	str	x8, [sp]
Lloh103:
	adrp	x1, l_.str.17@PAGE
Lloh104:
	add	x1, x1, l_.str.17@PAGEOFF
	bl	_fail
LBB0_45:
	ldr	x0, [x19]
	bl	_ok
	mov	w0, #1
	mov	w1, #6
	bl	_dup2
	tbz	x0, #63, LBB0_47
; %bb.46:
Lloh105:
	adrp	x0, l_.str.19@PAGE
Lloh106:
	add	x0, x0, l_.str.19@PAGEOFF
	bl	_fail_err
LBB0_47:
	bl	_highest_fd
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #6
	b.eq	LBB0_49
; %bb.48:
	str	x0, [sp]
Lloh107:
	adrp	x0, l_.str.19@PAGE
Lloh108:
	add	x0, x0, l_.str.19@PAGEOFF
Lloh109:
	adrp	x1, l_.str.6@PAGE
Lloh110:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_fail
LBB0_49:
Lloh111:
	adrp	x0, l_.str.19@PAGE
Lloh112:
	add	x0, x0, l_.str.19@PAGEOFF
	bl	_ok
	mov	w0, #4
	bl	_closefrom
	bl	_highest_fd
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #3
	b.eq	LBB0_51
; %bb.50:
	str	x0, [sp]
Lloh113:
	adrp	x0, l_.str.5@PAGE
Lloh114:
	add	x0, x0, l_.str.5@PAGEOFF
Lloh115:
	adrp	x1, l_.str.6@PAGE
Lloh116:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_fail
LBB0_51:
Lloh117:
	adrp	x0, l_.str.5@PAGE
Lloh118:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_ok
	mov	w0, #32
	bl	_closefrom
	bl	_highest_fd
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #3
	b.eq	LBB0_53
; %bb.52:
	str	x0, [sp]
Lloh119:
	adrp	x0, l_.str.5@PAGE
Lloh120:
	add	x0, x0, l_.str.5@PAGEOFF
Lloh121:
	adrp	x1, l_.str.6@PAGE
Lloh122:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_fail
LBB0_53:
Lloh123:
	adrp	x0, l_.str.5@PAGE
Lloh124:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_ok
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh58, Lloh59
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpLdrGotLdr	Lloh71, Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpAdd	Lloh60, Lloh61
	.loh AdrpAdd	Lloh77, Lloh78
	.loh AdrpAdd	Lloh79, Lloh80
	.loh AdrpAdd	Lloh83, Lloh84
	.loh AdrpAdd	Lloh81, Lloh82
	.loh AdrpAdd	Lloh85, Lloh86
	.loh AdrpAdd	Lloh87, Lloh88
	.loh AdrpAdd	Lloh89, Lloh90
	.loh AdrpAdd	Lloh91, Lloh92
	.loh AdrpAdd	Lloh95, Lloh96
	.loh AdrpAdd	Lloh93, Lloh94
	.loh AdrpAdd	Lloh97, Lloh98
	.loh AdrpAdd	Lloh99, Lloh100
	.loh AdrpAdd	Lloh101, Lloh102
	.loh AdrpAdd	Lloh103, Lloh104
	.loh AdrpAdd	Lloh105, Lloh106
	.loh AdrpAdd	Lloh109, Lloh110
	.loh AdrpAdd	Lloh107, Lloh108
	.loh AdrpAdd	Lloh111, Lloh112
	.loh AdrpAdd	Lloh115, Lloh116
	.loh AdrpAdd	Lloh113, Lloh114
	.loh AdrpAdd	Lloh117, Lloh118
	.loh AdrpAdd	Lloh121, Lloh122
	.loh AdrpAdd	Lloh119, Lloh120
	.loh AdrpAdd	Lloh123, Lloh124
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"open"

l_.str.2:                               ; @.str.2
	.asciz	"bad descriptor %d"

l_.str.3:                               ; @.str.3
	.asciz	"highest_fd"

l_.str.4:                               ; @.str.4
	.asciz	"bad descriptor %d != %d"

l_.str.5:                               ; @.str.5
	.asciz	"closefrom"

l_.str.6:                               ; @.str.6
	.asciz	"highest fd %d"

l_.str.7:                               ; @.str.7
	.asciz	"open 16"

l_.str.8:                               ; @.str.8
	.asciz	"close2 "

l_.str.9:                               ; @.str.9
	.asciz	"close 2"

l_.str.10:                              ; @.str.10
	.asciz	"close(6)"

l_.str.11:                              ; @.str.11
	.asciz	"did not fail"

	.comm	_errno,8,3                      ; @errno
	.comm	_EBADF,8,3                      ; @EBADF
l_.str.12:                              ; @.str.12
	.asciz	"close(8)"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_ANON,4,2                   ; @MAP_ANON
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.13:                              ; @.str.13
	.asciz	"mmap"

l_.str.14:                              ; @.str.14
	.asciz	"fork"

l_.str.15:                              ; @.str.15
	.asciz	"closefrom(0)"

l_.str.16:                              ; @.str.16
	.asciz	"wait"

l_.str.17:                              ; @.str.17
	.asciz	"%s"

l_.str.18:                              ; @.str.18
	.asciz	"closefrom(-1)"

l_.str.19:                              ; @.str.19
	.asciz	"dup2"

l_str:                                  ; @str
	.asciz	"1..15"

.subsections_via_symbols
