	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fgets                          ## -- Begin function fgets
	.p2align	4, 0x90
_fgets:                                 ## @fgets
	.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	%rdx, %r15
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	%rdx, %rdi
	callq	_FLOCKFILE_CANCELSAFE
	movq	%r15, %rdi
	movl	$-1, %esi
	callq	_ORIENT
	testl	%r13d, %r13d
	jle	LBB0_1
## %bb.2:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	decl	%r13d
	je	LBB0_12
## %bb.3:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	testq	%rax, %rax
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	___srefill
	testq	%rax, %rax
	jne	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r15), %rax
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r15), %rbx
	movslq	%r13d, %r14
	cmpq	%r14, %rax
	cmovbq	%rax, %r14
	movq	%rbx, %rdi
	movl	$10, %esi
	movq	%r14, %rdx
	callq	_memchr
	testq	%rax, %rax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	subq	%r14, (%r15)
	addq	%r14, 8(%r15)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_memcpy
	addq	%r14, %r12
	subl	%r14d, %r13d
	jne	LBB0_4
LBB0_12:
	movb	$0, (%r12)
	jmp	LBB0_13
LBB0_1:
	movq	___SERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%r15)
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_10:
	incq	%rax
	movq	%rax, %r14
	subq	%rbx, %r14
	subq	%r14, (%r15)
	movq	%rax, 8(%r15)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_memcpy
	movb	$0, (%r12,%r14)
LBB0_13:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_14:
	xorl	%eax, %eax
	callq	_FUNLOCKFILE_CANCELSAFE
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r15, %rdi
	callq	___sfeof
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_14
## %bb.7:
	cmpq	-48(%rbp), %r12                 ## 8-byte Folded Reload
	jne	LBB0_12
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	___SERR,4,2                     ## @__SERR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fgets                          ; -- Begin function fgets
	.p2align	2
_fgets:                                 ; @fgets
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	mov	x0, x2
	bl	_FLOCKFILE_CANCELSAFE
	mov	x0, x20
	mov	w1, #-1
	bl	_ORIENT
	cmp	w22, #0
	b.le	LBB0_9
; %bb.1:
	mov	x21, x19
	subs	w24, w22, #1
	b.eq	LBB0_8
; %bb.2:
	mov	x21, x19
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	cbnz	x8, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	bl	___srefill
	cbnz	x0, LBB0_13
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20]
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x22, [x20, #8]
	sxtw	x9, w24
	cmp	x8, x9
	csel	x23, x8, x9, lo
	mov	x0, x22
	mov	w1, #10
	mov	x2, x23
	bl	_memchr
	cbnz	x0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldp	x8, x9, [x20]
	sub	x8, x8, x23
	add	x9, x9, x23
	stp	x8, x9, [x20]
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_memcpy
	add	x21, x21, x23
	subs	w24, w24, w23
	b.ne	LBB0_3
LBB0_8:
	strb	wzr, [x21]
	b	LBB0_11
LBB0_9:
	mov	x22, #0
Lloh0:
	adrp	x8, ___SERR@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___SERR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
	str	w8, [x20, #16]
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _errno@GOTPAGE
Lloh7:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh8:
	str	w8, [x9]
	b	LBB0_12
LBB0_10:
	add	x8, x0, #1
	ldr	x9, [x20]
	sub	x23, x8, x22
	sub	x9, x9, x23
	stp	x9, x8, [x20]
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_memcpy
	strb	wzr, [x21, x23]
LBB0_11:
	mov	x22, x19
LBB0_12:
	bl	_FUNLOCKFILE_CANCELSAFE
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
	mov	x0, x20
	bl	___sfeof
	mov	x22, #0
	cbz	w0, LBB0_12
; %bb.14:
	cmp	x21, x19
	b.ne	LBB0_8
	b	LBB0_12
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	___SERR,4,2                     ; @__SERR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
