	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cat_fd
_cat_fd:                                ## @cat_fd
	.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
	movl	%ecx, %r15d
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_BUFLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r12, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_write_retry
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.1:
	cltq
	cmpq	%rbx, %rax
	jne	LBB0_4
## %bb.2:
	movl	%r15d, %edi
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_read
	testl	%eax, %eax
	je	LBB0_10
## %bb.3:
	movl	%eax, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r14d, %r14d
	js	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%r14d, %edi
	callq	_infile_newdata
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_write_retry
	cmpl	%r14d, %eax
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	addl	%r14d, %ebx
	movl	%r15d, %edi
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_read
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_6
	jmp	LBB0_10
LBB0_4:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_maybe_warn
	movl	$-1, %ebx
	jmp	LBB0_12
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_maybe_warn
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_maybe_warn
LBB0_10:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movl	%ebx, (%rax)
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFLEN,4,2                     ## @BUFLEN
	.comm	_STDOUT_FILENO,4,2              ## @STDOUT_FILENO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write to stdout"

L_.str.1:                               ## @.str.1
	.asciz	"read from fd %d"

	.no_dead_strip	_cat_fd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cat_fd
_cat_fd:                                ; @cat_fd
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x21, x3
	mov	x20, x2
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _BUFLEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BUFLEN@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	mov	x9, x22
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x22, #15
	and	x9, x9, #0x1fffffff0
	sub	x23, x8, x9
	mov	sp, x23
Lloh8:
	adrp	x25, _STDOUT_FILENO@GOTPAGE
Lloh9:
	ldr	x25, [x25, _STDOUT_FILENO@GOTPAGEOFF]
	ldr	w8, [x25]
	stp	x0, x1, [sp, #-16]!
	mov	x0, x8
	bl	_write_retry
	add	sp, sp, #16
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	cmn	w0, #1
	ccmp	x8, x19, #0, ne
	b.eq	LBB0_2
; %bb.1:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_maybe_warn
	mov	w19, #-1
	b	LBB0_10
LBB0_2:
	mov	x0, x21
	mov	x1, x23
	mov	x2, x22
	bl	_read
	cbz	w0, LBB0_8
; %bb.3:
	mov	x24, x0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	tbnz	w24, #31, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_infile_newdata
	ldr	w0, [x25]
	stp	x23, x24, [sp, #-16]!
	bl	_write_retry
	add	sp, sp, #16
	cmp	w0, w24
	b.ne	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w19, w24, w19
	mov	x0, x21
	mov	x1, x23
	mov	x2, x22
	bl	_read
	mov	x24, x0
	cbnz	w0, LBB0_4
	b	LBB0_8
LBB0_7:
	str	x21, [sp, #-16]!
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_maybe_warn
	add	sp, sp, #16
LBB0_8:
	cbz	x20, LBB0_10
LBB0_9:
	str	w19, [x20]
LBB0_10:
	ldur	x8, [x29, #-72]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.11:
	mov	x0, x19
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_maybe_warn
	cbnz	x20, LBB0_9
	b	LBB0_10
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFLEN,4,2                     ; @BUFLEN
	.comm	_STDOUT_FILENO,4,2              ; @STDOUT_FILENO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write to stdout"

l_.str.1:                               ; @.str.1
	.asciz	"read from fd %d"

	.no_dead_strip	_cat_fd
.subsections_via_symbols
