	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fd_gets
_fd_gets:                               ## @fd_gets
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movslq	%edx, %rax
	leaq	(%rsi,%rax), %r12
	decq	%r12
	movq	%rsi, %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r12, %rbx
	jae	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_fd_read
	testq	%rax, %rax
	jle	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	1(%rbx), %rax
	cmpb	$10, (%rbx)
	movq	%rax, %rbx
	jne	LBB0_1
	jmp	LBB0_6
LBB0_5:
	movq	%rbx, %rax
LBB0_6:
	movb	$0, (%rax)
	cmpb	$0, (%r14)
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_strlen                         ## TAILCALL
LBB0_8:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_fd_gets
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fd_gets
_fd_gets:                               ; @fd_gets
	.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
	mov	x19, x1
	mov	x21, x0
	add	x8, x1, w2, sxtw
	sub	x22, x8, #1
	mov	x20, x1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x20, x22
	b.hs	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x21
	mov	x1, x20
	mov	w2, #1
	bl	_fd_read
	cmp	x0, #1
	b.lt	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldrb	w8, [x20], #1
	cmp	w8, #10
	b.ne	LBB0_1
LBB0_4:
	strb	wzr, [x20]
	ldrb	w8, [x19]
	cbz	w8, LBB0_6
; %bb.5:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_strlen
LBB0_6:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_fd_gets
.subsections_via_symbols
