	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function run
_run:                                   ## @run
	.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	_buffer_size@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movl	$1, %edi
	callq	_calloc
	movq	_dbuf@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rdx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_err
LBB0_2:
	movq	_verbose@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	je	LBB0_4
## %bb.3:
	leaq	L_str.16(%rip), %rdi
	callq	_puts
LBB0_4:
	xorl	%eax, %eax
	callq	_pty_open
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_ptsname
	movl	%eax, %edi
	callq	_child_spawn
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	cmpq	$0, (%r13)
	je	LBB0_6
## %bb.5:
	leaq	L_str.15(%rip), %rdi
	callq	_puts
LBB0_6:
	movl	$1, %edi
	callq	_sleep
	cmpq	$0, (%r14)
	je	LBB0_9
## %bb.7:
	movq	_dbuf@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	%cl, %edx
	movq	%rdx, (%rax,%rcx,8)
	incq	%rcx
	cmpq	(%r14), %rcx
	jb	LBB0_8
LBB0_9:
	cmpq	$0, (%r13)
	je	LBB0_11
## %bb.10:
	leaq	L_str.14(%rip), %rdi
	callq	_puts
LBB0_11:
	movq	_packets@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	je	LBB0_19
## %bb.12:
	xorl	%r12d, %r12d
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%r12
	cmpq	(%r15), %r12
	jae	LBB0_19
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%r13)
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	(%r14), %rsi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	_dbuf@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	(%r14), %rdx
	movl	%ebx, %edi
	callq	_write
	cmpl	$-1, %eax
	je	LBB0_31
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpq	$0, (%r13)
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_13 Depth=1
	leaq	L_.str.6(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_18
LBB0_31:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_err
LBB0_19:
	cmpq	$0, (%r13)
	je	LBB0_21
## %bb.20:
	leaq	L_str.13(%rip), %rdi
	callq	_puts
LBB0_21:
	leaq	-44(%rbp), %rsi
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	xorl	%edx, %edx
	callq	_waitpid
	cmpl	$-1, %eax
	jne	LBB0_23
## %bb.22:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.8(%rip), %rsi
	xorl	%eax, %eax
	callq	_err
LBB0_23:
	movl	-44(%rbp), %edi
	callq	_WIFEXITED
	testl	%eax, %eax
	je	LBB0_25
## %bb.24:
	movl	-44(%rbp), %edi
	callq	_WEXITSTATUS
	testq	%rax, %rax
	je	LBB0_26
LBB0_25:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.9(%rip), %rsi
	callq	_errx
LBB0_26:
	cmpq	$0, (%r13)
	je	LBB0_28
## %bb.27:
	leaq	L_str.12(%rip), %rdi
	callq	_puts
LBB0_28:
	movl	%ebx, %edi
	callq	_close
	cmpq	$0, (%r13)
	je	LBB0_30
## %bb.29:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_30:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_buffer_size,8,3                ## @buffer_size
	.comm	_dbuf,8,3                       ## @dbuf
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"malloc(%zu)"

	.comm	_verbose,8,3                    ## @verbose
	.comm	_packets,8,3                    ## @packets
L_.str.4:                               ## @.str.4
	.asciz	"parent: attempting to write %zu bytes to PTY\n"

L_.str.5:                               ## @.str.5
	.asciz	"parent: write()"

L_.str.6:                               ## @.str.6
	.asciz	"parent: wrote %zd bytes to PTY\n"

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

L_.str.9:                               ## @.str.9
	.asciz	"child failed"

L_str:                                  ## @str
	.asciz	"parent: exiting"

L_str.12:                               ## @str.12
	.asciz	"parent: closing PTY"

L_str.13:                               ## @str.13
	.asciz	"parent: waiting for child to exit"

L_str.14:                               ## @str.14
	.asciz	"parent: writing"

L_str.15:                               ## @str.15
	.asciz	"parent: sleeping to make sure child is ready"

L_str.16:                               ## @str.16
	.asciz	"parent: started; opening PTY and spawning child"

	.no_dead_strip	_run
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function run
_run:                                   ; @run
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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 w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x25, _buffer_size@GOTPAGE
Lloh1:
	ldr	x25, [x25, _buffer_size@GOTPAGEOFF]
	ldr	x1, [x25]
	mov	w0, #1
	bl	_calloc
Lloh2:
	adrp	x26, _dbuf@GOTPAGE
Lloh3:
	ldr	x26, [x26, _dbuf@GOTPAGEOFF]
	str	x0, [x26]
Lloh4:
	adrp	x24, _EXIT_FAILURE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _EXIT_FAILURE@GOTPAGEOFF]
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x24]
	ldr	x8, [x25]
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_err
LBB0_2:
Lloh8:
	adrp	x23, _verbose@GOTPAGE
Lloh9:
	ldr	x23, [x23, _verbose@GOTPAGEOFF]
	ldr	x8, [x23]
	cbz	x8, LBB0_4
; %bb.3:
Lloh10:
	adrp	x0, l_str.16@PAGE
Lloh11:
	add	x0, x0, l_str.16@PAGEOFF
	bl	_puts
LBB0_4:
	bl	_pty_open
	mov	x19, x0
	bl	_ptsname
	bl	_child_spawn
	mov	x20, x0
	ldr	x8, [x23]
	cbz	x8, LBB0_6
; %bb.5:
Lloh12:
	adrp	x0, l_str.15@PAGE
Lloh13:
	add	x0, x0, l_str.15@PAGEOFF
	bl	_puts
LBB0_6:
	mov	w0, #1
	bl	_sleep
	ldr	x8, [x25]
	cbz	x8, LBB0_9
; %bb.7:
	mov	x8, #0
	ldr	x9, [x26]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	and	x10, x8, #0xff
	str	x10, [x9, x8, lsl #3]
	add	x8, x8, #1
	ldr	x10, [x25]
	cmp	x8, x10
	b.lo	LBB0_8
LBB0_9:
	ldr	x8, [x23]
	cbz	x8, LBB0_11
; %bb.10:
Lloh14:
	adrp	x0, l_str.14@PAGE
Lloh15:
	add	x0, x0, l_str.14@PAGEOFF
	bl	_puts
LBB0_11:
Lloh16:
	adrp	x27, _packets@GOTPAGE
Lloh17:
	ldr	x27, [x27, _packets@GOTPAGEOFF]
	ldr	x8, [x27]
	cbz	x8, LBB0_20
; %bb.12:
	mov	x28, #0
Lloh18:
	adrp	x21, l_.str.6@PAGE
Lloh19:
	add	x21, x21, l_.str.6@PAGEOFF
Lloh20:
	adrp	x22, l_.str.4@PAGE
Lloh21:
	add	x22, x22, l_.str.4@PAGEOFF
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x28, x28, #1
	ldr	x8, [x27]
	cmp	x28, x8
	b.hs	LBB0_20
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	cbz	x8, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x8, [x25]
	str	x8, [sp]
	mov	x0, x22
	bl	_printf
LBB0_16:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	x1, [x26]
	ldr	x2, [x25]
	mov	x0, x19
	bl	_write
                                        ; kill: def $w0 killed $w0 def $x0
	cmn	w0, #1
	b.eq	LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x8, [x23]
	cbz	x8, LBB0_13
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
	str	x0, [sp]
	mov	x0, x21
	bl	_printf
	b	LBB0_13
LBB0_19:
	ldr	w0, [x24]
Lloh22:
	adrp	x1, l_.str.5@PAGE
Lloh23:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_err
LBB0_20:
	ldr	x8, [x23]
	cbz	x8, LBB0_22
; %bb.21:
Lloh24:
	adrp	x0, l_str.13@PAGE
Lloh25:
	add	x0, x0, l_str.13@PAGEOFF
	bl	_puts
LBB0_22:
	add	x1, sp, #12
	mov	x0, x20
	mov	w2, #0
	bl	_waitpid
	cmn	w0, #1
	b.ne	LBB0_24
; %bb.23:
	ldr	w0, [x24]
Lloh26:
	adrp	x1, l_.str.8@PAGE
Lloh27:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_err
LBB0_24:
	ldr	w0, [sp, #12]
	bl	_WIFEXITED
	cbz	w0, LBB0_26
; %bb.25:
	ldr	w0, [sp, #12]
	bl	_WEXITSTATUS
	cbz	x0, LBB0_27
LBB0_26:
	ldr	w0, [x24]
Lloh28:
	adrp	x1, l_.str.9@PAGE
Lloh29:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_errx
LBB0_27:
	ldr	x8, [x23]
	cbz	x8, LBB0_29
; %bb.28:
Lloh30:
	adrp	x0, l_str.12@PAGE
Lloh31:
	add	x0, x0, l_str.12@PAGEOFF
	bl	_puts
LBB0_29:
	mov	x0, x19
	bl	_close
	ldr	x8, [x23]
	cbz	x8, LBB0_31
; %bb.30:
Lloh32:
	adrp	x0, l_str@PAGE
Lloh33:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_31:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_buffer_size,8,3                ; @buffer_size
	.comm	_dbuf,8,3                       ; @dbuf
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"malloc(%zu)"

	.comm	_verbose,8,3                    ; @verbose
	.comm	_packets,8,3                    ; @packets
l_.str.4:                               ; @.str.4
	.asciz	"parent: attempting to write %zu bytes to PTY\n"

l_.str.5:                               ; @.str.5
	.asciz	"parent: write()"

l_.str.6:                               ; @.str.6
	.asciz	"parent: wrote %zd bytes to PTY\n"

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

l_.str.9:                               ; @.str.9
	.asciz	"child failed"

l_str:                                  ; @str
	.asciz	"parent: exiting"

l_str.12:                               ; @str.12
	.asciz	"parent: closing PTY"

l_str.13:                               ; @str.13
	.asciz	"parent: waiting for child to exit"

l_str.14:                               ; @str.14
	.asciz	"parent: writing"

l_str.15:                               ; @str.15
	.asciz	"parent: sleeping to make sure child is ready"

l_str.16:                               ; @str.16
	.asciz	"parent: started; opening PTY and spawning child"

	.no_dead_strip	_run
.subsections_via_symbols
