	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pty_make_controlling_tty       ## -- Begin function pty_make_controlling_tty
	.p2align	4, 0x90
_pty_make_controlling_tty:              ## @pty_make_controlling_tty
	.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
	movq	%rsi, %r14
	xorl	%eax, %eax
	callq	_setsid
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_error
LBB0_2:
	movq	__PATH_TTY@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	movq	_O_RDWR@GOTPCREL(%rip), %r12
	movq	_O_NOCTTY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r12), %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
	movl	%ebx, %edi
	callq	_close
LBB0_4:
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	%eax, %edi
	callq	_close
	jmp	LBB0_7
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_error
LBB0_7:
	movq	(%r15), %rdi
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movl	%eax, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_close                          ## TAILCALL
LBB0_8:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.3(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_error                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"setsid: %.100s"

	.comm	_errno,4,2                      ## @errno
	.comm	__PATH_TTY,8,3                  ## @_PATH_TTY
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_NOCTTY,4,2                   ## @O_NOCTTY
L_.str.1:                               ## @.str.1
	.asciz	"Failed to disconnect from controlling tty."

L_.str.2:                               ## @.str.2
	.asciz	"%.100s: %.100s"

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
L_.str.3:                               ## @.str.3
	.asciz	"open /dev/tty failed - could not set controlling tty: %.100s"

	.comm	_TIOCNOTTY,4,2                  ## @TIOCNOTTY
	.comm	_TIOCSCTTY,4,2                  ## @TIOCSCTTY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pty_make_controlling_tty       ; -- Begin function pty_make_controlling_tty
	.p2align	2
_pty_make_controlling_tty:              ; @pty_make_controlling_tty
	.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
	bl	_setsid
	tbz	x0, #63, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_strerror
	str	x0, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_2:
Lloh5:
	adrp	x21, __PATH_TTY@GOTPAGE
Lloh6:
	ldr	x21, [x21, __PATH_TTY@GOTPAGEOFF]
Lloh7:
	adrp	x22, _O_RDWR@GOTPAGE
Lloh8:
	ldr	x22, [x22, _O_RDWR@GOTPAGEOFF]
	ldr	x0, [x21]
	ldr	w8, [x22]
Lloh9:
	adrp	x9, _O_NOCTTY@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_NOCTTY@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_open
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	x20, x0
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
	mov	x0, x20
	bl	_close
LBB0_4:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_open
	tbnz	w0, #31, LBB0_6
; %bb.5:
	bl	_close
	b	LBB0_7
LBB0_6:
Lloh14:
	adrp	x8, _errno@GOTPAGE
Lloh15:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_strerror
	stp	x19, x0, [sp]
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_error
LBB0_7:
	ldr	x0, [x21]
Lloh19:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	bl	_open
	tbnz	w0, #31, LBB0_9
; %bb.8:
	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	_close
LBB0_9:
Lloh22:
	adrp	x8, _errno@GOTPAGE
Lloh23:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	_strerror
	str	x0, [sp]
Lloh25:
	adrp	x0, l_.str.3@PAGE
Lloh26:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_error
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"setsid: %.100s"

	.comm	_errno,4,2                      ; @errno
	.comm	__PATH_TTY,8,3                  ; @_PATH_TTY
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_NOCTTY,4,2                   ; @O_NOCTTY
l_.str.1:                               ; @.str.1
	.asciz	"Failed to disconnect from controlling tty."

l_.str.2:                               ; @.str.2
	.asciz	"%.100s: %.100s"

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
l_.str.3:                               ; @.str.3
	.asciz	"open /dev/tty failed - could not set controlling tty: %.100s"

	.comm	_TIOCNOTTY,4,2                  ; @TIOCNOTTY
	.comm	_TIOCSCTTY,4,2                  ; @TIOCSCTTY
.subsections_via_symbols
