	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sp_open
_sp_open:                               ## @sp_open
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	movaps	%xmm0, -64(%rbp)
	movq	$0, -32(%rbp)
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movq	_O_NOCTTY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	(%rdi), %rdi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	xorl	%edx, %edx
	callq	_r_sandbox_open
	movl	%eax, 16(%r15)
	movl	$-1, %ebx
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	leaq	-64(%rbp), %rsi
	movl	%eax, %edi
	callq	_tcgetattr
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_sp_close
	jmp	LBB0_4
LBB0_3:
	movq	_B115200@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-64(%rbp), %r14
	movq	%r14, %rdi
	callq	_cfsetospeed
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_cfsetispeed
	movq	_CSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	-64(%rbp), %eax
	movq	_CS8@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_IGNBRK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	-60(%rbp), %edx
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	movq	-56(%rbp), %rsi
	movq	_VMIN@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movq	$0, (%rsi,%rdi,8)
	movq	_VTIME@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movq	$0, (%rsi,%rdi,8)
	movq	_IXON@GOTPCREL(%rip), %rsi
	movq	_IXOFF@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	orl	(%rsi), %edi
	movq	_IXANY@GOTPCREL(%rip), %rsi
	orl	(%rsi), %edi
	orl	%ecx, %edi
	notl	%edi
	andl	%edx, %edi
	movq	_CLOCAL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_CREAD@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_PARENB@GOTPCREL(%rip), %rcx
	movq	_PARODD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	%edi, -60(%rbp)
	notl	%edx
	movq	_CSTOPB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%edx, %ecx
	andl	%eax, %ecx
	andl	$2147483647, %ecx               ## imm = 0x7FFFFFFF
	movl	%ecx, -64(%rbp)
	movl	16(%r15), %edi
	movq	_TCSANOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_tcsetattr
	xorl	%ebx, %ebx
	negq	%rax
	sbbl	%ebx, %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_O_NOCTTY,4,2                   ## @O_NOCTTY
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_B115200,4,2                    ## @B115200
	.comm	_CSIZE,4,2                      ## @CSIZE
	.comm	_CS8,4,2                        ## @CS8
	.comm	_IGNBRK,4,2                     ## @IGNBRK
	.comm	_VMIN,8,3                       ## @VMIN
	.comm	_VTIME,8,3                      ## @VTIME
	.comm	_IXON,4,2                       ## @IXON
	.comm	_IXOFF,4,2                      ## @IXOFF
	.comm	_IXANY,4,2                      ## @IXANY
	.comm	_CLOCAL,4,2                     ## @CLOCAL
	.comm	_CREAD,4,2                      ## @CREAD
	.comm	_PARENB,4,2                     ## @PARENB
	.comm	_PARODD,4,2                     ## @PARODD
	.comm	_CSTOPB,4,2                     ## @CSTOPB
	.comm	_TCSANOW,4,2                    ## @TCSANOW
	.comm	_CBR_115200,4,2                 ## @CBR_115200
	.comm	_CRTSCTS,4,2                    ## @CRTSCTS
	.comm	_DTR_CONTROL_DISABLE,4,2        ## @DTR_CONTROL_DISABLE
	.comm	_EV_ERR,4,2                     ## @EV_ERR
	.comm	_EV_RXCHAR,4,2                  ## @EV_RXCHAR
	.comm	_FALSE,8,3                      ## @FALSE
	.comm	_FILE_ATTRIBUTE_NORMAL,4,2      ## @FILE_ATTRIBUTE_NORMAL
	.comm	_FILE_FLAG_OVERLAPPED,4,2       ## @FILE_FLAG_OVERLAPPED
	.comm	_GENERIC_READ,4,2               ## @GENERIC_READ
	.comm	_GENERIC_WRITE,4,2              ## @GENERIC_WRITE
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
	.comm	_NOPARITY,4,2                   ## @NOPARITY
	.comm	_ONESTOPBIT,4,2                 ## @ONESTOPBIT
	.comm	_OPEN_EXISTING,4,2              ## @OPEN_EXISTING
	.comm	_RTS_CONTROL_DISABLE,4,2        ## @RTS_CONTROL_DISABLE
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_read_ovl,4,2                   ## @read_ovl
	.comm	_wait_ovl,4,2                   ## @wait_ovl
	.comm	_write_ovl,4,2                  ## @write_ovl
	.no_dead_strip	_sp_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sp_open
_sp_open:                               ; @sp_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	str	xzr, [sp, #32]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	ldr	x0, [x0]
Lloh0:
	adrp	x8, _O_NONBLOCK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_NONBLOCK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_NOCTTY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_NOCTTY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	w2, #0
	bl	_r_sandbox_open
	str	w0, [x19, #16]
	tbnz	w0, #31, LBB0_3
; %bb.1:
	mov	x1, sp
	bl	_tcgetattr
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_sp_close
LBB0_3:
	mov	w0, #-1
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x20, _B115200@GOTPAGE
Lloh10:
	ldr	x20, [x20, _B115200@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, sp
	bl	_cfsetospeed
	ldr	w1, [x20]
	mov	x0, sp
	bl	_cfsetispeed
Lloh11:
	adrp	x8, _CSIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CSIZE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldp	w9, w10, [sp]
	bic	w8, w9, w8
Lloh14:
	adrp	x9, _CS8@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CS8@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh17:
	adrp	x9, _IGNBRK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _IGNBRK@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	stp	xzr, xzr, [sp, #16]
	ldr	x11, [sp, #8]
Lloh20:
	adrp	x12, _VMIN@GOTPAGE
Lloh21:
	ldr	x12, [x12, _VMIN@GOTPAGEOFF]
Lloh22:
	ldr	x12, [x12]
	str	xzr, [x11, x12, lsl #3]
Lloh23:
	adrp	x12, _VTIME@GOTPAGE
Lloh24:
	ldr	x12, [x12, _VTIME@GOTPAGEOFF]
Lloh25:
	ldr	x12, [x12]
	str	xzr, [x11, x12, lsl #3]
Lloh26:
	adrp	x11, _IXON@GOTPAGE
Lloh27:
	ldr	x11, [x11, _IXON@GOTPAGEOFF]
Lloh28:
	adrp	x12, _IXOFF@GOTPAGE
Lloh29:
	ldr	x12, [x12, _IXOFF@GOTPAGEOFF]
Lloh30:
	ldr	w11, [x11]
Lloh31:
	ldr	w12, [x12]
	orr	w11, w12, w11
Lloh32:
	adrp	x12, _IXANY@GOTPAGE
Lloh33:
	ldr	x12, [x12, _IXANY@GOTPAGEOFF]
Lloh34:
	ldr	w12, [x12]
	orr	w11, w11, w12
	orr	w9, w9, w11
	bic	w9, w10, w9
Lloh35:
	adrp	x10, _CLOCAL@GOTPAGE
Lloh36:
	ldr	x10, [x10, _CLOCAL@GOTPAGEOFF]
Lloh37:
	ldr	w10, [x10]
Lloh38:
	adrp	x11, _CREAD@GOTPAGE
Lloh39:
	ldr	x11, [x11, _CREAD@GOTPAGEOFF]
Lloh40:
	ldr	w11, [x11]
	orr	w8, w10, w8
Lloh41:
	adrp	x10, _PARENB@GOTPAGE
Lloh42:
	ldr	x10, [x10, _PARENB@GOTPAGEOFF]
	orr	w8, w8, w11
Lloh43:
	ldr	w10, [x10]
Lloh44:
	adrp	x11, _PARODD@GOTPAGE
Lloh45:
	ldr	x11, [x11, _PARODD@GOTPAGEOFF]
Lloh46:
	ldr	w11, [x11]
	orr	w10, w11, w10
	bic	w8, w8, w10
Lloh47:
	adrp	x10, _CSTOPB@GOTPAGE
Lloh48:
	ldr	x10, [x10, _CSTOPB@GOTPAGEOFF]
Lloh49:
	ldr	w10, [x10]
	bic	w8, w8, w10
	and	w8, w8, #0x7fffffff
	stp	w8, w9, [sp]
	ldr	w0, [x19, #16]
Lloh50:
	adrp	x8, _TCSANOW@GOTPAGE
Lloh51:
	ldr	x8, [x8, _TCSANOW@GOTPAGEOFF]
Lloh52:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_tcsetattr
	cmp	x0, #0
	csetm	w0, ne
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh30
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_O_NOCTTY,4,2                   ; @O_NOCTTY
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_B115200,4,2                    ; @B115200
	.comm	_CSIZE,4,2                      ; @CSIZE
	.comm	_CS8,4,2                        ; @CS8
	.comm	_IGNBRK,4,2                     ; @IGNBRK
	.comm	_VMIN,8,3                       ; @VMIN
	.comm	_VTIME,8,3                      ; @VTIME
	.comm	_IXON,4,2                       ; @IXON
	.comm	_IXOFF,4,2                      ; @IXOFF
	.comm	_IXANY,4,2                      ; @IXANY
	.comm	_CLOCAL,4,2                     ; @CLOCAL
	.comm	_CREAD,4,2                      ; @CREAD
	.comm	_PARENB,4,2                     ; @PARENB
	.comm	_PARODD,4,2                     ; @PARODD
	.comm	_CSTOPB,4,2                     ; @CSTOPB
	.comm	_TCSANOW,4,2                    ; @TCSANOW
	.comm	_CBR_115200,4,2                 ; @CBR_115200
	.comm	_CRTSCTS,4,2                    ; @CRTSCTS
	.comm	_DTR_CONTROL_DISABLE,4,2        ; @DTR_CONTROL_DISABLE
	.comm	_EV_ERR,4,2                     ; @EV_ERR
	.comm	_EV_RXCHAR,4,2                  ; @EV_RXCHAR
	.comm	_FALSE,8,3                      ; @FALSE
	.comm	_FILE_ATTRIBUTE_NORMAL,4,2      ; @FILE_ATTRIBUTE_NORMAL
	.comm	_FILE_FLAG_OVERLAPPED,4,2       ; @FILE_FLAG_OVERLAPPED
	.comm	_GENERIC_READ,4,2               ; @GENERIC_READ
	.comm	_GENERIC_WRITE,4,2              ; @GENERIC_WRITE
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
	.comm	_NOPARITY,4,2                   ; @NOPARITY
	.comm	_ONESTOPBIT,4,2                 ; @ONESTOPBIT
	.comm	_OPEN_EXISTING,4,2              ; @OPEN_EXISTING
	.comm	_RTS_CONTROL_DISABLE,4,2        ; @RTS_CONTROL_DISABLE
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_read_ovl,4,2                   ; @read_ovl
	.comm	_wait_ovl,4,2                   ; @wait_ovl
	.comm	_write_ovl,4,2                  ; @write_ovl
	.no_dead_strip	_sp_open
.subsections_via_symbols
