	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cu_fgets                       ## -- Begin function cu_fgets
	.p2align	4, 0x90
_cu_fgets:                              ## @cu_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, -48(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	_cu_fgets.state(%rip), %edx
	movq	_script@GOTPCREL(%rip), %r12
	leaq	_cu_fgets.string_ident(%rip), %rbx
	jmp	LBB0_1
LBB0_19:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_fname@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	%rax, _cu_fgets.s(%rip)
	movl	$2, %edx
	movl	%edx, _cu_fgets.state(%rip)
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_33 Depth 2
	testl	%edx, %edx
	je	LBB0_10
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$1, %edx
	je	LBB0_21
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$2, %edx
	jne	LBB0_42
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_linenum@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movq	_cu_fgets.s(%rip), %rax
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpb	$35, (%rax)
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpb	$110, 1(%rax)
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_nflag@GOTPCREL(%rip), %rcx
	movl	$1, (%rcx)
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$2, %r15d
	jl	LBB0_9
## %bb.32:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %r8
	leal	1(%r15), %edx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_33:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	(%rax,%rcx), %ebx
	movsbl	%bl, %esi
	cmpl	$10, %esi
	je	LBB0_39
## %bb.34:                              ##   in Loop: Header=BB0_33 Depth=2
	testl	%esi, %esi
	je	LBB0_35
## %bb.29:                              ##   in Loop: Header=BB0_33 Depth=2
	leaq	(%rax,%rcx), %rsi
	incq	%rsi
	movq	%rsi, _cu_fgets.s(%rip)
	movb	%bl, (%r14,%rcx)
	decl	%edx
	incq	%rcx
	cmpl	$3, %edx
	jae	LBB0_33
	jmp	LBB0_30
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_linenum@GOTPCREL(%rip), %rcx
	movl	$0, (%rcx)
	movl	16(%rax), %ecx
	cmpl	$128, %ecx
	je	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$129, %ecx
	jne	LBB0_20
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	movq	%rax, _cu_fgets.f(%rip)
	testq	%rax, %rax
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rax
	movq	(%rax), %rdx
	movl	$1, %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_err
LBB0_16:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	_fname@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movl	$1, %edx
	movl	%edx, _cu_fgets.state(%rip)
	jmp	LBB0_1
LBB0_17:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rax), %rcx
	movq	%rbx, %rdi
	movl	$30, %esi
	leaq	L_.str.2(%rip), %rdx
	callq	_snprintf
	cmpl	$29, %eax
	jb	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_1 Depth=1
	leal	24(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_strcpy
	jmp	LBB0_19
LBB0_20:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	___unreachable
LBB0_21:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_cu_fgets.f(%rip), %rdx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_fgets
	testq	%rax, %rax
	jne	LBB0_22
## %bb.28:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movq	%rax, (%r12)
	movq	_cu_fgets.f(%rip), %rdi
	callq	_fclose
	xorl	%edx, %edx
	movl	%edx, _cu_fgets.state(%rip)
	jmp	LBB0_1
LBB0_35:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	$0, _cu_fgets.state(%rip)
	movq	(%r12), %rsi
	addq	%rcx, %rax
	movl	%ecx, %edx
	notl	%edx
	addl	%edx, %r15d
	xorl	%edx, %edx
	movq	8(%rsi), %rdi
	cmpq	(%rsi), %rax
	movq	%rdi, (%r12)
	movq	%r8, %rbx
	je	LBB0_1
## %bb.36:
	movb	$0, (%r14,%rcx)
	movq	_linenum@GOTPCREL(%rip), %rax
	incl	(%rax)
	jmp	LBB0_37
LBB0_22:
	movq	%rax, %r13
	movq	_linenum@GOTPCREL(%rip), %rdx
	movl	(%rdx), %eax
	leal	1(%rax), %ecx
	movl	%ecx, (%rdx)
	testl	%eax, %eax
	jne	LBB0_26
## %bb.23:
	cmpb	$35, (%r14)
	jne	LBB0_26
## %bb.24:
	cmpb	$110, 1(%r14)
	jne	LBB0_26
## %bb.25:
	movq	_nflag@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
LBB0_26:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_27
## %bb.40:
	movq	_cu_fgets.f(%rip), %rdi
	callq	_feof
	xorl	%ecx, %ecx
	testl	%eax, %eax
	sete	%cl
	movq	%r13, %r14
	jmp	LBB0_41
LBB0_42:
	xorl	%r14d, %r14d
	jmp	LBB0_43
LBB0_11:
	xorl	%ecx, %ecx
	movl	$0, %r14d
	jmp	LBB0_38
LBB0_27:
	movq	%r13, %r14
	jmp	LBB0_43
LBB0_39:
	movw	$10, (%r14,%rcx)
	movq	_linenum@GOTPCREL(%rip), %rdx
	incl	(%rdx)
	addq	%rcx, %rax
	incq	%rax
	movq	%rax, _cu_fgets.s(%rip)
LBB0_37:
	xorl	%ecx, %ecx
	jmp	LBB0_38
LBB0_30:
	addq	%r14, %rcx
LBB0_31:
	movb	$0, (%rcx)
	movq	_linenum@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	$1, %ecx
LBB0_38:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_43
LBB0_41:
	movl	%ecx, (%rbx)
LBB0_43:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r14, %rcx
	jmp	LBB0_31
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_cu_fgets.state,4,2 ## @cu_fgets.state
.zerofill __DATA,__bss,_cu_fgets.f,8,3  ## @cu_fgets.f
.zerofill __DATA,__bss,_cu_fgets.s,8,3  ## @cu_fgets.s
.zerofill __DATA,__bss,_cu_fgets.string_ident,30,4 ## @cu_fgets.string_ident
	.comm	_script,8,3                     ## @script
	.comm	_linenum,4,2                    ## @linenum
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"r"

L_.str.1:                               ## @.str.1
	.asciz	"%s"

	.comm	_fname,8,3                      ## @fname
L_.str.2:                               ## @.str.2
	.asciz	"\"%s\""

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

	.comm	_nflag,4,2                      ## @nflag
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cu_fgets                       ; -- Begin function cu_fgets
	.p2align	2
_cu_fgets:                              ; @cu_fgets
	.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
	str	x2, [sp, #8]                    ; 8-byte Folded Spill
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _script@GOTPAGE
Lloh1:
	ldr	x24, [x24, _script@GOTPAGEOFF]
Lloh2:
	adrp	x28, _linenum@GOTPAGE
Lloh3:
	ldr	x28, [x28, _linenum@GOTPAGEOFF]
Lloh4:
	adrp	x22, _cu_fgets.string_ident@PAGE
Lloh5:
	add	x22, x22, _cu_fgets.string_ident@PAGEOFF
	adrp	x23, _cu_fgets.state@PAGE
	ldr	w10, [x23, _cu_fgets.state@PAGEOFF]
Lloh6:
	adrp	x25, _fname@GOTPAGE
Lloh7:
	ldr	x25, [x25, _fname@GOTPAGEOFF]
	adrp	x19, _cu_fgets.s@PAGE
	adrp	x26, _cu_fgets.f@PAGE
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	str	x22, [x25]
	ldr	x8, [x24]
	ldr	x8, [x8]
	str	x8, [x19, _cu_fgets.s@PAGEOFF]
	mov	w10, #2
	str	w10, [x23, _cu_fgets.state@PAGEOFF]
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	cbz	w10, LBB0_14
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w10, #1
	b.eq	LBB0_23
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w10, #2
	b.ne	LBB0_33
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x28]
	ldr	x8, [x19, _cu_fgets.s@PAGEOFF]
	cbnz	w9, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldrb	w9, [x8]
	cmp	w9, #35
	b.ne	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	ldrb	w9, [x8, #1]
	cmp	w9, #110
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh8:
	adrp	x9, _nflag@GOTPAGE
Lloh9:
	ldr	x9, [x9, _nflag@GOTPAGEOFF]
	mov	w10, #1
Lloh10:
	str	w10, [x9]
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	cmp	w21, #2
	b.lt	LBB0_43
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	x9, #0
	add	w10, w21, #1
LBB0_11:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldrsb	w11, [x8, x9]
	cmp	w11, #10
	b.eq	LBB0_36
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	cbz	w11, LBB0_25
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=2
	and	w11, w11, #0xff
	add	x12, x8, x9
	add	x12, x12, #1
	str	x12, [x19, _cu_fgets.s@PAGEOFF]
	strb	w11, [x20, x9]
	sub	w10, w10, #1
	add	x9, x9, #1
	cmp	w10, #3
	b.hs	LBB0_11
	b	LBB0_38
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x24]
	cbz	x8, LBB0_34
; %bb.15:                               ;   in Loop: Header=BB0_2 Depth=1
	str	wzr, [x28]
	ldr	w9, [x8, #16]
	cmp	w9, #128
	b.eq	LBB0_20
; %bb.16:                               ;   in Loop: Header=BB0_2 Depth=1
	cmp	w9, #129
	b.ne	LBB0_22
; %bb.17:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	x0, [x8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	str	x0, [x26, _cu_fgets.f@PAGEOFF]
	cbnz	x0, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x24]
	ldr	x2, [x8]
	mov	w0, #1
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_err
LBB0_19:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x24]
	ldr	x8, [x8]
	str	x8, [x25]
	mov	w10, #1
	str	w10, [x23, _cu_fgets.state@PAGEOFF]
	b	LBB0_2
LBB0_20:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x3, [x8]
	mov	x0, x22
	mov	w1, #30
Lloh15:
	adrp	x2, l_.str.2@PAGE
Lloh16:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_snprintf
	cmp	w0, #29
	b.lo	LBB0_1
; %bb.21:                               ;   in Loop: Header=BB0_2 Depth=1
	add	w0, w22, #24
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_strcpy
	b	LBB0_1
LBB0_22:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	___unreachable
LBB0_23:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x2, [x26, _cu_fgets.f@PAGEOFF]
	mov	x0, x20
	mov	x1, x21
	bl	_fgets
	cbnz	x0, LBB0_27
; %bb.24:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x24]
	ldr	x8, [x8, #8]
	str	x8, [x24]
	ldr	x0, [x26, _cu_fgets.f@PAGEOFF]
	bl	_fclose
	mov	w10, #0
	str	wzr, [x23, _cu_fgets.state@PAGEOFF]
	b	LBB0_2
LBB0_25:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w10, #0
	str	wzr, [x23, _cu_fgets.state@PAGEOFF]
	ldr	x11, [x24]
	ldp	x12, x11, [x11]
	str	x11, [x24]
	mvn	w11, w9
	add	w21, w11, w21
	add	x8, x8, x9
	cmp	x8, x12
	b.eq	LBB0_2
; %bb.26:
	mov	w8, #0
	strb	wzr, [x20, x9]
	ldr	w9, [x28]
	add	w9, w9, #1
	str	w9, [x28]
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	cbnz	x19, LBB0_41
	b	LBB0_42
LBB0_27:
	mov	x27, x0
	ldr	w8, [x28]
	add	w9, w8, #1
	str	w9, [x28]
	cbnz	w8, LBB0_31
; %bb.28:
	ldrb	w8, [x20]
	cmp	w8, #35
	b.ne	LBB0_31
; %bb.29:
	ldrb	w8, [x20, #1]
	cmp	w8, #110
	b.ne	LBB0_31
; %bb.30:
	mov	w8, #1
Lloh19:
	adrp	x9, _nflag@GOTPAGE
Lloh20:
	ldr	x9, [x9, _nflag@GOTPAGEOFF]
Lloh21:
	str	w8, [x9]
LBB0_31:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	cbz	x19, LBB0_35
; %bb.32:
	ldr	x0, [x26, _cu_fgets.f@PAGEOFF]
	bl	_feof
	cmp	w0, #0
	cset	w8, eq
	mov	x20, x27
	b	LBB0_41
LBB0_33:
	mov	x20, #0
	b	LBB0_42
LBB0_34:
	mov	x20, #0
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	cbnz	x19, LBB0_37
	b	LBB0_42
LBB0_35:
	mov	x20, x27
	b	LBB0_42
LBB0_36:
	mov	w10, #10
	strh	w10, [x20, x9]
	add	x8, x8, x9
	add	x8, x8, #1
	str	x8, [x19, _cu_fgets.s@PAGEOFF]
	ldr	w8, [x28]
	add	w8, w8, #1
	str	w8, [x28]
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	cbz	x19, LBB0_42
LBB0_37:
	mov	w8, #0
	str	wzr, [x19]
	b	LBB0_42
LBB0_38:
	add	x8, x20, x9
LBB0_39:
	strb	wzr, [x8]
	ldr	w8, [x28]
	add	w8, w8, #1
	str	w8, [x28]
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	cbz	x19, LBB0_42
; %bb.40:
	mov	w8, #1
LBB0_41:
	str	w8, [x19]
LBB0_42:
	mov	x0, x20
	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
LBB0_43:
	mov	x8, x20
	b	LBB0_39
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_cu_fgets.state,4,2 ; @cu_fgets.state
.zerofill __DATA,__bss,_cu_fgets.f,8,3  ; @cu_fgets.f
.zerofill __DATA,__bss,_cu_fgets.s,8,3  ; @cu_fgets.s
.zerofill __DATA,__bss,_cu_fgets.string_ident,30,0 ; @cu_fgets.string_ident
	.comm	_script,8,3                     ; @script
	.comm	_linenum,4,2                    ; @linenum
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"r"

l_.str.1:                               ; @.str.1
	.asciz	"%s"

	.comm	_fname,8,3                      ; @fname
l_.str.2:                               ; @.str.2
	.asciz	"\"%s\""

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

	.comm	_nflag,4,2                      ; @nflag
.subsections_via_symbols
