	.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	%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
	movq	%rsi, %r14
	movl	%edi, %ebx
	movq	_LC_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %r15
	movq	%r15, %rsi
	callq	_setlocale
	movl	%ebx, %edi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_getopt
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_usage
	movl	%ebx, %edi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_getopt
	cmpl	$-1, %eax
	jne	LBB0_2
LBB0_3:
	movq	_optind@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%r14,%rax,8), %r13
	movq	_stdin@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r12
	movq	(%r14,%rax,8), %rdi
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	L_.str.1(%rip), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	-64(%rbp), %rbx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	callq	_fclose
LBB0_19:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_20
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
                                        ##       Child Loop BB0_13 Depth 3
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str.2(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r12
	movq	(%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	addq	$8, %r13
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_fgetwln
	testq	%rax, %rax
	je	LBB0_16
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r14
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=2
	movl	$10, %edi
	callq	_putwchar
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_fgetwln
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_16
LBB0_10:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_13 Depth 3
	movq	-64(%rbp), %rax
	cmpb	$10, -1(%r14,%rax)
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	decq	%rax
	movq	%rax, -64(%rbp)
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=2
	leaq	(%r14,%rax), %r15
	decq	%r15
	cmpq	%r14, %r15
	jb	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_4 Depth=1
                                        ##     Parent Loop BB0_10 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movsbl	(%r15), %edi
	callq	_putwchar
	decq	%r15
	cmpq	%r14, %r15
	jae	LBB0_13
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	callq	_ferror
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str.3(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_warn
	movq	%r12, %rdi
	callq	_clearerr
	movl	$1, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r13), %rsi
	leaq	L_.str.3(%rip), %rdi
	callq	_warn
	addq	$8, %r13
	movl	$1, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_19
LBB0_20:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_LC_ALL,4,2                     ## @LC_ALL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_optind,8,3                     ## @optind
	.comm	_stdin,8,3                      ## @stdin
L_.str.1:                               ## @.str.1
	.asciz	"stdin"

L_.str.2:                               ## @.str.2
	.asciz	"r"

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

.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:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _LC_ALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LC_ALL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x21, l_.str@PAGE
Lloh4:
	add	x21, x21, l_.str@PAGEOFF
	mov	x1, x21
	bl	_setlocale
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_getopt
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.1:
Lloh5:
	adrp	x21, l_.str@PAGE
Lloh6:
	add	x21, x21, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_usage
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_getopt
	cmn	w0, #1
	b.ne	LBB0_2
LBB0_3:
	mov	w21, #0
Lloh7:
	adrp	x8, _optind@GOTPAGE
Lloh8:
	ldr	x8, [x8, _optind@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	add	x25, x19, x8, lsl #3
Lloh10:
	adrp	x8, _stdin@GOTPAGE
Lloh11:
	ldr	x8, [x8, _stdin@GOTPAGEOFF]
Lloh12:
	ldr	x23, [x8]
	ldr	x0, [x25]
Lloh13:
	adrp	x19, l_.str.1@PAGE
Lloh14:
	add	x19, x19, l_.str.1@PAGEOFF
Lloh15:
	adrp	x20, l_.str.3@PAGE
Lloh16:
	add	x20, x20, l_.str.3@PAGEOFF
Lloh17:
	adrp	x22, l_.str.2@PAGE
Lloh18:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	bl	_fclose
	ldr	x0, [x25]
	cbz	x0, LBB0_18
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
                                        ;       Child Loop BB0_14 Depth 3
	cbz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x22
	bl	_fopen
	mov	x23, x0
	cbz	x0, LBB0_17
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x19, [x25], #8
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x1, sp, #8
	mov	x0, x23
	bl	_fgetwln
	cbz	x0, LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x24, x0
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=2
	mov	w0, #10
	bl	_putwchar
	add	x1, sp, #8
	mov	x0, x23
	bl	_fgetwln
	mov	x24, x0
	cbz	x0, LBB0_15
LBB0_11:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_14 Depth 3
	ldr	x8, [sp, #8]
	sub	x9, x8, #1
	ldrb	w10, [x24, x9]
	cmp	w10, #10
	b.ne	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	str	x9, [sp, #8]
	mov	x8, x9
LBB0_13:                                ;   in Loop: Header=BB0_11 Depth=2
	add	x8, x24, x8
	sub	x26, x8, #1
	cmp	x26, x24
	b.lo	LBB0_10
LBB0_14:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_11 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldrsb	w0, [x26], #-1
	bl	_putwchar
	cmp	x26, x24
	b.hs	LBB0_14
	b	LBB0_10
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	bl	_ferror
	cbz	x0, LBB0_4
; %bb.16:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_warn
	mov	x0, x23
	bl	_clearerr
	mov	w21, #1
	b	LBB0_4
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [x25], #8
	mov	x0, x20
	bl	_warn
	mov	w21, #1
	ldr	x0, [x25]
	cbnz	x0, LBB0_5
LBB0_18:
	mov	x0, x21
	bl	_exit
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_LC_ALL,4,2                     ; @LC_ALL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_optind,8,3                     ; @optind
	.comm	_stdin,8,3                      ; @stdin
l_.str.1:                               ; @.str.1
	.asciz	"stdin"

l_.str.2:                               ; @.str.2
	.asciz	"r"

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

.subsections_via_symbols
