	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movl	%edi, %ebx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	L_.str.1(%rip), %r13
	movq	_optarg@GOTPCREL(%rip), %r14
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_getopt
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$84, %eax
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$73, %eax
	je	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_usage
	jmp	LBB0_1
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r14), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_1
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r14), %r15
	jmp	LBB0_1
LBB0_7:
	xorl	%eax, %eax
	testl	%ebx, %ebx
	movq	_optind@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, %r13
	cmovleq	%rax, %r13
	cmovlel	%eax, %ecx
	subl	%ecx, %ebx
	cmpl	$2, %ebx
	je	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	_usage
LBB0_9:
	movq	_AF_LOCAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AF_UNSPEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %rcx
	callq	_socketpair
	cmpl	$-1, %eax
	jne	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_11:
	xorl	%eax, %eax
	callq	_fork
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	cmpl	$-1, %eax
	jne	LBB0_15
## %bb.13:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_14:
	movl	-56(%rbp), %edi
	callq	_close
	movl	-52(%rbp), %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_run_mandocd
LBB0_15:
	movl	-52(%rbp), %edi
	callq	_close
	movq	8(%r12,%r13,8), %rdi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_DIRECTORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_open
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_17
## %bb.16:
	movq	8(%r12,%r13,8), %rdx
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_17:
	movq	(%r12,%r13,8), %rdi
	callq	_chdir
	cmpl	$-1, %eax
	jne	LBB0_19
## %bb.18:
	movq	(%r12,%r13,8), %rdx
	leaq	L_.str.5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_19:
	movl	-56(%rbp), %edi
	movl	%ebx, %esi
	callq	_process_tree
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	$-1, %ecx
	sete	%cl
	movq	___stack_chk_guard@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	-48(%rbp), %rdx
	jne	LBB0_21
## %bb.20:
	movb	%cl, %al
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ascii"

L_.str.1:                               ## @.str.1
	.asciz	"I:T:"

	.comm	_optarg,8,3                     ## @optarg
	.comm	_optind,8,3                     ## @optind
	.comm	_AF_LOCAL,4,2                   ## @AF_LOCAL
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_AF_UNSPEC,4,2                  ## @AF_UNSPEC
L_.str.2:                               ## @.str.2
	.asciz	"socketpair"

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

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_DIRECTORY,4,2                ## @O_DIRECTORY
L_.str.4:                               ## @.str.4
	.asciz	"open(%s)"

L_.str.5:                               ## @.str.5
	.asciz	"chdir(%s)"

.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, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x1
	mov	x22, x0
	mov	x19, #0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x20, l_.str@PAGE
Lloh4:
	add	x20, x20, l_.str@PAGEOFF
Lloh5:
	adrp	x23, l_.str.1@PAGE
Lloh6:
	add	x23, x23, l_.str.1@PAGEOFF
Lloh7:
	adrp	x24, _optarg@GOTPAGE
Lloh8:
	ldr	x24, [x24, _optarg@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x23
	bl	_getopt
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w0, #84
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w0, #73
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_usage
	b	LBB0_1
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x20, [x24]
	b	LBB0_1
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x19, [x24]
	b	LBB0_1
LBB0_7:
Lloh9:
	adrp	x8, _optind@GOTPAGE
Lloh10:
	ldr	x8, [x8, _optind@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	w22, #0
	csel	w9, w8, wzr, gt
	csel	x23, x8, xzr, gt
	sub	w8, w22, w9
	cmp	w8, #2
	b.eq	LBB0_9
; %bb.8:
	bl	_usage
LBB0_9:
	add	x21, x21, x23, lsl #3
Lloh12:
	adrp	x8, _AF_LOCAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AF_LOCAL@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _AF_UNSPEC@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AF_UNSPEC@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	add	x3, sp, #16
	bl	_socketpair
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.10:
	bl	_fork
	cbnz	w0, LBB0_12
	b	LBB0_14
LBB0_11:
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_err
	bl	_fork
	cbz	w0, LBB0_14
LBB0_12:
	cmn	w0, #1
	b.ne	LBB0_15
; %bb.13:
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_14:
	ldr	w0, [sp, #16]
	bl	_close
	ldr	w0, [sp, #20]
	mov	x1, x20
	mov	x2, x19
	bl	_run_mandocd
LBB0_15:
	ldr	w0, [sp, #20]
	bl	_close
Lloh25:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
	ldr	x0, [x21, #8]
Lloh27:
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _O_DIRECTORY@GOTPAGE
Lloh29:
	ldr	x9, [x9, _O_DIRECTORY@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_open
	mov	x19, x0
	cmn	w0, #1
	b.ne	LBB0_17
; %bb.16:
	ldr	x8, [x21, #8]
	str	x8, [sp]
Lloh31:
	adrp	x1, l_.str.4@PAGE
Lloh32:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_17:
	ldr	x0, [x21]
	bl	_chdir
	cmn	w0, #1
	b.ne	LBB0_19
; %bb.18:
	ldr	x8, [x21]
	str	x8, [sp]
Lloh33:
	adrp	x1, l_.str.5@PAGE
Lloh34:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_19:
	ldr	w0, [sp, #16]
	mov	x1, x19
	bl	_process_tree
	cmn	w0, #1
	cset	w0, eq
	ldr	x8, [sp, #24]
Lloh35:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh36:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.20:
	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
	add	sp, sp, #96
	ret
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ascii"

l_.str.1:                               ; @.str.1
	.asciz	"I:T:"

	.comm	_optarg,8,3                     ; @optarg
	.comm	_optind,8,3                     ; @optind
	.comm	_AF_LOCAL,4,2                   ; @AF_LOCAL
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_AF_UNSPEC,4,2                  ; @AF_UNSPEC
l_.str.2:                               ; @.str.2
	.asciz	"socketpair"

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

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_DIRECTORY,4,2                ; @O_DIRECTORY
l_.str.4:                               ; @.str.4
	.asciz	"open(%s)"

l_.str.5:                               ; @.str.5
	.asciz	"chdir(%s)"

.subsections_via_symbols
