	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_BIG_PIPE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r15, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	leaq	-32(%rbp), %rdi
	callq	_pipe
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_2:
	movl	-28(%rbp), %edi
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%eax, %eax
	callq	_fcntl
	cmpl	$-1, %eax
	je	LBB0_16
## %bb.3:
	movl	-28(%rbp), %edi
	movq	_F_SETFL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fcntl
	cmpl	$-1, %eax
	jne	LBB0_4
LBB0_16:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_printf
	movl	$1, %edi
	callq	_exit
LBB0_4:
	xorl	%eax, %eax
	callq	_fork
	testl	%eax, %eax
	je	LBB0_10
## %bb.5:
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.6:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_7:
	movl	-32(%rbp), %edi
	callq	_close
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_memset
	movl	$1000, %ebx                     ## imm = 0x3E8
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	-28(%rbp), %edi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_write_frame
	decl	%ebx
	jne	LBB0_8
## %bb.9:
	leaq	L_str(%rip), %rdi
	callq	_puts
	xorl	%edi, %edi
	callq	_exit
LBB0_10:
	movl	-28(%rbp), %edi
	callq	_close
	movl	-32(%rbp), %edi
	movq	%r14, %rsi
	movl	$256, %edx                      ## imm = 0x100
	callq	_read
	testl	%eax, %eax
	jne	LBB0_11
LBB0_15:
	xorl	%edi, %edi
	callq	_exit
LBB0_11:
	leaq	L_.str.3(%rip), %rbx
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	-32(%rbp), %edi
	movq	%r14, %rsi
	movl	$256, %edx                      ## imm = 0x100
	callq	_read
	testl	%eax, %eax
	je	LBB0_15
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	testl	%eax, %eax
	jns	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	$1, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_err
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_BIG_PIPE_SIZE,4,2              ## @BIG_PIPE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pipe failed"

	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
L_.str.1:                               ## @.str.1
	.asciz	"fcntl failed: %s\n"

	.comm	_errno,4,2                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"fork failed: %s\n"

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

L_str:                                  ## @str
	.asciz	"ok"

.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	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	sub	sp, sp, #16
Lloh0:
	adrp	x8, _BIG_PIPE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BIG_PIPE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	mov	x9, x20
Lloh3:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh4:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x20, #15
	and	x9, x9, #0x1fffffff0
	sub	x19, x8, x9
	mov	sp, x19
	sub	x0, x29, #40
	bl	_pipe
	tbz	x0, #63, LBB0_2
; %bb.1:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_2:
	ldur	w0, [x29, #-36]
Lloh7:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_fcntl
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.3:
Lloh10:
	adrp	x9, _F_SETFL@GOTPAGE
Lloh11:
	ldr	x9, [x9, _F_SETFL@GOTPAGEOFF]
	ldur	w8, [x29, #-36]
Lloh12:
	ldr	w1, [x9]
Lloh13:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w9, w9, w0
	str	x9, [sp, #-16]!
	mov	x0, x8
	bl	_fcntl
	add	sp, sp, #16
	cmn	w0, #1
	b.ne	LBB0_5
LBB0_4:
Lloh16:
	adrp	x8, _errno@GOTPAGE
Lloh17:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_strerror
	str	x0, [sp, #-16]!
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	add	sp, sp, #16
	mov	w0, #1
	bl	_exit
LBB0_5:
	bl	_fork
	cbz	w0, LBB0_11
; %bb.6:
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
Lloh21:
	adrp	x8, _errno@GOTPAGE
Lloh22:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	bl	_strerror
	str	x0, [sp, #-16]!
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_err
	add	sp, sp, #16
LBB0_8:
	ldur	w0, [x29, #-40]
	bl	_close
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_memset
	mov	w21, #1000
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w0, [x29, #-36]
	mov	x1, x19
	mov	x2, x20
	bl	_write_frame
	subs	w21, w21, #1
	b.ne	LBB0_9
; %bb.10:
Lloh26:
	adrp	x0, l_str@PAGE
Lloh27:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #0
	bl	_exit
LBB0_11:
	ldur	w0, [x29, #-36]
	bl	_close
	ldur	w0, [x29, #-40]
	mov	x1, x19
	mov	w2, #256
	bl	_read
	cbnz	w0, LBB0_13
LBB0_12:
	mov	w0, #0
	bl	_exit
LBB0_13:
Lloh28:
	adrp	x20, l_.str.3@PAGE
Lloh29:
	add	x20, x20, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	ldur	w0, [x29, #-40]
	mov	x1, x19
	mov	w2, #256
	bl	_read
	cbz	w0, LBB0_12
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	tbz	w0, #31, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	w0, #1
	mov	x1, x20
	bl	_err
	b	LBB0_14
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_BIG_PIPE_SIZE,4,2              ; @BIG_PIPE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pipe failed"

	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
l_.str.1:                               ; @.str.1
	.asciz	"fcntl failed: %s\n"

	.comm	_errno,4,2                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"fork failed: %s\n"

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

l_str:                                  ; @str
	.asciz	"ok"

.subsections_via_symbols
