	.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, %rbx
	movl	%edi, %r14d
	movl	$-1, -48(%rbp)
	movl	$-1, -44(%rbp)
	cmpl	$1, %edi
	jg	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_usage
LBB0_2:
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.7:
	movq	8(%rbx), %rdi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	xorl	%edx, %edx
	callq	_open
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_8
## %bb.4:
	cmpl	$2, %r14d
	jne	LBB0_5
LBB0_9:
	movq	_TIOCMGDTRWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movl	%r12d, %edi
	callq	_ioctl
	movq	%rax, %r14
	xorl	%r15d, %r15d
	testq	%rax, %rax
	jns	LBB0_12
## %bb.10:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOTTY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	movl	$1, %r15d
LBB0_12:
	movq	_TIOCGDRAINWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movl	%r12d, %edi
	callq	_ioctl
	movq	%rax, %rbx
	testq	%rax, %rax
	jns	LBB0_15
## %bb.13:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOTTY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_15
## %bb.14:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	movl	$1, %r15d
LBB0_15:
	testq	%r14, %r14
	js	LBB0_17
## %bb.16:
	movl	-48(%rbp), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
LBB0_17:
	testq	%rbx, %rbx
	js	LBB0_19
## %bb.18:
	movl	-44(%rbp), %esi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
LBB0_19:
	movl	$10, %edi
	callq	_putchar
	jmp	LBB0_44
LBB0_3:
	movq	_STDIN_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	cmpl	$2, %r14d
	je	LBB0_9
LBB0_5:
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.20:
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	leaq	16(%rbx), %r12
	movl	$-1, %r14d
	leaq	L_.str.7(%rip), %r15
	movl	$-1, %r13d
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_35:                                ##   in Loop: Header=BB0_21 Depth=1
	xorl	%eax, %eax
	callq	_usage
	movq	%rbx, %r12
LBB0_36:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	%r12, %rbx
	addq	$16, %r12
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_37
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_22
## %bb.28:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	(%r12), %rdi
	leaq	L_.str.8(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_35
## %bb.29:                              ##   in Loop: Header=BB0_21 Depth=1
	testl	%r13d, %r13d
	js	LBB0_31
## %bb.30:                              ##   in Loop: Header=BB0_21 Depth=1
	xorl	%eax, %eax
	callq	_usage
LBB0_31:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_33
## %bb.32:                              ##   in Loop: Header=BB0_21 Depth=1
	movsbl	(%rax), %edi
	callq	_isdigit
	testl	%eax, %eax
	jne	LBB0_34
LBB0_33:                                ##   in Loop: Header=BB0_21 Depth=1
	xorl	%eax, %eax
	callq	_usage
LBB0_34:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	24(%rbx), %rdi
	callq	_atoi
	movl	%eax, %r13d
	movl	%eax, -44(%rbp)
	jmp	LBB0_36
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_21 Depth=1
	testl	%r14d, %r14d
	js	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_21 Depth=1
	xorl	%eax, %eax
	callq	_usage
LBB0_24:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_21 Depth=1
	movsbl	(%rax), %edi
	callq	_isdigit
	testl	%eax, %eax
	jne	LBB0_27
LBB0_26:                                ##   in Loop: Header=BB0_21 Depth=1
	xorl	%eax, %eax
	callq	_usage
LBB0_27:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	24(%rbx), %rdi
	callq	_atoi
	movl	%eax, %r14d
	movl	%eax, -48(%rbp)
	jmp	LBB0_36
LBB0_37:
	xorl	%r15d, %r15d
	testl	%r14d, %r14d
	js	LBB0_38
## %bb.39:
	movq	_TIOCMSDTRWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edi
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_41
## %bb.40:
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	movl	$1, %r15d
	jmp	LBB0_41
LBB0_8:
	movq	8(%rbx), %rsi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	movl	$1, %r15d
	jmp	LBB0_45
LBB0_6:
	xorl	%r15d, %r15d
	jmp	LBB0_44
LBB0_38:
	movl	-52(%rbp), %r12d                ## 4-byte Reload
LBB0_41:
	testl	%r13d, %r13d
	js	LBB0_44
## %bb.42:
	movq	_TIOCSDRAINWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movl	%r12d, %edi
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_44
## %bb.43:
	leaq	L_.str.10(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	movl	$1, %r15d
LBB0_44:
	movl	%r12d, %edi
	callq	_close
LBB0_45:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-"

	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
L_.str.1:                               ## @.str.1
	.asciz	"couldn't open file %s"

	.comm	_TIOCMGDTRWAIT,4,2              ## @TIOCMGDTRWAIT
	.comm	_errno,8,3                      ## @errno
	.comm	_ENOTTY,8,3                     ## @ENOTTY
L_.str.2:                               ## @.str.2
	.asciz	"TIOCMGDTRWAIT"

	.comm	_TIOCGDRAINWAIT,4,2             ## @TIOCGDRAINWAIT
L_.str.3:                               ## @.str.3
	.asciz	"TIOCGDRAINWAIT"

L_.str.4:                               ## @.str.4
	.asciz	"dtrwait %d "

L_.str.5:                               ## @.str.5
	.asciz	"drainwait %d "

L_.str.7:                               ## @.str.7
	.asciz	"dtrwait"

L_.str.8:                               ## @.str.8
	.asciz	"drainwait"

	.comm	_TIOCMSDTRWAIT,4,2              ## @TIOCMSDTRWAIT
L_.str.9:                               ## @.str.9
	.asciz	"TIOCMSDTRWAIT"

	.comm	_TIOCSDRAINWAIT,4,2             ## @TIOCSDRAINWAIT
L_.str.10:                              ## @.str.10
	.asciz	"TIOCSDRAINWAIT"

.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	x20, x1
	mov	x21, x0
	mov	w8, #-1
	stp	w8, w8, [sp, #8]
	cmp	w0, #1
	b.gt	LBB0_2
; %bb.1:
	bl	_usage
LBB0_2:
	ldr	x0, [x20, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_16
; %bb.3:
Lloh2:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
	ldr	x0, [x20, #8]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w2, #0
	bl	_open
	mov	x19, x0
	tbnz	w0, #31, LBB0_38
; %bb.4:
	cmp	w21, #2
	b.ne	LBB0_17
LBB0_5:
Lloh8:
	adrp	x8, _TIOCMGDTRWAIT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TIOCMGDTRWAIT@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_ioctl
	mov	x21, x0
	tbz	x0, #63, LBB0_7
; %bb.6:
Lloh11:
	adrp	x8, _errno@GOTPAGE
Lloh12:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
Lloh14:
	adrp	x9, _ENOTTY@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ENOTTY@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_40
LBB0_7:
	mov	w20, #0
LBB0_8:
Lloh17:
	adrp	x8, _TIOCGDRAINWAIT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TIOCGDRAINWAIT@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_ioctl
	mov	x22, x0
	tbz	x0, #63, LBB0_11
; %bb.9:
Lloh20:
	adrp	x8, _errno@GOTPAGE
Lloh21:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
Lloh23:
	adrp	x9, _ENOTTY@GOTPAGE
Lloh24:
	ldr	x9, [x9, _ENOTTY@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.10:
Lloh26:
	adrp	x0, l_.str.3@PAGE
Lloh27:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_warn
	mov	w20, #1
LBB0_11:
	tbnz	x21, #63, LBB0_13
; %bb.12:
	ldr	w8, [sp, #12]
	str	x8, [sp]
Lloh28:
	adrp	x0, l_.str.4@PAGE
Lloh29:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
LBB0_13:
	tbnz	x22, #63, LBB0_15
; %bb.14:
	ldr	w8, [sp, #8]
	str	x8, [sp]
Lloh30:
	adrp	x0, l_.str.5@PAGE
Lloh31:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_printf
LBB0_15:
	mov	w0, #10
	bl	_putchar
	b	LBB0_44
LBB0_16:
Lloh32:
	adrp	x8, _STDIN_FILENO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _STDIN_FILENO@GOTPAGEOFF]
Lloh34:
	ldr	w19, [x8]
	cmp	w21, #2
	b.eq	LBB0_5
LBB0_17:
	mov	x25, x20
	ldr	x0, [x25, #16]!
	cbz	x0, LBB0_39
; %bb.18:
	mov	w24, #-1
Lloh35:
	adrp	x22, l_.str.7@PAGE
Lloh36:
	add	x22, x22, l_.str.7@PAGEOFF
	mov	w21, #-1
Lloh37:
	adrp	x23, l_.str.8@PAGE
Lloh38:
	add	x23, x23, l_.str.8@PAGEOFF
	b	LBB0_21
LBB0_19:                                ;   in Loop: Header=BB0_21 Depth=1
	bl	_usage
	mov	x25, x20
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=1
	mov	x20, x25
	ldr	x0, [x25, #16]!
	cbz	x0, LBB0_35
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	mov	x1, x22
	bl	_strcmp
	cbz	x0, LBB0_29
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	x0, [x25]
	mov	x1, x23
	bl	_strcmp
	cbnz	x0, LBB0_19
; %bb.23:                               ;   in Loop: Header=BB0_21 Depth=1
	tbnz	w21, #31, LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_21 Depth=1
	bl	_usage
LBB0_25:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_21 Depth=1
	ldrsb	w0, [x8]
	bl	_isdigit
	cbnz	w0, LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_21 Depth=1
	bl	_usage
LBB0_28:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	x0, [x20, #24]
	bl	_atoi
	mov	x21, x0
	str	w0, [sp, #8]
	b	LBB0_20
LBB0_29:                                ;   in Loop: Header=BB0_21 Depth=1
	tbnz	w24, #31, LBB0_31
; %bb.30:                               ;   in Loop: Header=BB0_21 Depth=1
	bl	_usage
LBB0_31:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_33
; %bb.32:                               ;   in Loop: Header=BB0_21 Depth=1
	ldrsb	w0, [x8]
	bl	_isdigit
	cbnz	w0, LBB0_34
LBB0_33:                                ;   in Loop: Header=BB0_21 Depth=1
	bl	_usage
LBB0_34:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	x0, [x20, #24]
	bl	_atoi
	mov	x24, x0
	str	w0, [sp, #12]
	b	LBB0_20
LBB0_35:
	tbnz	w24, #31, LBB0_37
; %bb.36:
Lloh39:
	adrp	x8, _TIOCMSDTRWAIT@GOTPAGE
Lloh40:
	ldr	x8, [x8, _TIOCMSDTRWAIT@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_41
LBB0_37:
	mov	w20, #0
	tbz	w21, #31, LBB0_42
	b	LBB0_44
LBB0_38:
	ldr	x8, [x20, #8]
	str	x8, [sp]
Lloh42:
	adrp	x0, l_.str.1@PAGE
Lloh43:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
	mov	w20, #1
	b	LBB0_45
LBB0_39:
	mov	w20, #0
	b	LBB0_44
LBB0_40:
Lloh44:
	adrp	x0, l_.str.2@PAGE
Lloh45:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_warn
	mov	w20, #1
	b	LBB0_8
LBB0_41:
Lloh46:
	adrp	x0, l_.str.9@PAGE
Lloh47:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_warn
	mov	w20, #1
	tbnz	w21, #31, LBB0_44
LBB0_42:
Lloh48:
	adrp	x8, _TIOCSDRAINWAIT@GOTPAGE
Lloh49:
	ldr	x8, [x8, _TIOCSDRAINWAIT@GOTPAGEOFF]
Lloh50:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_ioctl
	tbz	x0, #63, LBB0_44
; %bb.43:
Lloh51:
	adrp	x0, l_.str.10@PAGE
Lloh52:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_warn
	mov	w20, #1
LBB0_44:
	mov	x0, x19
	bl	_close
LBB0_45:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpAdd	Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-"

	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
l_.str.1:                               ; @.str.1
	.asciz	"couldn't open file %s"

	.comm	_TIOCMGDTRWAIT,4,2              ; @TIOCMGDTRWAIT
	.comm	_errno,8,3                      ; @errno
	.comm	_ENOTTY,8,3                     ; @ENOTTY
l_.str.2:                               ; @.str.2
	.asciz	"TIOCMGDTRWAIT"

	.comm	_TIOCGDRAINWAIT,4,2             ; @TIOCGDRAINWAIT
l_.str.3:                               ; @.str.3
	.asciz	"TIOCGDRAINWAIT"

l_.str.4:                               ; @.str.4
	.asciz	"dtrwait %d "

l_.str.5:                               ; @.str.5
	.asciz	"drainwait %d "

l_.str.7:                               ; @.str.7
	.asciz	"dtrwait"

l_.str.8:                               ; @.str.8
	.asciz	"drainwait"

	.comm	_TIOCMSDTRWAIT,4,2              ; @TIOCMSDTRWAIT
l_.str.9:                               ; @.str.9
	.asciz	"TIOCMSDTRWAIT"

	.comm	_TIOCSDRAINWAIT,4,2             ; @TIOCSDRAINWAIT
l_.str.10:                              ; @.str.10
	.asciz	"TIOCSDRAINWAIT"

.subsections_via_symbols
