	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_task_setsid                    ## -- Begin function task_setsid
	.p2align	4, 0x90
_task_setsid:                           ## @task_setsid
	.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	%rdi, %r14
	movq	_pids_lock@GOTPCREL(%rip), %rdi
	callq	_lock
	movq	8(%r14), %rbx
	movq	24(%rbx), %rax
	movq	(%rax), %r12
	cmpq	%r12, (%rbx)
	je	LBB0_2
## %bb.1:
	cmpq	%r12, 8(%rbx)
	jne	LBB0_3
LBB0_2:
	movq	_pids_lock@GOTPCREL(%rip), %rdi
	callq	_unlock
	movq	__EPERM@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	jmp	LBB0_4
LBB0_3:
	movq	%r14, %rdi
	callq	_task_leave_session
	movl	(%r14), %edi
	callq	_pid_get
	movq	%rax, %r14
	leaq	4(%rax), %rdi
	leaq	20(%rbx), %rsi
	callq	_list_add
	movq	%r12, 8(%rbx)
	leaq	16(%rbx), %r15
	movq	%r15, %rdi
	callq	_list_remove_safe
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_list_add
	movq	%r12, (%rbx)
	movq	_pids_lock@GOTPCREL(%rip), %rdi
	callq	_unlock
LBB0_4:
	movq	%r12, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pids_lock,4,2                  ## @pids_lock
	.comm	__EPERM,8,3                     ## @_EPERM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_task_setsid                    ; -- Begin function task_setsid
	.p2align	2
_task_setsid:                           ; @task_setsid
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x0
Lloh0:
	adrp	x0, _pids_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _pids_lock@GOTPAGEOFF]
	bl	_lock
	ldr	x22, [x20, #8]
	ldr	x8, [x22, #24]
	ldr	x19, [x8]
	ldr	x8, [x22]
	cmp	x8, x19
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x22, #8]
	cmp	x8, x19
	b.ne	LBB0_3
LBB0_2:
Lloh2:
	adrp	x0, _pids_lock@GOTPAGE
Lloh3:
	ldr	x0, [x0, _pids_lock@GOTPAGEOFF]
	bl	_unlock
Lloh4:
	adrp	x8, __EPERM@GOTPAGE
Lloh5:
	ldr	x8, [x8, __EPERM@GOTPAGEOFF]
Lloh6:
	ldr	x19, [x8]
	b	LBB0_4
LBB0_3:
	mov	x0, x20
	bl	_task_leave_session
	ldr	w0, [x20]
	bl	_pid_get
	mov	x20, x0
	add	x0, x0, #4
	add	x1, x22, #20
	bl	_list_add
	str	x19, [x22, #8]
	add	x21, x22, #16
	mov	x0, x21
	bl	_list_remove_safe
	mov	x0, x20
	mov	x1, x21
	bl	_list_add
	str	x19, [x22]
Lloh7:
	adrp	x0, _pids_lock@GOTPAGE
Lloh8:
	ldr	x0, [x0, _pids_lock@GOTPAGEOFF]
	bl	_unlock
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_pids_lock,4,2                  ; @pids_lock
	.comm	__EPERM,8,3                     ; @_EPERM
.subsections_via_symbols
