	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_proc_update_sc                 ## -- Begin function proc_update_sc
	.p2align	4, 0x90
_proc_update_sc:                        ## @proc_update_sc
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	(%rdi), %r15d
	movl	4(%rdi), %r12d
	movl	%r15d, %ebx
	movl	%r15d, %eax
	subl	%r12d, %ebx
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_proc_debug
	movl	(%r14), %eax
LBB0_2:
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_3
LBB0_6:
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.11:
	testl	%r13d, %r13d
	jne	LBB0_26
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_proc_is_task
	movl	40(%r14), %edi
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	callq	_task_suspend
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	callq	_thread_suspend
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	%eax, %r13d
	cmpl	$2, %ebx
	jb	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_12 Depth=1
	decl	%ebx
	testl	%r13d, %r13d
	je	LBB0_12
	jmp	LBB0_17
LBB0_3:
	cmpq	$0, 16(%r14)
	je	LBB0_6
## %bb.4:
	movq	%r14, %rdi
	callq	_proc_is_thread
	movl	%eax, %edi
	callq	_gdb_assert
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_proc_debug
	movl	40(%r14), %edi
	movq	_THREAD_STATE_FLAVOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	44(%r14), %edx
	movq	_THREAD_STATE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_thread_set_state
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	$0, 16(%r14)
	xorl	%r13d, %r13d
	jmp	LBB0_6
LBB0_7:
	cmpl	%r12d, %r15d
	je	LBB0_17
	.p2align	4, 0x90
## %bb.8:
	testl	%r13d, %r13d
	jne	LBB0_17
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_proc_is_task
	movl	40(%r14), %edi
	testq	%rax, %rax
	je	LBB0_21
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	callq	_task_resume
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_9 Depth=1
	callq	_thread_resume
LBB0_22:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	%eax, %r13d
	cmpl	$-2, %ebx
	jg	LBB0_17
## %bb.23:                              ##   in Loop: Header=BB0_9 Depth=1
	incl	%ebx
	testl	%r13d, %r13d
	je	LBB0_9
LBB0_17:
	testl	%r13d, %r13d
	je	LBB0_18
LBB0_26:
	leaq	L_.str.2(%rip), %rsi
	leaq	L_.str.3(%rip), %rdx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_proc_debug
	movl	%r13d, %edi
	callq	_safe_strerror
	leaq	L_.str.6(%rip), %rsi
	movq	%r14, %rdi
	movq	%rax, %rdx
LBB0_20:
	xorl	%eax, %eax
	callq	_proc_debug
LBB0_25:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movl	(%r14), %eax
	movl	%eax, 4(%r14)
	leaq	L_.str.2(%rip), %rsi
	testl	%eax, %eax
	je	LBB0_24
## %bb.19:
	leaq	L_.str.5(%rip), %rdx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	jmp	LBB0_20
LBB0_24:
	leaq	L_.str.4(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_proc_debug
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r14)
	movups	%xmm0, 24(%r14)
	movl	$1, %r15d
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sc: %d --> %d"

L_.str.1:                               ## @.str.1
	.asciz	"storing back changed thread state"

	.comm	_THREAD_STATE_FLAVOR,4,2        ## @THREAD_STATE_FLAVOR
	.comm	_THREAD_STATE_SIZE,4,2          ## @THREAD_STATE_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"is %s"

L_.str.3:                               ## @.str.3
	.asciz	"dead"

L_.str.4:                               ## @.str.4
	.asciz	"running"

L_.str.5:                               ## @.str.5
	.asciz	"suspended"

L_.str.6:                               ## @.str.6
	.asciz	"err = %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_proc_update_sc                 ; -- Begin function proc_update_sc
	.p2align	2
_proc_update_sc:                        ; @proc_update_sc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldp	w22, w23, [x0]
	mov	x8, x22
	subs	w21, w22, w23
	b.eq	LBB0_2
; %bb.1:
	stp	x23, x22, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_proc_debug
	ldr	w8, [x19]
LBB0_2:
	cbz	w8, LBB0_11
LBB0_3:
	mov	w20, #0
LBB0_4:
	cmp	w21, #0
	b.le	LBB0_14
; %bb.5:
	cbnz	w20, LBB0_21
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	sub	w21, w21, #1
	cbnz	w20, LBB0_20
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_proc_is_task
	mov	x8, x0
	ldr	w0, [x19, #40]
	cbz	x8, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_task_suspend
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	bl	_thread_suspend
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x20, x0
	cmp	w21, #2
	b.hs	LBB0_6
	b	LBB0_20
LBB0_11:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_3
; %bb.12:
	mov	x0, x19
	bl	_proc_is_thread
	bl	_gdb_assert
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_proc_debug
Lloh4:
	adrp	x8, _THREAD_STATE_FLAVOR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _THREAD_STATE_FLAVOR@GOTPAGEOFF]
	ldr	w0, [x19, #40]
Lloh6:
	ldr	w1, [x8]
	add	w2, w19, #44
Lloh7:
	adrp	x8, _THREAD_STATE_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _THREAD_STATE_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	bl	_thread_set_state
	mov	x20, x0
	cbnz	w0, LBB0_4
; %bb.13:
	str	xzr, [x19, #16]
	b	LBB0_4
LBB0_14:
	cmp	w22, w23
	ccmp	w20, #0, #0, ne
	b.ne	LBB0_20
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_proc_is_task
	mov	x8, x0
	ldr	w0, [x19, #40]
	cbz	x8, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	bl	_task_resume
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_15 Depth=1
	bl	_thread_resume
LBB0_18:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x20, x0
	cmn	w21, #2
	b.gt	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_15 Depth=1
	add	w21, w21, #1
	cbz	w20, LBB0_15
LBB0_20:
	cbz	w20, LBB0_24
LBB0_21:
Lloh10:
	adrp	x8, l_.str.3@PAGE
Lloh11:
	add	x8, x8, l_.str.3@PAGEOFF
	str	x8, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_proc_debug
	mov	x0, x20
	bl	_safe_strerror
	str	x0, [sp]
Lloh14:
	adrp	x1, l_.str.6@PAGE
Lloh15:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_22:
	mov	x0, x19
	bl	_proc_debug
	mov	w0, #0
LBB0_23:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_24:
	ldr	w8, [x19]
	str	w8, [x19, #4]
	cbz	w8, LBB0_26
; %bb.25:
Lloh16:
	adrp	x8, l_.str.5@PAGE
Lloh17:
	add	x8, x8, l_.str.5@PAGEOFF
	str	x8, [sp]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_22
LBB0_26:
Lloh20:
	adrp	x8, l_.str.4@PAGE
Lloh21:
	add	x8, x8, l_.str.4@PAGEOFF
	str	x8, [sp]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_proc_debug
	movi.2d	v0, #0000000000000000
	stur	q0, [x19, #8]
	stur	q0, [x19, #24]
	mov	w0, #1
	b	LBB0_23
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sc: %d --> %d"

l_.str.1:                               ; @.str.1
	.asciz	"storing back changed thread state"

	.comm	_THREAD_STATE_FLAVOR,4,2        ; @THREAD_STATE_FLAVOR
	.comm	_THREAD_STATE_SIZE,4,2          ; @THREAD_STATE_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"is %s"

l_.str.3:                               ; @.str.3
	.asciz	"dead"

l_.str.4:                               ; @.str.4
	.asciz	"running"

l_.str.5:                               ; @.str.5
	.asciz	"suspended"

l_.str.6:                               ; @.str.6
	.asciz	"err = %s"

.subsections_via_symbols
