	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_fork
_do_fork:                               ## @do_fork
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	xorl	%eax, %eax
	callq	_fork
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	je	LBB0_3
## %bb.10:
	movl	%eax, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_waitpid
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_3:
	movq	_listen_fd@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	incq	%rdi
	xorl	%esi, %esi
	callq	_ftruncate
	testq	%rax, %rax
	js	LBB0_4
## %bb.9:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_7
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EBADF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
LBB0_7:
	movl	$1, %edi
	popq	%rbp
	jmp	_errx                           ## TAILCALL
LBB0_8:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	popq	%rbp
	jmp	_err                            ## TAILCALL
LBB0_11:
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fork"

	.comm	_listen_fd,8,3                  ## @listen_fd
	.comm	_errno,8,3                      ## @errno
	.comm	_EBADF,8,3                      ## @EBADF
	.comm	_EINVAL,8,3                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"file descriptor still open in child"

L_.str.2:                               ## @.str.2
	.asciz	"unexpected error"

L_.str.3:                               ## @.str.3
	.asciz	"ftruncate succeeded"

	.no_dead_strip	_do_fork
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_fork
_do_fork:                               ; @do_fork
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	bl	_fork
	tbnz	w0, #31, LBB0_3
; %bb.1:
	cbz	w0, LBB0_4
; %bb.2:
	mov	x1, #0
	mov	w2, #0
	bl	_waitpid
	b	LBB0_11
LBB0_3:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_4:
Lloh2:
	adrp	x8, _listen_fd@GOTPAGE
Lloh3:
	ldr	x8, [x8, _listen_fd@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	add	x0, x8, #1
	mov	w1, #0
	bl	_ftruncate
	tbnz	x0, #63, LBB0_6
; %bb.5:
Lloh5:
	adrp	x1, l_.str.3@PAGE
Lloh6:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_6:
Lloh7:
	adrp	x8, _errno@GOTPAGE
Lloh8:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _EBADF@GOTPAGE
Lloh11:
	ldr	x9, [x9, _EBADF@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.7:
Lloh13:
	adrp	x9, _EINVAL@GOTPAGE
Lloh14:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_9:
	mov	w0, #1
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_errx
LBB0_10:
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_err
LBB0_11:
	mov	w0, #0
	bl	_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fork"

	.comm	_listen_fd,8,3                  ; @listen_fd
	.comm	_errno,8,3                      ; @errno
	.comm	_EBADF,8,3                      ; @EBADF
	.comm	_EINVAL,8,3                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"file descriptor still open in child"

l_.str.2:                               ; @.str.2
	.asciz	"unexpected error"

l_.str.3:                               ; @.str.3
	.asciz	"ftruncate succeeded"

	.no_dead_strip	_do_fork
.subsections_via_symbols
