	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_filename                   ## -- Begin function get_filename
	.p2align	4, 0x90
_get_filename:                          ## @get_filename
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_ibufp@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	cmpb	$10, (%rax)
	jne	LBB0_7
## %bb.1:
	movq	_old_filename@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpb	$0, (%rax)
	je	LBB0_15
## %bb.2:
	movq	_PATH_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
LBB0_3:
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_REALLOC
	movl	$0, -12(%rbp)
	movq	(%rbx), %rax
	cmpb	$10, (%rax)
	je	LBB0_6
## %bb.4:
	incq	%rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%rax,%rcx), %rdx
	movq	%rdx, (%rbx)
	leaq	1(%rcx), %rdx
	movl	%edx, -12(%rbp)
	cmpb	$10, (%rax,%rcx)
	movq	%rdx, %rcx
	jne	LBB0_5
LBB0_6:
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_is_legal_filename
	jmp	LBB0_18
LBB0_7:
	xorl	%eax, %eax
	callq	_SKIP_BLANKS
	movq	(%rbx), %rax
	cmpb	$10, (%rax)
	jne	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rax
	jmp	LBB0_16
LBB0_9:
	leaq	-12(%rbp), %rdi
	movl	$1, %esi
	callq	_get_extended_line
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_17
## %bb.10:
	cmpb	$33, (%rax)
	jne	LBB0_20
## %bb.11:
	incq	%rax
	movq	%rax, (%rbx)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_get_shell_command
	movl	%eax, -12(%rbp)
	testl	%eax, %eax
	js	LBB0_18
## %bb.12:
	je	LBB0_14
## %bb.13:
	movq	_shcmd@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	incq	%rsi
	leaq	L_.str.1(%rip), %rdi
	callq	_printf
LBB0_14:
	movq	_shcmd@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_18
LBB0_15:
	leaq	L_.str.3(%rip), %rax
LBB0_16:
	movq	_errmsg@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
LBB0_17:
	xorl	%ebx, %ebx
LBB0_18:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_20:
	movq	_PATH_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmpl	%edx, -12(%rbp)
	jl	LBB0_3
## %bb.21:
	leaq	L_.str.2(%rip), %rax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_ibufp,8,3                      ## @ibufp
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid filename"

	.comm	_errmsg,8,3                     ## @errmsg
L_.str.1:                               ## @.str.1
	.asciz	"%s\n"

	.comm	_shcmd,8,3                      ## @shcmd
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
L_.str.2:                               ## @.str.2
	.asciz	"filename too long"

	.comm	_old_filename,8,3               ## @old_filename
L_.str.3:                               ## @.str.3
	.asciz	"no current filename"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_filename                   ; -- Begin function get_filename
	.p2align	2
_get_filename:                          ; @get_filename
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
Lloh0:
	adrp	x19, _ibufp@GOTPAGE
Lloh1:
	ldr	x19, [x19, _ibufp@GOTPAGEOFF]
	ldr	x8, [x19]
	ldrb	w8, [x8]
	cmp	w8, #10
	b.ne	LBB0_8
; %bb.1:
Lloh2:
	adrp	x8, _old_filename@GOTPAGE
Lloh3:
	ldr	x8, [x8, _old_filename@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldrb	w8, [x8]
	cbz	w8, LBB0_16
; %bb.2:
Lloh5:
	adrp	x8, _PATH_MAX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PATH_MAX@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
LBB0_3:
	mov	x0, #0
	mov	w1, #0
	mov	x3, #0
	bl	_REALLOC
	str	wzr, [sp, #12]
	ldr	x8, [x19]
	ldrb	w9, [x8]
	cmp	w9, #10
	b.eq	LBB0_6
; %bb.4:
	mov	x9, #0
	add	x8, x8, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x10, x8, x9
	str	x10, [x19]
	add	x10, x9, #1
	str	w10, [sp, #12]
	ldrb	w11, [x8, x9]
	mov	x9, x10
	cmp	w11, #10
	b.ne	LBB0_5
LBB0_6:
	mov	x0, #0
	bl	_is_legal_filename
LBB0_7:
	mov	x0, #0
	b	LBB0_18
LBB0_8:
	bl	_SKIP_BLANKS
	ldr	x8, [x19]
	ldrb	w8, [x8]
	cmp	w8, #10
	b.ne	LBB0_10
; %bb.9:
	mov	x0, #0
Lloh8:
	adrp	x8, _errmsg@GOTPAGE
Lloh9:
	ldr	x8, [x8, _errmsg@GOTPAGEOFF]
Lloh10:
	adrp	x9, l_.str@PAGE
Lloh11:
	add	x9, x9, l_.str@PAGEOFF
	b	LBB0_17
LBB0_10:
	add	x0, sp, #12
	mov	w1, #1
	bl	_get_extended_line
	str	x0, [x19]
	cbz	x0, LBB0_18
; %bb.11:
	ldrb	w8, [x0]
	cmp	w8, #33
	b.ne	LBB0_19
; %bb.12:
	add	x8, x0, #1
	str	x8, [x19]
	bl	_get_shell_command
	str	w0, [sp, #12]
	tbnz	w0, #31, LBB0_7
; %bb.13:
Lloh12:
	adrp	x19, _shcmd@GOTPAGE
Lloh13:
	ldr	x19, [x19, _shcmd@GOTPAGEOFF]
	cbz	w0, LBB0_15
; %bb.14:
	ldr	x8, [x19]
	add	x1, x8, #1
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
LBB0_15:
	ldr	x0, [x19]
	b	LBB0_18
LBB0_16:
	mov	x0, #0
Lloh16:
	adrp	x8, _errmsg@GOTPAGE
Lloh17:
	ldr	x8, [x8, _errmsg@GOTPAGEOFF]
Lloh18:
	adrp	x9, l_.str.3@PAGE
Lloh19:
	add	x9, x9, l_.str.3@PAGEOFF
LBB0_17:
	str	x9, [x8]
LBB0_18:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_19:
	ldr	w8, [sp, #12]
Lloh20:
	adrp	x9, _PATH_MAX@GOTPAGE
Lloh21:
	ldr	x9, [x9, _PATH_MAX@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x9]
	cmp	w8, w2
	b.lt	LBB0_3
; %bb.20:
	mov	x0, #0
Lloh23:
	adrp	x8, _errmsg@GOTPAGE
Lloh24:
	ldr	x8, [x8, _errmsg@GOTPAGEOFF]
Lloh25:
	adrp	x9, l_.str.2@PAGE
Lloh26:
	add	x9, x9, l_.str.2@PAGEOFF
	b	LBB0_17
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_ibufp,8,3                      ; @ibufp
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid filename"

	.comm	_errmsg,8,3                     ; @errmsg
l_.str.1:                               ; @.str.1
	.asciz	"%s\n"

	.comm	_shcmd,8,3                      ; @shcmd
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
l_.str.2:                               ; @.str.2
	.asciz	"filename too long"

	.comm	_old_filename,8,3               ; @old_filename
l_.str.3:                               ; @.str.3
	.asciz	"no current filename"

.subsections_via_symbols
