	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_threads
_add_threads:                           ## @add_threads
	.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
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_PT_GETNUMLWPS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rsi), %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ptrace
	movl	%eax, %r14d
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	xorl	%edi, %edi
	testl	%r14d, %r14d
	setg	%dil
	callq	_assert
	movl	%r14d, %edi
	movl	$4, %esi
	callq	_calloc
	movq	%rax, %r12
	movq	_PT_GETLWPLIST@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	movq	%r12, %rdx
	movl	%r14d, %ecx
	callq	_ptrace
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.4:
	testl	%eax, %eax
	jle	LBB0_11
## %bb.5:
	movl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%r15
	cmpq	%r15, -64(%rbp)                 ## 8-byte Folded Reload
	movq	%r14, %rbx
	je	LBB0_11
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%r15,4), %esi
	movq	%rbx, %r14
	movq	%rbx, %rdi
	callq	_new_thread
	movq	%rax, %r13
	movq	_PT_LWPINFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12,%r15,4), %esi
	leaq	-48(%rbp), %rdx
	movl	$4, %ecx
	callq	_ptrace
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	$1, %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_err
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	_PL_FLAG_SCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -48(%rbp)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, (%rdi)
	movq	%r13, %rsi
	leaq	-48(%rbp), %rdx
	callq	_enter_syscall
	jmp	LBB0_10
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_11:
	movq	%r12, %rdi
	callq	_free
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PT_GETNUMLWPS,4,2              ## @PT_GETNUMLWPS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to fetch number of LWPs"

	.comm	_PT_GETLWPLIST,4,2              ## @PT_GETLWPLIST
L_.str.1:                               ## @.str.1
	.asciz	"Unable to fetch LWP list"

	.comm	_PT_LWPINFO,4,2                 ## @PT_LWPINFO
L_.str.2:                               ## @.str.2
	.asciz	"ptrace(PT_LWPINFO)"

	.comm	_PL_FLAG_SCE,4,2                ## @PL_FLAG_SCE
	.no_dead_strip	_add_threads
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_threads
_add_threads:                           ; @add_threads
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _PT_GETNUMLWPS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PT_GETNUMLWPS@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w1, [x1]
	mov	x2, #0
	mov	w3, #0
	bl	_ptrace
	mov	x22, x0
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	cmp	w22, #0
	cset	w0, gt
	bl	_assert
	mov	x0, x22
	mov	w1, #4
	bl	_calloc
	mov	x21, x0
Lloh5:
	adrp	x8, _PT_GETLWPLIST@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PT_GETLWPLIST@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldr	w1, [x19]
	mov	x2, x21
	mov	x3, x22
	bl	_ptrace
	cmn	w0, #1
	b.eq	LBB0_10
; %bb.3:
	cmp	w0, #1
	b.lt	LBB0_11
; %bb.4:
Lloh8:
	adrp	x24, _PT_LWPINFO@GOTPAGE
Lloh9:
	ldr	x24, [x24, _PT_LWPINFO@GOTPAGEOFF]
	mov	w25, w0
Lloh10:
	adrp	x26, _PL_FLAG_SCE@GOTPAGE
Lloh11:
	ldr	x26, [x26, _PL_FLAG_SCE@GOTPAGEOFF]
	mov	x27, x21
Lloh12:
	adrp	x22, l_.str.2@PAGE
Lloh13:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x27, x27, #4
	subs	x25, x25, #1
	b.eq	LBB0_11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x27]
	mov	x0, x19
	bl	_new_thread
	mov	x23, x0
	ldr	w0, [x24]
	ldr	w1, [x27]
	add	x2, sp, #8
	mov	w3, #4
	bl	_ptrace
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #1
	mov	x1, x22
	bl	_err
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [sp, #8]
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	str	x23, [x20]
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x23
	bl	_enter_syscall
	b	LBB0_5
LBB0_10:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_11:
	mov	x0, x21
	bl	_free
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PT_GETNUMLWPS,4,2              ; @PT_GETNUMLWPS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to fetch number of LWPs"

	.comm	_PT_GETLWPLIST,4,2              ; @PT_GETLWPLIST
l_.str.1:                               ; @.str.1
	.asciz	"Unable to fetch LWP list"

	.comm	_PT_LWPINFO,4,2                 ; @PT_LWPINFO
l_.str.2:                               ; @.str.2
	.asciz	"ptrace(PT_LWPINFO)"

	.comm	_PL_FLAG_SCE,4,2                ; @PL_FLAG_SCE
	.no_dead_strip	_add_threads
.subsections_via_symbols
