	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_stream
_setup_stream:                          ## @setup_stream
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_DD_OPEN@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_pprintf
	movq	_BPRI_MED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_allocb
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %rbx
	movq	_SO_READOPT@GOTPCREL(%rip), %rax
	movq	_SO_HIWAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_SO_LOWAT@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movslq	(%rbx), %rax
	movq	_SO_ISNTTY@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, (%rax)
	movq	_M_PARSE@GOTPCREL(%rip), %r12
	cmpl	%r14d, (%r12)
	movq	_RNORM@GOTPCREL(%rip), %rcx
	cmoveq	_RMSGD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movl	$4, %ecx
	movl	$256, %edx                      ## imm = 0x100
	cmovel	%ecx, %edx
	movl	%edx, 4(%rax)
	movq	$0, 8(%rax)
	movq	_M_SETOPTS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	8(%rbx), %rdx
	movl	%ecx, (%rdx)
	addl	$24, %eax
	movl	%eax, (%rbx)
	testq	%r15, %r15
	jne	LBB0_3
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	callq	_panic
LBB0_3:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_putnext
	movq	%r15, %rdi
	callq	_WR
	movl	(%rax), %edi
	movq	_M_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	%r14d, (%r12)
	jne	LBB0_4
## %bb.5:
	movq	_MC_SERVICEIMM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_7:
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_pprintf
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_MC_SERVICEDEF@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_putctl1                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DD_OPEN,4,2                    ## @DD_OPEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"parse: SETUP_STREAM - setting up stream for q=%x\n"

	.comm	_BPRI_MED,4,2                   ## @BPRI_MED
	.comm	_SO_READOPT,4,2                 ## @SO_READOPT
	.comm	_SO_HIWAT,4,2                   ## @SO_HIWAT
	.comm	_SO_LOWAT,4,2                   ## @SO_LOWAT
	.comm	_SO_ISNTTY,4,2                  ## @SO_ISNTTY
	.comm	_M_PARSE,4,2                    ## @M_PARSE
	.comm	_RMSGD,4,2                      ## @RMSGD
	.comm	_RNORM,4,2                      ## @RNORM
	.comm	_M_SETOPTS,4,2                  ## @M_SETOPTS
L_.str.1:                               ## @.str.1
	.asciz	"NULL q - strange"

	.comm	_M_CTL,4,2                      ## @M_CTL
	.comm	_MC_SERVICEIMM,4,2              ## @MC_SERVICEIMM
	.comm	_MC_SERVICEDEF,4,2              ## @MC_SERVICEDEF
L_.str.2:                               ## @.str.2
	.asciz	"parse: setup_stream - FAILED - no MEMORY for allocb\n"

	.no_dead_strip	_setup_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_stream
_setup_stream:                          ; @setup_stream
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _DD_OPEN@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DD_OPEN@GOTPAGEOFF]
	ldr	w0, [x22]
	str	x20, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_pprintf
Lloh4:
	adrp	x8, _BPRI_MED@GOTPAGE
Lloh5:
	ldr	x8, [x8, _BPRI_MED@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_allocb
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	ldrsw	x8, [x0]
Lloh7:
	adrp	x9, _SO_READOPT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SO_READOPT@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _SO_HIWAT@GOTPAGE
Lloh11:
	ldr	x10, [x10, _SO_HIWAT@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh13:
	adrp	x10, _SO_LOWAT@GOTPAGE
Lloh14:
	ldr	x10, [x10, _SO_LOWAT@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	orr	w9, w9, w10
Lloh16:
	adrp	x10, _SO_ISNTTY@GOTPAGE
Lloh17:
	ldr	x10, [x10, _SO_ISNTTY@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	orr	w9, w9, w10
	str	w9, [x8]
Lloh19:
	adrp	x22, _M_PARSE@GOTPAGE
Lloh20:
	ldr	x22, [x22, _M_PARSE@GOTPAGEOFF]
	ldr	w9, [x22]
Lloh21:
	adrp	x10, _RMSGD@GOTPAGE
Lloh22:
	ldr	x10, [x10, _RMSGD@GOTPAGEOFF]
	mov	w11, #256
	mov	w12, #4
	cmp	w9, w19
	csel	w9, w12, w11, eq
Lloh23:
	adrp	x11, _RNORM@GOTPAGE
Lloh24:
	ldr	x11, [x11, _RNORM@GOTPAGEOFF]
	csel	x10, x10, x11, eq
	ldr	w10, [x10]
	str	w10, [x8, #16]
	str	w9, [x8, #4]
Lloh25:
	adrp	x9, _M_SETOPTS@GOTPAGE
Lloh26:
	ldr	x9, [x9, _M_SETOPTS@GOTPAGEOFF]
	str	xzr, [x8, #8]
Lloh27:
	ldr	w9, [x9]
	ldr	x10, [x0, #8]
	str	w9, [x10]
	add	w8, w8, #24
	str	w8, [x0]
	cbnz	x20, LBB0_3
; %bb.2:
Lloh28:
	adrp	x0, l_.str.1@PAGE
Lloh29:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_panic
LBB0_3:
	mov	x0, x20
	mov	x1, x21
	bl	_putnext
	mov	x0, x20
	bl	_WR
	ldr	w0, [x0]
Lloh30:
	adrp	x8, _M_CTL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _M_CTL@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	ldr	w8, [x22]
Lloh33:
	adrp	x9, _MC_SERVICEIMM@GOTPAGE
Lloh34:
	ldr	x9, [x9, _MC_SERVICEIMM@GOTPAGEOFF]
Lloh35:
	adrp	x10, _MC_SERVICEDEF@GOTPAGE
Lloh36:
	ldr	x10, [x10, _MC_SERVICEDEF@GOTPAGEOFF]
	cmp	w8, w19
	csel	x8, x9, x10, eq
	ldr	w2, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_putctl1
LBB0_4:
	ldr	w0, [x22]
Lloh37:
	adrp	x1, l_.str.2@PAGE
Lloh38:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_pprintf
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_DD_OPEN,4,2                    ; @DD_OPEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"parse: SETUP_STREAM - setting up stream for q=%x\n"

	.comm	_BPRI_MED,4,2                   ; @BPRI_MED
	.comm	_SO_READOPT,4,2                 ; @SO_READOPT
	.comm	_SO_HIWAT,4,2                   ; @SO_HIWAT
	.comm	_SO_LOWAT,4,2                   ; @SO_LOWAT
	.comm	_SO_ISNTTY,4,2                  ; @SO_ISNTTY
	.comm	_M_PARSE,4,2                    ; @M_PARSE
	.comm	_RMSGD,4,2                      ; @RMSGD
	.comm	_RNORM,4,2                      ; @RNORM
	.comm	_M_SETOPTS,4,2                  ; @M_SETOPTS
l_.str.1:                               ; @.str.1
	.asciz	"NULL q - strange"

	.comm	_M_CTL,4,2                      ; @M_CTL
	.comm	_MC_SERVICEIMM,4,2              ; @MC_SERVICEIMM
	.comm	_MC_SERVICEDEF,4,2              ; @MC_SERVICEDEF
l_.str.2:                               ; @.str.2
	.asciz	"parse: setup_stream - FAILED - no MEMORY for allocb\n"

	.no_dead_strip	_setup_stream
.subsections_via_symbols
