	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_setcancelstate         ## -- Begin function pthread_setcancelstate
	.p2align	4, 0x90
_pthread_setcancelstate:                ## @pthread_setcancelstate
	.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	%rsi, %r12
	movl	%edi, %ebx
	xorl	%eax, %eax
	callq	_pthread_self
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r15
	movq	_PTHREAD_CANCEL_ENABLE@GOTPCREL(%rip), %r13
	movq	_PTHREAD_CANCEL_DISABLE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%r13)
	je	LBB0_4
## %bb.2:
	cmpl	%ebx, (%rax)
	je	LBB0_4
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_11
LBB0_4:
	movq	%r15, %r14
	addq	$16, %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	testq	%r12, %r12
	je	LBB0_6
## %bb.5:
	movl	(%r15), %eax
	movl	%eax, (%r12)
LBB0_6:
	movl	%ebx, (%r15)
	cmpl	%ebx, (%r13)
	jne	LBB0_10
## %bb.7:
	movq	8(%r15), %rax
	movq	_PTHREAD_CANCEL_ASYNCHRONOUS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.8:
	movl	24(%r15), %edi
	callq	_pte_osThreadCheckCancel
	movq	_PTE_OS_INTERRUPTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_PThreadStateCanceling@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r15)
	movq	_PTHREAD_CANCEL_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	movq	_PTE_EPS_CANCEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_pte_throw
LBB0_10:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	xorl	%eax, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PTHREAD_CANCEL_ENABLE,4,2      ## @PTHREAD_CANCEL_ENABLE
	.comm	_PTHREAD_CANCEL_DISABLE,4,2     ## @PTHREAD_CANCEL_DISABLE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PTHREAD_CANCEL_ASYNCHRONOUS,8,3 ## @PTHREAD_CANCEL_ASYNCHRONOUS
	.comm	_PTE_OS_INTERRUPTED,8,3         ## @PTE_OS_INTERRUPTED
	.comm	_PThreadStateCanceling,4,2      ## @PThreadStateCanceling
	.comm	_PTE_EPS_CANCEL,4,2             ## @PTE_EPS_CANCEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_setcancelstate         ; -- Begin function pthread_setcancelstate
	.p2align	2
_pthread_setcancelstate:                ; @pthread_setcancelstate
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x1
	mov	x21, x0
	bl	_pthread_self
	cbz	x0, LBB0_9
; %bb.1:
Lloh0:
	adrp	x24, _PTHREAD_CANCEL_ENABLE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PTHREAD_CANCEL_ENABLE@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh2:
	adrp	x23, _PTHREAD_CANCEL_DISABLE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PTHREAD_CANCEL_DISABLE@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w8, w21
	ccmp	w9, w21, #4, ne
	b.ne	LBB0_9
; %bb.2:
	mov	x19, x0
	add	x20, x0, #16
	mov	x0, x20
	bl	_pthread_mutex_lock
	cbz	x22, LBB0_4
; %bb.3:
	ldr	w8, [x19]
	str	w8, [x22]
LBB0_4:
	str	w21, [x19]
	ldr	w8, [x24]
	cmp	w8, w21
	b.ne	LBB0_8
; %bb.5:
	ldr	x8, [x19, #8]
Lloh4:
	adrp	x9, _PTHREAD_CANCEL_ASYNCHRONOUS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _PTHREAD_CANCEL_ASYNCHRONOUS@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:
	ldr	w0, [x19, #24]
	bl	_pte_osThreadCheckCancel
Lloh7:
	adrp	x8, _PTE_OS_INTERRUPTED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PTE_OS_INTERRUPTED@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.7:
Lloh10:
	adrp	x8, _PThreadStateCanceling@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PThreadStateCanceling@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x19, #20]
	ldr	w8, [x23]
	str	w8, [x19]
	mov	x0, x20
	bl	_pthread_mutex_unlock
Lloh13:
	adrp	x8, _PTE_EPS_CANCEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PTE_EPS_CANCEL@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_pte_throw
LBB0_8:
	mov	x0, x20
	bl	_pthread_mutex_unlock
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
LBB0_10:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PTHREAD_CANCEL_ENABLE,4,2      ; @PTHREAD_CANCEL_ENABLE
	.comm	_PTHREAD_CANCEL_DISABLE,4,2     ; @PTHREAD_CANCEL_DISABLE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PTHREAD_CANCEL_ASYNCHRONOUS,8,3 ; @PTHREAD_CANCEL_ASYNCHRONOUS
	.comm	_PTE_OS_INTERRUPTED,8,3         ; @PTE_OS_INTERRUPTED
	.comm	_PThreadStateCanceling,4,2      ; @PThreadStateCanceling
	.comm	_PTE_EPS_CANCEL,4,2             ; @PTE_EPS_CANCEL
.subsections_via_symbols
