	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cmd_main                       ## -- Begin function cmd_main
	.p2align	4, 0x90
_cmd_main:                              ## @cmd_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_LINE_BUFFER_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movl	%eax, -48(%rbp)
	cmpl	$1, %edi
	je	LBB0_1
## %bb.2:
	cmpl	$2, %edi
	jne	LBB0_4
## %bb.3:
	movq	8(%rsi), %r14
	jmp	LBB0_5
LBB0_1:
	xorl	%r14d, %r14d
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_usage
                                        ## implicit-def: $r14
LBB0_5:
	leaq	-40(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_buffer_init
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_die_errno
LBB0_7:
	testq	%r14, %r14
	je	LBB0_14
## %bb.8:
	cmpb	$38, (%r14)
	jne	LBB0_11
## %bb.9:
	leaq	1(%r14), %r15
	movq	%r15, %rdi
	callq	_strtouint32
	leaq	-48(%rbp), %r12
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_buffer_fdinit
	testq	%rax, %rax
	je	LBB0_14
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	jmp	LBB0_13
LBB0_11:
	leaq	-48(%rbp), %r12
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_buffer_init
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
LBB0_13:
	xorl	%eax, %eax
	callq	_die_errno
LBB0_14:
	leaq	-40(%rbp), %rdi
	callq	_buffer_read_line
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:
	leaq	-40(%rbp), %rbx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_handle_line
	movq	%rbx, %rdi
	callq	_buffer_read_line
	testq	%rax, %rax
	jne	LBB0_16
LBB0_17:
	testq	%r14, %r14
	je	LBB0_20
## %bb.18:
	leaq	-48(%rbp), %rdi
	callq	_buffer_deinit
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_die
LBB0_20:
	leaq	-40(%rbp), %rdi
	callq	_buffer_deinit
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_die
LBB0_22:
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ferror
	testq	%rax, %rax
	je	LBB0_24
## %bb.23:
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_die
LBB0_24:
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LINE_BUFFER_INIT,4,2           ## @LINE_BUFFER_INIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"test-line-buffer [file | &fd] < script"

L_.str.1:                               ## @.str.1
	.asciz	"open error"

L_.str.2:                               ## @.str.2
	.asciz	"error opening fd %s"

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

L_.str.4:                               ## @.str.4
	.asciz	"error reading from %s"

L_.str.5:                               ## @.str.5
	.asciz	"input error"

	.comm	_stdout,4,2                     ## @stdout
L_.str.6:                               ## @.str.6
	.asciz	"output error"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cmd_main                       ; -- Begin function cmd_main
	.p2align	2
_cmd_main:                              ; @cmd_main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _LINE_BUFFER_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LINE_BUFFER_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	str	w8, [sp, #16]
	cmp	w0, #1
	b.eq	LBB0_3
; %bb.1:
	cmp	w0, #2
	b.ne	LBB0_4
; %bb.2:
	ldr	x19, [x1, #8]
	b	LBB0_5
LBB0_3:
	mov	x19, #0
	b	LBB0_5
LBB0_4:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_usage
                                        ; implicit-def: $x19
LBB0_5:
	add	x0, sp, #24
	mov	x1, #0
	bl	_buffer_init
	cbz	x0, LBB0_7
; %bb.6:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_die_errno
LBB0_7:
	cbz	x19, LBB0_11
; %bb.8:
	ldrb	w8, [x19]
	cmp	w8, #38
	b.ne	LBB0_12
; %bb.9:
	add	x21, x19, #1
	mov	x0, x21
	bl	_strtouint32
	mov	x1, x0
	add	x20, sp, #16
	add	x0, sp, #16
	bl	_buffer_fdinit
	cbz	x0, LBB0_16
; %bb.10:
	str	x21, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_11:
	add	x20, sp, #24
	b	LBB0_16
LBB0_12:
	add	x20, sp, #16
	add	x0, sp, #16
	mov	x1, x19
	bl	_buffer_init
	cbz	x0, LBB0_16
; %bb.13:
	str	x19, [sp]
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_14:
	bl	_die_errno
	add	x20, sp, #16
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x1, x20
	bl	_handle_line
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #24
	bl	_buffer_read_line
	cbnz	x0, LBB0_15
; %bb.17:
	cbz	x19, LBB0_20
; %bb.18:
	add	x0, sp, #16
	bl	_buffer_deinit
	cbz	x0, LBB0_20
; %bb.19:
	str	x19, [sp]
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_die
LBB0_20:
	add	x0, sp, #24
	bl	_buffer_deinit
	cbz	x0, LBB0_22
; %bb.21:
Lloh13:
	adrp	x0, l_.str.5@PAGE
Lloh14:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_die
LBB0_22:
Lloh15:
	adrp	x8, _stdout@GOTPAGE
Lloh16:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_ferror
	cbz	x0, LBB0_24
; %bb.23:
Lloh18:
	adrp	x0, l_.str.6@PAGE
Lloh19:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_die
LBB0_24:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_LINE_BUFFER_INIT,4,2           ; @LINE_BUFFER_INIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"test-line-buffer [file | &fd] < script"

l_.str.1:                               ; @.str.1
	.asciz	"open error"

l_.str.2:                               ; @.str.2
	.asciz	"error opening fd %s"

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

l_.str.4:                               ; @.str.4
	.asciz	"error reading from %s"

l_.str.5:                               ; @.str.5
	.asciz	"input error"

	.comm	_stdout,4,2                     ; @stdout
l_.str.6:                               ; @.str.6
	.asciz	"output error"

.subsections_via_symbols
