	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_proc_attach                    ## -- Begin function proc_attach
	.p2align	4, 0x90
_proc_attach:                           ## @proc_attach
	.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
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.1:
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %r12
	xorl	%eax, %eax
	callq	_getpid
	cmpq	%r12, %rax
	jne	LBB0_4
## %bb.2:
	movq	_PATTACH_RDONLY@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_3
LBB0_4:
	movq	_EV_CURRENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_elf_version
	movq	_EV_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_22
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_22
LBB0_6:
	movq	_PS_RUN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-40(%rbp), %rcx
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_proc_init
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
## %bb.11:
	testl	%ebx, %ebx
	je	LBB0_21
LBB0_12:
	movq	-40(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.13:
	callq	_proc_free
	movq	$0, -40(%rbp)
	jmp	LBB0_21
LBB0_7:
	movq	_PATTACH_RDONLY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	testl	%r15d, (%rax)
	je	LBB0_8
LBB0_21:
	movq	-40(%rbp), %rax
	movq	%rax, (%r14)
LBB0_22:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_PT_ATTACH@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-40(%rbp), %rdi
	callq	_proc_getpid
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ptrace
	testq	%rax, %rax
	je	LBB0_14
## %bb.9:
	leaq	L_.str(%rip), %rdi
LBB0_10:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r12, %rsi
	callq	_DPRINTF
	testl	%ebx, %ebx
	jne	LBB0_12
	jmp	LBB0_21
LBB0_14:
	movq	_WUNTRACED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rsi
	movq	%r12, %rdi
	callq	_waitpid
	cmpl	$-1, %eax
	je	LBB0_15
## %bb.16:
	movl	-44(%rbp), %edi
	callq	_WIFSTOPPED
	testl	%eax, %eax
	je	LBB0_17
## %bb.18:
	movq	_PS_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-40(%rbp), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_19
LBB0_15:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_10
LBB0_17:
	movl	-44(%rbp), %edx
	leaq	L_.str.2(%rip), %rdi
	movq	%r12, %rsi
	callq	_DPRINTFX
LBB0_19:
	movq	_PATTACH_NOSTOP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	testl	%r15d, (%rax)
	je	LBB0_21
## %bb.20:
	movq	-40(%rbp), %rdi
	callq	_proc_continue
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_PATTACH_RDONLY,4,2             ## @PATTACH_RDONLY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EV_CURRENT,4,2                 ## @EV_CURRENT
	.comm	_EV_NONE,8,3                    ## @EV_NONE
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_PS_RUN,4,2                     ## @PS_RUN
	.comm	_PT_ATTACH,4,2                  ## @PT_ATTACH
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ERROR: cannot ptrace child process %d"

	.comm	_WUNTRACED,4,2                  ## @WUNTRACED
L_.str.1:                               ## @.str.1
	.asciz	"ERROR: child process %d didn't stop as expected"

L_.str.2:                               ## @.str.2
	.asciz	"ERROR: child process %d status 0x%x"

	.comm	_PS_STOP,4,2                    ## @PS_STOP
	.comm	_PATTACH_NOSTOP,4,2             ## @PATTACH_NOSTOP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_proc_attach                    ; -- Begin function proc_attach
	.p2align	2
_proc_attach:                           ; @proc_attach
	.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
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	bl	_getpid
	cmp	x0, x20
	b.ne	LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _PATTACH_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PATTACH_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_5
LBB0_3:
Lloh3:
	adrp	x8, _EV_CURRENT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EV_CURRENT@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_elf_version
Lloh6:
	adrp	x8, _EV_NONE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EV_NONE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.4:
Lloh9:
	adrp	x8, _ENOENT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
	b	LBB0_12
LBB0_5:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	b	LBB0_12
LBB0_6:
Lloh15:
	adrp	x8, _PS_RUN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PS_RUN@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x20
	mov	x1, x21
	bl	_proc_init
	mov	x22, x0
	cbz	w0, LBB0_9
LBB0_7:
	ldr	x0, [sp, #8]
	cmp	w22, #0
	ccmp	x0, #0, #4, ne
	b.eq	LBB0_11
; %bb.8:
	bl	_proc_free
	str	xzr, [sp, #8]
	b	LBB0_11
LBB0_9:
Lloh18:
	adrp	x8, _PATTACH_RDONLY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PATTACH_RDONLY@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_13
LBB0_10:
	mov	w22, #0
LBB0_11:
	ldr	x8, [sp, #8]
	str	x8, [x19]
LBB0_12:
	mov	x0, x22
	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
LBB0_13:
Lloh21:
	adrp	x8, _PT_ATTACH@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PT_ATTACH@GOTPAGEOFF]
Lloh23:
	ldr	w22, [x8]
	ldr	x0, [sp, #8]
	bl	_proc_getpid
	mov	x1, x0
	mov	x0, x22
	mov	w2, #0
	mov	w3, #0
	bl	_ptrace
	cbz	x0, LBB0_16
; %bb.14:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
LBB0_15:
Lloh26:
	adrp	x8, _errno@GOTPAGE
Lloh27:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh28:
	ldr	w22, [x8]
	mov	x1, x20
	bl	_DPRINTF
	b	LBB0_7
LBB0_16:
Lloh29:
	adrp	x8, _WUNTRACED@GOTPAGE
Lloh30:
	ldr	x8, [x8, _WUNTRACED@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	add	x1, sp, #4
	mov	x0, x20
	bl	_waitpid
	cmn	w0, #1
	b.eq	LBB0_19
; %bb.17:
	ldr	w0, [sp, #4]
	bl	_WIFSTOPPED
	cbz	w0, LBB0_20
; %bb.18:
Lloh32:
	adrp	x8, _PS_STOP@GOTPAGE
Lloh33:
	ldr	x8, [x8, _PS_STOP@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	ldr	x9, [sp, #8]
	str	w8, [x9]
	b	LBB0_21
LBB0_19:
Lloh35:
	adrp	x0, l_.str.1@PAGE
Lloh36:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_20:
	ldr	w2, [sp, #4]
Lloh37:
	adrp	x0, l_.str.2@PAGE
Lloh38:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_DPRINTFX
LBB0_21:
Lloh39:
	adrp	x8, _PATTACH_NOSTOP@GOTPAGE
Lloh40:
	ldr	x8, [x8, _PATTACH_NOSTOP@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_10
; %bb.22:
	ldr	x0, [sp, #8]
	bl	_proc_continue
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_PATTACH_RDONLY,4,2             ; @PATTACH_RDONLY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EV_CURRENT,4,2                 ; @EV_CURRENT
	.comm	_EV_NONE,8,3                    ; @EV_NONE
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_PS_RUN,4,2                     ; @PS_RUN
	.comm	_PT_ATTACH,4,2                  ; @PT_ATTACH
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ERROR: cannot ptrace child process %d"

	.comm	_WUNTRACED,4,2                  ; @WUNTRACED
l_.str.1:                               ; @.str.1
	.asciz	"ERROR: child process %d didn't stop as expected"

l_.str.2:                               ; @.str.2
	.asciz	"ERROR: child process %d status 0x%x"

	.comm	_PS_STOP,4,2                    ; @PS_STOP
	.comm	_PATTACH_NOSTOP,4,2             ; @PATTACH_NOSTOP
.subsections_via_symbols
